Auto commit: 2026-01-27T16:46:12.622Z

This commit is contained in:
Flatlogic Bot 2026-01-27 16:46:12 +00:00
parent bf2e9c972b
commit bc97f3cb27
8 changed files with 175 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 431 KiB

View File

@ -0,0 +1,56 @@
<?php
/**
* Twenty Twenty-Five Child functions and definitions
*/
function twentytwentyfive_child_enqueue_styles() {
// Enqueue parent styles
wp_enqueue_style('parent-style', get_template_directory_uri() . '/style.css');
// Enqueue child styles
wp_enqueue_style('child-style', get_stylesheet_uri(), ['parent-style'], wp_get_theme()->get('Version'));
// Enqueue dark mode JS
wp_enqueue_script('dark-mode-toggle', get_stylesheet_directory_uri() . '/js/dark-mode.js', [], '1.0.0', true);
}
add_action('wp_enqueue_scripts', 'twentytwentyfive_child_enqueue_styles');
/**
* Add a dark mode toggle to the site footer or header.
* We'll use a hook to inject the button.
*/
function twentytwentyfive_child_add_toggle() {
?>
<button id="dark-mode-toggle-btn" class="dark-mode-toggle" aria-label="Toggle Dark Mode">
<span class="sun">☀️</span>
<span class="moon">🌙</span>
</button>
<style>
.dark-mode-toggle {
position: fixed;
bottom: 20px;
right: 20px;
background: var(--wp--preset--color--contrast);
color: var(--wp--preset--color--base);
border: none;
border-radius: 50%;
width: 50px;
height: 50px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
z-index: 9999;
transition: transform 0.3s ease;
}
.dark-mode-toggle:hover {
transform: scale(1.1);
}
.dark-mode-toggle .moon { display: none; }
body.is-dark-theme .dark-mode-toggle .sun { display: none; }
body.is-dark-theme .dark-mode-toggle .moon { display: block; }
</style>
<?php
}
add_action('wp_footer', 'twentytwentyfive_child_add_toggle');

View File

@ -0,0 +1,22 @@
(function() {
const toggleBtn = document.getElementById('dark-mode-toggle-btn');
const body = document.body;
const storageKey = 'twentytwentyfive-dark-mode';
// Check for saved preference or default to enabled
if (localStorage.getItem(storageKey) === 'enabled' || localStorage.getItem(storageKey) === null) {
body.classList.add('is-dark-theme');
}
if (toggleBtn) {
toggleBtn.addEventListener('click', function() {
body.classList.toggle('is-dark-theme');
if (body.classList.contains('is-dark-theme')) {
localStorage.setItem(storageKey, 'enabled');
} else {
localStorage.setItem(storageKey, 'disabled');
}
});
}
})();

View File

@ -0,0 +1,36 @@
/*
Theme Name: Twenty Twenty-Five Child
Theme URI: https://healthfitnesswealth.com
Description: A child theme for Twenty Twenty-Five with dark mode support.
Author: Flatlogic
Template: twentytwentyfive
Version: 1.0.0
*/
/* Dark Mode Overrides */
body.is-dark-theme {
--wp--preset--color--base: #0a0a0a !important;
--wp--preset--color--contrast: #ffffff !important;
--wp--preset--color--accent-1: #1a1a1a !important;
--wp--preset--color--accent-2: #222222 !important;
--wp--preset--color--accent-3: #2a2a2a !important;
--wp--preset--color--accent-4: #bbbbbb !important;
--wp--preset--color--accent-5: #eeeeee !important;
--wp--preset--color--accent-6: rgba(255, 255, 255, 0.2) !important;
background-color: var(--wp--preset--color--base);
color: var(--wp--preset--color--contrast);
}
body.is-dark-theme img {
filter: brightness(.8) contrast(1.2);
}
body.is-dark-theme .wp-block-button__link {
background-color: var(--wp--preset--color--contrast) !important;
color: var(--wp--preset--color--base) !important;
}
body.is-dark-theme .wp-block-social-links {
--wp--preset--color--contrast: #ffffff;
}

View File

@ -0,0 +1,61 @@
{
"version": 3,
"settings": {
"color": {
"palette": [
{
"color": "#ffffff",
"name": "Base",
"slug": "base"
},
{
"color": "#111111",
"name": "Contrast",
"slug": "contrast"
},
{
"color": "#f5f5f5",
"name": "Accent 1",
"slug": "accent-1"
},
{
"color": "#eeeeee",
"name": "Accent 2",
"slug": "accent-2"
},
{
"color": "#0073aa",
"name": "Accent 3",
"slug": "accent-3"
}
]
},
"typography": {
"fontFamilies": [
{
"fontFamily": "system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif",
"name": "System Sans-serif",
"slug": "system-sans-serif"
}
]
}
},
"styles": {
"color": {
"background": "var(--wp--preset--color--base)",
"text": "var(--wp--preset--color--contrast)"
},
"elements": {
"link": {
"color": {
"text": "var(--wp--preset--color--accent-3)"
},
":hover": {
"color": {
"text": "var(--wp--preset--color--contrast)"
}
}
}
}
}
}