nomadro/src/modules/social/lib/skin.ts
Eric d38bf6c475 Polish /social home UX with glass panels, compact roster, and motion FX.
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>
2026-11-01 17:06:53 +08:00

33 lines
839 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/** 游民社区视觉主题: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);
}