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
+55
View File
@@ -0,0 +1,55 @@
import { type ExtractPropTypes } from 'vue';
export declare const countDownProps: {
time: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
format: {
type: import("vue").PropType<string>;
default: string;
};
autoStart: {
type: BooleanConstructor;
default: true;
};
millisecond: BooleanConstructor;
};
export type CountDownProps = ExtractPropTypes<typeof countDownProps>;
declare const _default: import("vue").DefineComponent<{
time: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
format: {
type: import("vue").PropType<string>;
default: string;
};
autoStart: {
type: BooleanConstructor;
default: true;
};
millisecond: BooleanConstructor;
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "finish")[], "change" | "finish", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
time: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
format: {
type: import("vue").PropType<string>;
default: string;
};
autoStart: {
type: BooleanConstructor;
default: true;
};
millisecond: BooleanConstructor;
}>> & {
onChange?: ((...args: any[]) => any) | undefined;
onFinish?: ((...args: any[]) => any) | undefined;
}, {
time: string | number;
format: string;
autoStart: boolean;
millisecond: boolean;
}>;
export default _default;
+57
View File
@@ -0,0 +1,57 @@
import { createVNode as _createVNode } from "vue";
import { watch, computed, defineComponent } from "vue";
import { truthProp, makeStringProp, makeNumericProp, createNamespace } from "../utils/index.mjs";
import { parseFormat } from "./utils.mjs";
import { useCountDown } from "@vant/use";
import { useExpose } from "../composables/use-expose.mjs";
const [name, bem] = createNamespace("count-down");
const countDownProps = {
time: makeNumericProp(0),
format: makeStringProp("HH:mm:ss"),
autoStart: truthProp,
millisecond: Boolean
};
var stdin_default = defineComponent({
name,
props: countDownProps,
emits: ["change", "finish"],
setup(props, {
emit,
slots
}) {
const {
start,
pause,
reset,
current
} = useCountDown({
time: +props.time,
millisecond: props.millisecond,
onChange: (current2) => emit("change", current2),
onFinish: () => emit("finish")
});
const timeText = computed(() => parseFormat(props.format, current.value));
const resetTime = () => {
reset(+props.time);
if (props.autoStart) {
start();
}
};
watch(() => props.time, resetTime, {
immediate: true
});
useExpose({
start,
pause,
reset: resetTime
});
return () => _createVNode("div", {
"role": "timer",
"class": bem()
}, [slots.default ? slots.default(current.value) : timeText.value]);
}
});
export {
countDownProps,
stdin_default as default
};
+1
View File
@@ -0,0 +1 @@
:root{--van-count-down-text-color: var(--van-text-color);--van-count-down-font-size: var(--van-font-size-md);--van-count-down-line-height: var(--van-line-height-md)}.van-count-down{color:var(--van-count-down-text-color);font-size:var(--van-count-down-font-size);line-height:var(--van-count-down-line-height)}
+46
View File
@@ -0,0 +1,46 @@
export declare const CountDown: import("../utils").WithInstall<import("vue").DefineComponent<{
time: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
format: {
type: import("vue").PropType<string>;
default: string;
};
autoStart: {
type: BooleanConstructor;
default: true;
};
millisecond: BooleanConstructor;
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "finish")[], "change" | "finish", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
time: {
type: (NumberConstructor | StringConstructor)[];
default: number;
};
format: {
type: import("vue").PropType<string>;
default: string;
};
autoStart: {
type: BooleanConstructor;
default: true;
};
millisecond: BooleanConstructor;
}>> & {
onChange?: ((...args: any[]) => any) | undefined;
onFinish?: ((...args: any[]) => any) | undefined;
}, {
time: string | number;
format: string;
autoStart: boolean;
millisecond: boolean;
}>>;
export default CountDown;
export { countDownProps } from './CountDown';
export type { CountDownProps } from './CountDown';
export type { CountDownInstance, CountDownThemeVars, CountDownCurrentTime, } from './types';
declare module 'vue' {
interface GlobalComponents {
VanCountDown: typeof CountDown;
}
}
+10
View File
@@ -0,0 +1,10 @@
import { withInstall } from "../utils/index.mjs";
import _CountDown from "./CountDown.mjs";
const CountDown = withInstall(_CountDown);
var stdin_default = CountDown;
import { countDownProps } from "./CountDown.mjs";
export {
CountDown,
countDownProps,
stdin_default as default
};
+1
View File
@@ -0,0 +1 @@
export {};
+2
View File
@@ -0,0 +1,2 @@
import "../../style/base.css";
import "../index.css";
+16
View File
@@ -0,0 +1,16 @@
import type { ComponentPublicInstance } from 'vue';
import type { CurrentTime } from '@vant/use';
import type { CountDownProps } from './CountDown';
type CountDownExpose = {
start: () => void;
pause: () => void;
reset: () => void;
};
export type CountDownInstance = ComponentPublicInstance<CountDownProps, CountDownExpose>;
export type CountDownCurrentTime = CurrentTime;
export type CountDownThemeVars = {
countDownTextColor?: string;
countDownFontSize?: string;
countDownLineHeight?: number | string;
};
export {};
View File
+2
View File
@@ -0,0 +1,2 @@
import { CurrentTime } from '@vant/use';
export declare function parseFormat(format: string, currentTime: CurrentTime): string;
+39
View File
@@ -0,0 +1,39 @@
import { padZero } from "../utils/index.mjs";
function parseFormat(format, currentTime) {
const { days } = currentTime;
let { hours, minutes, seconds, milliseconds } = currentTime;
if (format.includes("DD")) {
format = format.replace("DD", padZero(days));
} else {
hours += days * 24;
}
if (format.includes("HH")) {
format = format.replace("HH", padZero(hours));
} else {
minutes += hours * 60;
}
if (format.includes("mm")) {
format = format.replace("mm", padZero(minutes));
} else {
seconds += minutes * 60;
}
if (format.includes("ss")) {
format = format.replace("ss", padZero(seconds));
} else {
milliseconds += seconds * 1e3;
}
if (format.includes("S")) {
const ms = padZero(milliseconds, 3);
if (format.includes("SSS")) {
format = format.replace("SSS", ms);
} else if (format.includes("SS")) {
format = format.replace("SS", ms.slice(0, 2));
} else {
format = format.replace("S", ms.charAt(0));
}
}
return format;
}
export {
parseFormat
};