18 Commits

Author SHA1 Message Date
YoyoNow befc69cefc src/content/rules/de/warship.md aktualisiert
SteamWar CI / Build (push) Successful in 1m55s
SteamWar CI / Deploy (push) Successful in 10s
2026-06-10 20:58:59 +02:00
YoyoNow cdc2ae2432 src/content/rules/de/warship.md aktualisiert
SteamWar CI / Build (push) Successful in 1m59s
SteamWar CI / Deploy (push) Successful in 12s
2026-06-10 20:49:51 +02:00
JajaKings 69527cf2e9 Updated miniwargear.md
SteamWar CI / Build (push) Successful in 1m53s
SteamWar CI / Deploy (push) Successful in 11s
2026-06-04 13:18:24 +02:00
JajaKings bca2d6e85e Updated miniwargear.md
SteamWar CI / Build (push) Successful in 1m53s
SteamWar CI / Deploy (push) Successful in 10s
2026-06-03 23:55:49 +02:00
DreamJxnas 53886332f0 Added title numeration
SteamWar CI / Build (push) Successful in 1m53s
SteamWar CI / Deploy (push) Successful in 10s
2026-05-30 22:55:23 +02:00
DreamJxnas 1011ab1245 Added title numeration
SteamWar CI / Build (push) Successful in 1m56s
SteamWar CI / Deploy (push) Successful in 10s
2026-05-30 22:54:17 +02:00
Chaoscaot 167992769e Improve localized page path resolution
SteamWar CI / Build (push) Successful in 1m53s
SteamWar CI / Deploy (push) Successful in 10s
- Resolve page locale from source paths instead of IDs
- Deduplicate localized fallback paths and pass page descriptions to layout
2026-05-24 10:55:25 +02:00
Chaoscaot 413c84e293 Add pointer cursor styling to interactive UI primitives
SteamWar CI / Build (push) Successful in 1m53s
SteamWar CI / Deploy (push) Successful in 10s
- Update buttons, inputs, menus, tabs, sliders, and dialogs to show pointer cursors
- Keep disabled states unchanged
2026-05-19 10:19:23 +02:00
Chaoscaot 4c434f8511 Enhance theme variables in app.css for improved styling consistency
SteamWar CI / Build (push) Successful in 1m47s
SteamWar CI / Deploy (push) Successful in 9s
2026-05-18 23:36:25 +02:00
Chaoscaot 038c2768e6 Update Website
SteamWar CI / Build (push) Successful in 1m55s
SteamWar CI / Deploy (push) Successful in 10s
2026-05-18 23:24:15 +02:00
Chaoscaot a9260b1ca0 Refactor code structure for improved readability and maintainability
SteamWar CI / Build (push) Successful in 1m48s
SteamWar CI / Deploy (push) Successful in 10s
2026-05-15 13:30:24 +02:00
Chaoscaot 9717946784 Merge branch 'master' of https://git.steamwar.de/SteamWar/Website
SteamWar CI / Build (push) Failing after 1m6s
SteamWar CI / Deploy (push) Has been skipped
2026-05-15 13:27:07 +02:00
Chaoscaot 46ad3599e8 Add Gitea CI workflow for build and deploy
- Move CI config into `.gitea/workflows/steamwarci.yml`
- Build with pnpm, sync i18n, and upload `dist/`
- Deploy master pushes to `/var/www/html` over SCP
2026-05-15 13:26:54 +02:00
Chaoscaot e27269ec8b Updated 2026-wgs.md
SteamWarCI Build successful
2026-05-09 14:31:00 +02:00
JajaKings 388492cd21 Updated 2026-wgs.md
SteamWarCI Build successful
2026-05-07 16:32:23 +02:00
Chaoscaot b98f197d14 Make group round grouping configurable
SteamWarCI Build successful
- Add round grouping time and prefix to group view config
- Use the new settings in group display and editor defaults
2026-05-07 16:28:51 +02:00
JajaKings fc53376c73 Updated 2026-wgs.md
SteamWarCI Build successful
2026-05-07 16:17:45 +02:00
JajaKings ae5d232c54 Updated 2026-wgs.md
SteamWarCI Build successful
2026-05-07 16:11:27 +02:00
168 changed files with 8754 additions and 839 deletions
+88
View File
@@ -0,0 +1,88 @@
name: SteamWar CI
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
env:
PUBLIC_API_SERVER: https://api.steamwar.de
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 8.14.0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Write production environment
run: echo "PUBLIC_API_SERVER=${PUBLIC_API_SERVER}" > .env
- name: Compile i18n files
run: pnpm run i18n:compile
- name: Build website
run: pnpm run build
- name: Upload website artifact
uses: actions/upload-artifact@v3
with:
name: steamwar-website
path: dist/
deploy:
name: Deploy
runs-on: ubuntu-latest
needs: build
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
- name: Download website artifact
uses: actions/download-artifact@v3
with:
name: steamwar-website
path: dist
- name: Upload website with scp
shell: bash
env:
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
DEPLOY_USER: ${{ secrets.DEPLOY_USER }}
DEPLOY_PORT: ${{ secrets.DEPLOY_PORT }}
DEPLOY_SSH_KEY: ${{ secrets.DEPLOY_SSH_KEY }}
DEPLOY_PATH: /var/www/html
run: |
set -euo pipefail
: "${DEPLOY_HOST:?Missing DEPLOY_HOST secret}"
: "${DEPLOY_USER:?Missing DEPLOY_USER secret}"
: "${DEPLOY_SSH_KEY:?Missing DEPLOY_SSH_KEY secret}"
port="${DEPLOY_PORT:-22}"
mkdir -p ~/.ssh
chmod 700 ~/.ssh
echo "$DEPLOY_SSH_KEY" > ~/.ssh/deploy_key
chmod 600 ~/.ssh/deploy_key
ssh-keyscan -p "$port" "$DEPLOY_HOST" >> ~/.ssh/known_hosts
ssh -i ~/.ssh/deploy_key -p "$port" "${DEPLOY_USER}@${DEPLOY_HOST}" "mkdir -p '$DEPLOY_PATH' && find '$DEPLOY_PATH' -mindepth 1 -maxdepth 1 -exec rm -rf {} +"
scp -i ~/.ssh/deploy_key -P "$port" -r dist/* "${DEPLOY_USER}@${DEPLOY_HOST}:$DEPLOY_PATH/"
+1 -3
View File
@@ -19,11 +19,9 @@ pnpm-debug.log*
# macOS-specific files
.DS_Store
/.astro-i18n/
/bun.lockb
/src/pages/de/
/src/pages/en/
/steamwar-website.zip
/src/env.d.ts
/src/pages/en/
/.idea
pnpm-lock.yaml
+4 -4
View File
@@ -7,7 +7,7 @@
- [Tailwind CSS](https://tailwindcss.com/)
- [Day.js](https://day.js.org/)
- [Chart.js](https://www.chartjs.org/)
- [astro-i18n](https://github.com/Alexandre-Fernandez/astro-i18n)
- [Paraglide JS](https://inlang.com/m/gerre34r/library-inlang-paraglideJs)
- [Flowbite Svelte](https://flowbite-svelte.com/)
## Building
@@ -28,8 +28,8 @@ pnpm run dev
pnpm run build
```
### i18n-sync
### i18n Compile
```bash
pnpm run i18n:sync
```
pnpm run i18n:compile
```
-40
View File
@@ -1,40 +0,0 @@
import type { AstroIntegration } from "astro";
import { mkdir, access, constants, copyFile, rename } from "node:fs/promises";
const locales = [
"en",
"de",
];
export default function configureI18n(): AstroIntegration {
return {
name: "astro-i18n-renamer",
hooks: {
"astro:build:done": async ({pages, dir, logger, routes}) => {
for (const page of pages) {
const [locale, ...rest] = page.pathname.split("/");
if (locales.includes(locale)) {
const path = rest.join("/");
const oldPath = `${dir.pathname}${page.pathname}`;
const newPath = `${dir.pathname}${path}`;
try {
await access(cutPrefix(newPath), constants.R_OK | constants.W_OK);
} catch (e) {
await mkdir(cutPrefix(newPath), {recursive: true});
}
await copyFile(`${cutPrefix(oldPath)}index.html`, `${cutPrefix(newPath)}index.html.${locale}`);
logger.info(`Copied ${oldPath}index.html to ${newPath}index.html.${locale}`);
} else {
const oldPath = cutPrefix(`${dir.pathname}${page.pathname}`);
await rename(`${oldPath}index.html`, `${oldPath}index.html.de`);
}
}
},
},
};
}
function cutPrefix(path: string): string {
return process.platform === "win32" ? path.substring(1) : path;
}
-27
View File
@@ -1,27 +0,0 @@
import { defineAstroI18nConfig } from "astro-i18n";
export default defineAstroI18nConfig({
primaryLocale: "de",
secondaryLocales: ["en"],
fallbackLocale: "de",
trailingSlash: "never",
run: "client+server",
showPrimaryLocale: false,
translationLoadingRules: [],
translationDirectory: {},
translations: {},
routes: {
en: {
"jetzt-spielen": "join",
impressum: "imprint",
verhaltensrichtlinien: "code-of-conduct",
regeln: "rules",
rangliste: "ranked",
"haeufige-fragen": "faq",
statistiken: "stats",
ankuendigungen: "announcements",
datenschutzerklaerung: "privacy-policy",
"passwort-setzen": "set-password",
},
},
});
+74 -8
View File
@@ -1,8 +1,8 @@
import { defineConfig, sharpImageService } from "astro/config";
import { defineConfig, fontProviders, sharpImageService } from "astro/config";
import svelte from "@astrojs/svelte";
import tailwind from "@astrojs/tailwind";
import configureI18n from "./astro-i18n.adapter";
import tailwindcss from "@tailwindcss/vite";
import sitemap from "@astrojs/sitemap";
import { paraglideVitePlugin } from "@inlang/paraglide-js";
import robotsTxt from "astro-robots-txt";
import path from "node:path";
@@ -12,7 +12,68 @@ import starlight from "@astrojs/starlight";
// https://astro.build/config
export default defineConfig({
fonts: [{
provider: fontProviders.google(),
name: "Roboto",
cssVariable: "--font-roboto",
}, {
provider: fontProviders.local(),
name: "Barlow Condensed",
cssVariable: "--font-barlow-condensed",
options: {
variants: [
{
src: ["./src/assets/fonts/barlow-condensed/barlow-condensed-regular.woff2"],
weight: "400",
style: "normal",
}, {
src: ["./src/assets/fonts/barlow-condensed/barlow-condensed-medium.woff2"],
weight: "500",
style: "normal"
}, {
src: ["./src/assets/fonts/barlow-condensed/barlow-condensed-bold.woff2"],
weight: "700",
style: "normal"
}, {
src: ["./src/assets/fonts/barlow-condensed/barlow-condensed-italic.woff2"],
weight: "400",
style: "italic"
}, {
src: ["./src/assets/fonts/barlow-condensed/barlow-condensed-medium-italic.woff2"],
weight: "500",
style: "italic"
}, {
src: ["./src/assets/fonts/barlow-condensed/barlow-condensed-bold-italic.woff2"],
weight: "700",
style: "italic"
}, {
src: ["./src/assets/fonts/barlow-condensed/barlow-condensed-black.woff2"],
weight: "900",
style: "normal"
}, {
src: ["./src/assets/fonts/barlow-condensed/barlow-condensed-black-italic.woff2"],
weight: "900",
style: "italic"
}, {
src: ["./src/assets/fonts/barlow-condensed/barlow-condensed-light.woff2"],
weight: "300",
style: "normal"
}, {
src: ["./src/assets/fonts/barlow-condensed/barlow-condensed-light-italic.woff2"],
weight: "300",
style: "italic"
}
]
}
}],
output: "static",
i18n: {
defaultLocale: "de",
locales: ["de", "en"],
routing: {
prefixDefaultLocale: false,
},
},
image: {
service: sharpImageService(),
},
@@ -43,13 +104,9 @@ export default defineConfig({
baseUrl: "https://git.steamwar.de/SteamWar/Website/src/branch/master/",
},
}),
tailwind({
configFile: "./tailwind.config.js",
applyBaseStyles: false,
}),
sitemap({
i18n: {
defaultLocale: "en",
defaultLocale: "de",
locales: {
en: "en-US",
de: "de-DE",
@@ -82,6 +139,15 @@ export default defineConfig({
mdx(),
],
vite: {
plugins: [
paraglideVitePlugin({
project: "./project.inlang",
outdir: "./src/paraglide",
strategy: ["url", "globalVariable", "baseLocale"],
emitTsDeclarations: true,
}),
tailwindcss(),
],
resolve: {
alias: {
"@components": path.resolve("./src/components"),
+58 -65
View File
@@ -3,87 +3,80 @@
"type": "module",
"version": "0.0.1",
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro build",
"dev": "pnpm run i18n:generate:pages && astro dev",
"start": "pnpm run dev",
"build": "pnpm run i18n:generate:pages && astro build",
"preview": "astro preview",
"astro": "astro",
"i18n:extract": "astro-i18n extract",
"i18n:generate:pages": "astro-i18n generate:pages --purge",
"i18n:generate:types": "astro-i18n generate:types",
"i18n:sync": "pnpm run i18n:generate:pages && pnpm run i18n:generate:types",
"i18n:generate:pages": "node scripts/generate-en-pages.mjs",
"i18n:compile": "paraglide-js compile --project ./project.inlang --outdir ./src/paraglide --strategy url globalVariable baseLocale --emit-ts-declarations && pnpm run i18n:generate:pages",
"clean:dist": "rm -rf dist",
"clean:node_modules": "rm -rf node_modules",
"ci": "pnpm install && pnpm run i18n:sync && pnpm run build"
"ci": "pnpm install && pnpm run build"
},
"devDependencies": {
"@astrojs/svelte": "^7.1.0",
"@astrojs/tailwind": "^5.1.5",
"@astropub/icons": "^0.2.0",
"@internationalized/date": "^3.8.1",
"@lucide/svelte": "^0.488.0",
"@types/color": "^4.2.0",
"@astrojs/svelte": "^8.1.1",
"@internationalized/date": "^3.12.1",
"@lucide/svelte": "^1.16.0",
"@tailwindcss/vite": "^4.3.0",
"@types/color": "^4.2.1",
"@types/js-yaml": "^4.0.9",
"@types/node": "^22.15.23",
"@types/three": "^0.170.0",
"@typescript-eslint/eslint-plugin": "^8.33.0",
"@typescript-eslint/parser": "^8.33.0",
"autoprefixer": "^10.4.21",
"bits-ui": "1.3.4",
"@types/node": "^25.9.0",
"@types/three": "^0.184.1",
"@typescript-eslint/eslint-plugin": "^8.59.4",
"@typescript-eslint/parser": "^8.59.4",
"autoprefixer": "^10.5.0",
"bits-ui": "2.18.1",
"clsx": "^2.1.1",
"cmdk-sv": "^0.0.18",
"cssnano": "^7.0.7",
"cssnano": "^8.0.1",
"embla-carousel-svelte": "^8.6.0",
"esbuild": "^0.24.2",
"eslint": "^9.27.0",
"eslint-plugin-astro": "^1.3.1",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-svelte": "^2.46.1",
"formsnap": "1.0.1",
"lucide-svelte": "^0.476.0",
"mode-watcher": "^0.5.1",
"paneforge": "^0.0.6",
"postcss-nesting": "^13.0.1",
"sass": "^1.89.0",
"svelte": "^5.33.4",
"svelte-sonner": "^0.3.28",
"tailwind-merge": "^2.6.0",
"tailwind-variants": "^0.3.1",
"tailwindcss": "^3.4.17",
"three": "^0.170.0",
"typescript": "^5.8.3",
"vaul-svelte": "^0.3.2",
"zod": "^3.25.31"
"esbuild": "^0.28.0",
"eslint": "^10.4.0",
"eslint-plugin-astro": "^1.7.0",
"eslint-plugin-svelte": "^3.17.1",
"formsnap": "2.0.1",
"mode-watcher": "^1.1.0",
"paneforge": "^1.0.2",
"postcss-nesting": "^14.0.0",
"sass": "^1.99.0",
"svelte": "^5.55.8",
"svelte-sonner": "^1.1.1",
"tailwind-merge": "^3.6.0",
"tailwind-variants": "^3.2.2",
"tailwindcss": "^4.3.0",
"three": "^0.184.0",
"typescript": "^6.0.3",
"zod": "^4.4.3"
},
"dependencies": {
"@astrojs/mdx": "^4.3.0",
"@astrojs/sitemap": "^3.4.0",
"@astrojs/starlight": "^0.34.4",
"@astrojs/starlight-tailwind": "^4.0.1",
"@codemirror/commands": "^6.8.1",
"@codemirror/lang-json": "^6.0.1",
"@codemirror/view": "^6.36.8",
"@ddietr/codemirror-themes": "^1.5.1",
"@astrojs/mdx": "^5.0.6",
"@astrojs/sitemap": "^3.7.2",
"@astrojs/starlight": "^0.39.2",
"@astrojs/starlight-tailwind": "^5.0.0",
"@codemirror/commands": "^6.10.3",
"@codemirror/lang-json": "^6.0.2",
"@codemirror/view": "^6.43.0",
"@ddietr/codemirror-themes": "^1.5.2",
"@inlang/paraglide-js": "^2.18.0",
"@tanstack/table-core": "^8.21.3",
"astro": "5.7.14",
"astro-i18n": "^2.2.4",
"astro": "6.3.5",
"astro-robots-txt": "^1.0.0",
"astro-seo": "^0.8.4",
"chart.js": "^4.4.9",
"astro-seo": "^1.1.0",
"chart.js": "^4.5.1",
"chartjs-adapter-dayjs-4": "^1.0.4",
"chartjs-adapter-moment": "^1.0.1",
"codemirror": "^6.0.1",
"color": "^4.2.3",
"dayjs": "^1.11.13",
"easymde": "^2.20.0",
"flowbite": "^2.5.2",
"flowbite-svelte": "^0.47.4",
"flowbite-svelte-icons": "^2.2.0",
"js-yaml": "^4.1.0",
"qs": "^6.14.0",
"sharp": "^0.33.5",
"codemirror": "^6.0.2",
"color": "^5.0.3",
"dayjs": "^1.11.20",
"easymde": "^2.21.0",
"flowbite": "^4.0.2",
"flowbite-svelte": "^1.33.1",
"flowbite-svelte-icons": "^3.1.0",
"js-yaml": "^4.1.1",
"qs": "^6.15.2",
"sharp": "^0.34.5",
"svelte-awesome": "^3.3.5",
"svelte-spa-router": "^4.0.1"
"svelte-spa-router": "^5.1.0"
},
"pnpm": {
"onlyBuiltDependencies": [
+7569
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -4,6 +4,6 @@ module.exports = {
plugins: [
require('autoprefixer'),
require('cssnano'),
require("tailwindcss/nesting"),
require("postcss-nesting"),
]
};
+11
View File
@@ -0,0 +1,11 @@
{
"$schema": "https://inlang.com/schema/project-settings",
"baseLocale": "de",
"locales": ["de", "en"],
"modules": [
"https://cdn.jsdelivr.net/npm/@inlang/plugin-message-format@latest/dist/index.js"
],
"plugin.inlang.messageFormat": {
"pathPattern": "./src/i18n/common/{locale}.json"
}
}
@@ -1,145 +0,0 @@
/* barlow-condensed-thin */
@font-face {
font-family: Barlow Condensed;
font-style: normal;
font-weight: 100;
src: local("Barlow Condensed Thin"), local("BarlowCondensed-Thin"), url(barlow-condensed-thin.woff2) format("woff2");
font-display: swap;
}
/* barlow-condensed-thin-italic */
@font-face {
font-family: Barlow Condensed;
font-style: italic;
font-weight: 100;
src: local("Barlow Condensed Thin Italic"), local("BarlowCondensed-ThinItalic"), url(barlow-condensed-thin-italic.woff2) format("woff2");
font-display: swap;
}
/* barlow-condensed-extralight */
@font-face {
font-family: Barlow Condensed;
font-style: normal;
font-weight: 400;
src: local("Barlow Condensed ExtraLight"), local("BarlowCondensed-ExtraLight"), url(barlow-condensed-extralight.woff2) format("woff2");
font-display: swap;
}
/* barlow-condensed-extralight-italic */
@font-face {
font-family: Barlow Condensed;
font-style: italic;
font-weight: 400;
src: local("Barlow Condensed ExtraLight Italic"), local("BarlowCondensed-ExtraLightItalic"), url(barlow-condensed-extralight-italic.woff2) format("woff2");
font-display: swap;
}
/* barlow-condensed-light */
@font-face {
font-family: Barlow Condensed;
font-style: normal;
font-weight: 300;
src: local("Barlow Condensed Light"), local("BarlowCondensed-Light"), url(barlow-condensed-light.woff2) format("woff2");
font-display: swap;
}
/* barlow-condensed-light-italic */
@font-face {
font-family: Barlow Condensed;
font-style: italic;
font-weight: 300;
src: local("Barlow Condensed Light Italic"), local("BarlowCondensed-LightItalic"), url(barlow-condensed-light-italic.woff2) format("woff2");
font-display: swap;
}
/* barlow-condensed-regular */
@font-face {
font-family: Barlow Condensed;
font-style: normal;
font-weight: 400;
src: local("Barlow Condensed Regular"), local("BarlowCondensed-Regular"), url(barlow-condensed-regular.woff2) format("woff2");
font-display: swap;
}
/* barlow-condensed-italic */
@font-face {
font-family: Barlow Condensed;
font-style: italic;
font-weight: 400;
src: local("Barlow Condensed Italic"), local("BarlowCondensed-Italic"), url(barlow-condensed-italic.woff2) format("woff2");
font-display: swap;
}
/* barlow-condensed-medium */
@font-face {
font-family: Barlow Condensed;
font-style: normal;
font-weight: 500;
src: local("Barlow Condensed Medium"), local("BarlowCondensed-Medium"), url(barlow-condensed-medium.woff2) format("woff2");
font-display: swap;
}
/* barlow-condensed-medium-italic */
@font-face {
font-family: Barlow Condensed;
font-style: italic;
font-weight: 500;
src: local("Barlow Condensed Medium Italic"), local("BarlowCondensed-MediumItalic"), url(barlow-condensed-medium-italic.woff2) format("woff2");
font-display: swap;
}
/* barlow-condensed-semibold */
@font-face {
font-family: Barlow Condensed;
font-style: normal;
font-weight: 400;
src: local("Barlow Condensed SemiBold"), local("BarlowCondensed-SemiBold"), url(barlow-condensed-semibold.woff2) format("woff2");
font-display: swap;
}
/* barlow-condensed-semibold-italic */
@font-face {
font-family: Barlow Condensed;
font-style: italic;
font-weight: 400;
src: local("Barlow Condensed SemiBold Italic"), local("BarlowCondensed-SemiBoldItalic"), url(barlow-condensed-semibold-italic.woff2) format("woff2");
font-display: swap;
}
/* barlow-condensed-bold */
@font-face {
font-family: Barlow Condensed;
font-style: normal;
font-weight: 700;
src: local("Barlow Condensed Bold"), local("BarlowCondensed-Bold"), url(barlow-condensed-bold.woff2) format("woff2");
font-display: swap;
}
/* barlow-condensed-bold-italic */
@font-face {
font-family: Barlow Condensed;
font-style: italic;
font-weight: 700;
src: local("Barlow Condensed Bold Italic"), local("BarlowCondensed-BoldItalic"), url(barlow-condensed-bold-italic.woff2) format("woff2");
font-display: swap;
}
/* barlow-condensed-extrabold */
@font-face {
font-family: Barlow Condensed;
font-style: normal;
font-weight: 400;
src: local("Barlow Condensed ExtraBold"), local("BarlowCondensed-ExtraBold"), url(barlow-condensed-extrabold.woff2) format("woff2");
font-display: swap;
}
/* barlow-condensed-extrabold-italic */
@font-face {
font-family: Barlow Condensed;
font-style: italic;
font-weight: 400;
src: local("Barlow Condensed ExtraBold Italic"), local("BarlowCondensed-ExtraBoldItalic"), url(barlow-condensed-extrabold-italic.woff2) format("woff2");
font-display: swap;
}
/* barlow-condensed-black */
@font-face {
font-family: Barlow Condensed;
font-style: normal;
font-weight: 900;
src: local("Barlow Condensed Black"), local("BarlowCondensed-Black"), url(barlow-condensed-black.woff2) format("woff2");
font-display: swap;
}
/* barlow-condensed-black-italic */
@font-face {
font-family: Barlow Condensed;
font-style: italic;
font-weight: 900;
src: local("Barlow Condensed Black Italic"), local("BarlowCondensed-BlackItalic"), url(barlow-condensed-black-italic.woff2) format("woff2");
font-display: swap;
}
-108
View File
@@ -1,108 +0,0 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2024 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/*
This file was generated by font-facer from the font files in the dir:
.
*/
@font-face {
font-family: "Roboto";
font-weight: 100;
font-style: normal;
src: url('./Roboto-Thin.ttf');
}
@font-face {
font-family: "Roboto";
font-weight: 100;
font-style: italic;
src: url('./Roboto-ThinItalic.ttf');
}
@font-face {
font-family: "Roboto";
font-weight: 300;
font-style: normal;
src: url('./Roboto-Light.ttf');
}
@font-face {
font-family: "Roboto";
font-weight: 300;
font-style: italic;
src: url('./Roboto-LightItalic.ttf');
}
@font-face {
font-family: "Roboto";
font-weight: 400;
font-style: normal;
src: url('./Roboto-Regular.ttf');
}
@font-face {
font-family: "Roboto";
font-weight: 400;
font-style: italic;
src: url('./Roboto-Italic.ttf');
}
@font-face {
font-family: "Roboto";
font-weight: 500;
font-style: normal;
src: url('./Roboto-Medium.ttf');
}
@font-face {
font-family: "Roboto";
font-weight: 500;
font-style: italic;
src: url('./Roboto-MediumItalic.ttf');
}
@font-face {
font-family: "Roboto";
font-weight: 700;
font-style: normal;
src: url('./Roboto-Bold.ttf');
}
@font-face {
font-family: "Roboto";
font-weight: 700;
font-style: italic;
src: url('./Roboto-BoldItalic.ttf');
}
@font-face {
font-family: "Roboto";
font-weight: 900;
font-style: normal;
src: url('./Roboto-Black.ttf');
}
@font-face {
font-family: "Roboto";
font-weight: 900;
font-style: italic;
src: url('./Roboto-BlackItalic.ttf');
}
+111
View File
@@ -0,0 +1,111 @@
import { mkdir, rm, writeFile, readFile } from "node:fs/promises";
import path from "node:path";
import { fileURLToPath } from "node:url";
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
const pagesDir = path.join(root, "src", "pages");
const locale = "en";
const outputDir = path.join(pagesDir, locale);
const routeTranslations = new Map([
["jetzt-spielen", "join"],
["impressum", "imprint"],
["verhaltensrichtlinien", "code-of-conduct"],
["regeln", "rules"],
["rangliste", "ranked"],
["haeufige-fragen", "faq"],
["statistiken", "stats"],
["ankuendigungen", "announcements"],
["datenschutzerklaerung", "privacy-policy"],
["passwort-setzen", "set-password"],
]);
const pages = await collectAstroPages(pagesDir);
await rm(outputDir, { recursive: true, force: true });
for (const page of pages) {
const relativePage = path.relative(pagesDir, page);
const segments = relativePage.split(path.sep);
if (segments[0] === locale || segments[0] === "de") {
continue;
}
const outputSegments = translateSegments(segments);
const outFile = path.join(outputDir, ...outputSegments);
const source = await readFile(page, "utf8");
const hasGetStaticPaths = /\bexport\s+(?:const|async\s+function|function)\s+getStaticPaths\b/.test(source);
await mkdir(path.dirname(outFile), { recursive: true });
await writeFile(outFile, createProxyPage(page, outFile, hasGetStaticPaths));
}
function translateSegments(segments) {
const translated = [...segments];
if (translated[0] !== "index.astro" && !translated[0].startsWith("[")) {
translated[0] = routeTranslations.get(translated[0]) ?? translated[0];
}
const file = translated.pop();
const name = file.slice(0, -".astro".length);
if (name !== "index") {
translated.push(name);
}
translated.push("index.astro");
return translated;
}
function createProxyPage(sourceFile, outFile, hasGetStaticPaths) {
const outDir = path.dirname(outFile);
const importPath = normalizeImportPath(path.relative(outDir, sourceFile));
const lines = [
"---",
`import Page from "${importPath}";`,
];
if (hasGetStaticPaths) {
lines.push(
`import { getStaticPaths as proxyGetStaticPaths } from "${importPath}";`,
`export const getStaticPaths = (props) => proxyGetStaticPaths({ ...props, astroI18n: { locale: "${locale}" } });`,
);
}
lines.push(
"const { props } = Astro;",
"---",
"",
"<Page {...props} />",
"",
);
return lines.join("\n");
}
function normalizeImportPath(importPath) {
const normalized = importPath.split(path.sep).join("/");
return normalized.startsWith(".") ? normalized : `./${normalized}`;
}
async function collectAstroPages(dir) {
const entries = await import("node:fs/promises").then(({ readdir }) => readdir(dir, { withFileTypes: true }));
const files = [];
for (const entry of entries) {
const fullPath = path.join(dir, entry.name);
if (entry.isDirectory()) {
files.push(...await collectAstroPages(fullPath));
continue;
}
if (entry.isFile() && entry.name.endsWith(".astro")) {
files.push(fullPath);
}
}
return files;
}
+9 -2
View File
@@ -66,14 +66,21 @@
transition: scale 300ms cubic-bezier(0.2, 3, 0.67, 0.6);
:global(h1) {
@apply text-xl font-bold mt-4;
margin-top: 1rem;
font-size: 1.25rem;
line-height: 1.75rem;
font-weight: 700;
font-family: "Barlow Condensed", sans-serif;
letter-spacing: 0.06em;
}
:global(svg) {
color: #f59e0b;
@apply transition-transform duration-300 ease-in-out hover:scale-110;
transition: transform 300ms ease-in-out;
}
:global(svg:hover) {
transform: scale(1.1);
}
}
+1 -1
View File
@@ -18,7 +18,7 @@
-->
<script lang="ts">
import {t} from "astro-i18n"
import {t} from "$lib/i18n"
import UserInfo from "./dashboard/UserInfo.svelte";
import {dataRepo} from "@repo/data.ts";
import UploadModal from "@components/dashboard/UploadModal.svelte";
+1 -1
View File
@@ -18,7 +18,7 @@
-->
<script lang="ts">
import {t} from "astro-i18n";
import {t} from "$lib/i18n";
import {statsRepo} from "@repo/stats.ts";
import "@styles/table.css"
+1 -1
View File
@@ -19,7 +19,7 @@
<script lang="ts">
import FightStatsChart from "./FightStatsChart.svelte";
import { t } from "astro-i18n";
import { t } from "$lib/i18n";
import { statsRepo } from "@repo/stats.ts";
let request = getStats();
+1 -1
View File
@@ -20,7 +20,7 @@
<script lang="ts">
import { window } from "./utils.ts";
import { astroI18n, t } from "astro-i18n";
import { astroI18n, t } from "$lib/i18n";
import type { EventFight, ExtendedEvent } from "@type/event";
import "@styles/table.css";
+1 -1
View File
@@ -20,7 +20,7 @@
<script lang="ts">
import { window } from "./utils.ts";
import { t } from "astro-i18n";
import { t } from "$lib/i18n";
import type { ExtendedEvent } from "@type/event.ts";
import "@styles/table.css";
+1 -1
View File
@@ -1,5 +1,5 @@
---
import { t } from "astro-i18n";
import { t } from "$lib/i18n";
---
<div class="border-l-2 border-amber-500 bg-amber-500/5 p-4" role="alert">
+1 -1
View File
@@ -20,7 +20,7 @@
<script lang="ts">
import { preventDefault } from "svelte/legacy";
import { l } from "@utils/util.ts";
import { t } from "astro-i18n";
import { t } from "$lib/i18n";
import { get } from "svelte/store";
import { navigate } from "astro:transitions/client";
import { onMount } from "svelte";
+2 -2
View File
@@ -20,10 +20,10 @@
<script lang="ts">
import "../styles/button.css";
import { CaretDownOutline, GlobeOutline } from "flowbite-svelte-icons";
import { t, l } from "astro-i18n";
import { t, l } from "$lib/i18n";
import { onMount } from "svelte";
import { loggedIn } from "@repo/authv2.ts";
import { astroI18n } from "astro-i18n";
import { astroI18n } from "$lib/i18n";
interface Props {
logo?: import("svelte").Snippet;
}
+2 -2
View File
@@ -1,7 +1,7 @@
---
import type { CollectionEntry } from "astro:content";
import { l } from "../util/util";
import { astroI18n } from "astro-i18n";
import { astroI18n, stripLocaleFromPath } from "$lib/i18n";
import { Image } from "astro:assets";
import TagComponent from "./TagComponent.astro";
import P from "./P.astro";
@@ -19,7 +19,7 @@ const {
slim: boolean;
} = Astro.props as Props;
const postUrl = l(`/announcements/${post.slug.split("/").slice(1).join("/")}`);
const postUrl = l(`/announcements/${stripLocaleFromPath(post.id)}`);
---
<Card extraClasses={`w-full items-start mx-0 ${slim ? "m-0 p-2 backdrop-blur-xl bg-transparent border-0" : "border-t-2 border-t-amber-500/30"}`} hoverEffect={false}>
+1 -1
View File
@@ -18,7 +18,7 @@
-->
<script lang="ts">
import { t } from "astro-i18n"
import { t } from "$lib/i18n"
import {server} from "./stores/stores.ts";
function generateVersionString(version: string): string {
@@ -116,6 +116,6 @@
<style>
li {
@apply py-2;
padding-block: 0.5rem;
}
</style>
@@ -18,7 +18,7 @@
-->
<script lang="ts">
import {astroI18n, t} from "astro-i18n";
import {astroI18n, t} from "$lib/i18n";
import {CheckSolid, XCircleOutline} from "flowbite-svelte-icons";
import type {SchematicInfo} from "@type/schem.ts";
import {createEventDispatcher} from "svelte";
+23 -6
View File
@@ -20,7 +20,7 @@
<script lang="ts">
import { preventDefault } from 'svelte/legacy';
import {t} from "astro-i18n";
import {t} from "$lib/i18n";
import {
ChevronDoubleRightOutline,
FolderOutline,
@@ -143,15 +143,32 @@
<style lang="postcss">
table {
@apply w-full;
width: 100%;
}
tr {
@apply transition-colors cursor-pointer border-b
dark:hover:bg-gray-800 hover:bg-gray-300;
cursor: pointer;
border-bottom: 1px solid #e5e7eb;
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
transition-duration: 150ms;
}
tr:hover {
background-color: #d1d5db;
}
:global(.dark) tr:hover {
background-color: #1f2937;
}
th {
@apply text-left py-4 md:px-2;
padding-block: 1rem;
text-align: left;
}
</style>
@media (min-width: 768px) {
th {
padding-inline: 0.5rem;
}
}
</style>
@@ -21,7 +21,7 @@
import { createBubbler, preventDefault } from 'svelte/legacy';
const bubble = createBubbler();
import {astroI18n, t} from "astro-i18n";
import {astroI18n, t} from "$lib/i18n";
import {CheckSolid, FileOutline, FolderOutline, XCircleOutline} from "flowbite-svelte-icons";
import type {Schematic} from "@type/schem.ts";
import type {Player} from "@type/data.ts";
@@ -82,11 +82,32 @@
<style lang="scss">
tr {
@apply transition-colors cursor-pointer border-b border-gray-300
dark:hover:bg-gray-800 hover:bg-gray-300 dark:border-neutral-700;
cursor: pointer;
border-bottom: 1px solid #d1d5db;
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
transition-duration: 150ms;
}
tr:hover {
background-color: #d1d5db;
}
:global(.dark) tr {
border-bottom-color: #404040;
}
:global(.dark) tr:hover {
background-color: #1f2937;
}
th {
@apply text-left py-4 md:px-2;
padding-block: 1rem;
text-align: left;
}
</style>
@media (min-width: 768px) {
th {
padding-inline: 0.5rem;
}
}
</style>
+1 -1
View File
@@ -19,7 +19,7 @@
<script lang="ts">
import type {Player} from "@type/data.ts";
import {astroI18n, t} from "astro-i18n"
import {astroI18n, t} from "$lib/i18n"
import {statsRepo} from "@repo/stats.ts";
interface Props {
+1 -1
View File
@@ -21,7 +21,7 @@
import {createEventDispatcher} from "svelte";
import {schemRepo} from "@repo/schem.ts";
import SWModal from "@components/styled/SWModal.svelte";
import {t} from "astro-i18n";
import {t} from "$lib/i18n";
const dispatch = createEventDispatcher();
+1 -1
View File
@@ -18,7 +18,7 @@
-->
<script lang="ts">
import { t } from "astro-i18n";
import { t } from "$lib/i18n";
import type { Player } from "@type/data.ts";
import { l } from "@utils/util.ts";
import Statistics from "./Statistics.svelte";
+1 -1
View File
@@ -3,7 +3,7 @@
import "dayjs/locale/de";
import type { ExtendedEvent } from "../types/event";
import { Button } from "../ui/button";
import { ChevronLeft, ChevronRight } from "lucide-svelte";
import { ChevronLeft, ChevronRight } from "@lucide/svelte";
import * as Card from "../ui/card";
import EventCard from "./EventCard.svelte";
import SWButton from "@components/styled/SWButton.svelte";
+2 -2
View File
@@ -1,8 +1,8 @@
<script lang="ts">
import type { ExtendedEvent } from "../types/event";
import { Button } from "../ui/button";
import { Calendar } from "lucide-svelte";
import { List } from "lucide-svelte";
import { Calendar } from "@lucide/svelte";
import { List } from "@lucide/svelte";
import EventList from "./EventList.svelte";
import CalendarView from "./Calendar.svelte";
+6 -7
View File
@@ -15,12 +15,10 @@
config: GroupViewConfig;
} = $props();
// Groups fights into rounds: a round starts at the first fight's start;
// all fights starting within 10 minutes (600_000 ms) of that are in the same round.
function detectRounds(fights: EventFight[]): EventFight[][] {
function detectRounds(fights: EventFight[], groupingTimeMinutes: number): EventFight[][] {
if (!fights || fights.length === 0) return [];
const TEN_MIN_MS = 10 * 60 * 1000;
const groupingTimeMs = Math.max(1, Math.floor(groupingTimeMinutes || 10)) * 60 * 1000;
const sorted = [...fights].sort((a, b) => a.start - b.start);
const rounds: EventFight[][] = [];
@@ -28,7 +26,7 @@
let roundStart = sorted[0].start;
for (const fight of sorted) {
if (fight.start - roundStart <= TEN_MIN_MS) {
if (fight.start - roundStart <= groupingTimeMs) {
currentRound.push(fight);
} else {
if (currentRound.length) rounds.push(currentRound);
@@ -61,8 +59,9 @@
{#each config.groups as groupId}
{@const group = event.groups.find((g) => g.id === groupId)!!}
{@const fights = event.fights.filter((f) => f.group?.id === groupId)}
{@const rounds = detectRounds(fights)}
{@const rounds = detectRounds(fights, config.roundGroupingTimeMinutes ?? 10)}
{@const roundRows = config.roundRows ?? 1}
{@const roundPrefix = config.roundPrefix ?? "Runde"}
{@const roundRowsChunked = chunkIntoRows(rounds, roundRows)}
<div class="flex">
<div>
@@ -83,7 +82,7 @@
{@const roundIndex = rounds.indexOf(round)}
{@const teams = Array.from(new Set(round.flatMap((f) => [f.redTeam, f.blueTeam])))}
<div class="{hover.currentHover && !teams.some((t) => t?.id === hover.currentHover) ? 'opacity-30' : ''} transition-opacity">
<EventCard title="Runde {roundIndex + 1}">
<EventCard title={`${roundPrefix} ${roundIndex + 1}`}>
{#each round as fight}
<EventFightChip {event} {fight} {group} />
{/each}
+2
View File
@@ -4,6 +4,8 @@ export const GroupViewSchema = z.object({
type: z.literal("GROUP"),
groups: z.array(z.number()),
roundRows: z.number().int().positive().optional().default(1),
roundGroupingTimeMinutes: z.number().int().positive().optional().default(10),
roundPrefix: z.enum(["Runde", "Tag"]).optional().default("Runde"),
});
export type GroupViewConfig = z.infer<typeof GroupViewSchema>;
@@ -8,7 +8,7 @@
import { Popover, PopoverContent, PopoverTrigger } from "@components/ui/popover";
import { gamemodes, maps } from "@components/stores/stores";
import { CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, Command } from "@components/ui/command";
import { ChevronsUpDown, Check } from "lucide-svelte";
import { ChevronsUpDown, Check } from "@lucide/svelte";
import { Button } from "@components/ui/button";
import { cn } from "@components/utils";
import { Select, SelectContent, SelectItem, SelectTrigger } from "@components/ui/select";
@@ -2,7 +2,7 @@
import type { GroupUpdateEdit, ResponseGroups, SWEvent } from "@type/event";
import { Popover, PopoverContent, PopoverTrigger } from "@components/ui/popover";
import { CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, Command } from "@components/ui/command";
import { ChevronsUpDownIcon, PlusIcon, CheckIcon, MinusIcon } from "lucide-svelte";
import { ChevronsUpDownIcon, PlusIcon, CheckIcon, MinusIcon } from "@lucide/svelte";
import { Button } from "@components/ui/button";
import { cn } from "@components/utils";
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle } from "@components/ui/dialog";
@@ -7,7 +7,7 @@
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@components/ui/tabs";
import { Tooltip, TooltipContent, TooltipTrigger } from "@components/ui/tooltip";
import { cn } from "@components/utils";
import { Check, ChevronsUpDown, GitPullRequestArrow, Plus } from "lucide-svelte";
import { Check, ChevronsUpDown, GitPullRequestArrow, Plus } from "@lucide/svelte";
import type { EventModel } from "../pages/event/eventmodel.svelte";
import { Select, SelectContent, SelectItem, SelectTrigger } from "@components/ui/select";
import { Label } from "@components/ui/label";
@@ -18,14 +18,14 @@
-->
<script lang="ts">
import { location } from "svelte-spa-router";
import { router } from "svelte-spa-router";
</script>
<nav class="flex items-center space-x-4 lg:space-x-6 mx-6">
<a href="#/" class="hover:text-primary text-sm font-medium transition-colors" class:text-muted-foreground={$location !== "/"}> Dashboard </a>
<a href="#/events" class="hover:text-primary text-sm font-medium transition-colors" class:text-muted-foreground={!$location.startsWith("/event")}> Events </a>
<a href="#/players" class="hover:text-primary text-sm font-medium transition-colors" class:text-muted-foreground={$location !== "/players"}> Players </a>
<a href="#/pages" class="hover:text-primary text-sm font-medium transition-colors" class:text-muted-foreground={$location !== "/pages"}> Pages </a>
<a href="#/schematics" class="hover:text-primary text-sm font-medium transition-colors" class:text-muted-foreground={$location !== "/schematics"}> Schematics </a>
<a href="#/logs" class="hover:text-primary text-sm font-medium transition-colors" class:text-muted-foreground={$location !== "/logs"}> Logs </a>
<a href="#/" class="hover:text-primary text-sm font-medium transition-colors" class:text-muted-foreground={router.location !== "/"}> Dashboard </a>
<a href="#/events" class="hover:text-primary text-sm font-medium transition-colors" class:text-muted-foreground={!router.location.startsWith("/event")}> Events </a>
<a href="#/players" class="hover:text-primary text-sm font-medium transition-colors" class:text-muted-foreground={router.location !== "/players"}> Players </a>
<a href="#/pages" class="hover:text-primary text-sm font-medium transition-colors" class:text-muted-foreground={router.location !== "/pages"}> Pages </a>
<a href="#/schematics" class="hover:text-primary text-sm font-medium transition-colors" class:text-muted-foreground={router.location !== "/schematics"}> Schematics </a>
<a href="#/logs" class="hover:text-primary text-sm font-medium transition-colors" class:text-muted-foreground={router.location !== "/logs"}> Logs </a>
</nav>
@@ -25,10 +25,10 @@
import DateTimePicker from "@components/ui/datetime-picker/DateTimePicker.svelte";
import { fromAbsolute } from "@internationalized/date";
import { Button, buttonVariants } from "@components/ui/button";
import { ChevronsUpDown } from "lucide-svelte";
import { ChevronsUpDown } from "@lucide/svelte";
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from "@components/ui/command";
import { schemTypes } from "@stores/stores.ts";
import Check from "lucide-svelte/icons/check";
import Check from "@lucide/svelte/icons/check";
import { cn } from "@components/utils.ts";
import { Switch } from "@components/ui/switch";
import { eventRepo } from "@repo/event.ts";
@@ -34,7 +34,7 @@
import GroupEditDialog from "./GroupEditDialog.svelte";
import GroupResultsDialog from "./GroupResultsDialog.svelte";
import type { ResponseGroups } from "@type/event";
import { EditIcon, GroupIcon, LinkIcon } from "lucide-svelte";
import { EditIcon, GroupIcon, LinkIcon } from "@lucide/svelte";
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "@components/ui/dropdown-menu";
import GroupSelector from "@components/moderator/components/GroupSelector.svelte";
import { fightRepo } from "@components/repo/fight";
@@ -1,7 +1,7 @@
<script lang="ts">
import type { EventFight, EventFightEdit, ResponseGroups, ResponseRelation, SWEvent } from "@type/event";
import { Button } from "@components/ui/button";
import { EditIcon, CopyIcon } from "lucide-svelte";
import { EditIcon, CopyIcon } from "@lucide/svelte";
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "@components/ui/dialog";
import FightEdit from "@components/moderator/components/FightEdit.svelte";
import type { Team } from "@components/types/team";
@@ -25,7 +25,7 @@
import { Input } from "@components/ui/input/index.js";
import { Label } from "@components/ui/label/index.js";
import DateTimePicker from "@components/ui/datetime-picker/DateTimePicker.svelte";
import { PlusIcon } from "lucide-svelte";
import { PlusIcon } from "@lucide/svelte";
import dayjs from "dayjs";
import { fromAbsolute, now, ZonedDateTime } from "@internationalized/date";
@@ -12,7 +12,7 @@
import { Slider } from "@components/ui/slider";
import { fromAbsolute } from "@internationalized/date";
import dayjs from "dayjs";
import { Plus, Shuffle } from "lucide-svelte";
import { Plus, Shuffle } from "@lucide/svelte";
import { replace } from "svelte-spa-router";
let { data }: { data: ExtendedEvent } = $props();
@@ -12,7 +12,7 @@
import { Slider } from "@components/ui/slider";
import { fromAbsolute } from "@internationalized/date";
import dayjs from "dayjs";
import { Plus, Shuffle } from "lucide-svelte";
import { Plus, Shuffle } from "@lucide/svelte";
import { replace } from "svelte-spa-router";
let { data }: { data: ExtendedEvent } = $props();
@@ -16,7 +16,7 @@
import { Slider } from "@components/ui/slider";
import { fromAbsolute, fromDate, parseDateTime, parseDuration } from "@internationalized/date";
import dayjs from "dayjs";
import { Plus } from "lucide-svelte";
import { Plus } from "@lucide/svelte";
import { replace } from "svelte-spa-router";
let {
data,
@@ -11,7 +11,7 @@
import { Input } from "@components/ui/input";
import { Popover, PopoverContent, PopoverTrigger } from "@components/ui/popover";
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from "@components/ui/command";
import { Check } from "lucide-svelte";
import { Check } from "@lucide/svelte";
import { cn } from "@components/utils";
import DateTimePicker from "@components/ui/datetime-picker/DateTimePicker.svelte";
import PlayerSelector from "@components/ui/PlayerSelector.svelte";
@@ -1,6 +1,6 @@
<script lang="ts">
import { manager, OpenEditPage } from "./page.svelte";
import { File, FileCode2, FileText, Save, X } from "lucide-svelte";
import { File, FileCode2, FileText, Save, X } from "@lucide/svelte";
import { onMount } from "svelte";
import { EditorView } from "@codemirror/view";
import { basicSetup } from "codemirror";
@@ -3,7 +3,7 @@
import { Input } from "@components/ui/input";
import { Label } from "@components/ui/label";
import { Checkbox } from "@components/ui/checkbox";
import { Plus, X } from "lucide-svelte";
import { Plus, X } from "@lucide/svelte";
import yaml from "js-yaml";
import { manager } from "./page.svelte";
import type { FrontmatterFieldSchema } from "../../../../content/frontmatter-editor-schemas";
@@ -6,7 +6,7 @@
import EditorWithTabs from "./EditorWithTabs.svelte";
import { Popover, PopoverContent, PopoverTrigger } from "@components/ui/popover";
import { Button } from "@components/ui/button";
import { Check, ChevronsUpDown, RefreshCw, FileImage, Plus, GitBranch, Upload } from "lucide-svelte";
import { Check, ChevronsUpDown, RefreshCw, FileImage, Plus, GitBranch, Upload } from "@lucide/svelte";
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from "@components/ui/command";
import { cn } from "@components/utils";
import { pageRepo } from "@components/repo/page";
@@ -1,5 +1,5 @@
<script lang="ts">
import { ChevronDown, ChevronRight, Folder, FileJson, FileText, File, FilePlus } from "lucide-svelte";
import { ChevronDown, ChevronRight, Folder, FileJson, FileText, File, FilePlus } from "@lucide/svelte";
import type { DirTree } from "./page.svelte";
import PagesList from "./PagesList.svelte";
import { slide } from "svelte/transition";
@@ -4,7 +4,7 @@
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from "@components/ui/command";
import { eventRepo } from "@repo/event";
import type { ShortEvent } from "@type/event";
import { CalendarDays, Check, ChevronsUpDown } from "lucide-svelte";
import { CalendarDays, Check, ChevronsUpDown } from "@lucide/svelte";
const {
value,
@@ -2,7 +2,7 @@
import { Button } from "@components/ui/button";
import { Input } from "@components/ui/input";
import { Popover, PopoverContent, PopoverTrigger } from "@components/ui/popover";
import { Image, Search } from "lucide-svelte";
import { Image, Search } from "@lucide/svelte";
import { manager } from "../page.svelte";
const {
@@ -4,13 +4,21 @@
import { Label } from "@components/ui/label";
import { eventRepo } from "@repo/event";
import type { EventFight, ExtendedEvent, ResponseGroups } from "@type/event";
import { Plus, Trash2 } from "lucide-svelte";
import { Plus, Trash2 } from "@lucide/svelte";
type StageType = "GROUP" | "ELEMINATION" | "DOUBLE_ELEMINATION";
type RoundPrefix = "Runde" | "Tag";
const roundGroupingTimeOptions = [
{ label: "10 Minutes", value: 10 },
{ label: "30 Minutes", value: 30 },
{ label: "1 Hour", value: 60 },
{ label: "2 Hours", value: 120 },
{ label: "12 Hours", value: 720 },
];
type StageConfig = {
name: string;
view:
| { type: "GROUP"; groups: number[]; roundRows?: number }
| { type: "GROUP"; groups: number[]; roundRows?: number; roundGroupingTimeMinutes?: number; roundPrefix?: RoundPrefix }
| { type: "ELEMINATION"; finalFight: number }
| { type: "DOUBLE_ELEMINATION"; winnersFinalFight: number; losersFinalFight: number; grandFinalFight: number };
};
@@ -68,7 +76,7 @@
draft[key] = {
name: "New stage",
view: { type: "GROUP", groups: [], roundRows: 1 },
view: { type: "GROUP", groups: [], roundRows: 1, roundGroupingTimeMinutes: 10, roundPrefix: "Runde" },
};
});
}
@@ -105,7 +113,7 @@
function setStageType(key: string, type: StageType, event?: ExtendedEvent) {
nextConfig((draft) => {
if (type === "GROUP") {
draft[key].view = { type, groups: [], roundRows: 1 };
draft[key].view = { type, groups: [], roundRows: 1, roundGroupingTimeMinutes: 10, roundPrefix: "Runde" };
} else if (type === "ELEMINATION") {
draft[key].view = { type, finalFight: event?.fights[0]?.id ?? 0 };
} else {
@@ -139,6 +147,24 @@
});
}
function setRoundGroupingTimeMinutes(key: string, value: string) {
nextConfig((draft) => {
const view = draft[key].view;
if (view.type === "GROUP") {
view.roundGroupingTimeMinutes = Math.max(1, Math.floor(Number(value) || 10));
}
});
}
function setRoundPrefix(key: string, value: RoundPrefix) {
nextConfig((draft) => {
const view = draft[key].view;
if (view.type === "GROUP") {
view.roundPrefix = value;
}
});
}
function setFightParam(key: string, param: "finalFight" | "winnersFinalFight" | "losersFinalFight" | "grandFinalFight", fightId: string) {
nextConfig((draft) => {
const view = draft[key].view as Record<string, unknown>;
@@ -235,6 +261,29 @@
<Label>Round rows</Label>
<Input type="number" min="1" value={stage.view.roundRows ?? 1} onchange={(event) => setRoundRows(key, (event.currentTarget as HTMLInputElement).value)} />
</div>
<div class="space-y-1">
<Label>Round grouping time (minutes)</Label>
<select
class="h-9 w-full rounded-md border border-neutral-800 bg-neutral-900 px-3 text-sm outline-none focus-visible:ring-2 focus-visible:ring-ring"
value={(stage.view.roundGroupingTimeMinutes ?? 10).toString()}
onchange={(event) => setRoundGroupingTimeMinutes(key, (event.currentTarget as HTMLSelectElement).value)}
>
{#each roundGroupingTimeOptions as option}
<option value={option.value.toString()}>{option.label}</option>
{/each}
</select>
</div>
<div class="space-y-1">
<Label>Round prefix</Label>
<select
class="h-9 w-full rounded-md border border-neutral-800 bg-neutral-900 px-3 text-sm outline-none focus-visible:ring-2 focus-visible:ring-ring"
value={stage.view.roundPrefix ?? "Runde"}
onchange={(event) => setRoundPrefix(key, (event.currentTarget as HTMLSelectElement).value as RoundPrefix)}
>
<option value="Runde">Runde</option>
<option value="Tag">Tag</option>
</select>
</div>
</div>
</div>
{:else if stage.view.type === "ELEMINATION"}
+1 -1
View File
@@ -2,7 +2,7 @@
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from "@components/ui/command";
import { Popover, PopoverContent, PopoverTrigger } from "@components/ui/popover";
import { Button } from "@components/ui/button";
import { Check, ChevronsUpDown } from "lucide-svelte";
import { Check, ChevronsUpDown } from "@lucide/svelte";
import { cn } from "@components/utils";
import { dataRepo } from "@repo/data";
import type { Player } from "@type/data";
@@ -1,6 +1,6 @@
<script lang="ts">
import { Accordion as AccordionPrimitive } from "bits-ui";
import ChevronDown from "lucide-svelte/icons/chevron-down";
import ChevronDown from "@lucide/svelte/icons/chevron-down";
import { cn } from "$lib/components/utils.js";
type $$Props = AccordionPrimitive.TriggerProps;
@@ -1,5 +1,5 @@
<script lang="ts">
import Ellipsis from "lucide-svelte/icons/ellipsis";
import Ellipsis from "@lucide/svelte/icons/ellipsis";
import type { HTMLAttributes } from "svelte/elements";
import { cn } from "$lib/components/utils.js";
@@ -1,6 +1,6 @@
<script lang="ts">
import type { HTMLLiAttributes } from "svelte/elements";
import ChevronRight from "lucide-svelte/icons/chevron-right";
import ChevronRight from "@lucide/svelte/icons/chevron-right";
import { cn } from "$lib/components/utils.js";
type $$Props = HTMLLiAttributes & {
+1 -1
View File
@@ -4,7 +4,7 @@
import { type VariantProps, tv } from "tailwind-variants";
export const buttonVariants = tv({
base: "ring-offset-background focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
base: "ring-offset-background focus-visible:ring-ring inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
variants: {
variant: {
default: "bg-primary text-primary-foreground hover:bg-primary/90",
@@ -1,6 +1,6 @@
<script lang="ts">
import { Calendar as CalendarPrimitive } from "bits-ui";
import ChevronRight from "lucide-svelte/icons/chevron-right";
import ChevronRight from "@lucide/svelte/icons/chevron-right";
import { buttonVariants } from "$lib/components/ui/button/index.js";
import { cn } from "$lib/components/utils.js";
@@ -1,6 +1,6 @@
<script lang="ts">
import { Calendar as CalendarPrimitive } from "bits-ui";
import ChevronLeft from "lucide-svelte/icons/chevron-left";
import ChevronLeft from "@lucide/svelte/icons/chevron-left";
import { buttonVariants } from "$lib/components/ui/button/index.js";
import { cn } from "$lib/components/utils.js";
@@ -1,5 +1,5 @@
<script lang="ts">
import ArrowRight from "lucide-svelte/icons/arrow-right";
import ArrowRight from "@lucide/svelte/icons/arrow-right";
import type { VariantProps } from "tailwind-variants";
import { getEmblaContext } from "./context.js";
import { cn } from "$lib/components/utils.js";
@@ -1,5 +1,5 @@
<script lang="ts">
import ArrowLeft from "lucide-svelte/icons/arrow-left";
import ArrowLeft from "@lucide/svelte/icons/arrow-left";
import type { VariantProps } from "tailwind-variants";
import { getEmblaContext } from "./context.js";
import { cn } from "$lib/components/utils.js";
+1 -1
View File
@@ -16,7 +16,7 @@
<CheckboxPrimitive.Root
bind:ref
class={cn(
"border-primary ring-offset-background focus-visible:ring-ring data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground peer box-content size-4 shrink-0 rounded-sm border focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[disabled=true]:cursor-not-allowed data-[disabled=true]:opacity-50",
"border-primary ring-offset-background focus-visible:ring-ring data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground peer box-content size-4 shrink-0 cursor-pointer rounded-sm border focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[disabled=true]:cursor-not-allowed data-[disabled=true]:opacity-50",
className
)}
bind:checked
@@ -1,6 +1,6 @@
<script lang="ts">
import { Command as CommandPrimitive } from "bits-ui";
import Search from "lucide-svelte/icons/search";
import Search from "@lucide/svelte/icons/search";
import { cn } from "$lib/components/utils.js";
let {
@@ -11,7 +11,7 @@
<CommandPrimitive.Item
class={cn(
"aria-selected:bg-accent aria-selected:text-accent-foreground relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
"aria-selected:bg-accent aria-selected:text-accent-foreground relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
className
)}
bind:ref
@@ -11,7 +11,7 @@
<CommandPrimitive.LinkItem
class={cn(
"aria-selected:bg-accent aria-selected:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
"aria-selected:bg-accent aria-selected:text-accent-foreground relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
className
)}
bind:ref
@@ -1,11 +1,9 @@
<script lang="ts">
import { ContextMenu as ContextMenuPrimitive } from "bits-ui";
import Check from "lucide-svelte/icons/check";
import Check from "@lucide/svelte/icons/check";
import { cn } from "$lib/components/utils.js";
type $$Props = ContextMenuPrimitive.CheckboxItemProps;
type $$Events = ContextMenuPrimitive.CheckboxItemEvents;
let className: $$Props["class"] = undefined;
export let checked: $$Props["checked"] = undefined;
export { className as class };
@@ -14,7 +12,7 @@
<ContextMenuPrimitive.CheckboxItem
bind:checked
class={cn(
"data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
"data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
className
)}
{...$$restProps}
@@ -26,10 +24,12 @@
on:pointerleave
on:pointermove
>
<span class="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
<ContextMenuPrimitive.CheckboxIndicator>
{#snippet children({ checked })}
<span class="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
{#if checked}
<Check class="h-4 w-4" />
</ContextMenuPrimitive.CheckboxIndicator>
</span>
<slot />
{/if}
</span>
<slot />
{/snippet}
</ContextMenuPrimitive.CheckboxItem>
@@ -14,7 +14,7 @@
<ContextMenuPrimitive.Item
class={cn(
"data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
"data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
inset && "pl-8",
className
)}

Some files were not shown because too many files have changed in this diff Show More