From 02acf270c5c6724acde34a942edb323c85e2843d Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 9 Jul 2023 08:19:05 +0300 Subject: [keyboard.js] Removed hjkl header navigation --- src/_footer.html | 2 +- src/scripts/keyboard.js | 24 ------------------------ 2 files changed, 1 insertion(+), 25 deletions(-) (limited to 'src') diff --git a/src/_footer.html b/src/_footer.html index 0fa2f4b..6d6190c 100644 --- a/src/_footer.html +++ b/src/_footer.html @@ -6,6 +6,6 @@ - + diff --git a/src/scripts/keyboard.js b/src/scripts/keyboard.js index f618e45..b5d2312 100644 --- a/src/scripts/keyboard.js +++ b/src/scripts/keyboard.js @@ -1,31 +1,7 @@ -const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6'); -var currentHeading = 0; - document.addEventListener('keydown', function (e) { if (e.ctrlKey) return; switch (e.code) { - case 'KeyG': - currentHeading = (e.shiftKey) ? headings.length - 1 : 0; - headings[currentHeading].scrollIntoView(); - break; - - case 'KeyJ': case 'KeyL': - if (typeof presenting != 'undefined' && presenting) showSlide(+1); - else { - currentHeading = (headings.length + currentHeading + 1) % headings.length; - headings[currentHeading].scrollIntoView(); - } - break; - - case 'KeyK': case 'KeyH': - if (typeof presenting != 'undefined' && presenting) showSlide(-1); - else { - currentHeading = (headings.length + currentHeading - 1) % headings.length; - headings[currentHeading].scrollIntoView(); - } - break; - /* theme-changer.js */ case 'KeyC': -- cgit v1.3.1-26-gb76a From 6c32e096ebb3e95b73adc09bb51fe5f2178a7e59 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 9 Jul 2023 15:19:09 +0300 Subject: (page-width.js,theme-changer.js) Replaced icons with text buttons --- src/_footer.html | 2 +- src/_header.html | 8 ++++---- src/scripts/page-width.js | 6 +++--- src/scripts/theme-changer.js | 8 +++----- src/styles.css | 17 ++++++++++++++++- 5 files changed, 27 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/_footer.html b/src/_footer.html index 6d6190c..986a60a 100644 --- a/src/_footer.html +++ b/src/_footer.html @@ -3,7 +3,7 @@ ^ - + diff --git a/src/_header.html b/src/_header.html index e05de81..b6929a2 100644 --- a/src/_header.html +++ b/src/_header.html @@ -27,7 +27,7 @@
- + diff --git a/src/scripts/page-width.js b/src/scripts/page-width.js index 38add7c..6d700d0 100644 --- a/src/scripts/page-width.js +++ b/src/scripts/page-width.js @@ -2,7 +2,7 @@ const widthBtn = document.getElementById('changeWidthBtn'); const articleElem = document.getElementsByTagName('article')[0]; if (localStorage.getItem('width') === 'wide') { - widthBtn.src = '/img/viewport-narrow.svg'; + widthBtn.innerHTML = 'Narrow
article'; articleElem.classList.add('noMaxWidth'); } @@ -10,11 +10,11 @@ widthBtn.onclick = function() { articleElem.classList.toggle('noMaxWidth'); if (localStorage.getItem('width') !== 'norm') { - widthBtn.src = '/img/viewport-wide.svg'; + widthBtn.innerHTML = 'Wide
article'; localStorage.setItem('width', 'norm'); } else { - widthBtn.src = '/img/viewport-narrow.svg'; + widthBtn.innerHTML = 'Narrow
article'; localStorage.setItem('width', 'wide'); } } diff --git a/src/scripts/theme-changer.js b/src/scripts/theme-changer.js index 39eedc9..94eb61f 100644 --- a/src/scripts/theme-changer.js +++ b/src/scripts/theme-changer.js @@ -1,19 +1,17 @@ const themeBtn = document.getElementById('changeThemeBtn'); if (darkThemeStyle.disabled) - themeBtn.src = '/img/moon.svg'; - -themeBtn.style.display = 'initial'; + themeBtn.innerHTML = 'Dark
theme'; themeBtn.onclick = function() { darkThemeStyle.disabled = !darkThemeStyle.disabled; if (localStorage.getItem('theme') !== 'light') { - themeBtn.src = '/img/moon.svg'; + themeBtn.innerHTML = 'Dark
theme'; localStorage.setItem('theme', 'light'); } else { - themeBtn.src = '/img/sun.svg'; + themeBtn.innerHTML = 'Light
theme'; localStorage.setItem('theme', 'dark'); } } diff --git a/src/styles.css b/src/styles.css index 04425e0..a917f5e 100644 --- a/src/styles.css +++ b/src/styles.css @@ -131,7 +131,6 @@ img { .file-icon { min-width: 1.3em; vertical-align: text-bottom; } .borderless, .oldschool-badge, .file-icon { border: none; } - .setting-btn { border: none; vertical-align: middle; } .btn:hover { cursor: pointer; } /* image-show.js */ @@ -325,7 +324,23 @@ dt, dd { border-bottom: none; margin: 0.58em 0 1em 0; font-size: 1.2em; + line-height: 1em; + /* Thanks https://stackoverflow.com/a/4407335/12036073 */ + -webkit-touch-callout: none; /* iOS Safari */ + -webkit-user-select: none; /* Safari */ + -khtml-user-select: none; /* Konqueror HTML */ + -moz-user-select: none; /* Old versions of Firefox */ + -ms-user-select: none; /* Internet Explorer/Edge */ + user-select: none; } + .setting-btn { + font-size: 0.5em; + text-align: center; + display: inline-block; + line-height: 1em; + border: 1px solid var(--border-color); + padding: 0.2em 0.3em; + } #footer { font-size: 0.7em; overflow-x: hidden; -- cgit v1.3.1-26-gb76a From e030ac76e6ba3ba52ec8a62706f2366deaa4e097 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 9 Jul 2023 15:25:19 +0300 Subject: [styles] Added small button animation on click --- src/styles.css | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/styles.css b/src/styles.css index a917f5e..410dfd9 100644 --- a/src/styles.css +++ b/src/styles.css @@ -132,6 +132,7 @@ img { .borderless, .oldschool-badge, .file-icon { border: none; } .btn:hover { cursor: pointer; } + .btn:active { transform: scale(0.9); } /* image-show.js */ .clicked-image { -- cgit v1.3.1-26-gb76a From 4a039574ecb8b4fc7c7e355c9d6526010e1cb411 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 9 Jul 2023 15:59:02 +0300 Subject: (expand-navbar.js) Replaced icon with triangle character --- src/_header.html | 4 ++-- src/scripts/expand-navbar.js | 6 +++--- src/styles.css | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/_header.html b/src/_header.html index b6929a2..1bba6ad 100644 --- a/src/_header.html +++ b/src/_header.html @@ -27,8 +27,8 @@
- ^ +
︽
diff --git a/src/styles.css b/src/styles.css index e2b02f2..1b3b204 100644 --- a/src/styles.css +++ b/src/styles.css @@ -379,14 +379,14 @@ dt, dd { } /* back-to-top.js */ #scrollBtn { - background-color: transparent; - bottom: 1em; + background-color: var(--bg-color); + bottom: 1rem; border: 1px solid; display: none; - font-size: 1rem; + font-size: 1.66rem; position: fixed; - padding: 0.3em; - right: 1em; + padding: 0 0.15em; + right: 1rem; transition-duration: 0.5s; z-index: 1; } -- cgit v1.3.1-26-gb76a From 3485f567c5a6a5155db1ed3065c40c47c968a511 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Mon, 10 Jul 2023 16:49:38 +0300 Subject: (keyboard) Added J and K slide navigation --- src/_footer.html | 2 +- src/scripts/keyboard.js | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/_footer.html b/src/_footer.html index 3af5205..dcc0437 100644 --- a/src/_footer.html +++ b/src/_footer.html @@ -6,6 +6,6 @@ - + diff --git a/src/scripts/keyboard.js b/src/scripts/keyboard.js index b5d2312..2609cfe 100644 --- a/src/scripts/keyboard.js +++ b/src/scripts/keyboard.js @@ -11,13 +11,12 @@ document.addEventListener('keydown', function (e) { /* presentation.js */ // Previous slide - case 'Backspace': case 'PageUp': + case 'KeyK': case 'Backspace': case 'PageUp': case 'ArrowLeft': case 'ArrowUp': showSlide(-1); break; // Next slide - case 'Space': case 'Enter': case 'PageDown': - + case 'KeyJ': case 'Space': case 'Enter': case 'PageDown': case 'ArrowRight': case 'ArrowDown': showSlide(+1); break; -- cgit v1.3.1-26-gb76a From b03df02e27292bfbe13e2efb4becb721684a4719 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Mon, 10 Jul 2023 16:50:06 +0300 Subject: (presentation) Reworked controller to use the characters --- awk-edits/Presentation.awk | 10 +++++----- src/_header.html | 2 +- src/presentation.css | 8 ++------ 3 files changed, 8 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/awk-edits/Presentation.awk b/awk-edits/Presentation.awk index d20763b..f3fce0e 100644 --- a/awk-edits/Presentation.awk +++ b/awk-edits/Presentation.awk @@ -156,12 +156,12 @@ BEGIN { pres = ORS \ "

" ORS \ " " diff --git a/src/_header.html b/src/_header.html index 0b7b1a6..5156c29 100644 --- a/src/_header.html +++ b/src/_header.html @@ -27,7 +27,7 @@

" ORS \ -" " +" " for (i = 1; i <= nameslength; i++) { pat[i] = "&&" names[i] diff --git a/src/presentation.css b/src/presentation.css index 4b74030..4dbe7e0 100644 --- a/src/presentation.css +++ b/src/presentation.css @@ -6,6 +6,8 @@ padding: 1em; width: 297mm; /* Size of landscape A4 paper */ font-size: 30px; + transform-origin: 0 0; + margin-bottom: 1em; } .absolute-slide { border: none !important; @@ -15,6 +17,7 @@ right: 0; top: 50%; transform: translate(-50%, -50%); + transform-origin: center center; visibility: visible; } .absolute-slide .clicked-image { @@ -25,8 +28,6 @@ /* Stylesheet override */ -article { max-width: calc(297mm + 2em); } - ul, ol { padding-inline-start: 30px; } /* Presentation controller */ @@ -127,7 +128,6 @@ absolute-slide {...} */ @media screen { .slide { border: 1px solid var(--fg-color); - margin-bottom: 1em; } } @@ -135,7 +135,7 @@ absolute-slide {...} */ article, body { border: none !important; margin: 0; - max-width: auto; + max-width: none; padding: 0; } nav, article > :not(.slide), #pagenav { @@ -144,6 +144,7 @@ absolute-slide {...} */ .slide { height: 210mm; width: 297mm; + margin: 0; } } diff --git a/src/scripts/presentation.js b/src/scripts/presentation.js index 425815c..ba7dd66 100644 --- a/src/scripts/presentation.js +++ b/src/scripts/presentation.js @@ -79,20 +79,26 @@ presentBtn.addEventListener('click', function() { else { pageY = window.scrollY; pageX = window.scrollX; window.scrollTo(0, 0); - fixAbsoluteSlideScale(); } presenting = !presenting; + fixAbsoluteSlideScale(); }); function fixAbsoluteSlideScale() { - var scale = Math.min(window.innerHeight / slides[0].offsetHeight, window.innerWidth / slides[0].offsetWidth); + var height = (presenting) ? window.innerHeight : articleElem.offsetHeight; + var width = (presenting) ? window.innerWidth : articleElem.offsetWidth - 32; + var scale = Math.min(height / slides[0].offsetHeight, width / slides[0].offsetWidth); + // Update .slide + document.styleSheets.item(3).cssRules[0].style.transform = 'scale(' + scale + ')'; + document.styleSheets.item(3).cssRules[0].style.marginBottom = 'calc(1em - ' + slides[0].offsetHeight + 'px * ' + (1 - scale) + ')'; // Update .absolute-slide document.styleSheets.item(3).cssRules[1].style.transform = 'translate(-50%, -50%) scale(' + scale + ')'; // Update .clicked-image document.styleSheets.item(3).cssRules[2].style.transform = 'translate(-50%, -50%) scale(' + (1/scale) + ')'; } window.addEventListener('resize', fixAbsoluteSlideScale); +window.addEventListener('load', fixAbsoluteSlideScale); /* Show as article button */ diff --git a/src/styles.css b/src/styles.css index 79b0b83..2a14de5 100644 --- a/src/styles.css +++ b/src/styles.css @@ -423,7 +423,7 @@ dt, dd { /* Small screen support */ -@media screen and (max-width: 610px) { +@media screen and ((max-width: 610px) or (max-height: 610px)) { article { border-top: none; max-width: calc(100vw - 16px - 3px); @@ -460,6 +460,7 @@ dt, dd { } pre, code { white-space: pre-wrap !important; } + .slide, .absolute-slide { transform: none !important; margin: 0; } } /* presentation.js */ -- cgit v1.3.1-26-gb76a From ccb8fc87c90acfd5ec03b73075f7e0f13e8b19b1 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Tue, 11 Jul 2023 09:39:33 +0300 Subject: (presentation) Disabled image clicking on slides that aren't absolute We need to fix slide scale, however, this means that all positioning of child elements is relative to the slide So, the image cannot be in the middle of the screen --- src/presentation.css | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/presentation.css b/src/presentation.css index 4dbe7e0..c231259 100644 --- a/src/presentation.css +++ b/src/presentation.css @@ -46,6 +46,7 @@ ul, ol { padding-inline-start: 30px; } max-width: 100%; /* width: auto; */ } + .slide:not(.absolute-slide) img { pointer-events: none; } .slide td { font: inherit; } .slide > *:first-child, .slide > div:only-child > *:first-child, .slide > ul:first-child > li:first-child > *:first-child, -- cgit v1.3.1-26-gb76a From 7e3f6667b9668f21c7c2b45d5c6e0a42b748c0fb Mon Sep 17 00:00:00 2001 From: Syndamia Date: Tue, 11 Jul 2023 12:46:08 +0300 Subject: (presentation) nodisplay is toggled dynamically, updated controller button styles and added labels where applicable --- awk-edits/Presentation.awk | 6 +++--- src/scripts/presentation.js | 14 +++++++++----- src/styles.css | 2 +- 3 files changed, 13 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/awk-edits/Presentation.awk b/awk-edits/Presentation.awk index d1233c6..b0ed659 100644 --- a/awk-edits/Presentation.awk +++ b/awk-edits/Presentation.awk @@ -159,9 +159,9 @@ BEGIN { " \\←" ORS \ " 0" ORS \ " \\→" ORS \ -" \\☲" ORS \ -" \\⎚" ORS \ -" \\⎙" ORS \ +" Article view \\☲" ORS \ +" Present \\⎚" ORS \ +" Print \\⎙" ORS \ "

" ORS \ " " diff --git a/src/scripts/presentation.js b/src/scripts/presentation.js index ba7dd66..1a9b42c 100644 --- a/src/scripts/presentation.js +++ b/src/scripts/presentation.js @@ -65,11 +65,15 @@ presentBtn.addEventListener('click', function() { document.body.classList.toggle('body-bg-color'); // Show the slide controller presentCont.classList.toggle('absolute-cont'); - prevSlideBtn.classList.toggle('nodisplay'); - slideIndexShow.classList.toggle('nodisplay'); - nextSlideBtn.classList.toggle('nodisplay'); - articleBtn.classList.toggle('nodisplay'); - printBtn.classList.toggle('nodisplay'); + for (var i = presentCont.children.length - 1; i >= 0; i--) { + if (i == 4) continue; // presentBtn + presentCont.children[i].classList.toggle('nodisplay'); + } + presentBtn.classList.toggle('setting-btn'); + if (presentBtn.innerHTML[0] === 'P') + presentBtn.innerHTML = presentBtn.innerHTML.substr(8); + else + presentBtn.innerHTML = 'Present ' + presentBtn.innerHTML; // Show the first slide slides[slideIndex].classList.toggle('absolute-slide'); // Alignment of presentation to screen diff --git a/src/styles.css b/src/styles.css index 2a14de5..a8fd245 100644 --- a/src/styles.css +++ b/src/styles.css @@ -334,13 +334,13 @@ dt, dd { line-height: 1em; } .setting-btn { - font-size: 0.5em; text-align: center; display: inline-block; line-height: 1em; border: 1px solid var(--border-color); padding: 0.2em 0.3em 0.4em; } + #settingsWrapper > .setting-btn { font-size: 0.5em; } #footer { font-size: 0.7em; overflow-x: hidden; -- cgit v1.3.1-26-gb76a From 0635b41dd22b5978475b95fffba94fe2a19d82fc Mon Sep 17 00:00:00 2001 From: Syndamia Date: Tue, 11 Jul 2023 12:48:59 +0300 Subject: (presentation) Moved present and article mode functions outside of their event listeners and updated keyboard to use the functions Button clicking isn't very well supported for older browsers --- src/scripts/keyboard.js | 4 ++-- src/scripts/presentation.js | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/scripts/keyboard.js b/src/scripts/keyboard.js index 2609cfe..bacbea1 100644 --- a/src/scripts/keyboard.js +++ b/src/scripts/keyboard.js @@ -22,11 +22,11 @@ document.addEventListener('keydown', function (e) { break; // Start (toggle) presenting case 'KeyP': case 'KeyT': - presentBtn.click(); + togglePresentMode(); break; // Exit presentation case 'Escape': - if (presenting) presentBtn.click(); + if (presenting) togglePresentMode(); break; // Go to first slide case 'Home': diff --git a/src/scripts/presentation.js b/src/scripts/presentation.js index 1a9b42c..98849a2 100644 --- a/src/scripts/presentation.js +++ b/src/scripts/presentation.js @@ -57,7 +57,7 @@ const articleBtn = document.getElementById('articleBtn'); var pageY = 0; var pageX = 0; -presentBtn.addEventListener('click', function() { +function togglePresentMode() { // Hide the whole page document.body.classList.toggle('invisible'); document.body.classList.toggle('no-overflow'); @@ -88,6 +88,8 @@ presentBtn.addEventListener('click', function() { presenting = !presenting; fixAbsoluteSlideScale(); }); +} +presentBtn.addEventListener('click', togglePresentMode); function fixAbsoluteSlideScale() { var height = (presenting) ? window.innerHeight : articleElem.offsetHeight; @@ -106,9 +108,12 @@ window.addEventListener('load', fixAbsoluteSlideScale); /* Show as article button */ -articleBtn.addEventListener('click', function() { +function toggleArticleMode() { printBtn.classList.toggle('nodisplay'); presentBtn.classList.toggle('nodisplay'); // Toggle presentation.css document.styleSheets.item(3).disabled = !document.styleSheets.item(3).disabled; +} +articleBtn.addEventListener('click', toggleArticleMode); +window.addEventListener('load', function() { }); -- cgit v1.3.1-26-gb76a From c6cd443da038de421909278726b18972dd4cc19a Mon Sep 17 00:00:00 2001 From: Syndamia Date: Tue, 11 Jul 2023 12:49:45 +0300 Subject: (presentation) Disabled present mode being activated while in article mode and minor code formatting fixes --- src/scripts/presentation.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/scripts/presentation.js b/src/scripts/presentation.js index 98849a2..8dd4960 100644 --- a/src/scripts/presentation.js +++ b/src/scripts/presentation.js @@ -58,11 +58,14 @@ var pageY = 0; var pageX = 0; function togglePresentMode() { + if (document.styleSheets.item(3).disabled) return; + // Hide the whole page document.body.classList.toggle('invisible'); document.body.classList.toggle('no-overflow'); // Fix background color document.body.classList.toggle('body-bg-color'); + // Show the slide controller presentCont.classList.toggle('absolute-cont'); for (var i = presentCont.children.length - 1; i >= 0; i--) { @@ -76,6 +79,7 @@ function togglePresentMode() { presentBtn.innerHTML = 'Present ' + presentBtn.innerHTML; // Show the first slide slides[slideIndex].classList.toggle('absolute-slide'); + // Alignment of presentation to screen if (presenting) { window.scrollTo(pageX, pageY); @@ -84,10 +88,8 @@ function togglePresentMode() { pageY = window.scrollY; pageX = window.scrollX; window.scrollTo(0, 0); } - presenting = !presenting; fixAbsoluteSlideScale(); -}); } presentBtn.addEventListener('click', togglePresentMode); -- cgit v1.3.1-26-gb76a From a3827aca5f9d0e021bc94a00e4f022982e4a3db6 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Tue, 11 Jul 2023 12:50:36 +0300 Subject: (presentation) Implemented changing label on article mode button and query inside URL when in article mode So you could share a presentation as an article --- src/scripts/presentation.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src') diff --git a/src/scripts/presentation.js b/src/scripts/presentation.js index 8dd4960..484961e 100644 --- a/src/scripts/presentation.js +++ b/src/scripts/presentation.js @@ -115,7 +115,22 @@ function toggleArticleMode() { presentBtn.classList.toggle('nodisplay'); // Toggle presentation.css document.styleSheets.item(3).disabled = !document.styleSheets.item(3).disabled; + + // Add a=y to url when in article mode + var url = window.location.href.substring(0, window.location.href.indexOf('?')); + if (document.styleSheets.item(3).disabled) url += '?a=y'; + url += window.location.href.substr(window.location.href.indexOf('#')); + + window.history.replaceState(history.state, document.title, url); + + // Fix message + if (articleBtn.innerHTML[0] === 'A') + articleBtn.innerHTML = 'Slide' + articleBtn.innerHTML.substr(7); + else + articleBtn.innerHTML = 'Article' + articleBtn.innerHTML.substr(5); } articleBtn.addEventListener('click', toggleArticleMode); window.addEventListener('load', function() { + if (window.location.href.substr(window.location.href.indexOf('?'), 4) === '?a=y') + toggleArticleMode(); }); -- cgit v1.3.1-26-gb76a From 01ca5176ebbb2c557e23fcb0320b8e88cb0c1b29 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Tue, 11 Jul 2023 13:04:24 +0300 Subject: (presentation) Brought back removal of top margin of direct children to header --- src/styles.css | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/styles.css b/src/styles.css index a8fd245..498af65 100644 --- a/src/styles.css +++ b/src/styles.css @@ -195,7 +195,9 @@ h1, h2, h3, h4, h5, h6 { h1 { display: block; font-size: 1.7em; margin-block-end: 0.5em; } h2 { margin-top: 2.5em; } h3 { margin-top: 2em; } - h1 + *, h1 ~ h1 { margin-top: 0; } + h1 + *, h1 ~ h1, h2 + a + *, h3 + a + *, h4 + a + *, h5 + a + *, h6 + a + * { + margin-top: 0; + } .h-anchor { color: var(--fg-color); border: none; } /* Slightly smaller than browser defaults https://stackoverflow.com/a/70720104/12036073 */ h2 + .h-anchor { font-size: 1.4em; } -- cgit v1.3.1-26-gb76a From 958d10a545ae24103bfbf98dfce044cdcfce93c7 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Tue, 11 Jul 2023 13:08:48 +0300 Subject: (back-to-top) Reworked code to use addEventListener, rather than onevent, and made scroll button show on window load If you opened a page with a hash, the button wouldn't show up before scrolling --- src/_footer.html | 2 +- src/scripts/back-to-top.js | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/_footer.html b/src/_footer.html index dcc0437..eb04df1 100644 --- a/src/_footer.html +++ b/src/_footer.html @@ -5,7 +5,7 @@ - + diff --git a/src/scripts/back-to-top.js b/src/scripts/back-to-top.js index d7222ce..2ca728a 100644 --- a/src/scripts/back-to-top.js +++ b/src/scripts/back-to-top.js @@ -1,13 +1,15 @@ const scrollBtn = document.getElementById('scrollBtn'); -window.onscroll = function() { +function scrollBtnShow() { if (window.scrollY >= 800) { scrollBtn.style.display = 'block'; } else { scrollBtn.style.display = 'none'; } } +window.addEventListener('scroll', scrollBtnShow); +window.addEventListener('load', scrollBtnShow); -scrollBtn.onclick = function() { +scrollBtn.addEventListener('click', function() { window.scrollTo(0, 0); -} +}); -- cgit v1.3.1-26-gb76a From c4214d237efcf5deab7c2137b87b137d7a7af69d Mon Sep 17 00:00:00 2001 From: Syndamia Date: Tue, 11 Jul 2023 13:10:37 +0300 Subject: (presentation) Minor code style change: added curly braces to simple if-else statements --- src/scripts/presentation.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/scripts/presentation.js b/src/scripts/presentation.js index 484961e..049d9e6 100644 --- a/src/scripts/presentation.js +++ b/src/scripts/presentation.js @@ -73,10 +73,11 @@ function togglePresentMode() { presentCont.children[i].classList.toggle('nodisplay'); } presentBtn.classList.toggle('setting-btn'); - if (presentBtn.innerHTML[0] === 'P') + if (presentBtn.innerHTML[0] === 'P') { presentBtn.innerHTML = presentBtn.innerHTML.substr(8); - else + } else { presentBtn.innerHTML = 'Present ' + presentBtn.innerHTML; + } // Show the first slide slides[slideIndex].classList.toggle('absolute-slide'); @@ -124,10 +125,11 @@ function toggleArticleMode() { window.history.replaceState(history.state, document.title, url); // Fix message - if (articleBtn.innerHTML[0] === 'A') + if (articleBtn.innerHTML[0] === 'A') { articleBtn.innerHTML = 'Slide' + articleBtn.innerHTML.substr(7); - else + } else { articleBtn.innerHTML = 'Article' + articleBtn.innerHTML.substr(5); + } } articleBtn.addEventListener('click', toggleArticleMode); window.addEventListener('load', function() { -- cgit v1.3.1-26-gb76a From a978ffe9844fb7c40acf6edc9877c444cbf77b83 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Tue, 11 Jul 2023 13:31:32 +0300 Subject: (presentation) Removed old ::after header styling --- src/presentation.css | 3 --- 1 file changed, 3 deletions(-) (limited to 'src') diff --git a/src/presentation.css b/src/presentation.css index c231259..f22d419 100644 --- a/src/presentation.css +++ b/src/presentation.css @@ -67,9 +67,6 @@ ul, ol { padding-inline-start: 30px; } .clide > * { flex: 1; } .centered { text-align: center; } - .centered h1::after, .centered h2::after, .centered h3::after { - content: " \2550" - } .fright { float: right; text-align: right; } * + .fright { margin-left: 1em; } -- cgit v1.3.1-26-gb76a From 0dde174f562fee8307accbe78ea24a102fda43af Mon Sep 17 00:00:00 2001 From: Syndamia Date: Tue, 11 Jul 2023 13:32:18 +0300 Subject: [header,footer] Removed integrity hashes --- src/_footer.html | 2 +- src/_header.html | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/_footer.html b/src/_footer.html index eb04df1..4481b8a 100644 --- a/src/_footer.html +++ b/src/_footer.html @@ -4,7 +4,7 @@ - + diff --git a/src/_header.html b/src/_header.html index 5156c29..23e1534 100644 --- a/src/_header.html +++ b/src/_header.html @@ -12,8 +12,8 @@ - - + + -- cgit v1.3.1-26-gb76a From d2886ab997f166882bbf6d888a0ae64123ce73e9 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Tue, 11 Jul 2023 14:22:57 +0300 Subject: [software] Added texty-office and small web utilities --- src/software.md | 8 +++++++- src/software/index.md | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/software.md b/src/software.md index 473e64a..37722dc 100644 --- a/src/software.md +++ b/src/software.md @@ -2,7 +2,13 @@ This is a curated list of the more relevant software projects I've made or heavily contributed to -
+
+ +[gitlab / texty-office](https://gitlab.com/Syndamia/texty-office) + [gitlab / texty-office.vim](https://gitlab.com/Syndamia/texty-office.vim) +: An imperfect converter from DOCX, PPTX and XLSX to normal text with it's associated [Vim](https://www.vim.org/) plugin.
`GNU GPLv3` & `MIT` | `C++` `vimscript` | `Office file` `converter` `plugin` `Vim` `CLI tool` + +[gitlab / small-web-utilities](https://gitlab.com/Syndamia/small-web-utilities)   *maintained* +: A collection of small but fast utilities, like a checklist, that work locally on your browser. Also hosted [here](https://utils.syndamia.com).
`GNU GPLv3` | `HTML` `Javascript` | `checklist` `utilities` [gitlab / ss-law](https://gitlab.com/Syndamia/ss-law) + [github / ss-law](https://github.com/Syndamia/ss-law)   *maintained* : A small, lightweight and simple static site generation system, extracted as a template from my own
`Markdown` `bash` `awk` | `ssg` `lowdown` `static site generator` `pipelines` diff --git a/src/software/index.md b/src/software/index.md index 473e64a..37722dc 100644 --- a/src/software/index.md +++ b/src/software/index.md @@ -2,7 +2,13 @@ This is a curated list of the more relevant software projects I've made or heavily contributed to -
+
+ +[gitlab / texty-office](https://gitlab.com/Syndamia/texty-office) + [gitlab / texty-office.vim](https://gitlab.com/Syndamia/texty-office.vim) +: An imperfect converter from DOCX, PPTX and XLSX to normal text with it's associated [Vim](https://www.vim.org/) plugin.
`GNU GPLv3` & `MIT` | `C++` `vimscript` | `Office file` `converter` `plugin` `Vim` `CLI tool` + +[gitlab / small-web-utilities](https://gitlab.com/Syndamia/small-web-utilities)   *maintained* +: A collection of small but fast utilities, like a checklist, that work locally on your browser. Also hosted [here](https://utils.syndamia.com).
`GNU GPLv3` | `HTML` `Javascript` | `checklist` `utilities` [gitlab / ss-law](https://gitlab.com/Syndamia/ss-law) + [github / ss-law](https://github.com/Syndamia/ss-law)   *maintained* : A small, lightweight and simple static site generation system, extracted as a template from my own
`Markdown` `bash` `awk` | `ssg` `lowdown` `static site generator` `pipelines` -- cgit v1.3.1-26-gb76a From 9a638fc25df29edd4b4b135347470ab358797325 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Tue, 11 Jul 2023 15:00:27 +0300 Subject: [privacy] Added privacy policy --- src/_header.html | 1 + src/privacy.md | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 src/privacy.md (limited to 'src') diff --git a/src/_header.html b/src/_header.html index 23e1534..f40f189 100644 --- a/src/_header.html +++ b/src/_header.html @@ -61,6 +61,7 @@ CC BY-SA 4.0 and GNU GPLv3

Policies
+ Privacy policy
Regarding JavaScript
Acknowledgements

diff --git a/src/privacy.md b/src/privacy.md new file mode 100644 index 0000000..a469aae --- /dev/null +++ b/src/privacy.md @@ -0,0 +1,32 @@ +# Privacy policy + +This website, [syndamia.com](https://syndamia.com) and [tiny.syndamia.com](https://tiny.syndamia.com), offers no user data submission (user accounts, reply forms, etc.). + +**No data is ever collected to be sold** *but* some data may be collected, primarily [http logs](#http-logs), but [no collection with Javascript](#no-collection-with-javascript). +However, I have no control over the used [third-party services](#third-party-services) + +## HTTP logs + +General HTTP requests and data surrounding them are saved, which may include: IP address, timestamps, exact page request, user agent, etc. +These depend on apache2 defaults. + +One such data line could look something like: + +``` +1.1.1.1 - - [11/Jul/2023:14:28:11 +0300] "GET / HTTP/1.1" 200 668 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/113.0" +``` + +These logs could be useful when issues pop up, including server being too slow or being attacked in some way. + +## Third-party services + +My domain is bought with [namecheap](https://www.namecheap.com/) and it's associated DNS entries are managed with namecheap servers. +This means that DNS entries, or more simply, domain configurations, first go through namecheap, and that may or may not mean they can collect data from you. + +Analogously, my server is hosted on [hetzner](https://www.hetzner.com/) servers, which may or may not be doing some sort of data collection. + +## No collection with Javascript + +[This site uses Javascript](/regarding-js.html), so some feature settings data may be temporarily stored in your browser. +For what exactly that data is, read [here](/regarding-js.html#data-in-browser-storage). +However, for now there are no plans on integrating any sort of statistics or personal data collection. -- cgit v1.3.1-26-gb76a From bc3760fa69357f3d270d2a661ee0bb42f60043b6 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Tue, 11 Jul 2023 15:52:56 +0300 Subject: [accessibility] Added a page explaning accessibility of this website --- src/_header.html | 1 + src/accessibility.md | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 src/accessibility.md (limited to 'src') diff --git a/src/_header.html b/src/_header.html index f40f189..47d768a 100644 --- a/src/_header.html +++ b/src/_header.html @@ -62,6 +62,7 @@

Policies
Privacy policy
+ Accessibility
Regarding JavaScript
Acknowledgements

diff --git a/src/accessibility.md b/src/accessibility.md new file mode 100644 index 0000000..61f3e48 --- /dev/null +++ b/src/accessibility.md @@ -0,0 +1,36 @@ +# Accessibility + +I do personally want to make sure the content on this website is useable by people with disabilities and/or with poor internet connection and browser speed. +However, at the same time, I want to add any feature I deem useful to the website experience, for everyone else. +This is how I reach a middle ground between both sides: + +### Bare bone website version + +At [tiny.syndamia.com](https://tiny.syndamia.com) I offer my website with all styling and JavaScript functionality removed. +On all pages you'll get the text and assets of the given page and nothing more. + +From my testing, pages usually load two times faster on tiny.syndamia.com. +I do also hope that without the styling and JavaScript, people with impairments will have an easier time either viewing the content or configuring their helping tools. + +### Consumable content with everything blocked + +By design, all "normal" pages[^normal-pages] can be viewed without any JavaScript, any styling and any custom font. +All of those are meant to make the browsing experience prettier and easier for those that can benefit from it. +Even my [talks](/talks), where each one is a collection of delicately crafted CSS and JS slides, can be viewed as any normal text article on my site. + +### Reasonable icons + +First, icons on this website are managed with an icon font. +I've watched [Seren Davies' talk](https://www.youtube.com/watch?v=9xXBYcWgCHA), but I've found working with SVGs noticeably increases workload on my end. + +**However**, I've still implemented those icons with accessibility in mind: + +- Navigation is done with text entries in the sidebar, not icons. +- Buttons for other functionalities use text to reference their action, rather than (only) an "image", most of the time. + The only mission-critical one that isn't represented with text is the sidebar folding and expanding button, right next to "Home". + But it is mapped to the standard up and down pointing triangle characters, so it should still be useable. +- Icons that aren't decorative are "mapped" to their closest standard Unicode symbol, so even without the font, their purpose should be fairly understandable. + Furthermore, I make sure those Unicode symbols have been standardised since at least 1999. +- My font has only the icons I use, and compared to the SVG equivalent setup, it takes up roughly a third of the size. + +[^normal-pages]: Meaning a page that has only text, images and video. If the page contains a JavaScript demo, it obviously cannot function entirely without JS. -- cgit v1.3.1-26-gb76a From 799bed0d2a7feba1931809a71e537530d7db1ec7 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Tue, 11 Jul 2023 15:53:48 +0300 Subject: [policies] Removed policies page, since it encapsulates everything privacy, accessibility and licenses do --- src/_header.html | 1 - src/policies.md | 25 ------------------------- 2 files changed, 26 deletions(-) delete mode 100644 src/policies.md (limited to 'src') diff --git a/src/_header.html b/src/_header.html index 47d768a..104707a 100644 --- a/src/_header.html +++ b/src/_header.html @@ -60,7 +60,6 @@