-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
966 lines (896 loc) · 36.5 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
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
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="description" content="Add a little Stoicism to your day with interesting quotes from Marcus Aurelius, Epictetus, and other Stoic philosophers. This lightweight site works best as your browser's default startup page, but can also be used whenever you need quick inspiration." />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="theme-color" content="#000000">
<meta property="fb:app_id" content="210276656313368">
<meta property="og:description" content="Start your day with stoic quotes">
<meta property="og:image" content="https://stoicstartup.app/icons/facebook-preview.jpg">
<meta property="og:title" content="Stoic Startup">
<meta property="og:type" content="website">
<meta property="og:url" content="https://stoicstartup.app">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="msapplication-config" content="./icons/browserconfig.xml">
<link rel="apple-touch-icon" sizes="180x180" href="./icons/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="./icons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="./icons/favicon-16x16.png">
<link rel="mask-icon" href="./icons/safari-pinned-tab.svg" color="#5bbad5">
<link rel="shortcut icon" href="./icons/favicon.ico">
<link rel="manifest" href="./icons/manifest.json">
<link rel="canonical" href="https://stoicstartup.app"/>
<link rel="alternate" hreflang="en" href="https://stoicstartup.app" />
<title>Stoic Startup</title>
<style>
html, body {
background: #000;
font-family: Calibri, Arial, sans-serif;
height: 100%;
padding: 0;
margin: 0;
width: 100%;
}
body {
cursor: pointer;
overflow: hidden;
position: fixed;
}
.flex {
align-items: center;
bottom: 0;
display: flex;
justify-content: center;
left: 0;
overflow-y: auto;
position: absolute;
right: 0;
top: 0;
}
.quote-box {
bottom: 0;
color: #fff;
padding: 2rem 2rem 2rem 2.5rem;
max-width: 600px;
transition: opacity 0.5s, transform 0.5s;
}
.hidden {
opacity: 0;
transform: scale(0.95);
}
.quote {
font-size: 2rem;
padding-bottom: 0.5rem;
}
.quote::before {
content: "\201C";
left: -0.5rem;
margin-left: -1rem;
position: relative;
}
.quote::after {
content: "\201D";
}
.author {
font-style: italic;
}
.logo {
opacity: 0.5;
position: fixed;
right: 60px;
top: 10px;
transition: 0.5s opacity;
z-index: 100;
}
.logo:focus, .logo:hover {
opacity: 1;
}
.facebook-enabled #fb-logo {
width: 32px;
}
#gh-logo {
right: 10px;
}
.copy {
position: fixed;
z-index: 100;
}
.nav-button {
background: transparent;
border: 1px white solid;
border-radius: 4px;
bottom: 12px;
color: #fff;
cursor: pointer;
height: 40px;
opacity: 0.5;
position: fixed;
transition: opacity 0.5s;
width: 40px;
}
.nav-button:hover, .nav-button:focus {
opacity: 1;
}
.nav-button.back {
left: 12px;
}
.nav-button.copy {
left: 50%;
margin-left: -75px;
width: 150px;;
}
.nav-button.next {
right: 12px;
}
@media (max-width: 960px) {
.long .quote {
font-size: 1.4rem;
}
}
@media (max-width: 640px) {
.quote {
font-size: 1.5rem;
}
.short .quote {
font-size: 1.8rem;
}
.long .quote {
font-size: 1.2rem;
}
.quote::before {
left: -0.375rem;
margin-left: -0.75rem;
}
}
</style>
</head>
<body>
<a id="fb-logo" class="logo" href="#" title="Share on Facebook">
<img src="icons/facebook.svg" alt="Facebook Logo"/>
</a>
<a id="gh-logo" class="logo" href="https://github.com/timmhayes/stoic-startup" title="GitHub Source">
<img src="icons/GitHub-Mark-Light-32px.png" alt="GitHub Logo"/>
</a>
<noscript>You must have JavaScript enabled to use this website.</noscript>
<section class="flex">
<div class="quote-box">
<div class="quote"></div>
<div class="author"></div>
</div>
</section>
<section class="flex">
<div class="quote-box hidden">
<div class="quote"></div>
<div class="author"></div>
</div>
</section>
<button class="nav-button back" aria-label="Previous Quote">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="24px"
height="24px" viewBox="0 0 24 24" enable-background="new 0 0 24 24" fill="white" xml:space="preserve">
<g><path opacity="0.87" fill="none" d="M0,0h24v24H0V0z"/></g>
<g><path d="M17.51,3.87L15.73,2.1L5.84,12l9.9,9.9l1.77-1.77L9.38,12L17.51,3.87z"/></g>
</svg>
</button>
<button class="nav-button copy" aria-label="Copy to clipboard">Copy to clipboard</button>
<button class="nav-button next" aria-label="Next Quote">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="24px"
height="24px" viewBox="0 0 24 24" enable-background="new 0 0 24 24" fill="white" xml:space="preserve">
<g><path opacity="0.87" fill="none" d="M24,24H0L0,0l24,0V24z"/></g>
<g><path d="M6.49,20.13l1.77,1.77l9.9-9.9l-9.9-9.9L6.49,3.87L14.62,12L6.49,20.13z"/></g>
</svg>
</button>
<script>
/* Google Analytics integration*/
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga')
ga('create', 'UA-124894314-1', 'auto')
ga('send', 'pageview')
/* Facebook integration */
window.fbAsyncInit = function() {
FB.init({
appId : 210276656313368,
status : true,
xfbml : false,
version : 'v3.1'
})
FB.AppEvents.logPageView()
document.body.classList.add('facebook-enabled')
};
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "https://connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'))
function init() {
var currentArrayPosition = -1
function share(e) {
if (!window.FB) return
FB.ui({
method: 'share',
href: 'https://stoicstartup.app/' + location.hash,
source: 'https://stoicstartup.app/icons/android-chrome-256x256.png',
quote: '"' + quotes[currentArrayPosition].quote + '" - ' + quotes[currentArrayPosition].author
}, function(response){});
ga('send', 'social', {
'socialNetwork': 'facebook',
'socialAction': 'share',
'socialTarget': 'https://stoicstartup.app/' + location.hash
})
e.stopPropagation()
return false
}
function increment (incrementBy) {
var to = currentArrayPosition
if (typeof incrementBy !== 'number') incrementBy = 1
to += incrementBy
if (to >= quotes.length) {
to = 0
} else if (to < 0) {
to = quotes.length - 1
}
goTo(to)
}
function goTo (index, ignorePushState) {
var incoming = document.querySelector('.hidden')
var outgoing = document.querySelector('.quote-box:not(.hidden)')
var quoteObj = quotes[index]
var copyButton = document.querySelector('.copy')
incoming.classList.remove('hidden') // ie doesn't support multiple params on classlist methods
incoming.classList.remove('short')
incoming.classList.remove('long')
if (quoteObj.quote.length < 150) incoming.classList.add('short')
else if (quoteObj.quote.length > 400) incoming.classList.toggle('long')
incoming.querySelector('.quote').innerText = quoteObj.quote
incoming.querySelector('.author').innerText = quoteObj.author
outgoing.classList.add('hidden')
if (!ignorePushState) {
var action = index === 0 ? 'replaceState' : 'pushState'
window.history[action](index, null, '#' + quoteObj.hash)
}
copyButton.innerText = copyButton.getAttribute('aria-label')
currentArrayPosition = index
ga('send', 'pageview')
}
window.addEventListener('popstate', function (e) {
if (typeof e.state === 'number') {
goTo(e.state, true)
}
})
document.body.addEventListener('swipe', function(e) {
if (e.direction === 'right') increment(1)
else if (e.direction === 'left') increment(-1)
})
document.body.addEventListener('click', increment )
document.body.addEventListener('keydown', function (e) {
if (e.keyCode === 37) increment(-1)
else if (e.keyCode === 13 || e.keyCode === 32 || e.keyCode === 39) increment(1)
})
document.querySelector('#fb-logo').addEventListener('click', share)
document.querySelector('#gh-logo').addEventListener('click', function(e) {
e.stopPropagation()
})
document.querySelector('.nav-button.back').addEventListener('click', function(e) {
increment(-1)
e.stopPropagation()
})
document.querySelector('.copy').addEventListener('click', function (e) {
var q = quotes[currentArrayPosition]
var str = '"' + q.quote + '" - ' + q.author
var success = copyToClipboard(str)
if (success) this.innerText = 'Quote copied!'
e.stopPropagation()
})
if (window.location.hash) {
var hash = window.location.hash.replace(/^#/, '')
var index = quotes.findIndex(function (quote) {
return hash === quote.hash
})
if (index !== -1) goTo(index)
else increment()
} else {
increment()
}
}
document.addEventListener('DOMContentLoaded', init)
var quotes = [
{
"quote": "Think of the life you have lived until now as over and, as a dead man, see what’s left as a bonus and live it according to Nature. Love the hand that fate deals you and play it as your own, for what could be more fitting?",
"author": "Marcus Aurelius"
},
{
"quote": "In your actions, don’t procrastinate. In your conversations, don’t confuse. In your thoughts, don’t wander. In your soul, don’t be passive or aggressive. In your life, don’t be all about business.",
"author": "Marcus Aurelius"
},
{
"quote": "If it is not right, do not do it, if it is not true, do not say it.",
"author": "Marcus Aurelius"
},
{
"quote": "Choose not to be harmed — and you won’t feel harmed. Don’t feel harmed — and you haven’t been.",
"author": "Marcus Aurelius"
},
{
"quote": "It’s time you realized that you have something in you more powerful and miraculous than the things that affect you and make you dance like a puppet.",
"author": "Marcus Aurelius"
},
{
"quote": "External things are not the problem. It’s your assessment of them. Which you can erase right now.",
"author": "Marcus Aurelius"
},
{
"quote": "If anyone can refute me—show me I’m making a mistake or looking at things from the wrong perspective—I’ll gladly change. It’s the truth I’m after, and the truth never harmed anyone.",
"author": "Marcus Aurelius"
},
{
"quote": "You could leave life right now. Let that determine what you do and say and think.",
"author": "Marcus Aurelius"
},
{
"quote": "Be tolerant with others and strict with yourself.",
"author": "Marcus Aurelius"
},
{
"quote": "We are more often frightened than hurt; and we suffer more in imagination than in reality.",
"author": "Seneca"
},
{
"quote": "If a man knows not which port he sails, no wind is favorable.",
"author": "Seneca"
},
{
"quote": "No person has the power to have everything they want, but it is in their power not to want what they don’t have, and to cheerfully put to good use what they do have.",
"author": "Seneca"
},
{
"quote": "Nothing, to my way of thinking, is a better proof of a well ordered mind than a man’s ability to stop just where he is and pass some time in his own company.",
"author": "Seneca"
},
{
"quote": "He who fears death will never do anything worth of a man who is alive.",
"author": "Seneca"
},
{
"quote": "This is our big mistake: to think we look forward to death. Most of death is already gone. Whatever time has passed is owned by death.",
"author": "Seneca"
},
{
"quote": "Life is very short and anxious for those who forget the past, neglect the present, and fear the future.",
"author": "Seneca"
},
{
"quote": "I judge you unfortunate because you have never lived through misfortune. You have passed through life without an opponent—no one can ever know what you are capable of, not even you.",
"author": "Seneca"
},
{
"quote": "How does it help…to make troubles heavier by bemoaning them?",
"author": "Seneca"
},
{
"quote": "People are frugal in guarding their personal property; but as soon as it comes to squandering time they are most wasteful of the one thing in which it is right to be stingy.",
"author": "Seneca"
},
{
"quote": "How long are you going to wait before you demand the best for yourself?",
"author": "Epictetus"
},
{
"quote": "Don’t seek for everything to happen as you wish it would, but rather wish that everything happens as it actually will—then your life will flow well.",
"author": "Epictetus"
},
{
"quote": "First say to yourself what you would be; and then do what you have to do.",
"author": "Epictetus"
},
{
"quote": "Curb your desire—don’t set your heart on so many things and you will get what you need.",
"author": "Epictetus"
},
{
"quote": "That’s why the philosophers warn us not to be satisfiedwith mere learning, but to add practice and then training. For as time passes we forget what we learned and end up doing the opposite, and hold opinions the opposite of what we should.",
"author": "Epictetus"
},
{
"quote": "Don’t explain your philosophy. Embody it.",
"author": "Epictetus"
},
{
"quote": "The chief task in life is simply this: to identify and separate matters so that I can say clearly to myself which are externals not under my control, and which have to do with the choices I actually control. Where then do I look for good and evil? Not to uncontrollable externals, but within myself to the choices that are my own…",
"author": "Epictetus"
},
{
"quote": "If anyone tells you that a certain person speaks ill of you, do not make excuses about what is said of you but answer, ‘He was ignorant of my other faults, else he would have not mentioned these alone.'",
"author": "Epictetus"
},
{
"quote": "I begin to speak only when I’m certain what I’ll say isn’t better left unsaid.",
"author": "Cato"
},
{
"quote": "What man actually needs is not a tensionless state but rather the striving and struggling for some goal worthy of him.",
"author": "Viktor Frankl"
},
{
"quote": "When we are no longer able to change a situation, we are challenged to change ourselves.",
"author": "Viktor Frankl"
},
{
"quote": "He is a wise man who does not grieve for the things which he has not, but rejoices for those which he has.",
"author": "Epictetus"
},
{
"quote": "Pain is inevitable. Suffering is optional.",
"author": "Buddhist adage"
},
{
"quote": "You have power over your mind - not outside events. Realize this, and you will find strength.",
"author": "Marcus Aurelius"
},
{
"quote": "Dwell on the beauty of life. Watch the stars, and see yourself running with them.",
"author": "Marcus Aurelius"
},
{
"quote": "The happiness of your life depends upon the quality of your thoughts.",
"author": "Marcus Aurelius"
},
{
"quote": "Everything we hear is an opinion, not a fact. Everything we see is a perspective, not the truth.",
"author": "Marcus Aurelius"
},
{
"quote": "Waste no more time arguing about what a good man should be. Be one.",
"author": "Marcus Aurelius"
},
{
"quote": "If you are distressed by anything external, the pain is not due to the thing itself, but to your estimate of it; and this you have the power to revoke at any moment.",
"author": "Marcus Aurelius"
},
{
"quote": "When you arise in the morning think of what a privilege it is to be alive, to think, to enjoy, to love ...",
"author": "Marcus Aurelius"
},
{
"quote": "Accept the things to which fate binds you, and love the people with whom fate brings you together,but do so with all your heart.",
"author": "Marcus Aurelius"
},
{
"quote": "The best revenge is to be unlike him who performed the injury.",
"author": "Marcus Aurelius"
},
{
"quote": "The soul becomes dyed with the colour of its thoughts.",
"author": "Marcus Aurelius"
},
{
"quote": "It is not death that a man should fear, but he should fear never beginning to live.",
"author": "Marcus Aurelius"
},
{
"quote": "Our life is what our thoughts make it.",
"author": "Marcus Aurelius"
},
{
"quote": "If someone is able to show me that what I think or do is not right, I will happily change, for I seek the truth, by which no one was ever truly harmed. It is the person who continues in his self-deception and ignorance who is harmed.",
"author": "Marcus Aurelius"
},
{
"quote": "Never let the future disturb you. You will meet it, if you have to, with the same weapons of reason which today arm you against the present.",
"author": "Marcus Aurelius"
},
{
"quote": "If it is not right do not do it; if it is not true do not say it.",
"author": "Marcus Aurelius"
},
{
"quote": "Very little is needed to make a happy life; it is all within yourself in your way of thinking.",
"author": "Marcus Aurelius"
},
{
"quote": "The object of life is not to be on the side of the majority, but to escape finding oneself in the ranks of the insane.",
"author": "Marcus Aurelius"
},
{
"quote": "I have often wondered how it is that every man loves himself more than all the rest of men, but yet sets less value on his own opinion of himself than on the opinion of others.",
"author": "Marcus Aurelius"
},
{
"quote": "Whenever you are about to find fault with someone, ask yourself the following question: What fault of mine most nearly resembles the one I am about to criticize?",
"author": "Marcus Aurelius"
},
{
"quote": "The best revenge is not to be like your enemy.",
"author": "Marcus Aurelius"
},
{
"quote": "Reject your sense of injury and the injury itself disappears.",
"author": "Marcus Aurelius"
},
{
"quote": "When another blames you or hates you, or people voice similar criticisms, go to their souls, penetrate inside and see what sort of people they are. You will realize that there is no need to be racked with anxiety that they should hold any particular opinion about you.",
"author": "Marcus Aurelius"
},
{
"quote": "How much more grievous are the consequences of anger than the causes of it.",
"author": "Marcus Aurelius"
},
{
"quote": "The first rule is to keep an untroubled spirit. The second is to look things in the face and know them for what they are.",
"author": "Marcus Aurelius"
},
{
"quote": "Begin each day by telling yourself: Today I shall be meeting with interference, ingratitude, insolence, disloyalty, ill-will, and selfishness – all of them due to the offenders’ ignorance of what is good or evil.",
"author": "Marcus Aurelius"
},
{
"quote": "Look well into thyself; there is a source of strength which will always spring up if thou wilt always look.",
"author": "Marcus Aurelius"
},
{
"quote": "Here is a rule to remember in future, when anything tempts you to feel bitter: not \"This is misfortune,\" but \"To bear this worthily is good fortune.",
"author": "Marcus Aurelius"
},
{
"quote": "How much time he gains who does not look to see what his neighbour says or does or thinks, but only at what he does himself, to make it just and holy.",
"author": "Marcus Aurelius"
},
{
"quote": "You are a little soul carrying about a corpse, as Epictetus used to say.",
"author": "Marcus Aurelius"
},
{
"quote": "Do every act of your life as though it were the very last act of your life.",
"author": "Marcus Aurelius"
},
{
"quote": "Look back over the past, with its changing empires that rose and fell, and you can foresee the future too.",
"author": "Marcus Aurelius"
},
{
"quote": "What we do now echoes in eternity.",
"author": "Marcus Aurelius"
},
{
"quote": "Do not indulge in dreams of having what you have not, but reckon up the chief of the blessings you do possess, and then thankfully remember how you would crave for them if they were not yours.",
"author": "Marcus Aurelius"
},
{
"quote": "For it is in your power to retire into yourself whenever you choose.",
"author": "Marcus Aurelius"
},
{
"quote": "Think of yourself as dead. You have lived your life. Now, take what's left and live it properly. What doesn't transmit light creates its own darkness.",
"author": "Marcus Aurelius"
},
{
"quote": "The universe is change; our life is what our thoughts make it.",
"author": "Marcus Aurelius"
},
{
"quote": "Perfection of character is this: to live each day as if it were your last, without frenzy, without apathy, without pretence.",
"author": "Marcus Aurelius"
},
{
"quote": "You always own the option of having no opinion. There is never any need to get worked up or to trouble your soul about things you can't control. These things are not asking to be judged by you. Leave them alone.",
"author": "Marcus Aurelius"
},
{
"quote": "Never esteem anything as of advantage to you that will make you break your word or lose your self-respect.",
"author": "Marcus Aurelius"
},
{
"quote": "Remember that very little is needed to make a happy life.",
"author": "Marcus Aurelius"
},
{
"quote": "A man’s worth is no greater than the worth of his ambitions.",
"author": "Marcus Aurelius"
},
{
"quote": "Receive without conceit, release without struggle.",
"author": "Marcus Aurelius"
},
{
"quote": "Nothing happens to anybody which he is not fitted by nature to bear.",
"author": "Marcus Aurelius"
},
{
"quote": "Don't go on discussing what a good person should be. Just be one.",
"author": "Marcus Aurelius"
},
{
"quote": "Just that you do the right thing. The rest doesn't matter. Cold or warm. Tired or well-rested. Despised or honored. Dying...or busy with other assignments. Because dying, too, is one of our assignments in life.",
"author": "Marcus Aurelius"
},
{
"quote": "How ridiculous and how strange to be surprised at anything which happens in life",
"author": "Marcus Aurelius"
},
{
"quote": "Life is neither good or evil, but only a place for good and evil.",
"author": "Marcus Aurelius"
},
{
"quote": "Whatever anyone does or says, I must be emerald and keep my colour.",
"author": "Marcus Aurelius"
},
{
"quote": "Humans have come into being for the sake of each other, so either teach them, or learn to bear them.",
"author": "Marcus Aurelius"
},
{
"quote": "Though you break your heart, men will go on as before.",
"author": "Marcus Aurelius"
},
{
"quote": "It is in your power to withdraw yourself whenever you desire. Perfect tranquility within consists in the good ordering of the mind, the realm of your own.",
"author": "Marcus Aurelius"
},
{
"quote": "Regain your senses, call yourself back, and once again wake up. Now that you realize that only dreams were troubling you, view this 'reality' as you view your dreams.",
"author": "Marcus Aurelius"
},
{
"quote": "Do what you will. Even if you tear yourself apart, most people will continue doing the same things.",
"author": "Marcus Aurelius"
},
{
"quote": "The happiness of your life depends upon the quality of your thoughts: therefore, guard accordingly, and take care that you entertain no notions unsuitable to virtue and reasonable nature.",
"author": "Marcus Aurelius"
},
{
"quote": "Whoever does wrong, wrongs himself; whoever does injustice, does it to himself, making himself evil.",
"author": "Marcus Aurelius"
},
{
"quote": "The memory of everything is very soon overwhelmed in time.",
"author": "Marcus Aurelius"
},
{
"quote": "Observe always that everything is the result of change, and get used to thinking that there is nothing Nature loves so well as to change existing forms and make new ones like them.",
"author": "Marcus Aurelius"
},
{
"quote": "Accept whatever comes to you woven in the pattern of your destiny, for what could more aptly fit your needs?",
"author": "Marcus Aurelius"
}, {
"quote": "If someone can prove me wrong and show me my mistake in any thought or action, I shall gladly change. I seek the truth, which never harmed anyone: the harm is to persist in one's own self-deception and ignorance.",
"author": "Marcus Aurelius"
},
{
"quote": "If any man despises me, that is his problem. My only concern is not doing or saying anything deserving of contempt.",
"author": "Marcus Aurelius"
},
{
"quote": "Do not act as if you had ten thousand years to throw away. Death stands at your elbow. Be good for something while you live and it is in your power.",
"author": "Marcus Aurelius"
},
{
"quote": "If you are pained by external things, it is not they that disturb you, but your own judgement of them. And it is in your power to wipe out that judgement now.",
"author": "Marcus Aurelius"
},
{
"quote": "Nowhere can man find a quieter or more untroubled retreat than in his own soul.",
"author": "Marcus Aurelius"
},
{
"quote": "Because a thing seems difficult for you, do not think it impossible for anyone to accomplish.",
"author": "Marcus Aurelius"
},
{
"quote": "Or is it your reputation that's bothering you? But look at how soon we're all forgotten. The abyss of endless time that swallows it all. The emptiness of those applauding hands. The people who praise us; how capricious they are, how arbitrary. And the tiny region it takes place. The whole earth a point in space - and most of it uninhabited.",
"author": "Marcus Aurelius"
},
{
"quote": "A noble man compares and estimates himself by an idea which is higher than himself; and a mean man, by one lower than himself. The one produces aspiration; the other ambition, which is the way in which a vulgar man aspires.",
"author": "Marcus Aurelius"
},
{
"quote": "A person's worth is measured by the worth of what he values.",
"author": "Marcus Aurelius"
},
{
"quote": "Confine yourself to the present.",
"author": "Marcus Aurelius"
},
{
"quote": "Pass then through this little space of time conformably to nature, and end thy journey in content, just as an olive falls off when it is ripe, blessing nature who produced it, and thanking the tree on which it grew.",
"author": "Marcus Aurelius"
},
{
"quote": "That which is really beautiful has no need of anything; not more than law, not more than truth, not more than benevolence or modesty.",
"author": "Marcus Aurelius"
},
{
"quote": "The happiness of those who want to be popular depends on others; the happiness of those who seek pleasure fluctuates with moods outside their control; but the happiness of the wise grows out of their own free acts.",
"author": "Marcus Aurelius"
},
{
"quote": "Dig within. Within is the wellspring of Good; and it is always ready to bubble up, if you just dig.",
"author": "Marcus Aurelius"
},
{
"quote": "Misfortune nobly born is good fortune.",
"author": "Marcus Aurelius"
},
{
"quote": "Take full account of what Excellencies you possess, and in gratitude remember how you would hanker after them, if you had them not.",
"author": "Marcus Aurelius"
},
{
"quote": "Is your cucumber bitter? Throw it away. Are there briars in your path? Turn aside. That is enough. Do not go on and say, \"Why were things of this sort ever brought into this world?\" neither intolerable nor everlasting - if thou bearest in mind that it has its limits, and if thou addest nothing to it in imagination. Pain is either an evil to the body (then let the body say what it thinks of it!)-or to the soul. But it is in the power of the soul to maintain its own serenity and tranquility. . . .",
"author": "Marcus Aurelius"
},
{
"quote": "What we cannot bear removes us from life; what remains can be borne.",
"author": "Marcus Aurelius"
},
{
"quote": "I was once a fortunate man but at some point fortune abandoned me.",
"author": "Marcus Aurelius"
},
{
"quote": "A man must stand erect, not be kept erect by others.",
"author": "Marcus Aurelius"
},
{
"quote": "The art of living is more like wrestling than dancing, in so far as it stands ready against the accidental and the unforeseen, and is not apt to fall.",
"author": "Marcus Aurelius"
},
{
"quote": "When you arise in the moring, think of what a precious privelege it is to be alive-- to breathe, to think, to enjoy, to love",
"author": "Marcus Aurelius"
},
{
"quote": "All men are made one for another: either then teach them better or bear with them.",
"author": "Marcus Aurelius"
},
{
"quote": "Life is opinion.",
"author": "Marcus Aurelius"
},
{
"quote": "The things you think about determine the quality of your mind.",
"author": "Marcus Aurelius"
},
{
"quote": "Every living organism is fulfilled when it follows the right path for its own nature.",
"author": "Marcus Aurelius"
},
{
"quote": "Unhappy am I because this has happened to me. Not so, but happy am I, though this has happened to me, because I continue free from pain, neither crushed by the present nor fearing the future.",
"author": "Marcus Aurelius"
},
{
"quote": "Be like the cliff against which the waves continually break; but it stands firm and tames the fury of the water around it.",
"author": "Marcus Aurelius"
},
{
"quote": "It never ceases to amaze me: we all love ourselves more than other people, but care more about their opinion than our own.",
"author": "Marcus Aurelius"
},
{
"quote": "How ridiculous and unrealistic is the man who is astonished at anything that happens in life.",
"author": "Marcus Aurelius"
}
];
// shuffle
for (var i = quotes.length - 1; i > 0; i--) {
var j = Math.floor(Math.random() * (i + 1))
var temp = quotes[i]
quotes[i] = quotes[j]
quotes[j] = temp
}
quotes.forEach(function(element) {
var short = element.quote.match(/^(\w+\W*,*){1,10}/)
element.hash = encodeURI(short[0].replace(/ $/gi, '').replace(/[ —]/gi, '_').replace(/[\:;,.\?\’']/gi, '').toLowerCase())
});
// swipe events
(function() {
var pageWidth = window.innerWidth || document.body.clientWidth
var treshold = Math.max(1,Math.floor(0.01 * (pageWidth)))
var touchstartX = 0
var touchstartY = 0
var touchendX = 0
var touchendY = 0
var limit = Math.tan(45 * 1.5 / 180 * Math.PI)
var gestureZone = document.body
gestureZone.addEventListener('touchstart', function(event) {
touchstartX = event.changedTouches[0].screenX
touchstartY = event.changedTouches[0].screenY
}, false)
gestureZone.addEventListener('touchend', function(event) {
touchendX = event.changedTouches[0].screenX
touchendY = event.changedTouches[0].screenY
handleGesture(event)
}, false)
function castEvent(direction) {
var e
if (window.CustomEvent) {
e = new CustomEvent('swipe')
} else {
e = document.createEvent('Event')
e.initEvent('swipe')
}
e.direction = direction
document.body.dispatchEvent(e)
}
function handleGesture(e) {
var x = touchendX - touchstartX
var y = touchendY - touchstartY
var xy = Math.abs(x / y)
var yx = Math.abs(y / x)
if (Math.abs(x) > treshold || Math.abs(y) > treshold) {
if (yx <= limit) {
if (x < 0) {
castEvent('left')
} else {
castEvent('right')
}
}
if (xy <= limit) {
if (y < 0) {
castEvent('top')
} else {
castEvent('bottom')
}
}
}
}
}())
function copyToClipboard(str) {
try {
var el = document.createElement('textarea')
el.value = str
document.body.appendChild(el)
el.select()
document.execCommand('copy')
document.body.removeChild(el)
return true
} catch (e) {
return false
}
}
// polyfill for IE 11
if (!Array.prototype.findIndex) {
Object.defineProperty(Array.prototype, 'findIndex', {
value: function(predicate) {
if (this == null) {
throw new TypeError('"this" is null or not defined')
}
var o = Object(this)
var len = o.length >>> 0
if (typeof predicate !== 'function') {
throw new TypeError('predicate must be a function')
}
var thisArg = arguments[1]
var k = 0
while (k < len) {
var kValue = o[k]
if (predicate.call(thisArg, kValue, k, o)) {
return k
}
k++
}
return -1
},
configurable: true,
writable: true
})
}
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('service-worker.js')
.then(function (reg) {
console.log("Service worker registered")
}).catch(function (err) {
console.log("Service worker failed to register", err)
})
}
</script>
</body>
</html>