Share complete dropdown chrome with forums and support; keep menus above cards
This commit is contained in:
parent
ebdb860866
commit
bf8cedaf43
2 changed files with 17 additions and 3 deletions
|
|
@ -4,6 +4,9 @@ import {existsSync, readFileSync,writeFileSync,copyFileSync} from 'node:fs';
|
|||
import {SHARED_HEADER,SHARED_HEAD,PORTAL_SCRIPT,PORTAL_CSS,CONTEXT_SCRIPT,CONTEXT_CSS} from './portal-navigation.mjs';
|
||||
const release=process.argv[2],integrations=process.argv[3];
|
||||
if(!release||!integrations)throw Error('Provide release and integration directories');
|
||||
// Native apps receive the complete canonical chrome, including dropdowns.
|
||||
const navigationCSS=readFileSync(release+'/web/portal-navigation.css','utf8');
|
||||
const navigationJS=readFileSync(release+'/web/portal-navigation.js','utf8');
|
||||
const cp=release+'/control-panel/public/cp-v2/index.html';let html=readFileSync(cp,'utf8');
|
||||
html=html.replace(/<header\b[^>]*>[\s\S]*?<\/header>/,SHARED_HEADER);
|
||||
if(!html.includes('https://www.dunerealms.com/portal-navigation.js'))html=html.replace('</head>',SHARED_HEAD+'</head>');
|
||||
|
|
@ -15,8 +18,8 @@ copyFileSync(release+'/integrations/osticket/dune-support.css',integrations+'/os
|
|||
for(const app of ['mybb','osticket']){
|
||||
writeFileSync(integrations+'/'+app+'/dune-actions.css',BUTTON_CSS);
|
||||
writeFileSync(integrations+'/'+app+'/dune-actions.js',BUTTON_SCRIPT);
|
||||
writeFileSync(integrations+'/'+app+'/dune-navigation.js',PORTAL_SCRIPT+CONTEXT_SCRIPT+BUTTON_SCRIPT+RELEASE_SCRIPT);
|
||||
writeFileSync(integrations+'/'+app+'/dune-navigation.css',PORTAL_CSS+CONTEXT_CSS+BUTTON_CSS+RELEASE_CSS);
|
||||
writeFileSync(integrations+'/'+app+'/dune-navigation.js',navigationJS+CONTEXT_SCRIPT+BUTTON_SCRIPT+RELEASE_SCRIPT);
|
||||
writeFileSync(integrations+'/'+app+'/dune-navigation.css',navigationCSS+CONTEXT_CSS+BUTTON_CSS+RELEASE_CSS);
|
||||
}
|
||||
let server=readFileSync(release+'/control-panel/server.mjs','utf8');
|
||||
server=server.replace("script-src 'self'; style-src 'self' https://fonts.googleapis.com;", "script-src 'self' https://www.dunerealms.com; style-src 'self' https://www.dunerealms.com https://fonts.googleapis.com;");
|
||||
|
|
@ -26,7 +29,7 @@ console.log('Shared header installed in CP and native integration templates');
|
|||
|
||||
// The Clan center serves local copies to retain the same masthead styles.
|
||||
const clans='/home/dunerealms/htdocs/clans.dunerealms.com';
|
||||
if(existsSync(clans+'/index.html')){writeFileSync(clans+'/dune-navigation.css',PORTAL_CSS+CONTEXT_CSS+BUTTON_CSS+RELEASE_CSS);writeFileSync(clans+'/dune-navigation.js',PORTAL_SCRIPT+CONTEXT_SCRIPT+BUTTON_SCRIPT+RELEASE_SCRIPT);}
|
||||
if(existsSync(clans+'/index.html')){writeFileSync(clans+'/dune-navigation.css',navigationCSS+CONTEXT_CSS+BUTTON_CSS+RELEASE_CSS);writeFileSync(clans+'/dune-navigation.js',navigationJS+CONTEXT_SCRIPT+BUTTON_SCRIPT+RELEASE_SCRIPT);}
|
||||
|
||||
// Persistent shared nginx aliases read these exact files on every site.
|
||||
const chrome='/var/lib/dunerealms-public-rates';
|
||||
|
|
|
|||
|
|
@ -133,3 +133,14 @@ header.dune-site-header nav[aria-label="Main navigation"] a,header.dune-site-hea
|
|||
|
||||
/* Central click/tap dropdown navigation. */
|
||||
header nav[aria-label="Main navigation"]{gap:14px!important}header nav[aria-label="Main navigation"]>a,header nav[aria-label="Main navigation"] summary{font:600 15px/1.3 system-ui,sans-serif!important;min-height:58px;padding:8px 10px!important;display:flex;align-items:center;gap:8px;color:#edddbc;cursor:pointer;box-sizing:border-box}header nav[aria-label="Main navigation"]>a>img,header nav[aria-label="Main navigation"] summary>img{width:42px!important;height:42px!important;object-fit:contain}header nav[aria-label="Main navigation"] .dune-menu-group{position:relative}header nav[aria-label="Main navigation"] summary{list-style:none;border:1px solid transparent;border-radius:8px}header nav[aria-label="Main navigation"] summary::-webkit-details-marker{display:none}header nav[aria-label="Main navigation"] summary:after{content:'▾';font-size:11px;color:#d1ad61}header nav[aria-label="Main navigation"] details[open]>summary,header nav[aria-label="Main navigation"] summary:hover{background:#254639;border-color:#b89a55}header nav[aria-label="Main navigation"] .dune-menu-dropdown{position:absolute;z-index:300;top:calc(100% + 8px);left:0;min-width:250px;padding:9px;background:linear-gradient(140deg,#213e31,#0c241c);border:1px solid #bb9d55;border-radius:10px;box-shadow:0 15px 35px #0008}header nav[aria-label="Main navigation"] details:last-of-type .dune-menu-dropdown{left:auto;right:0}header nav[aria-label="Main navigation"] .dune-menu-dropdown a{display:flex;align-items:center;gap:12px;padding:9px 12px;min-height:48px;color:#edddbc;text-decoration:none;white-space:nowrap;font:500 14px/1.3 system-ui;border-radius:6px}header nav[aria-label="Main navigation"] .dune-menu-dropdown img{width:36px;height:36px;object-fit:contain}header nav[aria-label="Main navigation"] .dune-menu-dropdown a:hover,header nav[aria-label="Main navigation"] .dune-menu-dropdown a:focus-visible{background:#42604b;color:#ffe4a4}header nav[aria-label="Main navigation"] summary:focus-visible{outline:2px solid #e9c573;outline-offset:3px}@media(max-width:1240px){header nav[aria-label="Main navigation"] .dune-menu-group{min-width:0}header nav[aria-label="Main navigation"] .dune-menu-dropdown{position:static;min-width:0;margin-top:5px}header nav[aria-label="Main navigation"] .dune-menu-dropdown a{white-space:normal}header nav[aria-label="Main navigation"] summary{font-size:16px!important}header nav[aria-label="Main navigation"]>a{justify-content:flex-start}}
|
||||
|
||||
/* Canonical chrome stays above portal cards and native application surfaces. */
|
||||
header.dune-site-header{position:relative!important;z-index:1000!important;isolation:isolate;overflow:visible!important}
|
||||
header.dune-site-header nav[aria-label="Main navigation"]{position:relative!important;z-index:10;overflow:visible!important}
|
||||
header.dune-site-header nav[aria-label="Main navigation"]>.dune-menu-group{display:block;float:none;margin:0;min-width:0}
|
||||
header.dune-site-header nav[aria-label="Main navigation"] .dune-menu-group:not([open])>.dune-menu-dropdown{display:none!important}
|
||||
header.dune-site-header nav[aria-label="Main navigation"] .dune-menu-group[open]{z-index:20}
|
||||
header.dune-site-header nav[aria-label="Main navigation"] .dune-menu-dropdown{box-sizing:border-box;max-width:calc(100vw - 24px)}
|
||||
|
||||
/* Reserve the dedication's height so it never covers Home or another menu. */
|
||||
@media(min-width:1101px){header.dune-site-header:has(>.dune-memorial)>.wordmark{min-height:240px;display:flex;flex-direction:column;align-items:center;justify-content:center}}
|
||||
|
|
|
|||
Loading…
Reference in a new issue

Staff