S
|
salus2 9/4/2025 |
Thanks for putting this together and sharing, I'd like to give it a try. I see the "custom_css" section, where is the "custom_functions" section? |
P
|
ppradhan@live.com author 9/4/2025 |
@salus2, |
S
|
salus2 9/4/2025 |
Thanks for that info. Maybe you are bumping into a form post length limit? Please seperate into sections if possible. |
P
|
ppradhan@live.com author 9/5/2025 |
/ =========== CUSTOM_CSS ==================== / Fill the mobile safe-area above the fixed navbar with the navbar theme / / Optional: when gradients look too “busy” up there, use the solid tone / .r-topheader { position: fixed !important; top: 0 !important; left: 0 !important; right: 0 !important; z-index: 1030 !important; } / Light variables (kept) / / Dark variables (kept) / / Surfaces & navbar / .navbar-default{ background:var(--bg-navbar) !important; border:0 !important; border-radius:0 !important; margin-bottom:0 !important; min-height:60px !important; width:100% !important; box-shadow:0 2px 10px var(--shadow-navbar); } .navbar-default .navbar-brand{ color:var(--navbar-brand-color) !important; font-weight:700 !important; font-size:20px !important; / Toggle: keep bars for a11y, add MENU label / / Menu links / / Dropdowns / / Theme switcher button / dynamic_theme_switcher{position:relative !important; min-width:45px !important; height:38px !important; padding:8px 12px !important; dynamic_theme_switcher:hover{ -webkit-transform:translateY(-2px) scale(1.05); transform:translateY(-2px) scale(1.05); }dynamic_theme_switcher .theme-icon{ font-size:18px !important; }dynamic_theme_switcher .theme-icon:before{ content:"☀️" !important; }body:not(.dark-theme) #dynamic_theme_switcher{ |
P
|
ppradhan@live.com author 9/5/2025 |
...continue of custom_css / Collapsed menu styling / .navbar-collapse{ background:var(--bg-navbar) !important; border-top:1px solid var(--border-navbar) !important; margin-top:1px !important; padding:0 !important; } mobile_nav_tools{ display:flex; justify-content:space-between; align-items:center; padding:8px 15px; margin-top:10px; border-top:1px solid var(--border-navbar); }.mobile-nav-left{ display:flex; align-items:center; gap:10px; } mobile_nav_tools>span,.mobile-nav-left>span{ padding:0 !important; margin:0 !important; border:0 !important; float:none !important; display:flex !important; align-items:center !important; }mobile_nav_tools #dynamic_theme_switcher{ margin:0 !important; width:42px !important; height:38px !important; -webkit-transform:none !important; transform:none !important; }tbody { background-color: var(--bg-primary) !important; } body:not(.dark-theme) .navbar-collapse .r-menu a{ color:#e8e8e8 !important; text-shadow:1px 1px 1px rgba(0,0,0,.5) !important; } / Dark overrides for your custom snippets (kept) / body { background-color: var(--bg-primary) !important; } .greeting, .weather-section, .date-section, [data-itemtype="text"] , [data-itemid="add_header"], .r-topbar-page, .r-gridrow, .form-section, td, input, select, textarea { background-color: var(--bg-input) !important; color: var(--text-input) !important; } / Custom Selectors here / / Fallback button (no inline styles in JS) / |
P
|
ppradhan@live.com author 9/5/2025 |
/* ==========CUSTOM_FUNCTIONS.JS ==============
var ThemeManager = { buttonId: 'dynamic_theme_switcher', initialized: false, originalParents: {}, _resizeTimer: null, _nav: null, init: function () { if (this.initialized) return; // NEW: make the phone's status/address bar + safe-area match the navbar }, // ES5 helper: closest ancestor with a matching id // Setup manual toggle for top-level dropdowns on mobile var links = container.querySelectorAll('.r-menu.nav.navbar-nav > li.dropdown > a'); }, createThemeButton: function () { var loc = this.findButtonContainer(); }, handleResize: function () { var isMobile = window.innerWidth < 768; if (isMobile) this.groupMobileNavbarItems(); else this.ungroupMobileNavbarItems(); }, groupMobileNavbarItems: function () { var nav = this._nav || document.querySelector('.navbar-default'); }, ungroupMobileNavbarItems: function () { var themeSwitcher = toolsGroup.querySelector('[data-itemid="theme_switcher"]'); }, findButtonContainer: function () { var notif = nav.querySelector('[data-itemid="notifications"]'); }, createFallbackButton: function () { getTheme: function () { saveTheme: function (theme) { applyTheme: function (theme) { // Scoped transition class (smooth flip, avoids global *) }, toggleTheme: function () { // NEW: keep address-bar color aligned with theme }, updateButtonText: function (theme) { bindEvents: function () { document.body.addEventListener('click', function (e) { }, showThemeChangeEffect: function () { setCookie: function (name, value, days) { getCookie: function (name) { / ===================== NEW: Safe-area + address bar ===================== / // Injects a small CSS block that paints the safe-area (status bar/notch) above // Note: Uses your existing CSS variables --bg-navbar and --bg-navbar-solid }, // Ensures <meta name="theme-color"> exists and sets it to the solid navbar color. setThemeColor: function () { function initThemeManager() { // Small delay so PHPRunner DOM pieces are available setTimeout(function () { ThemeManager.init(); }, 200); } if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', initThemeManager); } else { initThemeManager(); } window.ThemeManager = ThemeManager; |
G
|
Grdimitris 9/5/2025 |
The body.dark-theme #dynamic_theme_switcher .theme-icon:before{ |
P
|
ppradhan@live.com author 9/5/2025 |
I'd pasted full code but for some reason it truncated. Below is the missing code, but make sure to delete duplicates because I've copied little more so that you guys can figure out the missing part and have them compiled. missing in above ..... (part of custom_css) body:not(.dark-theme) #dynamic_theme_switcher{ |
G
|
Grdimitris 9/5/2025 |
Still missing. Copy and some next lines to be in middle |
![]() |
fhumanes 9/5/2025 |
Hello @ppradhan@live.com, When I tried to put code in the forum, if it was a bit extensive, it was impossible for me because when you enter the content it is not appreciated how it will be seen. All I can offer is to load it on my website, as a link to a file or as a publication (what you consider best), so that there is no problem or loss of information in the code. My blog is https://fhumanes.com/ Greetings, |
P
|
ppradhan@live.com author 9/6/2025 |
Sorry guys, copying code here in the blog truncates and has issues. So, I hosted them in the server itself. |
S
|
salus2 9/6/2025 |
Cool! Here is an example... https://calculationforms.com/ClassicModels/products_list.php Thanks for sharing! |