From dee9035ffedc1414c2d4308b4e158a12a64c1fc2 Mon Sep 17 00:00:00 2001 From: osmarks Date: Wed, 1 Jul 2020 20:29:42 +0100 Subject: [PATCH] updated things??? --- assets/images/icon.png | Bin 319 -> 0 bytes assets/images/logo.svg | 1 + assets/images/logo192.png | Bin 0 -> 357 bytes assets/images/logo384.png | Bin 0 -> 398 bytes assets/images/logo768.png | Bin 0 -> 600 bytes assets/images/logo96.png | Bin 0 -> 341 bytes assets/images/logo96inv.png | Bin 0 -> 453 bytes assets/js/page.js | 12 ++- assets/manifest.webmanifest | 30 ++++-- experiments/heavpoot-game/index.html | 135 +++++++++++++++++++++++++++ experiments/site-themes/index.html | 33 +++++++ experiments/site-themes/index.js | 48 ++++++++++ style.sass | 5 +- templates/layout.pug | 2 +- 14 files changed, 254 insertions(+), 12 deletions(-) delete mode 100644 assets/images/icon.png create mode 100644 assets/images/logo192.png create mode 100644 assets/images/logo384.png create mode 100644 assets/images/logo768.png create mode 100644 assets/images/logo96.png create mode 100644 assets/images/logo96inv.png create mode 100644 experiments/heavpoot-game/index.html create mode 100644 experiments/site-themes/index.html create mode 100644 experiments/site-themes/index.js diff --git a/assets/images/icon.png b/assets/images/icon.png deleted file mode 100644 index d964dbd7428c81ac29622d4c2c0e1ace83cdd4ae..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 319 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD1|%QND7OGoEX7WqAsj$Z!;#Vft6wd}Xb{Y3quACmu%g`7`cdN?<*})ga2C%@D@0h9QD+ z11SP-`H$rt@2hWNBvBuRRc5FE-~YeWj67E$nWlF~gn3W%W5?~l5Mc0h^>bP0l+XkK DxVKkJ diff --git a/assets/images/logo.svg b/assets/images/logo.svg index d525f0c..a190e24 100644 --- a/assets/images/logo.svg +++ b/assets/images/logo.svg @@ -1,5 +1,6 @@ + diff --git a/assets/images/logo192.png b/assets/images/logo192.png new file mode 100644 index 0000000000000000000000000000000000000000..777124497600f92dc9e115fabfdfccb581afea3e GIT binary patch literal 357 zcmeAS@N?(olHy`uVBq!ia0vp^2SAt+NHA0_4_pPLSkfJR9T^xl_H+M9WCijSl0AZa zfwF203=J&|48MRv4KElNN(~qoUL`OvSj}Ky5HFasE6@fg!Ib3f?!v%$w@Y{lkjGiz z5n0T@z;_sg8IR|$NC676mw5WRvOi&y<>0qCySv67C}iyE;usQf`0crcybK0BEF16F zznsDnnpL3nbHz#3*wUTMKs9U;hCoL?kY3>q zRdP`(kYX@0Ff!0JFw-@%3^A~H<{lbMMG|WN@iLmZVmg-ZT}3^ wAPKS|I6tkVJh3R1p}f3YFEcN@I61K(RWH9NefB#WDWD<-Pgg&ebxsLQ0Da+M-2eap literal 0 HcmV?d00001 diff --git a/assets/images/logo384.png b/assets/images/logo384.png new file mode 100644 index 0000000000000000000000000000000000000000..b97da477ee51b72be61bc0d7c95701a8db7091bf GIT binary patch literal 398 zcmeAS@N?(olHy`uVBq!ia0y~yU~B+kMxX#g&z=q;AjOjI=anMpdfpRr>`sf6E;~6F2?sK8H#{HF`h1tAr-gYo>SywVBk2i z;rIXL2a`GYF8);Wb~8OC22_Cx4s2}iMil|_Y}iYAFa#4;GHz(UzF zKCwUzk{}y`^V3So6N^$A%FE03GV`*FlM@S4_413-XTP(N0y)vs)z4*}Q$iB}V!vc9 literal 0 HcmV?d00001 diff --git a/assets/images/logo768.png b/assets/images/logo768.png new file mode 100644 index 0000000000000000000000000000000000000000..74bacd11783541b4088b1e7a92eadc1732439585 GIT binary patch literal 600 zcmeAS@N?(olHy`uVBq!ia0y~yUH=O_9twz9DE#~Dr+w>Ffgilx;TbZ+T$SkfJR9T^xl_H+M9WCijSl0AZa z85pY67#JE_7#My5g&JNkFq9fFFuY1&V6d9Oz#v{QXIG#NP=YDR+uenM@oty!5+IMW zz$3Dlfr0NZ2s0kfUy%Y7WH0gbb!C6TCdr;B5V#p&b(hNk}x2N;+a z&v861DYH)EX~N?_?o1#aBg4h|+WB*uj~oXoS1oakC`m~yNwrEYN(E93Mg~R(x&~&t zMwTH47FLEPR;C8p1_o9J22PEE-Y6P!^HVa@DsgKtzVq@sP=h4MhT#0PlJdl&REF~M ia=pyF?Be9af>gcyqV(DCY@~pS7(8A5T-G@yGywqXrC;a( literal 0 HcmV?d00001 diff --git a/assets/images/logo96inv.png b/assets/images/logo96inv.png new file mode 100644 index 0000000000000000000000000000000000000000..c33dc8b4847ba2912cd8b906d1a3a23e322a2db8 GIT binary patch literal 453 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD0wg^q?%xcgSkfJR9T^xl_H+M9WCijSl0AZa z85pY67#JE_7#My5g&JNkFq9fFFuY1&V6d9Oz#v{QXIG#NP=YDR+ueoXe|!I#{XiaP zfk$L90|Vb-5N14{zaj-F$X?><>&pIwO_qaSJT1#H4Jb6()5S5Q;?~=n8+jQNc^C{o z{eFLjf8rr0tM3cuTsnAXv+-%}cW=(spZ>X%X$wC1_OqS*gP*)23qzGav1V%sfy%Jc)!d8#F@5hW>!C8<`)MX5lF!N|bKK-a)b*T^!&z{1MV)XLCM z+rYrez@Wd*-Wo+iZhlH;S|x4`|CHO?ff^)1HU#IVm6RtIr81P4m+NKbWfvzW7NqLs W7p2dBXCnnv#Ng@b=d#Wzp$Py?myb;V literal 0 HcmV?d00001 diff --git a/assets/js/page.js b/assets/js/page.js index 01fb974..bc24931 100644 --- a/assets/js/page.js +++ b/assets/js/page.js @@ -297,4 +297,14 @@ window.points = (() => { achievementInfo, setMetric } -})() \ No newline at end of file +})() + +const customStyle = localStorage.getItem("user-stylesheet") +let customStyleEl = null +if (customStyle) { + customStyleEl = document.createElement("style") + customStyleEl.appendChild(document.createTextNode(customStyle)) + customStyleEl.onload = () => console.log("Loaded custom styles") + customStyleEl.id = "custom-style" + document.head.appendChild(customStyleEl) +} \ No newline at end of file diff --git a/assets/manifest.webmanifest b/assets/manifest.webmanifest index b3056ec..7cdbddb 100644 --- a/assets/manifest.webmanifest +++ b/assets/manifest.webmanifest @@ -3,19 +3,33 @@ "lang": "en", "name": "{{{name}}}", "scope": "/", - "display": "browser", + "display": "minimal-ui", "start_url": "https://{{domain}}/", "short_name": "{{domain}}", - "theme_color": "transparent", "description": "{{siteDescription}}", "orientation": "any", - "background_color": "transparent", - "related_applications": "", - "prefer_related_applications": "false", "icons": [ { - "src": "/assets/images/icon.png?reloadyoustupidicon=4", + "src": "/assets/images/logo96.png", "sizes": "96x96" + }, + { + "src": "/assets/images/logo192.png", + "sizes": "192x192" + }, + { + "src": "/assets/images/logo384.png", + "sizes": "384x384" + }, + { + "src": "/assets/images/logo768.png", + "sizes": "768x768" + }, + { + "src": "/assets/images/logo.svg", + "sizes": "512x512" } - ] -} \ No newline at end of file + ], + "theme_color": "#000000", + "background_color": "#000000" +} diff --git a/experiments/heavpoot-game/index.html b/experiments/heavpoot-game/index.html new file mode 100644 index 0000000..7f3eb7e --- /dev/null +++ b/experiments/heavpoot-game/index.html @@ -0,0 +1,135 @@ +--- +title: Heavpoot's Game +slug: heavscp +description: It is pitch black (if you ignore all of the lighting). You are likely to be eaten by Heavpoot's terrible writing skills, and/or lacerated/shot/[REDACTED]. Vaguely inspired by the SCP Foundation. +--- + + +
+ \ No newline at end of file diff --git a/experiments/site-themes/index.html b/experiments/site-themes/index.html new file mode 100644 index 0000000..6b670ca --- /dev/null +++ b/experiments/site-themes/index.html @@ -0,0 +1,33 @@ +--- +title: Site Theming +description: Apply custom CSS to most pages on here. +slug: themes +--- + +
+ +
Loading... (or your browser is bad)
+
+ + + + \ No newline at end of file diff --git a/experiments/site-themes/index.js b/experiments/site-themes/index.js new file mode 100644 index 0000000..f06065b --- /dev/null +++ b/experiments/site-themes/index.js @@ -0,0 +1,48 @@ +let currentStyle = localStorage.getItem("user-stylesheet") || "" + +if (!customStyleEl) { + customStyleEl = document.createElement("style") + customStyleEl.appendChild(document.createTextNode(customStyle)) + customStyleEl.onload = () => console.log("Loaded custom styles") + customStyleEl.id = "custom-style" + document.head.appendChild(customStyleEl) +} + +const saveStyles = () => { localStorage.setItem("user-stylesheet", currentStyle) } +const applyStyles = () => { + try { document.head.removeChild(customStyleEl) } catch {} + while (customStyleEl.firstChild) { customStyleEl.removeChild(customStyleEl.firstChild) } + customStyleEl.appendChild(document.createTextNode(currentStyle)) + document.head.appendChild(customStyleEl) +} +const removeStyles = () => { + document.head.removeChild(customStyleEl) +} + +const handleTab = ev => { + if (ev.keyCode === 9) { // tab + const start = ev.target.selectionStart + const end = ev.target.selectionEnd + const value = ev.target.value + ev.target.value = value.substring(0, start) + "\t" + value.substring(end) + ev.target.selectionStart = ev.target.selectionEnd = start + 1 + ev.preventDefault() + } +} + +const inputOnCreate = vnode => { vnode.dom.value = currentStyle } + +const App = { + view: () => m("", [ + m("em", "Due to browser limitations, this currently cannot tell you about errors or warnings in your stylesheet. You can check your browser console for these, probably."), + m(".toolbar", [ + m("button", { onclick: () => { saveStyles(); applyStyles() } }, "Save & Apply"), + m("button", { onclick: saveStyles }, "Save"), + m("button", { onclick: applyStyles }, "Apply"), + m("button", { onclick: removeStyles }, "Remove") + ]), + m("textarea.style-input", { oncreate: inputOnCreate, oninput: ev => { currentStyle = ev.target.value }, onkeydown: handleTab }), + ]) +} + +m.mount(document.getElementById("app"), App) \ No newline at end of file diff --git a/style.sass b/style.sass index 57f201d..0a8c270 100644 --- a/style.sass +++ b/style.sass @@ -21,8 +21,8 @@ nav margin-right: 0.5em @for $i from 1 through 3 - a:nth-child(#{$i}) - color: hsl(90 + ($i * 30), 100%, 80%) + a:nth-child(#{$i + 1}) + color: hsl(180 + ($i * 30), 100%, 80%) h1, h2, h3, h4, h5, h6 margin: 0 @@ -35,6 +35,7 @@ main, .header // for easier viewing on big screen devices, narrow the width of text main.blog-post max-width: 40em + text-align: justify main margin-top: 1em diff --git a/templates/layout.pug b/templates/layout.pug index f8d4da9..e6ddaa1 100644 --- a/templates/layout.pug +++ b/templates/layout.pug @@ -11,7 +11,7 @@ html(lang="en") if description meta(name="description", content=description) link(rel="manifest", href="/assets/manifest.webmanifest") - link(rel="shortcut icon", href="/assets/images/icon.png", type="image/png") + link(rel="shortcut icon", href="/assets/images/logo96inv.png", type="image/png") // this may be problematic but otherwise it overescapes stuff style!= css if comments !== "off"