Skip to content

Instantly share code, notes, and snippets.

@tslumley
Created January 19, 2018 08:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tslumley/e8251084e58f0ec00410df31c8f7f71d to your computer and use it in GitHub Desktop.
Save tslumley/e8251084e58f0ec00410df31c8f7f71d to your computer and use it in GitHub Desktop.
A Pen created at CodePen.io. You can find this one at https://codepen.io/anon/pen/ypGMjJ.
This is a random quote generator and clock.
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title>Epiphany Clock</title>
<link rel='stylesheet prefetch' href='http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css'>
<link rel="stylesheet" href="style.css">
</head>
<body>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<body onload="startTime(); startDate()">
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header"><a href="#" class="navbar-brand"><img alt="NIST password guidance" src=""/></a></div>
</div>
</nav>
<div class="container">
<div id="date"></div>
<div id="display"></div>
<div id="content">
<p id="quote">"Digital identity presents a technical challenge because it often involves the proofing of individuals over an open network and always involves the authentication of individuals over an open network. This presents multiple opportunities for impersonation and other attacks which can lead to fraudulent claims of a subject’s digital identity." <br/>- Introduction</p>
</div>
</div>
<div id="b-nav">
<ul>
<button id="gen" onclick="genQuote()">New Quote</button>
</ul>
</div>
<script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src="index.js"></script>
</body>
</html>
function startTime() {
var today=new Date();
var h=today.getHours();
var m=today.getMinutes();
var s=today.getSeconds();
var ampm = "";
m = checkTime(m);
if (h > 12) {
h = h - 12;
ampm = " PM";
} else if (h == 12){
h = 12;
ampm = " AM";
} else if (h < 12){
ampm = " AM";
} else {
ampm = "PM";
};
if(h==0) {
h=12;
}
document.getElementById('display').innerHTML = h+":"+m+ampm;
var t = setTimeout(function(){startTime()},500);
}
function checkTime(i) {
if (i<10) {i = "0" + i}; // add zero in front of numbers < 10
return i;
}
function genQuote() {
var randNum = Math.floor(Math.random() * 18) + 1;
document.getElementById('quote').innerHTML = quotes[randNum];
var tweetQuote = quotes[randNum].split(' ').join('%20');
tweetQuote = tweetQuote.split('<br>').join('');
tweetQuote = "https://twitter.com/intent/tweet?text=" + tweetQuote.split('"').join('')
$('.twitter-share-button').attr('href', tweetQuote);
}
//quote array
var quotes = ["Blank", "Verifiers SHALL require subscriber-chosen memorized secrets to be at least 8 characters in length. ",
"Verifiers SHOULD permit subscriber-chosen memorized secrets at least 64 characters in length. ", "All printing ASCII characters as well as the space character SHOULD be acceptable in memorized secrets", "Unicode [ISO/ISC 10646] characters SHOULD be accepted as well.", "Memorized secret verifiers SHALL NOT permit the subscriber to store a “hint” that is accessible to an unauthenticated claimant.", "When processing requests to establish and change memorized secrets, verifiers SHALL compare the prospective secrets against a list that contains values known to be commonly-used, expected, or compromised.", "Verifiers SHOULD offer guidance to the subscriber, such as a password-strength meter, to assist the user in choosing a strong memorized secret.","Verifiers SHALL implement a rate-limiting mechanism that effectively limits the number of failed authentication attempts that can be made on the subscriber’s account","Verifiers SHOULD NOT impose other composition rules (e.g., requiring mixtures of different character types or prohibiting consecutively repeated characters) for memorized secrets.","Verifiers SHOULD NOT require memorized secrets to be changed arbitrarily (e.g., periodically). ","Verifiers SHALL force a change if there is evidence of compromise of the authenticator.","Verifiers SHOULD permit claimants to use “paste” functionality when entering a memorized secret. This facilitates the use of password managers, which are widely used and in many cases increase the likelihood that users will choose stronger memorized secrets.","the verifier SHOULD offer an option to display the secret — rather than a series of dots or asterisks — until it is entered. This allows the claimant to verify their entry if they are in a location where their screen is unlikely to be observed.","Verifiers SHALL store memorized secrets in a form that is resistant to offline attacks. ","Memorized secrets SHALL be salted and hashed using a suitable one-way key derivation function.","Biometric characteristics do not constitute secrets. ","The biometric False Match Rate (FMR) does not provide confidence in the authentication of the subscriber by itself.","The verifier SHALL use approved encryption and an authenticated protected channel when requesting memorized secrets in order to provide resistance to eavesdropping and MitM attacks.","blah"];
//date
function startDate() {
var d = new Date();
var days = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];
document.getElementById("date").innerHTML = days[d.getDay()]+" | "+[d.getMonth()+1]+"/"+d.getDate()+"/"+d.getFullYear();
}
Modified by Thomas Lumley 2018-18-1
<!--
Copyright (c) 2018 by Captain Anonymous (https://codepen.io/anon/pen/ypGMjJ)
Fork of an original work by Sophanarith Sok (https://codepen.io/sok213/pen/NqJYzb)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-->
html, body {
overflow-x: hidden;
overflow-y: hidden;
height: 100%;
width: 100%;
position: absolute;
background-color: sienna;
background-repeat:repeat-x;
background-position: top;
z-index: -2;
}
#display {
color: white;
font-size: 2.9em;
top: 10px;
border-bottom: thin solid;
padding-bottom: 20px;
opacity: 0.80;
filter: alpha(opacity=80); /* For IE8 and earlier */
}
#date {
color: white;
font-size: 1.3em;
font-family: Georgia, "Times New Roman", Times, serif;
font-weight: normal;
letter-spacing: 0.2em;
opacity: 0.6;
filter: alpha(opacity=60); /* For IE8 and earlier */
}
#footer {
width: 100%;
height: 40px;
position: fixed;
bottom: -1px;
background-color: white;
text-align: center;
opacity: 0.5;
filter: alpha(opacity=50); /* For IE8 and earlier */
}
#line {
width: 100%;
bottom: 4em;
position: fixed;
border-bottom: solid white;
padding: 15px;
opacity: 0.5;
filter: alpha(opacity=50); /* For IE8 and earlier */
}
.navbar {
position: fixed;
width: 100%;
opacity: 0.6;
filter: alpha(opacity=60); /* For IE8 and earlier */
}
.wrapper {
background-color: red;
}
span {
border-radius: 100px;
opacity: 0.75;
filter: alpha(opacity=75); /* For IE8 and earlier */
}
#content {
height: 45em;
} p {
max-width: 30em;
color: white;
font-family: "Adobe Caslon Pro", "Hoefler Text", Georgia, Garamond, Times, serif;
letter-spacing:0.1em;
text-align:center;
margin: 40px auto;
line-height: 145%;
font-size: 2em;
}
p :hover {
text-decoration: none;
}
.container {
padding-top: 6em;
text-align: center;
}
#b-nav {
padding-bottom: 5em;
position: fixed;
width: 100%;
bottom: 2em;
}
#b-nav ul {
margin: 0;
padding: 0.5em;
list-style-type: none;
text-align: center;
}
#b-nav ul li {
display: inline;
}
#b-nav ul li a {
text-decoration: none;
padding: .2em 1em;
background-color: black;
opacity: 0.4;
filter: alpha(opacity=40); /* For IE8 and earlier */
}
.hold {
width: 100%;
text-align: left;
}
#gen {
outline: none;
padding-top: 5px;
text-decoration: none;
opacity: 0.6;
background-color: black;
color: white;
border: thin solid white;
height: 40px;
width: 100px;
border-radius: 10px;
transition: 0.5s;
}
#gen:hover {
background-color: white;
color: black;
border: thin solid black;
opacity: 0.8;
}
#gen a {
text-decoration: none;
}
#date {
color: white;
}
@media screen
and (max-device-width: 800px)
and (max-device-height: 640px)
and (-webkit-device-pixel-ratio: 2)
and (orientation: portrait) {
p {
font-size: 1em;
}
}
.fa-twitter {
font-size: 30px !important;
margin-left: 20px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment