Keep community-aligned layout without photo big-cards; add particles, emoji belts, and SVG sparks while hardening SiteShell mobile nav and join modal. Co-authored-by: Cursor <cursoragent@cursor.com>
33 lines
839 B
TypeScript
33 lines
839 B
TypeScript
/** 游民社区视觉主题:1=现网社区对齐,2=独立自定义 */
|
||
|
||
export type SocialSkin = "1" | "2";
|
||
|
||
export const SOCIAL_SKIN_KEY = "nomadro-social-skin";
|
||
export const SOCIAL_SKIN_DEFAULT: SocialSkin = "1";
|
||
|
||
export function readSocialSkin(): SocialSkin {
|
||
if (typeof window === "undefined") return SOCIAL_SKIN_DEFAULT;
|
||
try {
|
||
const v = localStorage.getItem(SOCIAL_SKIN_KEY);
|
||
if (v === "1" || v === "2") return v;
|
||
} catch {
|
||
/* ignore */
|
||
}
|
||
return SOCIAL_SKIN_DEFAULT;
|
||
}
|
||
|
||
export function writeSocialSkin(skin: SocialSkin) {
|
||
try {
|
||
localStorage.setItem(SOCIAL_SKIN_KEY, skin);
|
||
} catch {
|
||
/* ignore */
|
||
}
|
||
if (typeof document !== "undefined") {
|
||
document.documentElement.setAttribute("data-social-skin", skin);
|
||
}
|
||
}
|
||
|
||
export function applySocialSkin(skin: SocialSkin) {
|
||
writeSocialSkin(skin);
|
||
}
|