diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml new file mode 100644 index 0000000..99e9331 --- /dev/null +++ b/.forgejo/workflows/build.yaml @@ -0,0 +1,41 @@ +jobs: + build: + runs-on: ubuntu-latest + name: Build application + steps: + - uses: actions/checkout@v4 + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 22 + - name: Get NPM cache directory + id: npm-cache-dir + shell: bash + run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT} + - uses: actions/cache@v4 + name: Cache NPM + id: npm-cache + with: + path: ${{ steps.npm-cache-dir.outputs.dir }} + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + - run: npm ci + name: Install dependencies + - run: npm lint + name: Lint code + - run: npm build + name: Build project + - run: npm test + name: Test project + - run: npm build-storybook + name: Build storybook + - uses: actions/upload-artifact@v4 + name: Upload build directories + with: + name: build-artifacts + path: | + dist/ + build/ + .svelte-kit/ + storybook-static/ diff --git a/.gitignore b/.gitignore index 01bf8ae..05ddd1b 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,5 @@ Thumbs.db # Vite vite.config.js.timestamp-* vite.config.ts.timestamp-* + +/storybook-static diff --git a/.storybook/main.js b/.storybook/main.js index dee51df..0d31a34 100644 --- a/.storybook/main.js +++ b/.storybook/main.js @@ -1,20 +1,15 @@ - - /** @type { import('@storybook/sveltekit').StorybookConfig } */ const config = { - "stories": [ - "../src/**/*.mdx", - "../src/**/*.stories.@(js|ts|svelte)" - ], - "addons": [ - "@storybook/addon-svelte-csf", - "@storybook/addon-essentials", - "@chromatic-com/storybook", - "@storybook/addon-interactions" - ], - "framework": { - "name": "@storybook/sveltekit", - "options": {} - } + stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|ts|svelte)'], + addons: [ + '@storybook/addon-svelte-csf', + '@storybook/addon-essentials', + '@chromatic-com/storybook', + '@storybook/addon-interactions' + ], + framework: { + name: '@storybook/sveltekit', + options: {} + } }; -export default config; \ No newline at end of file +export default config; diff --git a/.storybook/preview.js b/.storybook/preview.js index c594202..39cfdc4 100644 --- a/.storybook/preview.js +++ b/.storybook/preview.js @@ -1,13 +1,13 @@ /** @type { import('@storybook/svelte').Preview } */ const preview = { - parameters: { - controls: { - matchers: { - color: /(background|color)$/i, - date: /Date$/i, - }, - }, - }, + parameters: { + controls: { + matchers: { + color: /(background|color)$/i, + date: /Date$/i + } + } + } }; -export default preview; \ No newline at end of file +export default preview; diff --git a/.vscode/extensions.json b/.vscode/extensions.json index a381942..629f094 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,5 +1,3 @@ { - "recommendations": [ - "inlang.vs-code-extension" - ] -} \ No newline at end of file + "recommendations": ["inlang.vs-code-extension"] +} diff --git a/messages/de.json b/messages/de.json index 2459437..3aaa845 100644 --- a/messages/de.json +++ b/messages/de.json @@ -1,10 +1,10 @@ { - "$schema": "https://inlang.com/schema/inlang-message-format", - "hello_world": "Hello, {name} from de!", - "body_part_throat": "Hals", - "body_part_thigh": "Oberschenkel", - "body_part_ankle": "Knöchel", - "body_part_upper_arm": "Oberarm", - "action_shock": "Shocken", - "action_vibrate": "Vibrieren" + "$schema": "https://inlang.com/schema/inlang-message-format", + "hello_world": "Hello, {name} from de!", + "body_part_throat": "Hals", + "body_part_thigh": "Oberschenkel", + "body_part_ankle": "Knöchel", + "body_part_upper_arm": "Oberarm", + "action_shock": "Shocken", + "action_vibrate": "Vibrieren" } diff --git a/messages/en.json b/messages/en.json index cfad5e6..2656fb1 100644 --- a/messages/en.json +++ b/messages/en.json @@ -1,10 +1,10 @@ { - "$schema": "https://inlang.com/schema/inlang-message-format", - "hello_world": "Hello, {name} from en!", - "body_part_throat": "Throat", - "body_part_thigh": "Thigh", - "body_part_ankle": "Ankle", - "body_part_upper_arm": "Upper Arm", - "action_shock": "Shock", - "action_vibrate": "Vibrate" + "$schema": "https://inlang.com/schema/inlang-message-format", + "hello_world": "Hello, {name} from en!", + "body_part_throat": "Throat", + "body_part_thigh": "Thigh", + "body_part_ankle": "Ankle", + "body_part_upper_arm": "Upper Arm", + "action_shock": "Shock", + "action_vibrate": "Vibrate" } diff --git a/src/app.css b/src/app.css index be7a6d6..f54b9e0 100644 --- a/src/app.css +++ b/src/app.css @@ -1,48 +1,53 @@ :root { - --padding: 30px; - --gap: 20px; - --radius: 20px; - --width: 700px; - --layout-slant: -30deg; - --color-base: #fff; - --color-primary-100: #331400; - --color-primary-300: #cc5200; - --color-primary-500: #ff7e29; - --color-primary-700: #ffa061; - --color-primary-900: #ffc299; - --color-secondary-0: #040127; - --color-secondary-100: #060240; - --color-secondary-300: #0b046c; - --color-secondary-500: #170cb6; - --color-secondary-700: #4c40e7; - --color-secondary-900: #a8a4ea; - --color-accent: var(--color-primary-500); - --color-accent-contrast: #fff; - --color-border: rgba(0, 0, 0, .1); - --color-surface: #ececec; - --color-dark-surface: rgba(26, 37, 22, .9); - --color-dark-surface-text: white; - --color-dark-surface-text-dim: #808080; - --color-light-surface: rgba(255, 255, 255, .9); - --color-light-surface-text: var(--color-text); - --color-accent-surface: var(--color-accent); - --color-accent-surface-text: var(--color-accent-contrast); - --color-highlight-accent: rgba(255, 145, 49, .2); - --color-highlight-blue: rgba(10, 10, 255, .2); - --color-highlight-white: rgba(200, 200, 200, .2); - --color-highlight-grey: rgba(100, 100, 100, .2); - --color-highlight-yellow: rgba(255, 230, 10, .2); - --color-highlight-green: rgba(10, 255, 10, .2); - --color-highlight-red: rgba(255, 10, 10, .2); - --color-highlight-pink: rgba(255, 128, 255, .2); - --color-highlight-purple: rgba(204, 30, 152, .2); - --color-text: black; - --color-background: var(--color-base); - --nav-space: 95px; - --fill-pattern: repeating-linear-gradient( var(--layout-slant), var(--color-base) 0, var(--color-primary-500) .5px 3px, var(--color-base) 3.5px 12px ); - --filter-gray: grayscale(1); + --padding: 30px; + --gap: 20px; + --radius: 20px; + --width: 700px; + --layout-slant: -30deg; + --color-base: #fff; + --color-primary-100: #331400; + --color-primary-300: #cc5200; + --color-primary-500: #ff7e29; + --color-primary-700: #ffa061; + --color-primary-900: #ffc299; + --color-secondary-0: #040127; + --color-secondary-100: #060240; + --color-secondary-300: #0b046c; + --color-secondary-500: #170cb6; + --color-secondary-700: #4c40e7; + --color-secondary-900: #a8a4ea; + --color-accent: var(--color-primary-500); + --color-accent-contrast: #fff; + --color-border: rgba(0, 0, 0, 0.1); + --color-surface: #ececec; + --color-dark-surface: rgba(26, 37, 22, 0.9); + --color-dark-surface-text: white; + --color-dark-surface-text-dim: #808080; + --color-light-surface: rgba(255, 255, 255, 0.9); + --color-light-surface-text: var(--color-text); + --color-accent-surface: var(--color-accent); + --color-accent-surface-text: var(--color-accent-contrast); + --color-highlight-accent: rgba(255, 145, 49, 0.2); + --color-highlight-blue: rgba(10, 10, 255, 0.2); + --color-highlight-white: rgba(200, 200, 200, 0.2); + --color-highlight-grey: rgba(100, 100, 100, 0.2); + --color-highlight-yellow: rgba(255, 230, 10, 0.2); + --color-highlight-green: rgba(10, 255, 10, 0.2); + --color-highlight-red: rgba(255, 10, 10, 0.2); + --color-highlight-pink: rgba(255, 128, 255, 0.2); + --color-highlight-purple: rgba(204, 30, 152, 0.2); + --color-text: black; + --color-background: var(--color-base); + --nav-space: 95px; + --fill-pattern: repeating-linear-gradient( + var(--layout-slant), + var(--color-base) 0, + var(--color-primary-500) 0.5px 3px, + var(--color-base) 3.5px 12px + ); + --filter-gray: grayscale(1); } body { - font-family: 'Roboto Flex Variable', sans-serif; -} \ No newline at end of file + font-family: 'Roboto Flex Variable', sans-serif; +} diff --git a/src/lib/components/ActionCard.svelte b/src/lib/components/ActionCard.svelte index 3826737..bb90cd8 100644 --- a/src/lib/components/ActionCard.svelte +++ b/src/lib/components/ActionCard.svelte @@ -1,53 +1,53 @@ diff --git a/src/lib/components/StoreGrid.svelte b/src/lib/components/StoreGrid.svelte index 631623d..eb35d33 100644 --- a/src/lib/components/StoreGrid.svelte +++ b/src/lib/components/StoreGrid.svelte @@ -1,19 +1,19 @@
- {#each actions as action} - - {/each} + {#each actions as action} + + {/each}
\ No newline at end of file + .store-grid { + display: grid; + grid-template-columns: repeat(6, 1fr); + gap: var(--gap); + } + diff --git a/src/lib/index.ts b/src/lib/index.ts index fe5dab1..80d8c6d 100644 --- a/src/lib/index.ts +++ b/src/lib/index.ts @@ -1,3 +1,3 @@ // Reexport your entry components here -export * from './types'; \ No newline at end of file +export * from './types'; diff --git a/src/lib/types.ts b/src/lib/types.ts index 9cfb45b..f5edc55 100644 --- a/src/lib/types.ts +++ b/src/lib/types.ts @@ -1,26 +1,26 @@ /** * An action to execute. */ -export type ActionType = "shock"|"vibrate"; +export type ActionType = 'shock' | 'vibrate'; /** * A body part an action can affect. */ -export type BodyPartKey = "throat"|"thigh"|"ankle"|"upper_arm"; +export type BodyPartKey = 'throat' | 'thigh' | 'ankle' | 'upper_arm'; /** * Time in seconds or burst. */ -export type Time = number|"burst"; +export type Time = number | 'burst'; /** * Entry in the coinshop. */ export type Action = { - id: string; - subject: string; - type: ActionType; - cost: number; - bodyPart: BodyPartKey; - time: Time; -}; \ No newline at end of file + id: string; + subject: string; + type: ActionType; + cost: number; + bodyPart: BodyPartKey; + time: Time; +}; diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 3e6de15..de13ada 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -1,8 +1,8 @@

Punish Raider

- \ No newline at end of file + diff --git a/src/stories/Button.stories.svelte b/src/stories/Button.stories.svelte index 4c8c7cc..d11a56d 100644 --- a/src/stories/Button.stories.svelte +++ b/src/stories/Button.stories.svelte @@ -1,24 +1,24 @@ diff --git a/src/stories/Button.svelte b/src/stories/Button.svelte index b2b820e..8941d26 100644 --- a/src/stories/Button.svelte +++ b/src/stories/Button.svelte @@ -1,26 +1,26 @@ diff --git a/src/stories/Configure.mdx b/src/stories/Configure.mdx index 549973e..f74b88b 100644 --- a/src/stories/Configure.mdx +++ b/src/stories/Configure.mdx @@ -1,35 +1,37 @@ -import { Meta } from "@storybook/blocks"; +import { Meta } from '@storybook/blocks'; -import Github from "./assets/github.svg"; -import Discord from "./assets/discord.svg"; -import Youtube from "./assets/youtube.svg"; -import Tutorials from "./assets/tutorials.svg"; -import Styling from "./assets/styling.png"; -import Context from "./assets/context.png"; -import Assets from "./assets/assets.png"; -import Docs from "./assets/docs.png"; -import Share from "./assets/share.png"; -import FigmaPlugin from "./assets/figma-plugin.png"; -import Testing from "./assets/testing.png"; -import Accessibility from "./assets/accessibility.png"; -import Theming from "./assets/theming.png"; -import AddonLibrary from "./assets/addon-library.png"; +import Github from './assets/github.svg'; +import Discord from './assets/discord.svg'; +import Youtube from './assets/youtube.svg'; +import Tutorials from './assets/tutorials.svg'; +import Styling from './assets/styling.png'; +import Context from './assets/context.png'; +import Assets from './assets/assets.png'; +import Docs from './assets/docs.png'; +import Share from './assets/share.png'; +import FigmaPlugin from './assets/figma-plugin.png'; +import Testing from './assets/testing.png'; +import Accessibility from './assets/accessibility.png'; +import Theming from './assets/theming.png'; +import AddonLibrary from './assets/addon-library.png'; -export const RightArrow = () => - - +export const RightArrow = () => ( + + + +); @@ -38,6 +40,7 @@ export const RightArrow = () =>
@@ -84,6 +87,7 @@ export const RightArrow = () =>
@@ -203,10 +207,11 @@ export const RightArrow = () => Discover tutorials
+