From 606cc0ca511710ce7cca0d06654406c41a69ce53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Ml=C3=A1dek?= Date: Thu, 7 Mar 2024 16:26:43 +0100 Subject: [PATCH] feat: new nav with categories & search; add internet speed test and timer test --- src/index.css | 7 +- src/lib/i18n.ts | 8 +- src/lib/locales/en.json | 49 ++++ src/routes/(pages)/+layout.svelte | 10 +- src/routes/(pages)/+page.svelte | 315 ++++++++++++++++++++--- src/routes/(pages)/internet/+page.svelte | 31 +++ src/routes/(pages)/timer/+page.svelte | 74 ++++++ 7 files changed, 448 insertions(+), 46 deletions(-) create mode 100644 src/lib/locales/en.json create mode 100644 src/routes/(pages)/internet/+page.svelte create mode 100644 src/routes/(pages)/timer/+page.svelte diff --git a/src/index.css b/src/index.css index 7c19cf8..efeefeb 100644 --- a/src/index.css +++ b/src/index.css @@ -44,13 +44,18 @@ button, .button { } } -input[type="number"] { +input[type="number"], input[type="search"], input[type="text"] { background: transparent; color: white; border: 1px solid white; border-radius: 4px; padding: 0.2em; + + &:focus { + outline: solid rgba(255, 255, 255, 0.66); + } + &:disabled { opacity: 0.7; pointer-events: none; diff --git a/src/lib/i18n.ts b/src/lib/i18n.ts index ad5830c..4e1229b 100644 --- a/src/lib/i18n.ts +++ b/src/lib/i18n.ts @@ -1,8 +1,14 @@ import i18next from 'i18next'; import { createI18nStore } from 'svelte-i18next'; +import enTranslation from './locales/en.json'; i18next.init({ - lng: 'en' + lng: 'en', + resources: { + en: { + translation: enTranslation + } + } }); export const i18n = createI18nStore(i18next); diff --git a/src/lib/locales/en.json b/src/lib/locales/en.json new file mode 100644 index 0000000..65b488f --- /dev/null +++ b/src/lib/locales/en.json @@ -0,0 +1,49 @@ +{ + "tests": { + "audio": { + "label": "Audio", + "description": "Check your stereo channels or surround audio output, verify if your speakers are in phase." + }, + "av-sync": { + "label": "Audio/Video Sync", + "description": "Check if your audio and video are in sync, and measure the delay." + }, + "card": { + "label": "Card", + "description": "Test card for your display or projector, check colors, resolution and geometry." + }, + "camera": { + "label": "Camera", + "description": "Check whether your webcam or capture device is working, its image quality, resolution and frame rate. Take a snapshot." + }, + "gamepad": { + "label": "Gamepad", + "description": "Test your gamepad, check if it's working, all the buttons and joysticks, stick drift, dead zones and calibration." + }, + "keyboard": { + "label": "Keyboard", + "description": "Check if all keys are working and what key codes they send." + }, + "microphone": { + "label": "Microphone", + "description": "Check if your microphone is working, its quality, volume and noise." + }, + "mouse": { + "label": "Mouse", + "description": "Check if your mouse or touch device works properly, if there are dead zones or jitter." + }, + "sensors": { + "label": "Sensors", + "description": "See the output of your device's sensors, e.g. GPS, accelerometer, gyroscope, compass, etc." + + }, + "internet": { + "label": "Internet speed", + "description": "Measure your internet speed, ping and jitter." + }, + "timer": { + "label": "High resolution timer", + "description": "Display a microsecond resolution timer on screen, useful for measuring video pipeline latency." + } + } +} diff --git a/src/routes/(pages)/+layout.svelte b/src/routes/(pages)/+layout.svelte index 136a390..de7905b 100644 --- a/src/routes/(pages)/+layout.svelte +++ b/src/routes/(pages)/+layout.svelte @@ -17,7 +17,10 @@ top: 50%; left: 50%; transform: translate(-50%, -50%); - background: rgba(0, 0, 0, 0.8); + height: 90vh; + width: 90vw; + + background: rgba(0, 0, 0, 0.85); border-radius: 0.5rem; border: 1px solid white; @@ -27,11 +30,6 @@ flex-direction: column; } - main.sub { - height: 90vh; - width: 90vw; - } - .button-back { position: absolute; top: 1rem; diff --git a/src/routes/(pages)/+page.svelte b/src/routes/(pages)/+page.svelte index 710d5b6..98ae007 100644 --- a/src/routes/(pages)/+page.svelte +++ b/src/routes/(pages)/+page.svelte @@ -1,53 +1,243 @@ - +

Total Tech Test

+ diff --git a/src/routes/(pages)/timer/+page.svelte b/src/routes/(pages)/timer/+page.svelte new file mode 100644 index 0000000..1328869 --- /dev/null +++ b/src/routes/(pages)/timer/+page.svelte @@ -0,0 +1,74 @@ + + +

{$i18n.t('High resolution timer')}

+
+
{time}
+
{displayFps} {$i18n.t('FPS')}
+
+ + +