jekyll-theme-zer0 0.22.5 → 0.22.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +196 -0
- data/README.md +66 -19
- data/_data/navigation/admin.yml +53 -0
- data/_data/theme_backgrounds.yml +121 -0
- data/_includes/components/admin-tabs.html +59 -0
- data/_includes/components/analytics-dashboard.html +232 -0
- data/_includes/components/background-customizer.html +159 -0
- data/_includes/components/background-settings.html +137 -0
- data/_includes/components/collection-manager.html +151 -0
- data/_includes/components/component-showcase.html +452 -0
- data/_includes/components/config-editor.html +207 -0
- data/_includes/components/config-viewer.html +479 -0
- data/_includes/components/cookie-consent.html +35 -100
- data/_includes/components/env-dashboard.html +154 -0
- data/_includes/components/feature-card.html +94 -0
- data/_includes/components/info-section.html +172 -149
- data/_includes/components/js-cdn.html +4 -1
- data/_includes/components/nanobar.html +117 -0
- data/_includes/components/nav-editor.html +99 -0
- data/_includes/components/setup-banner.html +28 -0
- data/_includes/components/setup-check.html +53 -0
- data/_includes/components/svg-background.html +42 -0
- data/_includes/components/theme-customizer.html +46 -0
- data/_includes/content/seo.html +68 -135
- data/_includes/core/footer.html +10 -12
- data/_includes/core/head.html +7 -27
- data/_includes/core/header.html +30 -17
- data/_includes/landing/landing-install-cards.html +18 -7
- data/_includes/navigation/admin-nav.html +95 -0
- data/_includes/navigation/navbar.html +45 -6
- data/_includes/navigation/sidebar-left.html +1 -1
- data/_includes/setup/wizard.html +330 -0
- data/_layouts/admin.html +166 -0
- data/_layouts/landing.html +15 -9
- data/_layouts/root.html +12 -6
- data/_layouts/setup.html +73 -0
- data/_plugins/preview_image_generator.rb +26 -12
- data/_sass/core/_navbar.scss +8 -2
- data/_sass/custom.scss +65 -10
- data/_sass/theme/_background-mixins.scss +95 -0
- data/_sass/theme/_backgrounds.scss +156 -0
- data/_sass/theme/_color-modes.scss +2 -1
- data/assets/backgrounds/gradients/air.svg +15 -0
- data/assets/backgrounds/gradients/aqua.svg +15 -0
- data/assets/backgrounds/gradients/contrast.svg +15 -0
- data/assets/backgrounds/gradients/dark.svg +15 -0
- data/assets/backgrounds/gradients/dirt.svg +15 -0
- data/assets/backgrounds/gradients/mint.svg +15 -0
- data/assets/backgrounds/gradients/neon.svg +15 -0
- data/assets/backgrounds/gradients/plum.svg +15 -0
- data/assets/backgrounds/gradients/sunrise.svg +15 -0
- data/assets/backgrounds/noise/air.svg +8 -0
- data/assets/backgrounds/noise/aqua.svg +8 -0
- data/assets/backgrounds/noise/contrast.svg +8 -0
- data/assets/backgrounds/noise/dark.svg +8 -0
- data/assets/backgrounds/noise/dirt.svg +8 -0
- data/assets/backgrounds/noise/mint.svg +8 -0
- data/assets/backgrounds/noise/neon.svg +8 -0
- data/assets/backgrounds/noise/plum.svg +8 -0
- data/assets/backgrounds/noise/sunrise.svg +8 -0
- data/assets/backgrounds/patterns/air.svg +7 -0
- data/assets/backgrounds/patterns/aqua.svg +7 -0
- data/assets/backgrounds/patterns/contrast.svg +4 -0
- data/assets/backgrounds/patterns/dark.svg +5 -0
- data/assets/backgrounds/patterns/dirt.svg +5 -0
- data/assets/backgrounds/patterns/mint.svg +6 -0
- data/assets/backgrounds/patterns/neon.svg +6 -0
- data/assets/backgrounds/patterns/plum.svg +6 -0
- data/assets/backgrounds/patterns/sunrise.svg +5 -0
- data/assets/js/background-customizer.js +73 -0
- data/assets/js/code-copy.js +18 -47
- data/assets/js/config-utility.js +307 -0
- data/assets/js/nanobar-init.js +63 -0
- data/assets/js/nav-editor.js +39 -0
- data/assets/js/palette-generator.js +415 -0
- data/assets/js/search-modal.js +31 -11
- data/assets/js/setup-wizard.js +306 -0
- data/assets/js/skin-editor.js +645 -0
- data/assets/js/theme-customizer.js +102 -0
- data/assets/js/ui-enhancements.js +2 -24
- data/assets/vendor/bootstrap/css/bootstrap.min.css +1 -0
- data/assets/vendor/bootstrap/js/bootstrap.bundle.min.js +1 -0
- data/scripts/README.md +45 -0
- data/scripts/features/generate-preview-images +297 -7
- data/scripts/features/install-preview-generator +51 -33
- data/scripts/fork-cleanup.sh +92 -19
- data/scripts/github-setup.sh +284 -0
- data/scripts/init_setup.sh +0 -1
- data/scripts/lib/frontmatter.sh +543 -0
- data/scripts/lib/migrate.sh +265 -0
- data/scripts/lib/preview_generator.py +607 -32
- data/scripts/lint-pages +508 -0
- data/scripts/migrate.sh +201 -0
- data/scripts/platform/setup-linux.sh +244 -0
- data/scripts/platform/setup-macos.sh +187 -0
- data/scripts/platform/setup-wsl.sh +196 -0
- metadata +73 -6
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="800" height="400" viewBox="0 0 800 400">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="g1" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
4
|
+
<stop offset="0%" stop-color="#ff006e"/>
|
|
5
|
+
<stop offset="50%" stop-color="#8338ec"/>
|
|
6
|
+
<stop offset="100%" stop-color="#3a86ff"/>
|
|
7
|
+
</linearGradient>
|
|
8
|
+
<filter id="f1">
|
|
9
|
+
<feTurbulence type="fractalNoise" baseFrequency="0.006" numOctaves="5" seed="42"/>
|
|
10
|
+
<feDisplacementMap in="SourceGraphic" scale="80"/>
|
|
11
|
+
</filter>
|
|
12
|
+
</defs>
|
|
13
|
+
<rect width="100%" height="100%" fill="url(#g1)"/>
|
|
14
|
+
<rect width="100%" height="100%" fill="url(#g1)" filter="url(#f1)" opacity="0.6"/>
|
|
15
|
+
</svg>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="800" height="400" viewBox="0 0 800 400">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="g1" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
4
|
+
<stop offset="0%" stop-color="#4a0e4e"/>
|
|
5
|
+
<stop offset="50%" stop-color="#812f85"/>
|
|
6
|
+
<stop offset="100%" stop-color="#c77dff"/>
|
|
7
|
+
</linearGradient>
|
|
8
|
+
<filter id="f1">
|
|
9
|
+
<feTurbulence type="fractalNoise" baseFrequency="0.006" numOctaves="4" seed="15"/>
|
|
10
|
+
<feDisplacementMap in="SourceGraphic" scale="65"/>
|
|
11
|
+
</filter>
|
|
12
|
+
</defs>
|
|
13
|
+
<rect width="100%" height="100%" fill="url(#g1)"/>
|
|
14
|
+
<rect width="100%" height="100%" fill="url(#g1)" filter="url(#f1)" opacity="0.5"/>
|
|
15
|
+
</svg>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="800" height="400" viewBox="0 0 800 400">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="g1" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
4
|
+
<stop offset="0%" stop-color="#ff6b35"/>
|
|
5
|
+
<stop offset="50%" stop-color="#f7c59f"/>
|
|
6
|
+
<stop offset="100%" stop-color="#efefd0"/>
|
|
7
|
+
</linearGradient>
|
|
8
|
+
<filter id="f1">
|
|
9
|
+
<feTurbulence type="fractalNoise" baseFrequency="0.008" numOctaves="4" seed="7"/>
|
|
10
|
+
<feDisplacementMap in="SourceGraphic" scale="60"/>
|
|
11
|
+
</filter>
|
|
12
|
+
</defs>
|
|
13
|
+
<rect width="100%" height="100%" fill="url(#g1)"/>
|
|
14
|
+
<rect width="100%" height="100%" fill="url(#g1)" filter="url(#f1)" opacity="0.5"/>
|
|
15
|
+
</svg>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="300" height="300" viewBox="0 0 300 300">
|
|
2
|
+
<filter id="n1">
|
|
3
|
+
<feTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/>
|
|
4
|
+
<feColorMatrix type="saturate" values="0"/>
|
|
5
|
+
</filter>
|
|
6
|
+
<rect width="100%" height="100%" fill="transparent"/>
|
|
7
|
+
<rect width="100%" height="100%" filter="url(#n1)" opacity="0.04"/>
|
|
8
|
+
</svg>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="300" height="300" viewBox="0 0 300 300">
|
|
2
|
+
<filter id="n1">
|
|
3
|
+
<feTurbulence type="fractalNoise" baseFrequency="0.7" numOctaves="3" stitchTiles="stitch"/>
|
|
4
|
+
<feColorMatrix type="saturate" values="0"/>
|
|
5
|
+
</filter>
|
|
6
|
+
<rect width="100%" height="100%" fill="transparent"/>
|
|
7
|
+
<rect width="100%" height="100%" filter="url(#n1)" opacity="0.05"/>
|
|
8
|
+
</svg>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="300" height="300" viewBox="0 0 300 300">
|
|
2
|
+
<filter id="n1">
|
|
3
|
+
<feTurbulence type="fractalNoise" baseFrequency="0.6" numOctaves="4" stitchTiles="stitch"/>
|
|
4
|
+
<feColorMatrix type="saturate" values="0"/>
|
|
5
|
+
</filter>
|
|
6
|
+
<rect width="100%" height="100%" fill="transparent"/>
|
|
7
|
+
<rect width="100%" height="100%" filter="url(#n1)" opacity="0.06"/>
|
|
8
|
+
</svg>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="300" height="300" viewBox="0 0 300 300">
|
|
2
|
+
<filter id="n1">
|
|
3
|
+
<feTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/>
|
|
4
|
+
<feColorMatrix type="saturate" values="0"/>
|
|
5
|
+
</filter>
|
|
6
|
+
<rect width="100%" height="100%" fill="transparent"/>
|
|
7
|
+
<rect width="100%" height="100%" filter="url(#n1)" opacity="0.04"/>
|
|
8
|
+
</svg>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="300" height="300" viewBox="0 0 300 300">
|
|
2
|
+
<filter id="n1">
|
|
3
|
+
<feTurbulence type="fractalNoise" baseFrequency="0.6" numOctaves="4" stitchTiles="stitch"/>
|
|
4
|
+
<feColorMatrix type="saturate" values="0"/>
|
|
5
|
+
</filter>
|
|
6
|
+
<rect width="100%" height="100%" fill="transparent"/>
|
|
7
|
+
<rect width="100%" height="100%" filter="url(#n1)" opacity="0.06"/>
|
|
8
|
+
</svg>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="300" height="300" viewBox="0 0 300 300">
|
|
2
|
+
<filter id="n1">
|
|
3
|
+
<feTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/>
|
|
4
|
+
<feColorMatrix type="saturate" values="0"/>
|
|
5
|
+
</filter>
|
|
6
|
+
<rect width="100%" height="100%" fill="transparent"/>
|
|
7
|
+
<rect width="100%" height="100%" filter="url(#n1)" opacity="0.04"/>
|
|
8
|
+
</svg>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="300" height="300" viewBox="0 0 300 300">
|
|
2
|
+
<filter id="n1">
|
|
3
|
+
<feTurbulence type="fractalNoise" baseFrequency="0.7" numOctaves="3" stitchTiles="stitch"/>
|
|
4
|
+
<feColorMatrix type="saturate" values="0"/>
|
|
5
|
+
</filter>
|
|
6
|
+
<rect width="100%" height="100%" fill="transparent"/>
|
|
7
|
+
<rect width="100%" height="100%" filter="url(#n1)" opacity="0.05"/>
|
|
8
|
+
</svg>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="300" height="300" viewBox="0 0 300 300">
|
|
2
|
+
<filter id="n1">
|
|
3
|
+
<feTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/>
|
|
4
|
+
<feColorMatrix type="saturate" values="0"/>
|
|
5
|
+
</filter>
|
|
6
|
+
<rect width="100%" height="100%" fill="transparent"/>
|
|
7
|
+
<rect width="100%" height="100%" filter="url(#n1)" opacity="0.05"/>
|
|
8
|
+
</svg>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="300" height="300" viewBox="0 0 300 300">
|
|
2
|
+
<filter id="n1">
|
|
3
|
+
<feTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/>
|
|
4
|
+
<feColorMatrix type="saturate" values="0"/>
|
|
5
|
+
</filter>
|
|
6
|
+
<rect width="100%" height="100%" fill="transparent"/>
|
|
7
|
+
<rect width="100%" height="100%" filter="url(#n1)" opacity="0.05"/>
|
|
8
|
+
</svg>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="60" height="60" viewBox="0 0 60 60">
|
|
2
|
+
<circle cx="30" cy="30" r="8" fill="none" stroke="#6fa8dc" stroke-width="0.5" opacity="0.3"/>
|
|
3
|
+
<circle cx="0" cy="0" r="5" fill="none" stroke="#b8d4e3" stroke-width="0.5" opacity="0.2"/>
|
|
4
|
+
<circle cx="60" cy="60" r="5" fill="none" stroke="#b8d4e3" stroke-width="0.5" opacity="0.2"/>
|
|
5
|
+
<circle cx="60" cy="0" r="5" fill="none" stroke="#b8d4e3" stroke-width="0.5" opacity="0.2"/>
|
|
6
|
+
<circle cx="0" cy="60" r="5" fill="none" stroke="#b8d4e3" stroke-width="0.5" opacity="0.2"/>
|
|
7
|
+
</svg>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="60" height="60" viewBox="0 0 60 60">
|
|
2
|
+
<circle cx="30" cy="30" r="8" fill="none" stroke="#00b4d8" stroke-width="0.5" opacity="0.3"/>
|
|
3
|
+
<circle cx="0" cy="0" r="5" fill="none" stroke="#90e0ef" stroke-width="0.5" opacity="0.2"/>
|
|
4
|
+
<circle cx="60" cy="60" r="5" fill="none" stroke="#90e0ef" stroke-width="0.5" opacity="0.2"/>
|
|
5
|
+
<circle cx="60" cy="0" r="5" fill="none" stroke="#90e0ef" stroke-width="0.5" opacity="0.2"/>
|
|
6
|
+
<circle cx="0" cy="60" r="5" fill="none" stroke="#90e0ef" stroke-width="0.5" opacity="0.2"/>
|
|
7
|
+
</svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40">
|
|
2
|
+
<line x1="0" y1="0" x2="40" y2="40" stroke="#ffcc00" stroke-width="0.5" opacity="0.15"/>
|
|
3
|
+
<line x1="40" y1="0" x2="0" y2="40" stroke="#ffffff" stroke-width="0.3" opacity="0.08"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" viewBox="0 0 50 50">
|
|
2
|
+
<rect x="22" y="22" width="6" height="6" rx="1" fill="none" stroke="#0f3460" stroke-width="0.5" opacity="0.25"/>
|
|
3
|
+
<rect x="-3" y="-3" width="6" height="6" rx="1" fill="none" stroke="#16213e" stroke-width="0.5" opacity="0.15"/>
|
|
4
|
+
<rect x="47" y="47" width="6" height="6" rx="1" fill="none" stroke="#16213e" stroke-width="0.5" opacity="0.15"/>
|
|
5
|
+
</svg>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" viewBox="0 0 50 50">
|
|
2
|
+
<polygon points="25,10 35,35 15,35" fill="none" stroke="#d4a574" stroke-width="0.5" opacity="0.2"/>
|
|
3
|
+
<circle cx="8" cy="8" r="3" fill="none" stroke="#8b6914" stroke-width="0.4" opacity="0.15"/>
|
|
4
|
+
<circle cx="42" cy="42" r="3" fill="none" stroke="#8b6914" stroke-width="0.4" opacity="0.15"/>
|
|
5
|
+
</svg>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" viewBox="0 0 50 50">
|
|
2
|
+
<circle cx="25" cy="25" r="10" fill="none" stroke="#52b788" stroke-width="0.5" opacity="0.2"/>
|
|
3
|
+
<circle cx="25" cy="25" r="6" fill="none" stroke="#95d5b2" stroke-width="0.4" opacity="0.15"/>
|
|
4
|
+
<circle cx="5" cy="5" r="3" fill="none" stroke="#2d6a4f" stroke-width="0.3" opacity="0.1"/>
|
|
5
|
+
<circle cx="45" cy="45" r="3" fill="none" stroke="#2d6a4f" stroke-width="0.3" opacity="0.1"/>
|
|
6
|
+
</svg>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="60" height="60" viewBox="0 0 60 60">
|
|
2
|
+
<polygon points="30,5 55,50 5,50" fill="none" stroke="#ff006e" stroke-width="0.6" opacity="0.25"/>
|
|
3
|
+
<circle cx="30" cy="35" r="4" fill="none" stroke="#3a86ff" stroke-width="0.5" opacity="0.2"/>
|
|
4
|
+
<circle cx="10" cy="10" r="3" fill="none" stroke="#8338ec" stroke-width="0.5" opacity="0.15"/>
|
|
5
|
+
<circle cx="50" cy="10" r="3" fill="none" stroke="#8338ec" stroke-width="0.5" opacity="0.15"/>
|
|
6
|
+
</svg>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="60" height="60" viewBox="0 0 60 60">
|
|
2
|
+
<circle cx="30" cy="30" r="12" fill="none" stroke="#c77dff" stroke-width="0.5" opacity="0.2"/>
|
|
3
|
+
<circle cx="30" cy="30" r="6" fill="none" stroke="#812f85" stroke-width="0.4" opacity="0.15"/>
|
|
4
|
+
<line x1="10" y1="10" x2="50" y2="50" stroke="#4a0e4e" stroke-width="0.3" opacity="0.1"/>
|
|
5
|
+
<line x1="50" y1="10" x2="10" y2="50" stroke="#4a0e4e" stroke-width="0.3" opacity="0.1"/>
|
|
6
|
+
</svg>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" viewBox="0 0 50 50">
|
|
2
|
+
<circle cx="25" cy="25" r="10" fill="none" stroke="#ff6b35" stroke-width="0.5" opacity="0.2"/>
|
|
3
|
+
<line x1="5" y1="25" x2="45" y2="25" stroke="#f7c59f" stroke-width="0.3" opacity="0.12"/>
|
|
4
|
+
<line x1="25" y1="5" x2="25" y2="45" stroke="#f7c59f" stroke-width="0.3" opacity="0.12"/>
|
|
5
|
+
</svg>
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* background-customizer.js
|
|
3
|
+
* Runtime switching of theme skin and fffuel-style SVG backgrounds.
|
|
4
|
+
*
|
|
5
|
+
* API:
|
|
6
|
+
* zer0Bg.setSkin('aqua') — change skin (persists to localStorage)
|
|
7
|
+
* zer0Bg.toggle() — enable / disable backgrounds
|
|
8
|
+
* zer0Bg.setOpacity('gradient', 0.5) — adjust a layer opacity at runtime
|
|
9
|
+
* zer0Bg.currentSkin() — returns current skin name
|
|
10
|
+
*/
|
|
11
|
+
(() => {
|
|
12
|
+
"use strict";
|
|
13
|
+
|
|
14
|
+
const STORAGE_KEY_SKIN = "zer0-theme-skin";
|
|
15
|
+
const STORAGE_KEY_BG = "zer0-bg-enabled";
|
|
16
|
+
|
|
17
|
+
const html = document.documentElement;
|
|
18
|
+
|
|
19
|
+
/** Read stored skin or fall back to the server-rendered attribute. */
|
|
20
|
+
function getStoredSkin() {
|
|
21
|
+
return localStorage.getItem(STORAGE_KEY_SKIN) || html.getAttribute("data-theme-skin") || "dark";
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** Read stored background on/off preference. */
|
|
25
|
+
function isBgEnabled() {
|
|
26
|
+
const stored = localStorage.getItem(STORAGE_KEY_BG);
|
|
27
|
+
if (stored !== null) return stored === "true";
|
|
28
|
+
return html.getAttribute("data-zer0-bg") !== "false";
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** Apply skin to <html> and persist. */
|
|
32
|
+
function setSkin(name) {
|
|
33
|
+
html.setAttribute("data-theme-skin", name);
|
|
34
|
+
localStorage.setItem(STORAGE_KEY_SKIN, name);
|
|
35
|
+
document.dispatchEvent(new CustomEvent("zer0:skin-change", { detail: { skin: name } }));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** Toggle backgrounds on/off. */
|
|
39
|
+
function toggle(force) {
|
|
40
|
+
const enabled = typeof force === "boolean" ? force : !isBgEnabled();
|
|
41
|
+
html.setAttribute("data-zer0-bg", enabled ? "on" : "off");
|
|
42
|
+
localStorage.setItem(STORAGE_KEY_BG, String(enabled));
|
|
43
|
+
document.dispatchEvent(new CustomEvent("zer0:bg-toggle", { detail: { enabled } }));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** Adjust a specific layer opacity at runtime via CSS custom property. */
|
|
47
|
+
function setOpacity(layer, value) {
|
|
48
|
+
const map = {
|
|
49
|
+
gradient: "--zer0-bg-gradient-opacity",
|
|
50
|
+
texture: "--zer0-bg-texture-opacity",
|
|
51
|
+
pattern: "--zer0-bg-pattern-opacity"
|
|
52
|
+
};
|
|
53
|
+
const prop = map[layer];
|
|
54
|
+
if (prop) html.style.setProperty(prop, value);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** Return current skin name. */
|
|
58
|
+
function currentSkin() {
|
|
59
|
+
return html.getAttribute("data-theme-skin") || "dark";
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Restore on page load
|
|
63
|
+
const storedSkin = getStoredSkin();
|
|
64
|
+
if (storedSkin !== html.getAttribute("data-theme-skin")) {
|
|
65
|
+
html.setAttribute("data-theme-skin", storedSkin);
|
|
66
|
+
}
|
|
67
|
+
if (!isBgEnabled()) {
|
|
68
|
+
html.setAttribute("data-zer0-bg", "off");
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Public API
|
|
72
|
+
window.zer0Bg = { setSkin, toggle, setOpacity, currentSkin };
|
|
73
|
+
})();
|
data/assets/js/code-copy.js
CHANGED
|
@@ -20,7 +20,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
|
|
20
20
|
button.innerHTML = '<i class="bi bi-clipboard me-1"></i>' + copyText;
|
|
21
21
|
button.tabIndex = 0;
|
|
22
22
|
|
|
23
|
-
//
|
|
23
|
+
// Click handler using modern Clipboard API
|
|
24
24
|
button.addEventListener('click', function (e) {
|
|
25
25
|
e.preventDefault();
|
|
26
26
|
e.stopPropagation();
|
|
@@ -34,24 +34,23 @@ document.addEventListener('DOMContentLoaded', function () {
|
|
|
34
34
|
.join('\n')
|
|
35
35
|
.trim();
|
|
36
36
|
|
|
37
|
-
//
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
37
|
+
// Modern Clipboard API (supported in all current browsers)
|
|
38
|
+
navigator.clipboard.writeText(code).then(function() {
|
|
39
|
+
// Success feedback
|
|
40
|
+
button.innerHTML = '<i class="bi bi-check-circle me-1"></i>' + copiedText;
|
|
41
|
+
button.classList.add('copied');
|
|
42
|
+
|
|
43
|
+
setTimeout(function () {
|
|
44
|
+
button.innerHTML = '<i class="bi bi-clipboard me-1"></i>' + copyText;
|
|
45
|
+
button.classList.remove('copied');
|
|
46
|
+
}, 2000);
|
|
47
|
+
}).catch(function(err) {
|
|
48
|
+
console.error('Failed to copy:', err);
|
|
49
|
+
button.innerHTML = '<i class="bi bi-x-circle me-1"></i>Copy failed';
|
|
50
|
+
setTimeout(function () {
|
|
51
|
+
button.innerHTML = '<i class="bi bi-clipboard me-1"></i>' + copyText;
|
|
52
|
+
}, 2000);
|
|
53
|
+
});
|
|
55
54
|
});
|
|
56
55
|
|
|
57
56
|
// Ensure pre has position relative for absolute positioning
|
|
@@ -62,32 +61,4 @@ document.addEventListener('DOMContentLoaded', function () {
|
|
|
62
61
|
preElement.appendChild(button);
|
|
63
62
|
preElement.classList.add('has-copy-button');
|
|
64
63
|
});
|
|
65
|
-
|
|
66
|
-
// Fallback copy method for older browsers
|
|
67
|
-
function fallbackCopy(text, button, copyText) {
|
|
68
|
-
var textArea = document.createElement('textarea');
|
|
69
|
-
textArea.value = text;
|
|
70
|
-
textArea.style.position = 'fixed';
|
|
71
|
-
textArea.style.opacity = '0';
|
|
72
|
-
document.body.appendChild(textArea);
|
|
73
|
-
textArea.select();
|
|
74
|
-
|
|
75
|
-
try {
|
|
76
|
-
document.execCommand('copy');
|
|
77
|
-
button.innerHTML = '<i class="bi bi-check-circle me-1"></i>Copied!';
|
|
78
|
-
button.classList.add('copied');
|
|
79
|
-
setTimeout(function () {
|
|
80
|
-
button.innerHTML = '<i class="bi bi-clipboard me-1"></i>' + copyText;
|
|
81
|
-
button.classList.remove('copied');
|
|
82
|
-
}, 2000);
|
|
83
|
-
} catch (err) {
|
|
84
|
-
console.error('Fallback copy failed:', err);
|
|
85
|
-
button.innerHTML = '<i class="bi bi-x-circle me-1"></i>Failed';
|
|
86
|
-
setTimeout(function () {
|
|
87
|
-
button.innerHTML = '<i class="bi bi-clipboard me-1"></i>' + copyText;
|
|
88
|
-
}, 2000);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
document.body.removeChild(textArea);
|
|
92
|
-
}
|
|
93
64
|
});
|