Initial commit: GamePortrait 竖屏版 - 深色豪华主题

This commit is contained in:
li
2026-01-16 17:47:53 +08:00
commit 40976e4b45
26611 changed files with 2843638 additions and 0 deletions
+70
View File
@@ -0,0 +1,70 @@
import { createVNode as _createVNode } from "vue";
import { watch, provide, computed, watchEffect, onActivated, onDeactivated, onBeforeUnmount, defineComponent } from "vue";
import { extend, inBrowser, kebabCase, makeStringProp, createNamespace } from "../utils/index.mjs";
import { setGlobalZIndex } from "../composables/use-global-z-index.mjs";
const [name, bem] = createNamespace("config-provider");
const CONFIG_PROVIDER_KEY = Symbol(name);
const configProviderProps = {
tag: makeStringProp("div"),
theme: makeStringProp("light"),
zIndex: Number,
themeVars: Object,
themeVarsDark: Object,
themeVarsLight: Object,
iconPrefix: String
};
function mapThemeVarsToCSSVars(themeVars) {
const cssVars = {};
Object.keys(themeVars).forEach((key) => {
cssVars[`--van-${kebabCase(key)}`] = themeVars[key];
});
return cssVars;
}
var stdin_default = defineComponent({
name,
props: configProviderProps,
setup(props, {
slots
}) {
const style = computed(() => mapThemeVarsToCSSVars(extend({}, props.themeVars, props.theme === "dark" ? props.themeVarsDark : props.themeVarsLight)));
if (inBrowser) {
const addTheme = () => {
document.documentElement.classList.add(`van-theme-${props.theme}`);
};
const removeTheme = (theme = props.theme) => {
document.documentElement.classList.remove(`van-theme-${theme}`);
};
watch(() => props.theme, (newVal, oldVal) => {
if (oldVal) {
removeTheme(oldVal);
}
addTheme();
}, {
immediate: true
});
onActivated(addTheme);
onDeactivated(removeTheme);
onBeforeUnmount(removeTheme);
}
provide(CONFIG_PROVIDER_KEY, props);
watchEffect(() => {
if (props.zIndex !== void 0) {
setGlobalZIndex(props.zIndex);
}
});
return () => _createVNode(props.tag, {
"class": bem(),
"style": style.value
}, {
default: () => {
var _a;
return [(_a = slots.default) == null ? void 0 : _a.call(slots)];
}
});
}
});
export {
CONFIG_PROVIDER_KEY,
configProviderProps,
stdin_default as default
};