From ef224f132636c1c7aa2a67eec78c2d5ccd2f2d76 Mon Sep 17 00:00:00 2001 From: li-chx Date: Mon, 17 Nov 2025 11:50:44 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E9=83=A8=E5=88=86=E4=BE=9D=E8=B5=96?= =?UTF-8?q?=E4=BC=98=E5=8C=96=20Cloudflare=E6=9E=84=E5=BB=BA=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- configs/breakpoints.ts | 1 - package.json | 11 ++++++++++- tailwind.config.js | 37 ------------------------------------- utils/ColorHelper.ts | 22 ++++++++++++++-------- 4 files changed, 24 insertions(+), 47 deletions(-) delete mode 100644 tailwind.config.js diff --git a/configs/breakpoints.ts b/configs/breakpoints.ts index 9f61374..a4be9ce 100644 --- a/configs/breakpoints.ts +++ b/configs/breakpoints.ts @@ -4,6 +4,5 @@ const breakpoints = { 'lg': '1024px', 'xl': '1280px', '2xl': '1536px', - 'hidden-logo': '1736px', }; export default breakpoints; diff --git a/package.json b/package.json index 4a197b6..61c9343 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "vue-router": "^4.5.1", "word-count": "^0.3.1" }, - "packageManager": "pnpm@10.18.0", + "packageManager": "pnpm@10.22.0", "devDependencies": { "@iconify-json/clarity": "^1.2.4", "@iconify-json/codicon": "^1.2.32", @@ -50,5 +50,14 @@ "overlayscrollbars": "^2.12.0", "typescript-eslint": "^8.44.1", "vue-eslint-parser": "^10.2.0" + }, + "pnpm": { + "onlyBuiltDependencies": [ + "@parcel/watcher", + "better-sqlite3", + "esbuild", + "unrs-resolver", + "vue-demi" + ] } } diff --git a/tailwind.config.js b/tailwind.config.js deleted file mode 100644 index f48de1e..0000000 --- a/tailwind.config.js +++ /dev/null @@ -1,37 +0,0 @@ -// tailwind config file -import plugin from 'tailwindcss/plugin'; -import tailwindScrollbar from 'tailwind-scrollbar'; -import breakpoints from '~/configs/breakpoints'; - -export default { - mode: 'jit', - darkMode: 'class', - theme: { - screens: breakpoints, - }, - plugins: [ - plugin(function ({ addUtilities }) { - addUtilities({ - '.scrollbar-hide': { - /* IE and Edge */ - '-ms-overflow-style': 'none', - - /* Firefox */ - 'scrollbar-width': 'none', - - /* Safari and Chrome */ - '&::-webkit-scrollbar': { - display: 'none', - }, - }, - }); - }), - tailwindScrollbar, - ], - content: [ - './app.vue', - './components/**/*.{vue,js,ts}', - './layouts/**/*.vue', - './pages/**/*.vue', - ], -}; diff --git a/utils/ColorHelper.ts b/utils/ColorHelper.ts index 39da277..3eeea76 100644 --- a/utils/ColorHelper.ts +++ b/utils/ColorHelper.ts @@ -4,6 +4,9 @@ export function rgbToHsl(rgb: number[]) { throw new Error('Input must be an array of three numbers representing RGB values.'); } let [r, g, b] = rgb; + r = r!; + b = b!; + g = g!; r /= 255; g /= 255; b /= 255; @@ -36,6 +39,9 @@ export function hslToRgb(hsl: number[]) { throw new Error('Input must be an array of three numbers representing HSL values.'); } let [h, s, l] = hsl; + h = h!; + s = s!; + l = l!; h /= 360; s /= 100; l /= 100; @@ -65,16 +71,16 @@ export function toRGBArray(color: string): number[] { // 处理 rgb/rgba const rgbMatch = color.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*[\d.]+)?\)/); if (rgbMatch) { - return [parseInt(rgbMatch[1]), parseInt(rgbMatch[2]), parseInt(rgbMatch[3])]; + return [parseInt(rgbMatch[1]!), parseInt(rgbMatch[2]!), parseInt(rgbMatch[3]!)]; } // 处理 #fff 或 #ffffff const hexMatch = color.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/); if (hexMatch) { let hex = hexMatch[1]; - if (hex.length === 3) { - hex = hex.split('').map((x) => x + x).join(''); + if (hex!.length === 3) { + hex = hex!.split('').map((x) => x + x).join(''); } - const num = parseInt(hex, 16); + const num = parseInt(hex!, 16); return [ (num >> 16) & 255, (num >> 8) & 255, @@ -97,14 +103,14 @@ export function toHexString(rgb: number[]): string { export function toLightColor(rgb: number[]): number[] { const hsl = rgbToHsl(rgb); - if (hsl[2] < 50) - hsl[2] = hsl[2] / 5 + 50; // 增加亮度 + if (hsl[2]! < 50) + hsl[2] = hsl[2]! / 5 + 50; // 增加亮度 return hslToRgb(hsl); } export function toDarkColor(rgb: number[]): number[] { const hsl = rgbToHsl(rgb); - if (hsl[2] > 50) - hsl[2] = 50 - (hsl[2] - 50) / 5; // 减少亮度 + if (hsl[2]! > 50) + hsl[2] = 50 - (hsl[2]! - 50) / 5; // 减少亮度 return hslToRgb(hsl); }