-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
148 lines (128 loc) · 3.85 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<div class="codepen" data-height="300" data-default-tab="html,result" data-slug-hash="VwzGNqL" data-user="zxylitoics" data-prefill='{"title":"Horizontal Fundraising Thermometer","description":"Inspired by the basic Kickstarter thermometer... Looking for a simple way to help a friend raise money with a beard-a-thon","tags":["horizontal","thermometer","barometer","progress","bar"],"head":"<link href=\"https://fonts.googleapis.com/css?family=Nunito:400,700\" rel=\"stylesheet\">","scripts":[],"stylesheets":[]}'>
<pre data-lang="html"><div id=countdown-wrap>
<svg class="heart" viewBox="0 0 32 29.6">
<path d="M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2
c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z"/>
</svg>
<div id="goal">$1 500,000</div>
<div id="glass">
<div id="progress">
</div>
</div>
<div class="goal-stat">
<span class="goal-number">0%</span>
<span class="goal-label">Funded</span>
</div>
<div class="goal-stat">
<span class="goal-number">$0</span>
<span class="goal-label">Raised</span>
</div>
<div class="goal-stat">
<span class="goal-
</div>
<!--http://stackoverflow.com/questions/9335140/how-to-countdown-to-a-date -->
</pre>
<pre data-lang="less">body * {
font-family: roboto-condensed, sans-serif;
font-weight: 600;
font-style: normal;
box-sizing: border-box;
}
body {
background-color: #142F4C;
}
#countdown-wrap {
width: 100%;
height: 300px;
//border: 1px solid black;
padding: 20px;
font-family: arial;
max-width: 650px;
margin: 150px auto 300px;
}
#goal {
font-size: 48px;
text-align: right;
color: #FFF;
@media only screen and (max-width : 640px) {
text-align: center;
}
}
.heart {
fill: #ffb351;
position: relative;
top: 50px;
width: 50px;
animation: pulse 1s ease infinite;
}
@keyframes pulse {
0% { transform: scale(1); }
50% { transform: scale(1.3); }
100% { transform: scale(1); }
}
#glass {
width: 100%;
height: 20px;
background: #0055a7;
border-radius: 10px;
float: left;
overflow: hidden;
}
#progress {
float: left;
width: 16%;
height: 20px;
background: #f04e31;
z-index: 333;
//border-radius: 5px;
}
.goal-stat {
width: 25%;
//height: 30px;
padding: 10px;
float: left;
margin: 0;
color: #FFF;
@media only screen and (max-width : 640px) {
width: 50%;
text-align: center;
}
}
.goal-number, .goal-label {
display: block;
}
.goal-number {
font-weight: bold;
}</pre>
<pre data-lang="js">
CountDownTimer('12/20/2020 10:1 AM', 'countdown');
CountDownTimer('12/20/2020 10:1 AM', 'newcountdown');
function CountDownTimer(dt, id)
{
var end = new Date(dt);
var _second = 1000;
var _minute = _second * 60;
var _hour = _minute * 60;
var _day = _hour * 24;
var timer;
function showRemaining() {
var now = new Date();
var distance = end - now;
if (distance < 0) {
clearInterval(timer);
document.getElementById(id).innerHTML = '0';
return;
}
var days = Math.floor(distance / _day);
var hours = Math.floor((distance % _day) / _hour);
var minutes = Math.floor((distance % _hour) / _minute);
var seconds = Math.floor((distance % _minute) / _second);
document.getElementById(id).innerHTML = days /*+ ' days'*/;
//document.getElementById(id).innerHTML += hours + 'hrs ';
//document.getElementById(id).innerHTML += minutes + 'mins ';
//document.getElementById(id).innerHTML += seconds + 'secs';
}
timer = setInterval(showRemaining, 1000);
}
</pre></div>
<script async src="https://cpwebassets.codepen.io/assets/embed/ei.js"></script>