chore: format

This commit is contained in:
Tomáš Mládek 2025-09-26 22:19:02 +02:00
parent e6009c619c
commit 9a46fd53c6
15 changed files with 244 additions and 230 deletions

View file

@ -9,7 +9,7 @@ steps:
- /var/run/docker.sock:/var/run/docker.sock - /var/run/docker.sock:/var/run/docker.sock
environment: environment:
FORCE_COLOR: 1 FORCE_COLOR: 1
EARTHLY_EXEC_CMD: "/bin/sh" EARTHLY_EXEC_CMD: '/bin/sh'
EARTHLY_CONFIGURATION: EARTHLY_CONFIGURATION:
from_secret: EARTHLY_CONFIGURATION from_secret: EARTHLY_CONFIGURATION
SSH_CONFIG: SSH_CONFIG:
@ -25,4 +25,4 @@ steps:
- earthly bootstrap - earthly bootstrap
- earthly --secret SSH_CONFIG --secret SSH_UPLOAD_KEY --secret SSH_KNOWN_HOSTS --secret SSH_TARGET --push +deploy - earthly --secret SSH_CONFIG --secret SSH_UPLOAD_KEY --secret SSH_KNOWN_HOSTS --secret SSH_TARGET --push +deploy
when: when:
branch: ["main"] branch: ['main']

View file

@ -1,3 +1,4 @@
html, body { html,
body {
margin: 0; margin: 0;
} }

View file

@ -1,7 +1,7 @@
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte' import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
export default { export default {
// Consult https://svelte.dev/docs#compile-time-svelte-preprocess // Consult https://svelte.dev/docs#compile-time-svelte-preprocess
// for more information about preprocessors // for more information about preprocessors
preprocess: vitePreprocess(), preprocess: vitePreprocess()
} };

View file

@ -1,7 +1,7 @@
import { defineConfig } from 'vite' import { defineConfig } from 'vite';
import { svelte } from '@sveltejs/vite-plugin-svelte' import { svelte } from '@sveltejs/vite-plugin-svelte';
// https://vitejs.dev/config/ // https://vitejs.dev/config/
export default defineConfig({ export default defineConfig({
plugins: [svelte()], plugins: [svelte()]
}) });

View file

