-
Notifications
You must be signed in to change notification settings - Fork 54
/
Copy pathindex.html
212 lines (184 loc) · 6.45 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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>simplyCountdown.js</title>
<link href='http://fonts.googleapis.com/css?family=Lato:300,400italic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.3.0/css/font-awesome.min.css"/>
<link rel="stylesheet" href="css/simplyCountdown.theme.losange.css"/>
<link rel="stylesheet" href="css/simplyCountdown.theme.default.css"/>
<link rel="stylesheet" href="css/demo-only/prism.css"/>
<link rel="stylesheet" href="css/demo.css"/>
</head>
<body>
<header class="row center-xs">
<div class="header-content">
<h1>simplyCountdown.js</h1>
<h2>A Tiny Javascript Countdown Library</h2>
<div class="repo-buttons">
<a href="https://github.com/VincentLoy/simplyCountdown.js" class="button">
<i class="fa fa-github"></i> View on GitHub
</a>
<a href="https://github.com/VincentLoy/simplyCountdown.js/archive/master.zip" class="button">
<i class="fa fa-download"></i> Download Sources
</a>
</div>
</div>
</header>
<main class="container">
<section class="intro">
<h2>Why another countdown ?</h2>
<p>
I developed this little library in a boring day. I regularly use this kind of Javascript's
libraries to display countdowns on websites and this one exactly meets the needs that I have.
It is perfect to make 'under construction' pages, etc.
</p>
<p>
This is a very (very) basic Javascript CountDown.
</p>
</section>
<section class="getting-started">
<h2>Getting Started</h2>
<h3>install via npm, bower or <a href="https://github.com/VincentLoy/simplyCountdown.js/archive/master.zip">direct download</a></h3>
<pre>
<code class="language-console">
$ bower install simplycountdown.js
$ npm install simplycountdown.js
</code>
</pre>
<h3>Insert simplyCountdown to your HTML</h3>
<pre>
<code class="language-html">
<link rel="stylesheet" href="css/simplyCountdown.theme.default.css"/>
<script src="dist/simplyCountdown.min.js"></script>
</code>
</pre>
<pre>
<code class="language-javascript">
// This is an example with default parameters
// You'll always have to call simplyCountdown using ID's, no classes.
simplyCountdown('[CSS-SELECTOR]', {
year: 2015, // required
month: 6, // required
day: 28, // required
hours: 0, // Default is 0 [0-23] integer
minutes: 0, // Default is 0 [0-59] integer
seconds: 0, // Default is 0 [0-59] integer
words: { //words displayed into the countdown
days: 'day',
hours: 'hour',
minutes: 'minute',
seconds: 'second',
pluralLetter: 's'
},
plural: true, //use plurals
inline: false, //set to true to get an inline basic countdown like : 24 days, 4 hours, 2 minutes, 5 seconds
inlineClass: 'simply-countdown-inline', //inline css span class in case of inline = true
// in case of inline set to false
enableUtc: true,
onEnd: function () {
// your code
return;
},
refresh: 1000, //default refresh every 1s
sectionClass: 'simply-section', //section css class
amountClass: 'simply-amount', // amount css class
wordClass: 'simply-word' // word css class
});
</code>
</pre>
<h3>You can use it with jQuery too (not required)</h3>
<pre>
<code class="language-javascript">
// jQuery Example
$('[SELECTOR]').simplyCountdown({
year: 2015, // required
month: 6, // required
day: 28, // required
...
});
</code>
</pre>
</section>
<section class="custom">
<h2>Easy to customize</h2>
<p>
You can easly customize the countdown using the css theme starter file or create your own like so :
</p>
<div class="note">
<p>
<i class="fa fa-info"></i> The following theme template works with default class in parameters
</p>
</div>
<pre>
<code class="language-css">
/**
* Project : simply-countdown
* File : simplyCountdown.theme.custom
* Author : Your Name <your-mail[at]example.com>
*/
.simply-countdown {
/* The countdown */
}
.simply-countdown > .simply-section {
/* coutndown blocks */
}
.simply-countdown > .simply-section > div {
/* countdown block inner div */
}
.simply-countdown > .simply-section .simply-amount,
.simply-countdown > .simply-section .simply-word {
/* amounts and words */
}
.simply-countdown > .simply-section .simply-amount {
/* amounts */
}
.simply-countdown > .simply-section .simply-word {
/* words */
}
</code>
</pre>
</section>
<section class="examples">
<h2>Examples</h2>
<h3>Default</h3>
<p>Displayed whithout jQuery - UTC enabled</p>
<div class="simply-countdown simply-countdown-one"></div>
<h3>Custom</h3>
<p>Displayed with jQuery - UTC disabled</p>
<div class="simply-countdown-losange" id="simply-countdown-losange"></div>
<h3>Inline</h3>
<div class="simply-countdown-inline"></div>
</section>
</main>
<footer>
<p>Made with ❤ by <a href="https://github.com/VincentLoy">Vincent Loy</a></p>
</footer>
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/0.0.1/prism.min.js"></script>
<script src="dev/simplyCountdown.js"></script>
<script>
var d = new Date(new Date().getTime() + 48 * 120 * 120 * 2000);
// default example
simplyCountdown('.simply-countdown-one', {
year: d.getFullYear(),
month: d.getMonth() + 1,
day: d.getDate()
});
// inline example
simplyCountdown('.simply-countdown-inline', {
year: d.getFullYear(),
month: d.getMonth() + 1,
day: d.getDate(),
inline: true
});
//jQuery example
$('#simply-countdown-losange').simplyCountdown({
year: d.getFullYear(),
month: d.getMonth() + 1,
day: d.getDate(),
enableUtc: false
});
</script>
</body>
</html>