Remove seasonal styles and selectors, migrate retired browser preferences, and retain the original purple/green options and dark-mode controls. Preserve VIP and other theme features. Authorized for the independent FUC-XB test instance only.
16 lines
763 B
JavaScript
16 lines
763 B
JavaScript
// Original FUC user palettes. Public landing styles remain independent.
|
|
export const palettes=Object.freeze({purple:{label:'紫色'},cyan:{label:'绿色'}});
|
|
const retired=new Set(['spring','summer','autumn','winter']);
|
|
export function getPalette(storage=localStorage){
|
|
const id=storage.getItem('fuc_themeLight');
|
|
return id==='cyan'||id==='spring'?'cyan':'purple';
|
|
}
|
|
export function applyPalette(doc=document,storage=localStorage){
|
|
const id=getPalette(storage),root=doc.documentElement;
|
|
if(retired.has(storage.getItem('fuc_themeLight')))storage.setItem('fuc_themeLight',id);
|
|
delete root.dataset.fucPalette;
|
|
delete root.dataset.fucSeason;
|
|
for(const key of Array.from(root.style))if(key.startsWith('--season-'))root.style.removeProperty(key);
|
|
return id;
|
|
}
|