-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.html
330 lines (304 loc) · 14 KB
/
template.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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
<!DOCTYPE html>
<html lang="en">
<!--
Welcome! You're reading this source code. You must have a good reason. Maybe you want to do something besides show a quote,
like redirecting to your todo list. In that case, edit the raw template file. For most people this will be at
/Applications/Focus.app/Contents/Resources/template.html
You can edit that file (which is this file) to be anything you want, and it will display when a block page appears.
To redirect to a todo list, select the entire template text and replace it with
<meta http-equiv="refresh" content="0; url=http://EnterRedirectUrlHere.com/page.html">
If you have any questions email support@heyfocus.com
Enjoy! — stay curious ✌️
-->
<head>
<meta charset="UTF-8">
<title>Focus</title>
<style>
/*! minireset.css v0.0.3 | MIT License | github.com/jgthms/minireset.css */html,body,p,ol,ul,li,dl,dt,dd,blockquote,figure,fieldset,legend,textarea,pre,iframe,hr,h1,h2,h3,h4,h5,h6{margin:0;padding:0}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal}ul{list-style:none}button,input,select,textarea{margin:0}html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}img,embed,iframe,object,audio,video{height:auto;max-width:100%}iframe{border:0}table{border-collapse:collapse;border-spacing:0}td,th{padding:0;text-align:left}
/** Page styles **/
html,
body {
height: 100%;
}
body {
font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}
body.dark {
background: #111111;
}
#bg {
width: 100%;
height: 100%;
background: url(data:image/svg+xml,%3Csvg%20width%3D%22576px%22%20height%3D%22400px%22%20viewBox%3D%220%200%20576%20400%22%20version%3D%221.1%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20xmlns%3Axlink%3D%22http%3A//www.w3.org/1999/xlink%22%3E%0A%20%20%20%20%3C%21--%20Generator%3A%20Sketch%2045.1%20%2843504%29%20-%20http%3A//www.bohemiancoding.com/sketch%20--%3E%0A%20%20%20%20%3Cdesc%3ECreated%20with%20Sketch.%3C/desc%3E%0A%20%20%20%20%3Cdefs%3E%3C/defs%3E%0A%20%20%20%20%3Cg%20id%3D%223-Blocking-Page%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20opacity%3D%221%22%3E%0A%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Light-%281920x1200%29%22%20transform%3D%22translate%28-672.000000%2C%20-400.000000%29%22%20fill%3D%22%23CCCCCC%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Content%22%20transform%3D%22translate%28480.000000%2C%20400.000000%29%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M389.796226%2C0%20L320.241509%2C0%20L215.909434%2C197.826087%20C205.041509%2C219.565217%20192%2C247.826087%20192%2C280.434783%20C192%2C345.652174%20246.339623%2C400%20311.54717%2C400%20C378.928302%2C400%20433.267925%2C345.652174%20433.267925%2C280.434783%20C433.267925%2C226.086957%20398.490566%2C180.434783%20348.498113%2C165.217391%20L389.796226%2C0%20Z%20M724.528302%2C0%20L654.973585%2C0%20L550.641509%2C197.826087%20C539.773585%2C219.565217%20526.732075%2C247.826087%20526.732075%2C280.434783%20C526.732075%2C345.652174%20581.071698%2C400%20646.279245%2C400%20C713.660377%2C400%20768%2C345.652174%20768%2C280.434783%20C768%2C226.086957%20733.222642%2C180.434783%20683.230189%2C165.217391%20L724.528302%2C0%20Z%22%20id%3D%22-%22%3E%3C/path%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3C/g%3E%0A%20%20%20%20%20%20%20%20%3C/g%3E%0A%20%20%20%20%3C/g%3E%0A%3C/svg%3E) no-repeat fixed center;
background-size: 574px 400px;
top: 0;
left: 0;
opacity: 0.3;
position: absolute;
z-index: 1;
}
.light #bg {
opacity: 0.3;
}
.dark #bg {
opacity: 0.05;
}
#wrapper {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
min-height: 100%;
}
#inner {
max-width: 60%;
min-width: 400px;
padding: 10px;
}
#quote {
position: relative;
font-size: 45px;
line-height: 55px;
font-weight: 300;
color: #333333;
text-align: center;
z-index: 100;
}
.dark #quote {
color: #fff;
}
#cite {
position: relative;
color: #999999;
font-style: normal;
margin-top: 20px;
display: block;
text-align: center;
z-index: 99;
}
.dark #cite {
color: #fff;
opacity: 0.3;
}
#info {
text-align: center;
width: 100%;
font-size: 12px;
color: #999999;
position: absolute;
bottom: 10px;
font-weight: 300;
z-index: 98;
}
#info a {
color: #999999;
}
.dark #info {
color: #ffffff;
opacity: 0.3;
}
.dark #info a {
color: #ffffff;
}
@media screen and (max-width: 1300px) {
#inner {
max-width: 75%;
}
}
@media screen and (max-width: 750px),
screen and (max-height: 525px) {
#bg {
background-size: 430px 300px;
}
}
@media screen and (max-width: 550px),
screen and (max-height: 425px) {
#bg {
background-size: 287px 200px;
}
}
@media screen and (max-width: 350px),
screen and (max-height: 325px) {
#bg {
background-size: 143px 100px;
}
}
@media screen and (max-width: 700px) {
#inner {
max-width: 75%;
}
#quote {
font-size: 38px;
line-height: 52px;
}
}
@media screen and (max-width: 600px) {
#quote {
font-size: 28px;
line-height: 40px;
}
}
@media screen and (max-height: 600px) {
#quote {
font-size: 28px;
line-height: 40px;
}
}
@media screen and (max-height: 400px) {
#quote {
font-size: 22px;
line-height: 29px;
}
}
@media screen and (max-height: 200px) {
#quote {
font-size: 19px;
line-height: 25px;
}
#info {
display: none;
}
}
/* Hide if on a really small screen */
@media screen and (max-width: 280px) {
body,
html {
display: none !important;
}
}
</style>
</head>
<script>
function load_quote (){
quotes_list = [
'Amateurs sit and wait for inspiration, the rest of us just get up and go to work.','Stephen King',
'All men dream, but not equally. Those who dream by night in the dusty recesses of their minds, wake in the day to find that it was vanity: but the dreamers of the day are dangerous men, for they may act on their dreams with open eyes, to make them possible.','T. E. Lawrence',
'Action is the foundational key to all success.','Pablo Picasso',
'There is no substitute for hard work.','Thomas Edison',
'Focused, hard work is the real key to success. Keep your eyes on the goal, and just keep taking the next step towards completing it.','John Carmack',
'Opportunities are usually disguised as hard work, so most people do not recognize them.','Ann Landers',
'The mind is everything. What you think you become.','Buddha',
'The best time to plant a tree is 20 years ago. The second best time is now.','Chinese Proverb',
'We do not make movies to make money, we make money to make more movies.','Walt Disney',
'A person who chases two rabbits catches neither.','Confucius',
'Inspiration exists, but it has to find you working.','Pablo Picasso',
'If there is no wind, row.','Latin Proverb',
'The secret of getting ahead is getting started.','Author unknown',
'Journey of a thousand miles begins with one step.','Lao Tzu',
'Pain is temporary. It may last a minute, or an hour, or a day, or a year, but eventually it will subside and something else will take its place. If I quit, however, it lasts forever.','Lance Armstrong',
]
selected_quote = Math.floor(Math.random() * quotes_list.length/2)
var x = document.getElementById("quote");
x.innerHTML = "“" + quotes_list[2*selected_quote] + "“"
var x = document.getElementById("cite");
x.innerHTML = "“" + quotes_list[2*selected_quote+1] + "“"
}
</script>
<body onload="load_quote()">
<div id="wrapper">
<div id="inner">
<!-- Display templated quote data -->
<blockquote id="quote">“Bla Bla Bla”</blockquote>
<cite id="cite">— Ahmed Taha</cite>
<div id="bg"></div>
</div>
</div>
</div>
<script>
function load_quote (){
alert('Hello World')
}
/** Page scripts **/
// Bust browser cache
window.onpageshow = function(event) {
if (event.persisted) {
window.location.reload()
}
};
/**
* Function to create a cookie
*
* https://gist.github.com/litodam/3048775
*
* usage: createCookie("myCookieUniqueName", value, 30);
*/
function createCookie(name, value, days) {
if (days) {
var date = new Date();
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
var expires = "; expires=" + date.toGMTString();
} else var expires = "";
document.cookie = name + "=" + value + expires + "; path=/";
}
/**
* Read a cookie
*
* https://gist.github.com/litodam/3048775
*
* usage: readCookie("myCookieUniqueName");
*/
function readCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for (var i = 0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') c = c.substring(1, c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
}
return null;
}
/**
* Erase a cookie
*
* https://gist.github.com/litodam/3048775
*
* usage: eraseCookie("myCookieUniqueName");
*/
function eraseCookie(name) {
createCookie(name, "", -1);
}
/**
* Name of theme cookie
*/
var focusThemeCookieName = "FocusColorPreference";
/**
* Toggle theme from light<->dark
*
* Relies on cookies, so has to be done once per browser.
*/
function toggleTheme() {
return document.querySelector("body").classList.toggle("dark")
}
function toggleThemeSelection() {
var selection = toggleTheme();
var value = "light";
if (selection) {
value = "dark";
}
eraseCookie(focusThemeCookieName);
createCookie(focusThemeCookieName, value, 5000);
}
/**
* Called when page loads. Sets default theme
*/
function initialize() {
{{#darkmode}}
var isDarkTheme = true;
{{/darkmode}}
{{^darkmode}}
var isDarkTheme = false;
{{/darkmode}}
var preference = readCookie(focusThemeCookieName);
if (preference == "dark") {
isDarkTheme = true;
} else if (preference == "light") {
isDarkTheme = false;
}
if (isDarkTheme) {
toggleTheme();
}
}
initialize();
</script>
</body>
</html>