From 0e5a91de24e3725baefc0f4e76b860ff48de51d8 Mon Sep 17 00:00:00 2001 From: Davide Date: Sat, 18 Jan 2025 00:37:06 +0100 Subject: [PATCH] fix tailwind merge and & tos links and lists colors --- apps/desktop/packages/mainWindow/index.html | 35 ++++++++++++++---- apps/website/astro.config.mjs | 40 ++++++++++----------- apps/website/src/styles/global.css | 3 +- apps/website/tailwind.config.cjs | 26 +++++++------- packages/config/src/appVersion.ts | 24 ++++++------- packages/config/src/index.ts | 4 +-- packages/config/src/unocss.config.ts | 18 ++-------- packages/config/src/unocss.icons.ts | 2 +- packages/config/src/unocss.theme.ts | 36 +++++-------------- packages/ui/package.json | 2 +- packages/ui/src/DropdownMenu/index.tsx | 4 +-- packages/ui/src/Menu/index.tsx | 4 +-- packages/ui/src/style.css | 37 ++++--------------- pnpm-lock.yaml | 29 ++++++++------- 14 files changed, 117 insertions(+), 147 deletions(-) diff --git a/apps/desktop/packages/mainWindow/index.html b/apps/desktop/packages/mainWindow/index.html index 0a97675ab..c133f8091 100644 --- a/apps/desktop/packages/mainWindow/index.html +++ b/apps/desktop/packages/mainWindow/index.html @@ -120,12 +120,6 @@ font-family: var(--font); } - html, - body { - background: rgb(var(--darkSlate-800)); - color: white; - } - img { -webkit-user-drag: none; } @@ -155,6 +149,35 @@ cursor: text !important; } + .instance-tile-spinning { + background-image: linear-gradient(to right, transparent, transparent), + conic-gradient( + from var(--instance-tile-angle), + rgb(var(--primary)) 0deg 90deg, + transparent 90deg 180deg, + transparent 180deg 270deg, + transparent 270deg 360deg + ); + background-origin: border-box; + background-clip: padding-box, border-box; + } + + @keyframes rotate { + to { + --instance-tile-angle: 360deg; + } + } + + .instance-tile-spinning { + animation: rotate 4s linear infinite; + } + + @property --instance-tile-angle { + syntax: ""; + initial-value: 0deg; + inherits: false; + } + .appFatalCrash { position: fixed; top: 0; diff --git a/apps/website/astro.config.mjs b/apps/website/astro.config.mjs index 9559cb642..effd523b7 100644 --- a/apps/website/astro.config.mjs +++ b/apps/website/astro.config.mjs @@ -1,30 +1,30 @@ -import { defineConfig } from "astro/config"; -import mdx from "@astrojs/mdx"; -import tailwind from "@astrojs/tailwind"; -import sitemap from "@astrojs/sitemap"; -import cloudflare from "@astrojs/cloudflare"; -import solidJs from "@astrojs/solid-js"; +import { defineConfig } from "astro/config" +import mdx from "@astrojs/mdx" +import tailwind from "@astrojs/tailwind" +import sitemap from "@astrojs/sitemap" +import cloudflare from "@astrojs/cloudflare" +import solidJs from "@astrojs/solid-js" -import yaml from "js-yaml"; +import yaml from "js-yaml" const response = await Promise.all([ fetch("https://cdn-raw.gdl.gg/launcher/latest.yml"), fetch("https://cdn-raw.gdl.gg/launcher/latest-mac.yml"), - fetch("https://cdn-raw.gdl.gg/launcher/latest-linux.yml"), -]); -const yamlfiles = await Promise.all(response.map((val) => val.text())); + fetch("https://cdn-raw.gdl.gg/launcher/latest-linux.yml") +]) +const yamlfiles = await Promise.all(response.map((val) => val.text())) const downloadLinks = yamlfiles .map((val) => yaml.load(val)) .map( (val) => - `https://cdn-raw.gdl.gg/launcher/${val.path.includes("zip") ? val.path.replace("zip", "dmg") : val.path}`, - ); + `https://cdn-raw.gdl.gg/launcher/${val.path.includes("zip") ? val.path.replace("zip", "dmg") : val.path}` + ) const excludedPages = [ "user-account-confirmed/", "user-deletion-confirmed/", - "newsletter/confirm/", -]; + "newsletter/confirm/" +] // https://astro.build/config export default defineConfig({ @@ -37,14 +37,14 @@ export default defineConfig({ sitemap({ filter: (page) => !excludedPages.find( - (excludedPage) => `https://gdlauncher.com/${excludedPage}` === page, - ), + (excludedPage) => `https://gdlauncher.com/${excludedPage}` === page + ) }), - solidJs(), + solidJs() ], redirects: { "/download/windows": downloadLinks[0], "/download/mac": downloadLinks[1], - "/download/linux": downloadLinks[2], - }, -}); + "/download/linux": downloadLinks[2] + } +}) diff --git a/apps/website/src/styles/global.css b/apps/website/src/styles/global.css index c5b862d2e..e333b21f2 100644 --- a/apps/website/src/styles/global.css +++ b/apps/website/src/styles/global.css @@ -70,7 +70,8 @@ h2, h3, h4, h5, -h6 { +h6, +li { overflow-wrap: break-word; margin-bottom: 20px; color: white; diff --git a/apps/website/tailwind.config.cjs b/apps/website/tailwind.config.cjs index 9d2b04df1..e432711ba 100644 --- a/apps/website/tailwind.config.cjs +++ b/apps/website/tailwind.config.cjs @@ -10,34 +10,34 @@ module.exports = { bluegd: { 400: "rgba(62, 134, 208, 1)", 500: "rgba(40, 101, 164, 1)", - 600: "rgba(35, 62, 94, 1)", - }, + 600: "rgba(35, 62, 94, 1)" + } }, boxShadow: { - mdgd: "0px 0px 12px 0px rgba(40, 101, 164, 1)", + mdgd: "0px 0px 12px 0px rgba(40, 101, 164, 1)" }, padding: { - mdgd: "24px", + mdgd: "24px" }, borderRadius: { xssgd: "8px", xsgd: "12px", - smgd: "34px", + smgd: "34px" }, fontSize: { smgd: "1.25rem", - mdgd: "3.125rem", + mdgd: "3.125rem" }, keyframes: { fadeIn: { "0%": { opacity: "0" }, - "100%": { opacity: "1" }, - }, + "100%": { opacity: "1" } + } }, animation: { - fadeIn: "fadeIn 0.2s ease-in-out", - }, - }, + fadeIn: "fadeIn 0.2s ease-in-out" + } + } }, - plugins: [], -}; + plugins: [] +} diff --git a/packages/config/src/appVersion.ts b/packages/config/src/appVersion.ts index ba07e4c8f..1ffbdede1 100644 --- a/packages/config/src/appVersion.ts +++ b/packages/config/src/appVersion.ts @@ -1,20 +1,20 @@ -import fs from "fs"; -import path from "path"; -import { execSync } from "child_process"; -import { dirname } from "path"; -import { fileURLToPath } from "url"; +import fs from "fs" +import path from "path" +import { execSync } from "child_process" +import { dirname } from "path" +import { fileURLToPath } from "url" -const __dirname = dirname(fileURLToPath(import.meta.url)); +const __dirname = dirname(fileURLToPath(import.meta.url)) -const gitCommitDate = execSync("git log -1 --format=%ct").toString().trim(); +const gitCommitDate = execSync("git log -1 --format=%ct").toString().trim() const VERSION_JSON = JSON.parse( - fs.readFileSync(path.resolve(__dirname, "../", "version.json")).toString(), -); + fs.readFileSync(path.resolve(__dirname, "../", "version.json")).toString() +) const channel = VERSION_JSON.channel ? "-" + VERSION_JSON.channel + "." + gitCommitDate - : ""; + : "" -const version = VERSION_JSON.version; +const version = VERSION_JSON.version -export const COMPLETE_VERSION = `${version}${channel}`; +export const COMPLETE_VERSION = `${version}${channel}` diff --git a/packages/config/src/index.ts b/packages/config/src/index.ts index 1cc2dd446..b382fa592 100644 --- a/packages/config/src/index.ts +++ b/packages/config/src/index.ts @@ -1,2 +1,2 @@ -export { unocssConfig } from "./unocss.config.js"; -export { COMPLETE_VERSION as appVersion } from "./appVersion.js"; +export { unocssConfig } from "./unocss.config.js" +export { COMPLETE_VERSION as appVersion } from "./appVersion.js" diff --git a/packages/config/src/unocss.config.ts b/packages/config/src/unocss.config.ts index 677931d1e..8ba574ce8 100644 --- a/packages/config/src/unocss.config.ts +++ b/packages/config/src/unocss.config.ts @@ -1,17 +1,9 @@ import presetIcons from "@unocss/preset-icons" import presetWind from "@unocss/preset-wind" -import { presetAttributify } from "unocss" import { theme } from "./unocss.theme.js" -// import { presetScrollbarHide } from "unocss-preset-scrollbar-hide" -// eslint-disable-next-line @typescript-eslint/ban-ts-comment -// @ts-ignore import { supportedLanguages } from "@gd/i18n" -// import gdlIcons from "./unocss.icons.js"; -import transformerDirectives from "@unocss/transformer-directives" const safelist = Object.values(supportedLanguages).map( - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore (lang) => `i-emojione-v1:flag-for-${lang}` ) @@ -23,21 +15,15 @@ const unocssConfig = { ] } }, - presets: [ - presetAttributify(), - presetWind(), - // presetScrollbarHide(), - presetIcons() - ], + presets: [presetWind(), presetIcons()], rules: [], - // rules: [["scrollbar-gutter", { "scrollbar-gutter": "stable" }]], safelist: [ ...safelist, ...Object.keys(theme.colors).map((v) => `bg-${v}-500`), ...Object.keys(theme.colors).map((v) => `hover:bg-${v}-700`) ], theme, - transformers: [transformerDirectives()] + transformers: [] } as unknown export { unocssConfig } diff --git a/packages/config/src/unocss.icons.ts b/packages/config/src/unocss.icons.ts index ff8b4c563..b1c6ea436 100644 --- a/packages/config/src/unocss.icons.ts +++ b/packages/config/src/unocss.icons.ts @@ -1 +1 @@ -export default {}; +export default {} diff --git a/packages/config/src/unocss.theme.ts b/packages/config/src/unocss.theme.ts index 1bcd684bc..a52230d93 100644 --- a/packages/config/src/unocss.theme.ts +++ b/packages/config/src/unocss.theme.ts @@ -3,33 +3,15 @@ type shade = 50 | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 type Theme = { // Colors accent: string - darkSlate: { - [key in shade]: string - } - lightSlate: { - [key in shade]: string - } - lightGray: { - [key in shade]: string - } - darkGray: { - [key in shade]: string - } - primary: { - [key in shade]: string - } - red: { - [key in shade]: string - } - yellow: { - [key in shade]: string - } - green: { - [key in shade]: string - } - brands: { - [key: string]: string - } + darkSlate: Record + lightSlate: Record + lightGray: Record + darkGray: Record + primary: Record + red: Record + yellow: Record + green: Record + brands: Record } const theme = { diff --git a/packages/ui/package.json b/packages/ui/package.json index afb6ac383..43bd17086 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -40,7 +40,7 @@ "storybook": "^7.0.22", "storybook-solidjs": "^1.0.0-beta.2", "storybook-solidjs-vite": "^1.0.0-beta.2", - "tailwind-merge": "^2.2.0", + "tailwind-merge": "^2.6.0", "tailwindcss-animate": "^1.0.7", "unocss": "^0.65.1", "vite": "^6.0.3", diff --git a/packages/ui/src/DropdownMenu/index.tsx b/packages/ui/src/DropdownMenu/index.tsx index 3fb2ce4ab..24735d73e 100644 --- a/packages/ui/src/DropdownMenu/index.tsx +++ b/packages/ui/src/DropdownMenu/index.tsx @@ -4,9 +4,7 @@ import { splitProps } from "solid-js" import * as DropdownMenuPrimitive from "@kobalte/core/dropdown-menu" import type { PolymorphicProps } from "@kobalte/core/polymorphic" -// import { cn } from "../util" - -const cn = (...args: any[]) => args.join(" ") +import { cn } from "../util" const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger const DropdownMenuPortal = DropdownMenuPrimitive.Portal diff --git a/packages/ui/src/Menu/index.tsx b/packages/ui/src/Menu/index.tsx index 9585788af..f30dd9a01 100644 --- a/packages/ui/src/Menu/index.tsx +++ b/packages/ui/src/Menu/index.tsx @@ -4,9 +4,7 @@ import { splitProps } from "solid-js" import * as ContextMenuPrimitive from "@kobalte/core/context-menu" import type { PolymorphicProps } from "@kobalte/core/polymorphic" -// import { cn } from "../util" - -const cn = (...args: any[]) => args.join(" ") +import { cn } from "../util" const ContextMenuTrigger = ContextMenuPrimitive.Trigger const ContextMenuPortal = ContextMenuPrimitive.Portal diff --git a/packages/ui/src/style.css b/packages/ui/src/style.css index 1d173b416..d11182137 100644 --- a/packages/ui/src/style.css +++ b/packages/ui/src/style.css @@ -19,6 +19,12 @@ background-color: rgb(var(--lightGray-900)); } +html, +body { + background: rgb(var(--darkSlate-800)); + color: white; +} + .potato-pc *, .potato-pc *::before, .potato-pc *::after { @@ -28,7 +34,7 @@ } a { - color: theme("colors.blue.500"); + color: rgb(var(--primary-500)); } @keyframes spin { @@ -57,32 +63,3 @@ a { opacity: 0; } } - -.instance-tile-spinning { - background-image: linear-gradient(to right, transparent, transparent), - conic-gradient( - from var(--instance-tile-angle), - rgb(var(--primary)) 0deg 90deg, - transparent 90deg 180deg, - transparent 180deg 270deg, - transparent 270deg 360deg - ); - background-origin: border-box; - background-clip: padding-box, border-box; -} - -@keyframes rotate { - to { - --instance-tile-angle: 360deg; - } -} - -.instance-tile-spinning { - animation: rotate 4s linear infinite; -} - -@property --instance-tile-angle { - syntax: ""; - initial-value: 0deg; - inherits: false; -} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ac3fdc4b2..e816b9cc5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -394,8 +394,8 @@ importers: specifier: ^1.0.0-beta.2 version: 1.0.0-beta.2(storybook@7.6.10(encoding@0.1.13))(vite@6.0.3(@types/node@20.11.6)(jiti@1.21.6)(less@4.2.0)(terser@5.27.0)(tsx@4.19.0)) tailwind-merge: - specifier: ^2.2.0 - version: 2.2.1 + specifier: ^2.6.0 + version: 2.6.0 tailwindcss-animate: specifier: ^1.0.7 version: 1.0.7(tailwindcss@3.4.1) @@ -3523,10 +3523,10 @@ packages: '@storybook/builder-manager@7.6.10': resolution: {integrity: sha512-f+YrjZwohGzvfDtH8BHzqM3xW0p4vjjg9u7uzRorqUiNIAAKHpfNrZ/WvwPlPYmrpAHt4xX/nXRJae4rFSygPw==} - '@storybook/builder-vite@8.5.0-beta.8': - resolution: {integrity: sha512-eFBMcawmDBDzOk9kWqquCttl9yfxYIQU6WQKYZDtfMzylzwWoHhdiHfN7uAUOmgA5RneLknYIu0rTzWoy9wBrw==} + '@storybook/builder-vite@8.6.0-alpha.0': + resolution: {integrity: sha512-31OJfaS6Aj3vFO/0pJE6iz3sDkQU6TB0m6/WfZ+i80Re4OG1pu5GCvP8bqOFuEAQpyc2sFKs6B+wOBvZuuSskg==} peerDependencies: - storybook: ^8.5.0-beta.8 + storybook: ^8.6.0-alpha.0 vite: ^4.0.0 || ^5.0.0 || ^6.0.0 '@storybook/channels@7.6.10': @@ -3560,10 +3560,10 @@ packages: '@storybook/csf-plugin@7.6.10': resolution: {integrity: sha512-Sc+zZg/BnPH2X28tthNaQBnDiFfO0QmfjVoOx0fGYM9SvY3P5ehzWwp5hMRBim6a/twOTzePADtqYL+t6GMqqg==} - '@storybook/csf-plugin@8.5.0-beta.8': - resolution: {integrity: sha512-gpv2SD7Af0GkQuPN8PMw24hXhkRfZnRCPg10ZHAG+fdGfElXwZjxSThioBTULk5tpssZfJ8rIwFnXBOSTrOGxw==} + '@storybook/csf-plugin@8.6.0-alpha.0': + resolution: {integrity: sha512-FkI3YW7ObEAFBQokJ04uPIQnBbnsfUKf08jriZ/nB03dcUNVDkl1GjPHONXJK8IwUKfKsiXRVqmrqJPSkK6xvQ==} peerDependencies: - storybook: ^8.5.0-beta.8 + storybook: ^8.6.0-alpha.0 '@storybook/csf-tools@7.6.10': resolution: {integrity: sha512-TnDNAwIALcN6SA4l00Cb67G02XMOrYU38bIpFJk5VMDX2dvgPjUtJNBuLmEbybGcOt7nPyyFIHzKcY5FCVGoWA==} @@ -8791,6 +8791,9 @@ packages: tailwind-merge@2.2.1: resolution: {integrity: sha512-o+2GTLkthfa5YUt4JxPfzMIpQzZ3adD1vLVkvKE1Twl9UAhGsEbIZhHHZVRttyW177S8PDJI3bTQNaebyofK3Q==} + tailwind-merge@2.6.0: + resolution: {integrity: sha512-P+Vu1qXfzediirmHOC3xKGAYeZtPcV9g76X+xg2FD4tYgR71ewMA35Y3sCz3zhiN/dwefRpJX0yBcgwi1fXNQA==} + tailwindcss-animate@1.0.7: resolution: {integrity: sha512-bl6mpH3T7I3UFxuvDEXLxy/VuFxBk5bbzplh7tXI68mwMokNYd1t9qPBHlnyTwfa4JGC4zP516I1hYYtQ/vspA==} peerDependencies: @@ -13869,9 +13872,9 @@ snapshots: - encoding - supports-color - '@storybook/builder-vite@8.5.0-beta.8(storybook@7.6.10(encoding@0.1.13))(vite@6.0.3(@types/node@20.11.6)(jiti@1.21.6)(less@4.2.0)(terser@5.27.0)(tsx@4.19.0))': + '@storybook/builder-vite@8.6.0-alpha.0(storybook@7.6.10(encoding@0.1.13))(vite@6.0.3(@types/node@20.11.6)(jiti@1.21.6)(less@4.2.0)(terser@5.27.0)(tsx@4.19.0))': dependencies: - '@storybook/csf-plugin': 8.5.0-beta.8(storybook@7.6.10(encoding@0.1.13)) + '@storybook/csf-plugin': 8.6.0-alpha.0(storybook@7.6.10(encoding@0.1.13)) browser-assert: 1.2.1 storybook: 7.6.10(encoding@0.1.13) ts-dedent: 2.2.0 @@ -14064,7 +14067,7 @@ snapshots: transitivePeerDependencies: - supports-color - '@storybook/csf-plugin@8.5.0-beta.8(storybook@7.6.10(encoding@0.1.13))': + '@storybook/csf-plugin@8.6.0-alpha.0(storybook@7.6.10(encoding@0.1.13))': dependencies: storybook: 7.6.10(encoding@0.1.13) unplugin: 1.6.0 @@ -20603,7 +20606,7 @@ snapshots: storybook-solidjs-vite@1.0.0-beta.2(storybook@7.6.10(encoding@0.1.13))(vite@6.0.3(@types/node@20.11.6)(jiti@1.21.6)(less@4.2.0)(terser@5.27.0)(tsx@4.19.0)): dependencies: - '@storybook/builder-vite': 8.5.0-beta.8(storybook@7.6.10(encoding@0.1.13))(vite@6.0.3(@types/node@20.11.6)(jiti@1.21.6)(less@4.2.0)(terser@5.27.0)(tsx@4.19.0)) + '@storybook/builder-vite': 8.6.0-alpha.0(storybook@7.6.10(encoding@0.1.13))(vite@6.0.3(@types/node@20.11.6)(jiti@1.21.6)(less@4.2.0)(terser@5.27.0)(tsx@4.19.0)) transitivePeerDependencies: - storybook - vite @@ -20763,6 +20766,8 @@ snapshots: dependencies: '@babel/runtime': 7.23.8 + tailwind-merge@2.6.0: {} + tailwindcss-animate@1.0.7(tailwindcss@3.4.1): dependencies: tailwindcss: 3.4.1