-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex-raw.html
1029 lines (923 loc) · 49.1 KB
/
index-raw.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
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<!-- link rel=icon" href="https://phseiff.github.io/images/icon_head.png" -->
<title>phseiff - opinions & obscurities</title>
<meta name="google-site-verification" content="ZXe-miNArcDCDFzTAAkEAcGL4_d-manFNwAXiGBSNLg"/>
<meta name="description" content="
Views about politics, social topics, economics, and whatever else I deem worth talking about. Let yourself be enriched by some opinions & obscurities!"/>
<meta property="og:title" content="phseiff - opinions & obscurities"/>
<meta property="og:type" content="website"/>
<meta property="og:image" content="https://phseiff.com/images/icon.jpeg"/> <!-- ToDo: Make this image - a rectangular version of my mastodon banner -->
<meta property="og:url" content="https://phseiff.com"/>
<meta property="og:description" content="
Views about politics, social topics, economics, and whatever else I deem worth talking about. Let yourself be enriched by some opinions & obscurities!"/>
<meta name="twitter:card" content="summary"/>
<meta name="twitter:site" content="@phseiff"/>
<meta name="twitter:creator" content="@phseiff"/>
<meta name="twitter:image" content="https://phseiff.com/images/icon.jpeg"/>
<meta name="twitter:title" content="phseiff - opinions & obscurities"/>
<meta name="twitter:description" content="
Views about politics, social topics, economics, and whatever else I deem worth talking about. Let yourself be enriched by some opinions & obscurities!"/>
<link rel="canonical" href="https://phseiff.com"/>
<link type="text/css" rel="stylesheet" href="follow-buttons/mstdn-button.min.css"/>
<link type="text/css" rel="stylesheet" href="follow-buttons/twitter-button.min.css"/>
<link type="text/css" rel="stylesheet" href="follow-buttons/rss-button.min.css"/>
<link type="text/css" rel="stylesheet" href="external-links/external-link.min.css"/>
<link type="text/css" rel="stylesheet" href="materialize-css/materialize.min.css" media="screen,projection"/>
<link type="text/css" rel="stylesheet" href="/phseiff-essays/css/github-css.css"/>
<link type="text/css" rel="stylesheet" href="google-fonts/icons.min.css"/>
<link type="text/css" rel="stylesheet" href="twemoji/twemoji.min.css"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<!-- color scheme -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="msapplication-TileColor" content="#cb7b02">
<meta name="theme-color" content="#cb7b02">
<meta name="msapplication-navbutton-color" content="#cb7b02">
<meta name="apple-mobile-web-app-status-bar-style" content="#cb7b02">
<!-- Be an exception for darkreader -->
<meta name="darkreader" content="104d4afa-2a17-4971-b5af-7914e4f49e72">
<!-- Early connections -->
<link rel="preconnect" href="https://api.github.com">
<link rel="dns-prefetch" href="https://api.github.com">
<link rel="preconnect" href="https://avatars0.githubusercontent.com">
<link rel="dns-prefetch" href="https://avatars0.githubusercontent.com">
<!-- Special favicon versions -->
<link rel="apple-touch-icon" sizes="57x57" href="/icons/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/icons/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="/icons/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="/icons/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="/icons/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="/icons/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/icons/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/icons/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="/icons/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" sizes="32x32" href="/icons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="192x192" href="/icons/android-chrome-192x192.png">
<link rel="icon" type="image/png" sizes="512x512" href="/icons/android-chrome-512x512.png">
<link rel="icon" type="image/png" sizes="16x16" href="/icons/favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="/icons/favicon-32x32.png">
<link rel="manifest" href="/icons/site.webmanifest">
<meta name="msapplication-TileImage" content="/icons/mstile-144x144.png">
<link rel="mask-icon" href="/icons/safari-pinned-tab.svg" color="#cb7b02">
<meta name="apple-mobile-web-app-title" content="phseiff's Blog">
<meta name="application-name" content="phseiff's Blog">
</head>
<body>
<!-- Which essays we already tooted about - don't change this, it is automatically parsed! -->
<span style="display: none">
<already_tooted></already_tooted>
</span>
<!-- dark reader dark mode -->
<script type="text/javascript" src="darkreader/darkreader.min.js"></script>
<script>
DarkReader.setFetchMethod(window.fetch);
DarkReader.enable({ // <-- always use darkmode instead of, like previously, adapting to the system.
brightness: 100,
contrast: 90,
sepia: 10
});
</script>
<!-- style definitions -->
<link type="text/css" rel="stylesheet" href="github-banner-css/banner.min.css">
<style>
/* zoom */
.zoom {
transition: transform .2s;
position: relative;
margin-left: 10px;
margin-right: 10px;
margin-bottom: 10px;
margin-top: 10px;
padding-right: 10px;
}
@media screen and (min-width:600px) {
.zoom:hover {
/* Zoom into desktop cards, but only on desktop. */
transform: scale(1.1);
}
}
@media screen and (max-width:599px) {
/* Make essay cards full screen width on mobile. */
.card-to-show-essay, .zoom, .card-to-show-essay *:not(.badge):not(.left-badge), .zoom *:not(.badge):not(.left-badge):not(img) {
width: 100%;
}
}
/* Reduce space to the left and right when we are on mobile. */
@media screen and (max-width: 599px) {
/*.container {
width: 100%;
}*/
#file-docker-image-pull-md-readme {
width: 97%;
margin-left: 0;
margin-right: 0;
padding-right: 30px;
padding-left: 0;
}
.js-gist-file-update-container,
.gist, .gist-data, .gist-file, .file, article, .gist div {
width: 100%;
margin-left: 0;
margin-right: 0;
padding-right: 0;
padding-left: 0;
}
}
/* Hide the desktop title/show the mobile title on mobile. */
.desktop_title {
display: none;
}
.mobile_title {
display: inital;
}
@media screen and (min-width:800px) {
.desktop_title {
display: initial;
}
.mobile_title {
display: none;
}
}
.h2class {
color: orange;
}
.resizable-essay-title h2 {
/* color: orange; */
}
.margin_when_on_desktop {
margin: 15px;
}
@media screen and (max-width: 799px) {
.resizable-essay-title h2 {
font-size: 8vw;
/* color: orange; */
}
.resizable-essay-title h1 {
font-size: 10vw;
/* color: orange; */
}
.margin_when_on_desktop {
margin: 4px;
}
}
/* The cookie bar */
.cookie_bar {
background-color: #ef9c04;
position: -webkit-sticky;
position: sticky;
bottom: 0;
width: 100%;
box-shadow: 0 -5px 5px black;
color: white;
}
@media (prefers-color-scheme: dark) {
.cookie_bar h1 {
box-shadow: 0 -5px 5px black;
}
}
.cookie-bar-flex-box {
width: 100%;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: flex-end;
align-items: center;
padding: 10px;
}
@media all and (max-width: 700px) {
.cookie-bar-flex-box {
flex-direction: column;
flex-wrap: wrap;
}
}
.cookie-bar-left {
flex-grow: 1;
}
.cookie-bar-right {
width: fit-content;
margin-left: 20px;
min-width: 120px;
}
/* Activate-js-reminder */
.reminder-red {
color: #990000;
}
/* REMEMBER: If you change a color, search for all other occurrences of the color to
keep the color scheme consistent! */
/* consent button background color & revoke consent button background & rss color */
.consent-button {
background-color: #be601a;
}
/*.consent-button:not(:hover) {
box-shadow: none; ToDo: Maybe re-add this?
Gimme your opinion in an issue if you're reading this.
}*/
.no-consent-button {
background-color: #ef9c04;
}
.no-consent-button:not(:hover) {
box-shadow: none;
}
/* For headers and the scroll-down-rss-button */
.bg-color-orange {
background-color: orange;
}
.rss-color {
background-color: #f26522;
}
.standard-text-color { /* This is used by autogenerated html; don't remove it! */
color: #000000;
}
.reading-progress-bar {
background-color: red;
}
/* Make buttons with wrongly specified hover color darker when hovering over them: */
#revoke-consent-button:hover {
background-color: orange;
background-image: linear-gradient(
0deg,
rgba(0,0,0,0.2) 0%,
rgba(0,0,0,0.2) 100%
);
}
#consent-button:hover {
background-color: #be601a;
background-image: linear-gradient(
0deg,
rgba(0,0,0,0.2) 0%,
rgba(0,0,0,0.2) 100%
);
}
.rss-color:hover {
background-color: #f26522;
background-image: linear-gradient(
0deg,
rgba(0,0,0,0.2) 0%,
rgba(0,0,0,0.2) 100%
);
}
/* greyed-out emoji */
.gray-emoji {
/*color:grey;
filter: grayscale(100%);*/
color: transparent;
text-shadow: 0 0 0 #757575;
}
.yellow-emoji {
color: transparent;
text-shadow: 0 0 0 #f1ad31;
}
/* Add nice fluid border to tables. */
.gist table {
border-radius: 5px;
}
/* Make sure that empty table rows are hidden. */
.gist table tr:empty {
display: none;
}
/* orange backdrop for essay/project cards: */
.orange-backdrop {
box-shadow: orange 0 2px 2px 0,
orange 0 3px 1px -2px,
orange 0 1px 5px 0;;
}
/* CSS for the essay cards to wrap the way we want them to: */
.card-view {
display: flex;
flex-wrap: wrap;
max-width: 100%;
width: 100%;
}
.essay-card {
display: flex;
}
</style>
<main>
<!-- Reading Progress Bar -->
<div id="outer-progress-bar" style="width:100%; background:transparent; height:5px; position: -webkit-sticky; position: sticky; top: 0; display: none; z-index: 10002">
<div class="reading-progress-bar" id="progress-bar" style="left:0; height:100%; width:0; transition:width 400ms;">
<script>
function getScrollPercent() {
/* Source: https://stackoverflow.com/a/8028584*/
let e = document.getElementById("embedded-essays-if-js-is-enabled"),
h = document.documentElement,
b = document.body,
st = 'scrollTop',
sh = 'offsetHeight';
return ((h[st]||b[st]) - e.offsetTop) / ((e[sh]||h[sh]||b[sh]) - h.clientHeight) * 100;
}
function updateScrollProgressBar() {
document.getElementById("progress-bar").style.width = Math.min(100, Math.max(0, Math.round(getScrollPercent()))) + "%";
}
let new_scroll_progress = false;
document.addEventListener('scroll', function(e) {
new_scroll_progress = true;
}, true);
</script>
</div>
</div>
<!-- Header -->
<div class="container">
<a href="#">
<span id="phseiff-header">
<div class="margin_when_on_desktop">
<div class="row valign-wrapper" color="orange">
<div class="col s2 desktop_title">
<img src="images/icon.jpeg" alt="me.jpeg" class="circle responsive-img orange">
</div>
<img src="images/icon.jpeg" alt="me.jpeg" height="14vw" width="14vw" class="circle orange mobile_title" style="size: 14vw; height: 14vw; width: 14vw">
<div class="col s10 h2class">
<div class="resizable-essay-title h2class"><h1> phseiff.com </h1></div>
</div>
</div>
</div><p class="mobile_title"></p>
</span>
</a>
<!-- About -->
<span id="embedded-essays-if-js-is-enabled"></span>
<span id="small-about-text">
{description} This is my blog, and I'll be uploading my thoughts on various random topics and links to my programming projects here over the next months/years. You can also visit me on github if you'd like to!<br/>
Criticism of everything I'm saying, as well as issues with any of my programming projects are always welcome, as long as you don't mind me fixing them ;) <!-- span style="color:white"> Oh, and by the way: If you can read this sentence, it means you're having your browser in darkmode; congrats for your great taste!</span -->
</span>
<!-- A small motivational text for people who don't use javascript -->
<p class="reminder-red" id="reminder-for-people-without-javascript">Oh, and by the way: I see you have javascript deactivated for this site.
Luckily, the site also works without javascript, but it will be more responsive if you activate it, plus I don't collect any data without your explicit permission. ;)</p>
<script> document.getElementById("reminder-for-people-without-javascript").setAttribute("style", "display: none;"); </script>
<!-- Projects -->
<div class="h2class resizable-essay-title"><h2> my projects </h2></div>
<hr>
<p>
Some of my project, on whom I work in my freetime.<br/>
I pour a lot of heart blood into most of these, so feedback is always appreciated, and I love collecting shiny sparkly little stars on GitHub, so if you want to make me happy and they somehow helped you, go and show them some love :3
</p>
<div class="card-view" >
<!-- project cards -->
</div>
<!-- Essays -->
<div class="h2class resizable-essay-title"><h2> some essays </h2></div>
<hr>
<p>
Here are some of my essays, at least those that are somewhat finished yet.<br/>
I use a system of ✨sparkles✨ to categorize how much effort went into each of those, or how much confidence I have in them, so you're not disappointed if you didn't like an essay I didn't pour my whole heart into. :3
</p>
<p>Enjoy! :D</p>
<div class="card-view">
<!-- essay cards -->
</div>
<!-- Actually Embedded essays -->
<span id="wrapper-for-embedded-essays">
<span id="puffer-for-embedded-essays" style="height: 10000px"></span>
<span id="embedded_essays">
<!-- the essays content -->
</span>
</span>
<script>
/* Ensure the original container with the spacing on the top is hidden when we are using javascript. */
let wrapper_for_embedded_essays = document.getElementById("wrapper-for-embedded-essays");
wrapper_for_embedded_essays.style.cssText = "display: none;";
/* Make every object within the inner container invisible. */
let embedded_essays = document.getElementById("embedded_essays");
for (i=0; i<embedded_essays.children.length; i++) {
embedded_essays.children[i].style.display = "none";
}
/* Move the inner container to the front (above the content chooser). */
new_container_for_essays = document.getElementById("embedded-essays-if-js-is-enabled");
new_container_for_essays.appendChild(embedded_essays);
/* Descriptions & Titles */
page_descriptions = {
"": "Views about politics, social topics, economics, and whatever else I deem worth talking about. Let yourself be enriched by some opinions & obscurities!",
/* other descriptions */
}
page_titles = {
"": "phseiff - opinions & obscurities",
/* other titles */
}
page_images = {
"": "https://phseiff.com/images/icon.jpeg",
/* other images */
}
page_languages = {
"": "en",
/* other languages */
}
/* Set the hash without scrolling - we now use a url, so search engines can index it separately. */
function set_hash(location) {
let current_url;
if (location !== "")
current_url = (
window.location.protocol
+ "//" + window.location.host
+ "/e/" + location
);
else
current_url = (
window.location.protocol + "//" + window.location.host
);
history.pushState({}, "", current_url);
// language tags:
let html_language_tag = document.querySelector("html");
html_language_tag.setAttribute("lang", page_languages[location]);
// meta tags:
let meta_description_tag = document.documentElement.querySelectorAll("meta[name=description]")[0];
let meta_title_tag = document.documentElement.querySelectorAll("title")[0];
meta_description_tag.setAttribute("content", page_descriptions[location]);
meta_title_tag.innerHTML = page_titles[location];
// canonical tag:
let canonical_tag = document.documentElement.querySelectorAll("link[rel=canonical]")[0];
canonical_tag.setAttribute("href", current_url);
// get og tags/ twitter tags:
let og_description_tags = [
document.documentElement.querySelectorAll("meta[property=\"og:description\"]")[0],
document.documentElement.querySelectorAll("meta[name=\"twitter:description\"]")[0]
];
let og_title_tags = [
document.documentElement.querySelectorAll("meta[property=\"og:title\"]")[0],
document.documentElement.querySelectorAll("meta[name=\"twitter:title\"]")[0]
];
let og_url_tag = document.documentElement.querySelectorAll("meta[property=\"og:url\"]")[0];
let og_image_tags = [
document.documentElement.querySelectorAll("meta[property=\"og:image\"]")[0],
document.documentElement.querySelectorAll("meta[name=\"twitter:image\"]")[0]
];
// set twitter card type:
let twitter_type_tag = document.documentElement.querySelectorAll("meta[name=\"twitter:card\"]")[0];
if (location === "")
twitter_type_tag.setAttribute("content", "summary");
else
twitter_type_tag.setAttribute("content", "summary_large_image");
// set og/twitter card tags:
for (i=0; i<2; i++) {
og_description_tags[i].setAttribute("content", page_descriptions[location]);
og_title_tags[i].setAttribute("content", page_titles[location]);
og_image_tags[i].setAttribute("content", page_images[location]);
}
og_url_tag.setAttribute("content", current_url);
}
/* Set location. */
function set_location(location) {
/* Scroll to the location if it is already in the hash, and set it to be the hash otherwise. */
console.log("new location: " + location);
let was_an_essay = scroll_to(location);
if (_paq && !was_an_essay && location)
_paq.push(['trackEvent', 'navigation', 'to-location', location]);
if (location === "phseiff-header") location = "";
if (location === "phseiff-footer") location = "";
if (!was_an_essay) location = "";
if (location !== "")
set_hash(location);
}
var opened_essay = undefined;
/* Scroll somewhere, and show said place if it is an essay. */
function scroll_to(id) {
if (id === "") id = "phseiff-header"; // <- ensure we have a valid point to scroll to
// Show essay/ hide other essays if this is the hash of an essay:
let essay_element_to_open = document.getElementById(id);
let was_an_essay = false;
if (essay_element_to_open.parentElement.id === "embedded_essays") {
console.log("opening essay: " + id);
if (opened_essay)
opened_essay.style.display = "none";
opened_essay = document.getElementById(id);
opened_essay.style.display = "inline";
document.getElementById("small-about-text").style.display = "none";
document.getElementById("phseiff-close-essay-button").style.display = "block";
document.getElementById("forkongithub").style.display = "none";
document.getElementById("outer-progress-bar").style.display = "block";
was_an_essay = true;
if (_paq)
_paq.push(['trackEvent', 'navigation', 'open-essay', id]);
}
// Scroll to the place:
console.log("scrolling to: " + id);
document.getElementById(id).scrollIntoView({
behavior: "smooth",
block: "start",
inline: "nearest"
});
// maybe close the essay:
if (id === "phseiff-header")
close_essay();
return was_an_essay; // Return whether we just opened an essay.
}
function close_essay() { // Close the given essay.
if (opened_essay) {
opened_essay.style.display = "none";
if (_paq)
_paq.push(['trackEvent', 'navigation', 'close-essay', opened_essay.getAttribute('id')])
document.getElementById("forkongithub").style.display = "block";
opened_essay = undefined;
document.getElementById("phseiff-close-essay-button").style.display = "none";
document.getElementById("outer-progress-bar").style.display = "none";
document.getElementById("small-about-text").style.display = "inline";
set_hash("");
scroll_to("");
}
}
// React to hashes added to the url
function update_on_hash_change(event) {
var hash = window.location.hash.slice(1, window.location.hash.length);
console.log("new hash: " + hash);
if (event !== undefined) {
console.log("blocking standard scroll event:" + event);
event.preventDefault();
}
}
window.addEventListener("hashchange", update_on_hash_change, true);
// Call close_essay() on Esc-key if we are not on android, mobile or tablet (in which case esc means the back key and should not be used for special things)
function check_if_we_are_on_mobile() {
let check = false;
(function(a){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))) check = true;})(navigator.userAgent||navigator.vendor||window.opera);
return check;
}
if (check_if_we_are_on_mobile()) {
console.log("We are on mobile.");
} else {
console.log("We are not on mobile.");
document.addEventListener("keyup", function(e){if (e.key === "Escape") {close_essay(); console.log("Pressed Esc.");}});
}
</script>
</div>
<!-- cookie bar -->
<div class="cookie_bar" id="cookie-bar-field" hidden>
<div class="container">
<div class="cookie-bar-flex-box">
<script>
// What we track, if user consents.
var _paq = window._paq = window._paq || [];
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
// If user consents/ does not consent
var consent_given = false;
var not_consent_given = false;
// Allow us to set and unset cookie consent:
function revoke_consent () {
document.getElementById("cookie-bar-field").style.display = "block";
document.getElementById("privacy-policy").style.display = "initial";
document.getElementById("privacy-policy-accepted").style.display = "none";
if (consent_given === true) // <- only call if we previously had consent
document.cookie = "matomo-consent=; path=/; sameSite=strict";
consent_given = false;
update_scroll_buttons(); // <- to hide the scroll-down-button
}
function give_consent() {
document.getElementById("cookie-bar-field").style.display = "none";
document.getElementById("privacy-policy").style.display = "none";
document.getElementById("privacy-policy-accepted").style.display = "initial";
document.cookie = "matomo-consent=true; path=/; sameSite=strict";
(function() {
var u="//snuffelpaff.phseiff.com/";
_paq.push(['setTrackerUrl', u+'js/index.php']);
_paq.push(['setSiteId', '1']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.src=u+'js/'; s.parentNode.insertBefore(g,s);
})();
console.log("Started tracking with matomo - thanks for the consent, kind stranger! <3");
consent_given = true;
update_scroll_buttons(); // <- to show the scroll-down-button
}
function give_no_consent() {
// Unsticky the cookie bar:
document.getElementById("no-consent-button").style.display = "none";
document.getElementById("cookie-bar-field").style.position = "static";
document.getElementById("cookie-bar-field").style.bottom = "";
// Set a cookie to remember the decision:
document.cookie = "matomo-no-consent=true; path=/; sameSite=strict";
// explicitely say so:
not_consent_given = true;
update_scroll_buttons(); // <- to show the scroll-down-button
}
// In case the the user consented to the cookie, we won't show the cookie bar again:
function getCookie(cname) {
// Taken from https://www.w3schools.com/js/js_cookies.asp.
const name = cname + "=";
const decodedCookie = decodeURIComponent(document.cookie);
const ca = decodedCookie.split(';');
for (let i = 0; i <ca.length; i++) {
let c = ca[i];
while (c.charAt(0) === ' ') {
c = c.substring(1);
}
if (c.indexOf(name) === 0) {
return c.substring(name.length, c.length);
}
}
return "";
}
</script>
<div class="cookie-bar-left">
<!-- I'd like to use a Cookie to analyse my traffic. Is that okay with you? -->
Would you mind to take a cookie to help me analyse my traffic?
<p> <small>
<!-- The cookie only contains the data it takes to anonymously count how many visits I have and from which countries. -->
I'd only count how many visits I have, when and from which countries, and use some magic to ensure you aren't counted twice, completely pseudonymous.
</small>
<small><a href="#privacy-policy">
learn more
<!-- Maybe use feature discovery instead of the pages bottom for this? -->
</a></small>
</div>
<div class="cookie-bar-right" style="min-width: fit-content; max-width: max-content; width: 100%">
<a class="waves-effect waves-light btn no-uppercase consent-button horizontally-arranged-buttons" style="margin-right: 5px; float: left" id="consent-button" href="javascript:give_consent()"> That's fine!</a>
<a class="waves-effect waves-light btn no-uppercase no-consent-button horizontally-arranged-buttons" style="float: right" id="no-consent-button" href="javascript:give_no_consent()"> Not now</a>
</div>
</div>
</div>
</div>
</main>
<!-- Footer -->
<footer id="phseiff-footer">
<div class="page-footer">
<div class="container" color="orange">
<!-- hr id="cookie-bar-line" -->
<div class="row">
<div class="col l6 s12" id="privacy-policy">
<h5 class="white-text">Privacy Policy</h5>
<p class="grey-text text-lighten-4">If you agree to it, I use a software called <a class="external-link" href="https://matomo.org/">matomo</a>, which is completely GDPR-conform (unlike Google Analytics),
to count my visitors. I get to see how many people from which country visited me when and for how long, and what inspired them enough to click on it, but <strong>not</strong> who they are or what their ip-address is, and neither does
anyone else get to see, because matomo is free software and I host it on my own servers! Some tiny cookies will chill on your device to do so, and an other cookie (made by me) will store your consent.</p>
</div>
<div class="col l6 s12" id="privacy-policy-accepted" hidden>
<h5 class="white-text">Privacy Policy</h5>
<p class="grey-text text-lighten-4">I use a software called <a class="external-link" href="https://matomo.org/">matomo</a>, which is completely GDPR-conform (unlike Google Analytics),
to count my visitors. I get to see how many people from which country visited me when and for how long, and what inspired them enough to click on it, but <strong>not</strong> who they are or what their ip-address is, and neither does
anyone else get to see, because matomo is free software and I host it on my own servers! Some tiny cookies chill on your device to do so, and an other cookie (made by me) to store your consent.</p>
<p class="grey-text text-lighten-4">
I generally care a lot about privacy, which is why I don't load any resources from google or other resources using google analytics into my page, and why I don't collect your private data.
I'd also like to mention that the twitter-follow-button as well as the mastodon-follow-button don't load any data from their respective sites until they are clicked.
And I really appreciate you let me count (on) your visits :D</p>
<a class="waves-effect waves-light btn-small no-uppercase bg-color-orange" id="revoke-consent-button" href="javascript:revoke_consent(); window.location.reload(false);">revoke my cookie-consent 💔</a>
</div>
<div class="col l6 s12">
<h5 class="white-text">Impressum & Contact</h5>
<!-- Visit me on Github - Banner -->
<span id="forkongithub"><a href="https://github.com/phseiff">Visit me on GitHub</a></span>
<p class="grey-text text-lighten-4">Visit me <a class="external-link" rel="me" href="https://toot.phseiff.com/@phseiff">on Mastodon</a>
or contact me <a class="external-link" href="https://github.com/phseiff">on GitHub</a> if you want to raise an issue with my projects!
You can also directly
<a class="mstdn" target="_new" href="https://toot.phseiff.com/users/phseiff/remote_follow">
follow
</a>
me on Mastodon from this webpage, or
<a class ="twitter-follow" target="_new" href="https://twitter.com/intent/follow?original_referer=http%3A%2F%2Flocalhost%3A63344%2F&ref_src=twsrc%5Etfw®ion=follow_link&screen_name=phseiff&tw_p=followbutton">
follow
</a>
me on twitter (currently impossible because twitter auto-banned my account before I ever got to use it), as well as follow my <a class="rss-follow" type="application/rss+xml" href="https://phseiff.com/phseiff-essays/feed.rss">rss-feed</a> to get regular updates on my essays!
<p class="grey-text text-lighten-4">Created with ❤️ by phseiff</p>
</div>
<div class="col l6 s12">
<h5 class="white-text">Contact</h5> <!-- @ GitHub (maybe add to this title? -->
<div class="github-card" data-github="phseiff" data-width="400" data-height="150" data-theme="default"></div>
</div>
</div>
</div>
<div class="footer-copyright" width="100%">
<div class="container">
© 2020, 2021 Copyright phseiff. All Rights Reserved <!-- 🇯🇵 🇰🇷 🇩🇪 🇨🇳 🇺🇸 🇫🇷 🇪🇸 🇮🇹 🇷🇺 🇬🇧 -->
</div>
</div>
</div>
</footer>
<!-- github cards -->
<script src="github-card/widget.min.js"></script>
<!-- materialize >
<script type="text/javascript" src="materialize-css/materialize.min.js"></script -->
<!-- [unneeded and throws error:] script type="text/javascript" src="share-buttons/mastodon.min.js"></script -->
<!-- Action Buttons -->
<div style="position: fixed; top: 5px; right: 5px; z-index: 100000">
<ul>
<li style="list-style-type: none; margin:0 0 5px 0; vertical-align:top; display: none" id="phseiff-close-essay-button">
<a class="btn-floating red" href="javascript:close_essay()">
<i class="material-icons">clear</i>
</a>
</li>
</ul>
</div>
<div style="position: fixed; top: 5px; right: 5px">
<ul>
<li style="list-style-type: none; margin:0 0 5px 0; vertical-align:top" id="phseiff-back-to-top-button">
<a class="btn-floating orange" href="#phseiff-header">
<i class="material-icons">keyboard_arrow_up</i>
</a>
</li>
</ul>
</div>
<div style="position: fixed; bottom: 5px; right: 5px" id="phseiff-back-to-bottom-button">
<ul>
<li style="list-style-type: none; margin:0 0 5px 0; vertical-align:top">
<a class="btn-floating rss-color" type="application/rss+xml" href="https://phseiff.com/phseiff-essays/feed.rss">
<i class="material-icons">rss_feed</i>
</a>
</li>
<li style="list-style-type: none; margin:0 0 5px 0; vertical-align:top">
<a class="btn-floating orange" href="#phseiff-footer">
<i class="material-icons">keyboard_arrow_down</i>
</a>
</li>
</ul>
</div>
<!-- Hide scroll up/down buttons when to close to top/bottom, and hide down-button when near footer or when
the cookie bar is shown. -->
<script>
// Get started under the assumption that we're on top of the page:
document.getElementById('phseiff-back-to-top-button').style.visibility="hidden";
if (consent_given === false && not_consent_given === false)
document.getElementById('phseiff-back-to-bottom-button').style.visibility="hidden";
// Function to hide and unhide scroll-to-top/bottom buttons when necessary
function update_scroll_buttons()
{
let pageOffset = document.documentElement.scrollTop || document.body.scrollTop;
if(pageOffset >= 1000)
{
document.getElementById('phseiff-back-to-top-button').style.visibility="visible";
}else
{
document.getElementById('phseiff-back-to-top-button').style.visibility="hidden";
}
if (document.documentElement.scrollHeight - document.documentElement.scrollTop
>= document.documentElement.clientHeight + 1000 && (consent_given || not_consent_given))
{
document.getElementById('phseiff-back-to-bottom-button').style.visibility="visible";
}else
{
document.getElementById('phseiff-back-to-bottom-button').style.visibility="hidden";
}
}
window.onscroll = update_scroll_buttons;
window.onload = update_scroll_buttons;
// realise we already consented to cookie use!
if (getCookie("matomo-consent") === "true") {
give_consent();
}
else {
revoke_consent();
// realise we already said we didn't want to consent for now:
if (getCookie("matomo-no-consent") === "true")
give_no_consent();
}
</script>
<!-- Scroll smoothly -->
<script>
// Ensure every page-intern link uses this:
var links = document.getElementsByTagName('a');
for(var i = 0; i < links.length; i++) {
var thisLink = links[i];
var source = thisLink.getAttribute('href');
if (source.charAt(0) === '#') {
thisLink.setAttribute("href", "javascript:set_location(\"" + source.substring(1, source.length) + "\")");
}
}
set_location(window.location.hash.slice(1, window.location.hash.length));
// Generate a user id and ensure every user uses one, which is stored in a cookie
function generate_user_id() {
let id_length = Math.floor(6 + Math.random() * 5);
let id = "";
let consonants = "qwrtzpsdfghjklxcvbnm";
let vocals = "euioay";
let starts_with_vocal = (Math.random() <= 0.3);
while (id.length < id_length) {
let set_to_use = [consonants, vocals][(id.length+starts_with_vocal)%2];
id += set_to_use[Math.round(Math.random() * set_to_use.length)];
}
return id;
}
function set_id(id) {
document.cookie = "unique_user_id=" + id + "; path=/; sameSite=strict";
console.log("Set user id to " + id + "!");
}
function get_id() {
return getCookie("unique_user_id");
}
if (consent_given === true) {
console.log("now pushing user id!");
if (!get_id()) {
set_id(generate_user_id());
}
_paq.push(['setUserId', get_id()]);
}
</script>
<!-- Make inline code in essays wrap! -->
<style>
.gist :not(pre)>code {
white-space: pre-wrap;
word-wrap: normal;
}
</style>
<!-- images with borders. -->
<style>
.gist img:not([height]):not([width]):not(.frameless):not([src*="-icon."]):not([src*="-noborder."]) {
border: 1px solid #dfe2e5;
border-radius:5px;
}
</style>
<!-- Ensure dark reader is executed again after we updated the essays using javascript. -->
<script>
DarkReader.disable();
DarkReader.enable({ // <-- always use darkmode instead of, like previously, adapting to the system.
brightness: 100,
contrast: 90,
sepia: 10
});
</script>
<!-- enlargeable images. -->
<style>
/* make sure bold text in essays is properly bolded (this is invalidated by materialize.css at the moment) */
.gist strong {
/* Added to make sure that bold text is properly bolded. */
font-weight: bolder !important;
}
/* Stop multiline code boxes from scrolling if the text si to long, and get them to use soft wrap instead. */
.gist pre {
white-space: pre-wrap; /* css-3 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
}
/* style for enlargeable images: */
.gist :not(a)>img:not([src*="-icon."]) {
all: initial;
cursor: zoom-in;
}
/* style for non-enlargeable images: */
.gist img[src*="-icon."] {
vertical-align: middle;
display: inline-block;
line-height: 1;
text-transform: none;
letter-spacing: normal;
word-wrap: normal;
white-space: nowrap;
direction: ltr;
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
}
</style>
<!-- code to display images as enlarged versions of themselves. -->
<div id="dimScreen" style="display: none;" onclick="close_enlarged_image_view()" title="Click to read on.">
<img aria-hidden="true" id="enlargedImage" src="" alt="">
</div>
<style>
#dimScreen {
position: fixed;
padding: 0;
margin: 0;
top: 0;
left: 0;
bottom: 0;
right: 0;
width: 100%;
height: 100%;
background:rgba(0, 0, 0, 0.8);
backdrop-filter: blur(4px);
-webkit-backdrop-filter: blur(4px);
cursor: zoom-out;
z-index: 100001;
}
#enlargedImage {
position: fixed;
z-index: 100002;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
max-width:100%;
max-height:100%;
display: block;
/*margin: 3px;
padding: 3px 6px 3px 3px;*/
}
</style>
<script>
function close_enlarged_image_view() {
document.getElementById("dimScreen").setAttribute("style", "display: none;");
document.getElementById("enlargedImage").setAttribute("src", "");
}
function open_enlarged_image_view(image) {