@ -1,4 +1,5 @@
body, html { body,
html {
height: 100%; height: 100%;
margin: 0; margin: 0;
display: flex; display: flex;
@ -8,7 +9,8 @@ body, html {
color: white; color: white;
background-color: black; background-color: black;
font-family: 'Atkinson Hyperlegible', 'B612', 'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif; font-family:
'Atkinson Hyperlegible', 'B612', 'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif;
font-size: 20px; font-size: 20px;
} }
@ -20,12 +22,15 @@ a {
color: white; color: white;
} }
h1,
h1, h2, h3, h4 { h2,
h3,
h4 {
margin-top: 0; margin-top: 0;
} }
button, .button { button,
.button {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
gap: 0.25em; gap: 0.25em;
@ -44,14 +49,15 @@ button, .button {
} }
} }
input[type="number"], input[type="search"], input[type="text"] { input[type='number'],
input[type='search'],
input[type='text'] {
background: transparent; background: transparent;
color: white; color: white;
border: 1px solid white; border: 1px solid white;
border-radius: 4px; border-radius: 4px;
padding: 0.2em; padding: 0.2em;
&:focus { &:focus {
outline: solid rgba(255, 255, 255, 0.66); outline: solid rgba(255, 255, 255, 0.66);
} }

View file

@ -115,9 +115,9 @@
</div> </div>
<div class="grid"> <div class="grid">
{#each [...Array(verticalCount).keys()] as x} {#each [...Array(verticalCount).keys()] as x}
<div class="row" data-idx="{x}"> <div class="row" data-idx={x}>
{#each [...Array(horizontalCount).keys()] as y} {#each [...Array(horizontalCount).keys()] as y}
<div class="block" data-idx="{y}"></div> <div class="block" data-idx={y}></div>
{/each} {/each}
</div> </div>
{/each} {/each}

View file

@ -28,7 +28,7 @@
.separator { .separator {
position: relative; position: relative;
bottom: .15em; bottom: 0.15em;
margin: 0 .05em; margin: 0 0.05em;
} }
</style> </style>

View file

@ -5,7 +5,7 @@
let screenResolution = $state('... x ...'); let screenResolution = $state('... x ...');
let windowResolution = $state(''); let windowResolution = $state('');
let dpr = $state("1"); let dpr = $state('1');
function updateResolution() { function updateResolution() {
const realWidth = Math.round(screen.width) * window.devicePixelRatio; const realWidth = Math.round(screen.width) * window.devicePixelRatio;
@ -35,8 +35,8 @@
<div class="value">{windowResolution}</div> <div class="value">{windowResolution}</div>
</div> </div>
{/if} {/if}
{#if dpr !== "1"} {#if dpr !== '1'}
<div class="dpr">{$i18n.t("Device Pixel Ratio")}: {dpr}</div> <div class="dpr">{$i18n.t('Device Pixel Ratio')}: {dpr}</div>
{/if} {/if}
</div> </div>
</div> </div>
@ -51,7 +51,8 @@
font-weight: bold; font-weight: bold;
} }
.window, .dpr { .window,
.dpr {
margin-top: calc(1em / 0.8); margin-top: calc(1em / 0.8);
font-size: 0.8em; font-size: 0.8em;
} }

View file

@ -35,7 +35,6 @@
"sensors": { "sensors": {
"label": "Sensors", "label": "Sensors",
"description": "See the output of your device's sensors, e.g. GPS, accelerometer, gyroscope, compass, etc." "description": "See the output of your device's sensors, e.g. GPS, accelerometer, gyroscope, compass, etc."
}, },
"internet": { "internet": {
"label": "Internet speed", "label": "Internet speed",

View file

@ -4,7 +4,7 @@
import { version } from '../../../package.json'; import { version } from '../../../package.json';
import { i18n } from '$lib/i18n'; import { i18n } from '$lib/i18n';
import type { Snapshot } from '@sveltejs/kit'; import type { Snapshot } from '@sveltejs/kit';
const buildDate = import.meta.env.VITE_BUILD_DATE || "???"; const buildDate = import.meta.env.VITE_BUILD_DATE || '???';
let search = $state(''); let search = $state('');
@ -155,13 +155,15 @@
} }
} }
let nonEmptyCategories = $derived(categories.filter((category) => { let nonEmptyCategories = $derived(
categories.filter((category) => {
const categoryTests = filteredTests.filter((test) => test.categories.includes(category.id)); const categoryTests = filteredTests.filter((test) => test.categories.includes(category.id));
return categoryTests.some( return categoryTests.some(
(test) => (test) =>
!filteredCategories.length || filteredCategories.every((f) => test.categories.includes(f)) !filteredCategories.length || filteredCategories.every((f) => test.categories.includes(f))
); );
})); })
);
export const snapshot: Snapshot<string> = { export const snapshot: Snapshot<string> = {
capture: () => JSON.stringify({ filtered: filteredCategories, search }), capture: () => JSON.stringify({ filtered: filteredCategories, search }),
@ -224,7 +226,12 @@
{/each} {/each}
</div> </div>
</nav> </nav>
<footer><a href="https://git.thm.place/thm/test-card">testcard v{version} {#if version.startsWith("0")}({buildDate}){/if}</a></footer> <footer>
<a href="https://git.thm.place/thm/test-card"
>testcard v{version}
{#if version.startsWith('0')}({buildDate}){/if}</a
>
</footer>
<style> <style>
nav { nav {

View file

@ -3,5 +3,5 @@ import type { PageLoad } from './$types';
export const load: PageLoad = () => { export const load: PageLoad = () => {
return { return {
root: true root: true
} };
} };