From 7f60a829b74127b8224c8082ed4a8e6c1ac89e8d Mon Sep 17 00:00:00 2001 From: recanman Date: Wed, 10 Jan 2024 16:02:36 -0800 Subject: [PATCH 1/5] upgrade dependencies --- Gemfile.lock | 54 ++++++++++++++++++++++++++++------------------------ 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 48ac909..3f66511 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,64 +1,68 @@ GEM remote: https://rubygems.org/ specs: - addressable (2.8.0) - public_suffix (>= 2.0.2, < 5.0) + addressable (2.8.6) + public_suffix (>= 2.0.2, < 6.0) colorator (1.1.0) - concurrent-ruby (1.1.9) + concurrent-ruby (1.2.2) em-websocket (0.5.3) eventmachine (>= 0.12.9) http_parser.rb (~> 0) eventmachine (1.2.7) - ffi (1.15.5) + ffi (1.16.3) forwardable-extended (2.6.0) + google-protobuf (3.25.2) http_parser.rb (0.8.0) - i18n (1.10.0) + i18n (1.14.1) concurrent-ruby (~> 1.0) - jekyll (4.2.1) + jekyll (4.3.3) addressable (~> 2.4) colorator (~> 1.0) em-websocket (~> 0.5) i18n (~> 1.0) - jekyll-sass-converter (~> 2.0) + jekyll-sass-converter (>= 2.0, < 4.0) jekyll-watch (~> 2.0) - kramdown (~> 2.3) + kramdown (~> 2.3, >= 2.3.1) kramdown-parser-gfm (~> 1.0) liquid (~> 4.0) - mercenary (~> 0.4.0) + mercenary (>= 0.3.6, < 0.5) pathutil (~> 0.9) - rouge (~> 3.0) + rouge (>= 3.0, < 5.0) safe_yaml (~> 1.0) - terminal-table (~> 2.0) + terminal-table (>= 1.8, < 4.0) + webrick (~> 1.7) jekyll-feed (0.16.0) jekyll (>= 3.7, < 5.0) jekyll-paginate (1.1.0) - jekyll-sass-converter (2.1.0) - sassc (> 2.0.1, < 3.0) + jekyll-sass-converter (3.0.0) + sass-embedded (~> 1.54) jekyll-watch (2.2.1) listen (~> 3.0) - kramdown (2.3.1) + kramdown (2.4.0) rexml kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) - liquid (4.0.3) - listen (3.7.1) + liquid (4.0.4) + listen (3.8.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) mercenary (0.4.0) pathutil (0.16.2) forwardable-extended (~> 2.6) - public_suffix (4.0.6) - rb-fsevent (0.11.1) + public_suffix (5.0.4) + rake (13.1.0) + rb-fsevent (0.11.2) rb-inotify (0.10.1) ffi (~> 1.0) - rexml (3.2.5) - rouge (3.28.0) + rexml (3.2.6) + rouge (4.2.0) safe_yaml (1.0.5) - sassc (2.4.0) - ffi (~> 1.9) - terminal-table (2.0.0) - unicode-display_width (~> 1.1, >= 1.1.1) - unicode-display_width (1.8.0) + sass-embedded (1.69.7) + google-protobuf (~> 3.25) + rake (>= 13.0.0) + terminal-table (3.0.2) + unicode-display_width (>= 1.1.1, < 3) + unicode-display_width (2.5.0) webrick (1.7.0) PLATFORMS From 9d3c3f2b99290fedb0da8bed8c82b195f239c533 Mon Sep 17 00:00:00 2001 From: recanman Date: Wed, 10 Jan 2024 17:07:48 -0800 Subject: [PATCH 2/5] add GNU LibreJS license information --- js/main.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/main.js b/js/main.js index 24257e2..62b5864 100644 --- a/js/main.js +++ b/js/main.js @@ -1,3 +1,7 @@ +// @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt Expat +// The above is a GNU LibreJS specific license declaration. The Expat license is the same as the MIT license. +// See: https://www.gnu.org/software/librejs/free-your-javascript.html#magnet-link-license + // Saves themes in-between pages to LocalStorage. const themeSwitcher = document.getElementById('theme-switcher'); From 675ed6abf92beaea0dc718898afcc5c2433d8d0a Mon Sep 17 00:00:00 2001 From: recanman Date: Wed, 10 Jan 2024 17:08:58 -0800 Subject: [PATCH 3/5] fix theme switcher position on mobile --- js/main.js | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) diff --git a/js/main.js b/js/main.js index 62b5864..e26b971 100644 --- a/js/main.js +++ b/js/main.js @@ -15,4 +15,64 @@ if (document.addEventListener) { themeSwitcher.attachEvent('onclick', setTheme); } -checkTheme() \ No newline at end of file +checkTheme() + +// Make the theme switcher in the hamburger menu on mobile devices work. +if (document.body.clientWidth < 940) { + const themeSwitcherLabel = document.getElementById('main-theme-switcher'); + const navActionsContainer = document.getElementById('nav-actions-container'); + + // Move the theme switcher to inside the hamburger menu. + navActionsContainer.appendChild(themeSwitcher); + navActionsContainer.appendChild(themeSwitcherLabel); + + themeSwitcherLabel.style.top = ''; + themeSwitcherLabel.style.left = '42vw'; + + const themeVariables = [ + // Light theme + [ + { name: 'primary-color', value: '#666666' }, + { name: 'secondary-color', value: '#555555' }, + { name: 'font-color', value: '#555555' }, + { name: 'link-color', value: '#444444' }, + { name: 'bg-color', value: '#f0f0f0' }, + { name: 'heading-color', value: '#666666' }, + { name: 'block-bg-color', value: '#d7d7d7' }, + { name: 'block-bg-color-secondary', value: '#c0c0c0' }, + { name: 'block-bg-color-heading', value: '#a5a5a5' }, + { name: 'table-color', value: '#000000' }, + { name: 'head-nav-bg-color', value: 'transparent' }, + { name: 'head-nav-text-color', value: '#d56f2a' }, + { name: 'menu-color', value: '#202225' }, + { name: 'license-color', value: '#666666' }, + ], + + // Dark theme + [ + { name: 'primary-color', value: '#888888' }, + { name: 'secondary-color', value: '#666666' }, + { name: 'font-color', value: '#cecece' }, + { name: 'link-color', value: '#e6e6e6' }, + { name: 'bg-color', value: '#0f0f0f' }, + { name: 'heading-color', value: '#454545' }, + { name: 'block-bg-color', value: '#2f3234' }, + { name: 'block-bg-color-secondary', value: '#444444' }, + { name: 'block-bg-color-heading', value: '#333333' }, + { name: 'table-color', value: '#cecece' }, + { name: 'head-nav-bg-color', value: 'transparent' }, + { name: 'head-nav-text-color', value: '#d56f2a' }, + { name: 'menu-color', value: '#e1e1e1' }, + { name: 'license-color', value: '#666666' }, + ] + ] + + // Switch the theme when the theme switcher is clicked. + themeSwitcher.addEventListener('change', () => { + const theme = themeVariables[themeSwitcher.checked ? 1 : 0]; + + theme.forEach(variable => { + document.documentElement.style.setProperty(`--${variable.name}`, variable.value); + }); + }); +} \ No newline at end of file From e88482e8cbaf8f2d32116c5e05d699ce34e8d013 Mon Sep 17 00:00:00 2001 From: recanman Date: Wed, 10 Jan 2024 17:09:09 -0800 Subject: [PATCH 4/5] add id to nav-actions div --- _includes/menu.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_includes/menu.html b/_includes/menu.html index 56a0d50..68a18a1 100644 --- a/_includes/menu.html +++ b/_includes/menu.html @@ -1,6 +1,6 @@