Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initial theme #12

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions examples/community/coming-soon/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>This site is coming soon!</title>

<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class="soon">
<div class="count">
<h1 id="countdown" class="clock"></h1>
<br>
<br>
</div>

<h2>Coming Soon</h2>
<h1>We are working on something awesome</h1>
<p>
</p>
<form>
<input type="email" name="email" placeholder="Enter your email">
<input type="submit">
</form>
</div>
<script src="jquery.js"></script>

<script src="time.js"></script>
</body>
</html>
4 changes: 4 additions & 0 deletions examples/community/coming-soon/jquery.js

Large diffs are not rendered by default.

171 changes: 171 additions & 0 deletions examples/community/coming-soon/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
font-family: roboto;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
body{
font-size: 20px;
background: #2ecc71;
background-size: cover;
transition: ease-in-out all 300ms;
}
.soon {
position:absolute;
width: 70%;
left:0;
right:0;
top:0px;
bottom:0;
margin-top:50%;
margin:auto;
max-width:100%;
max-height:100%;
}
.soon h2 {
text-align: center;
color: #fff;
font-size: 2em;
font-weight: 400;
text-shadow: 2px 2px #60616526;
}
.soon h1 {
text-align: center;
color: #fff;
font-size: 3em;
font-weight: 400;
margin-top: 15px;
text-shadow: 2px 2px #3c859487;
}
.soon p{
color: #fff;
font-weight: 400;
text-align: center;
margin: 0 auto;
font-size: 1.2em;
padding: 1.2em 0;
}
.soon form{
margin: 0 auto;
text-align: center;
position: absolute;
bottom: 10%;
left: 30%;
}
input{
transition: ease-in-out all 300ms;
}
.soon form input[type="email"]{
height: 2.5em;
color: #34495e;
border-radius: 3px;
border: none;
padding: 0 .5em;
padding-bottom: 0.1em;
font-weight: 300;
font-size: 0.8em;
}
.soon form input[type="email"]:focus{
outline: none;
}
.soon form input[type="submit"]{
height: 2.6em;
color: #fff;
background-color: transparent;
border-radius: 3px;
border: 2px solid #fff;
padding: 0 1.5em;
padding-bottom: 0.1em;
font-family: 'Lato';
font-weight: 400;
font-size: .8em;
}
.soon form input[type="submit"]:hover{
background-color:#fff;
background: rgba(255, 255, 255, 0.3);
}

.count {
position:relative;
margin-bottom:6%;
}
.clock {
font-size:1.5em;
text-align:center;
}
.count h3 {
position: absolute;
right: 1%;
top: 20%;
color: #ffffff;
}
body, html {
width: 100%;
height: 100%;
margin: 0;
}

html {
display: table;
}

canvas {
width: 900px;
height: 200px;
display: block;
position: relative;
background: transparent;
margin: 40px auto;
}

body {
background: #6BE5FF;
background-position: top center;
background-size: cover;
color: #fff;
margin: 0;
padding: 0;
overflow: hidden;
display: table-cell;
vertical-align: middle;
text-align: center;
}

111 changes: 111 additions & 0 deletions examples/community/coming-soon/time.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
var ringer = {
countdown_to: "2/18/2020",
rings: {
'DAYS': {
s: 86400000, // mseconds in a day,
max: 365
},
'HOURS': {
s: 3600000, // mseconds per hour,
max: 24
},
'MINUTES': {
s: 60000, // mseconds per minute
max: 60
},
'SECONDS': {
s: 1000,
max: 60
}
},
r_count: 4,
r_spacing: 10, // px
r_size: 100, // px
r_thickness: 10, // px
update_interval: 11, // ms


init: function(){

$r = ringer;
$r.cvs = document.createElement('canvas');

$r.size = {
w: ($r.r_size + $r.r_thickness) * $r.r_count + ($r.r_spacing*($r.r_count-1)),
h: ($r.r_size + $r.r_thickness)
};



$r.cvs.setAttribute('width',$r.size.w);
$r.cvs.setAttribute('height',$r.size.h);
$r.ctx = $r.cvs.getContext('2d');
$(document.body).append($r.cvs);
$r.cvs = $($r.cvs);
$r.ctx.textAlign = 'center';
$r.actual_size = $r.r_size + $r.r_thickness;
$r.countdown_to_time = new Date($r.countdown_to).getTime();
$r.cvs.css({ width: $r.size.w+"px", height: $r.size.h+"px" });
$r.go();
},
ctx: null,
go: function(){
var idx=0;

$r.time = (new Date().getTime()) - $r.countdown_to_time;


for(var r_key in $r.rings) $r.unit(idx++,r_key,$r.rings[r_key]);

setTimeout($r.go,$r.update_interval);
},
unit: function(idx,label,ring) {
var x,y, value, ring_secs = ring.s;
value = parseFloat($r.time/ring_secs);
$r.time-=Math.round(parseInt(value)) * ring_secs;
value = Math.abs(value);

x = ($r.r_size*.5 + $r.r_thickness*.5);
x +=+(idx*($r.r_size+$r.r_spacing+$r.r_thickness));
y = $r.r_size*.5;
y += $r.r_thickness*.5;


// calculate arc end angle
var degrees = 360-(value / ring.max) * 360.0;
var endAngle = degrees * (Math.PI / 180);

$r.ctx.save();

$r.ctx.translate(x,y);
$r.ctx.clearRect($r.actual_size*-0.5,$r.actual_size*-0.5,$r.actual_size,$r.actual_size);

// first circle
$r.ctx.strokeStyle = "rgba(128,128,128,0.2)";
$r.ctx.beginPath();
$r.ctx.arc(0,0,$r.r_size/2,0,2 * Math.PI, 2);
$r.ctx.lineWidth =$r.r_thickness;
$r.ctx.stroke();

// second circle
$r.ctx.strokeStyle = "#FFABAB";
$r.ctx.beginPath();
$r.ctx.arc(0,0,$r.r_size/2,0,endAngle, 1);
$r.ctx.lineWidth =$r.r_thickness;
$r.ctx.stroke();

// label
$r.ctx.fillStyle = "#ffffff";

$r.ctx.font = '12px Helvetica';
$r.ctx.fillText(label, 0, 23);
$r.ctx.fillText(label, 0, 23);

$r.ctx.font = 'bold 40px Helvetica';
$r.ctx.fillText(Math.floor(value), 0, 10);

$r.ctx.restore();
}
}

ringer.init();