Skip to content

web search done right

Add multiple themes (#97)

Oliver Bøving253bd252b102
diff --git a/frontend/package.json b/frontend/package.json
index dd688a33..232cc0dd 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -52,6 +52,7 @@
},
"type": "module",
"dependencies": {
+ "colord": "^2.9.3",
"file-saver": "^2.0.5",
"highlight.js": "^11.8.0",
"lz-string": "^1.5.0",
diff --git a/frontend/src/app.css b/frontend/src/app.css
index c94dc8ee..6cad7d8a 100644
--- a/frontend/src/app.css
+++ b/frontend/src/app.css
@@ -3,9 +3,20 @@
@tailwind utilities;
@layer base {
+ :root,
+ html {
+ @apply theme-light bg-base-100 text-base-content transition-colors duration-300;
+ }
+ @media (prefers-color-scheme: dark) {
+ :root,
+ html {
+ @apply theme-dark;
+ }
+ }
+
*,
::before,
::after {
- @apply dark:border-stone-700;
+ @apply border-base-300;
}
}
diff --git a/frontend/src/app.html b/frontend/src/app.html
index 49ae7480..9eb312ca 100644
--- a/frontend/src/app.html
+++ b/frontend/src/app.html
@@ -12,6 +12,9 @@
href="/opensearch.xml"
/>
<title>Stract</title>
+ <script nonce="%sveltekit.nonce%">
+ document.documentElement.classList.add(JSON.parse(localStorage.getItem('theme')));
+ </script>
%sveltekit.head%
</head>
<body data-sveltekit-preload-data="hover">
diff --git a/frontend/src/lib/api/schema.d.ts b/frontend/src/lib/api/schema.d.ts
index 18fef9b8..739119ac 100644
--- a/frontend/src/lib/api/schema.d.ts
+++ b/frontend/src/lib/api/schema.d.ts
@@ -3,39 +3,42 @@
* Do not make direct changes to the file.
*/
-
/** OneOf type helpers */
type Without<T, U> = { [P in Exclude<keyof T, keyof U>]?: never };
-type XOR<T, U> = (T | U) extends object ? (Without<T, U> & U) | (Without<U, T> & T) : T | U;
-type OneOf<T extends any[]> = T extends [infer Only] ? Only : T extends [infer A, infer B, ...infer Rest] ? OneOf<[XOR<A, B>, ...Rest]> : never;
+type XOR<T, U> = T | U extends object ? (Without<T, U> & U) | (Without<U, T> & T) : T | U;
+type OneOf<T extends any[]> = T extends [infer Only]
+ ? Only
+ : T extends [infer A, infer B, ...infer Rest]
+ ? OneOf<[XOR<A, B>, ...Rest]>
+ : never;
export interface paths {
- "/beta/api/alice": {
- get: operations["alice_route"];
+ '/beta/api/alice': {
+ get: operations['alice_route'];
};
- "/beta/api/autosuggest": {
- post: operations["route"];
+ '/beta/api/autosuggest': {
+ post: operations['route'];
};
- "/beta/api/explore/export": {
- post: operations["explore_export_optic"];
+ '/beta/api/explore/export': {
+ post: operations['explore_export_optic'];
};
- "/beta/api/fact_check": {
- post: operations["fact_check_route"];
+ '/beta/api/fact_check': {
+ post: operations['fact_check_route'];
};
- "/beta/api/search": {
- post: operations["api"];
+ '/beta/api/search': {
+ post: operations['api'];
};
- "/beta/api/sites/export": {
- post: operations["sites_export_optic"];
+ '/beta/api/sites/export': {
+ post: operations['sites_export_optic'];
};
- "/beta/api/summarize": {
- get: operations["summarize_route"];
+ '/beta/api/summarize': {
+ get: operations['summarize_route'];
};
- "/beta/api/webgraph/knows_site": {
- post: operations["knows_site"];
+ '/beta/api/webgraph/knows_site': {
+ post: operations['knows_site'];
};
- "/beta/api/webgraph/similar_sites": {
- post: operations["similar_sites"];
+ '/beta/api/webgraph/similar_sites': {
+ post: operations['similar_sites'];
};
}
@@ -57,16 +60,18 @@ export interface components {
query: string;
returnRankingSignals?: boolean;
safeSearch?: boolean | null;
- selectedRegion?: components["schemas"]["Region"] | null;
- siteRankings?: components["schemas"]["SiteRankings"] | null;
- };
- ApiSearchResult: (components["schemas"]["WebsitesResult"] & {
- /** @enum {string} */
- type: "websites";
- }) | (components["schemas"]["BangHit"] & {
- /** @enum {string} */
- type: "bang";
- });
+ selectedRegion?: components['schemas']['Region'] | null;
+ siteRankings?: components['schemas']['SiteRankings'] | null;
+ };
+ ApiSearchResult:
+ | (components['schemas']['WebsitesResult'] & {
+ /** @enum {string} */
+ type: 'websites';
+ })
+ | (components['schemas']['BangHit'] & {
+ /** @enum {string} */
+ type: 'bang';
+ });
Bang: {
c?: string | null;
d?: string | null;
@@ -77,24 +82,26 @@ export interface components {
u: string;
};
BangHit: {
- bang: components["schemas"]["Bang"];
- redirectTo: components["schemas"]["UrlWrapper"];
+ bang: components['schemas']['Bang'];
+ redirectTo: components['schemas']['UrlWrapper'];
};
Calculation: {
- expr: components["schemas"]["Expr"];
+ expr: components['schemas']['Expr'];
input: string;
/** Format: double */
result: number;
};
- CodeOrText: {
- /** @enum {string} */
- type: "code";
- value: string;
- } | {
- /** @enum {string} */
- type: "text";
- value: string;
- };
+ CodeOrText:
+ | {
+ /** @enum {string} */
+ type: 'code';
+ value: string;
+ }
+ | {
+ /** @enum {string} */
+ type: 'text';
+ value: string;
+ };
DisplayedAnswer: {
answer: string;
prettyUrl: string;
@@ -104,10 +111,10 @@ export interface components {
};
DisplayedEntity: {
imageBase64?: string | null;
- info: ((string & string)[])[];
+ info: (string & string)[][];
/** Format: float */
matchScore: number;
- relatedEntities: components["schemas"]["DisplayedEntity"][];
+ relatedEntities: components['schemas']['DisplayedEntity'][];
smallAbstract: string;
title: string;
};
@@ -115,44 +122,53 @@ export interface components {
domain: string;
prettyUrl: string;
rankingSignals?: {
- [key: string]: components["schemas"]["SignalScore"];
+ [key: string]: components['schemas']['SignalScore'];
} | null;
site: string;
- snippet: components["schemas"]["Snippet"];
+ snippet: components['schemas']['Snippet'];
title: string;
url: string;
};
/** @description base64 encoded `EncryptedState` */
EncodedEncryptedState: string;
EncodedSavedState: string;
- ExecutionState: {
- query: string;
- /** @enum {string} */
- type: "beginSearch";
- } | {
- query: string;
- result: components["schemas"]["SimplifiedWebsite"][];
- /** @enum {string} */
- type: "searchResult";
- } | {
- text: string;
- /** @enum {string} */
- type: "speaking";
- } | {
- state: components["schemas"]["EncodedEncryptedState"];
- /** @enum {string} */
- type: "done";
- };
+ ExecutionState:
+ | {
+ query: string;
+ /** @enum {string} */
+ type: 'beginSearch';
+ }
+ | {
+ query: string;
+ result: components['schemas']['SimplifiedWebsite'][];
+ /** @enum {string} */
+ type: 'searchResult';
+ }
+ | {
+ text: string;
+ /** @enum {string} */
+ type: 'speaking';
+ }
+ | {
+ state: components['schemas']['EncodedEncryptedState'];
+ /** @enum {string} */
+ type: 'done';
+ };
ExploreExportOpticParams: {
chosenSites: string[];
similarSites: string[];
};
- Expr: OneOf<[{
- /** Format: double */
- Number: number;
- }, {
- Op: Record<string, never>[];
- }]>;
+ Expr: OneOf<
+ [
+ {
+ /** Format: double */
+ Number: number;
+ },
+ {
+ Op: Record<string, never>[];
+ },
+ ]
+ >;
FactCheckParams: {
claim: string;
evidence: string;
@@ -165,34 +181,38 @@ export interface components {
highlighted: string;
raw: string;
};
- KnowsSite: {
- site: string;
- /** @enum {string} */
- type: "known";
- } | {
- /** @enum {string} */
- type: "unknown";
- };
+ KnowsSite:
+ | {
+ site: string;
+ /** @enum {string} */
+ type: 'known';
+ }
+ | {
+ /** @enum {string} */
+ type: 'unknown';
+ };
/** @enum {string} */
- Region: "All" | "Denmark" | "France" | "Germany" | "Spain" | "US";
+ Region: 'All' | 'Denmark' | 'France' | 'Germany' | 'Spain' | 'US';
ScoredSite: {
description?: string | null;
/** Format: double */
score: number;
site: string;
};
- Sidebar: {
- /** @enum {string} */
- type: "entity";
- value: components["schemas"]["DisplayedEntity"];
- } | {
- /** @enum {string} */
- type: "stackOverflow";
- value: {
- answer: components["schemas"]["StackOverflowAnswer"];
- title: string;
- };
- };
+ Sidebar:
+ | {
+ /** @enum {string} */
+ type: 'entity';
+ value: components['schemas']['DisplayedEntity'];
+ }
+ | {
+ /** @enum {string} */
+ type: 'stackOverflow';
+ value: {
+ answer: components['schemas']['StackOverflowAnswer'];
+ title: string;
+ };
+ };
SignalScore: {
/** Format: double */
coefficient: number;
@@ -215,63 +235,65 @@ export interface components {
liked: string[];
};
SitesExportOpticParams: {
- siteRankings: components["schemas"]["SiteRankings"];
- };
- Snippet: ({
- date?: string | null;
- text: components["schemas"]["TextSnippet"];
- /** @enum {string} */
- type: "normal";
- }) | {
- answers: components["schemas"]["StackOverflowAnswer"][];
- question: components["schemas"]["StackOverflowQuestion"];
- /** @enum {string} */
- type: "stackOverflowQA";
- };
+ siteRankings: components['schemas']['SiteRankings'];
+ };
+ Snippet:
+ | {
+ date?: string | null;
+ text: components['schemas']['TextSnippet'];
+ /** @enum {string} */
+ type: 'normal';
+ }
+ | {
+ answers: components['schemas']['StackOverflowAnswer'][];
+ question: components['schemas']['StackOverflowQuestion'];
+ /** @enum {string} */
+ type: 'stackOverflowQA';
+ };
StackOverflowAnswer: {
accepted: boolean;
- body: components["schemas"]["CodeOrText"][];
+ body: components['schemas']['CodeOrText'][];
date: string;
/** Format: int32 */
upvotes: number;
url: string;
};
StackOverflowQuestion: {
- body: components["schemas"]["CodeOrText"][];
+ body: components['schemas']['CodeOrText'][];
};
Suggestion: {
highlighted: string;
raw: string;
};
TextSnippet: {
- fragments: components["schemas"]["TextSnippetFragment"][];
+ fragments: components['schemas']['TextSnippetFragment'][];
};
TextSnippetFragment: {
- kind: components["schemas"]["TextSnippetFragmentKind"];
+ kind: components['schemas']['TextSnippetFragmentKind'];
text: string;
};
/** @enum {string} */
- TextSnippetFragmentKind: "normal" | "highlighted";
+ TextSnippetFragmentKind: 'normal' | 'highlighted';
/**
* Url
* @description Wrapper around `Url` that implements `ToSchema` for `Url`.
*/
UrlWrapper: string;
WebsitesResult: {
- directAnswer?: components["schemas"]["DisplayedAnswer"] | null;
- discussions?: components["schemas"]["DisplayedWebpage"][] | null;
+ directAnswer?: components['schemas']['DisplayedAnswer'] | null;
+ discussions?: components['schemas']['DisplayedWebpage'][] | null;
hasMoreResults: boolean;
numHits: number;
searchDurationMs: number;
- sidebar?: components["schemas"]["Sidebar"] | null;
- spellCorrectedQuery?: components["schemas"]["HighlightedSpellCorrection"] | null;
- webpages: components["schemas"]["DisplayedWebpage"][];
- widget?: components["schemas"]["Widget"] | null;
+ sidebar?: components['schemas']['Sidebar'] | null;
+ spellCorrectedQuery?: components['schemas']['HighlightedSpellCorrection'] | null;
+ webpages: components['schemas']['DisplayedWebpage'][];
+ widget?: components['schemas']['Widget'] | null;
};
Widget: {
/** @enum {string} */
- type: "calculator";
- value: components["schemas"]["Calculation"];
+ type: 'calculator';
+ value: components['schemas']['Calculation'];
};
};
responses: never;
@@ -286,20 +308,19 @@ export type $defs = Record<string, never>;
export type external = Record<string, never>;
export interface operations {
-
alice_route: {
parameters: {
query: {
message: string;
optic?: string | null;
- prevState?: components["schemas"]["EncodedSavedState"] | null;
+ prevState?: components['schemas']['EncodedSavedState'] | null;
};
};
responses: {
/** @description Interact with Alice */
200: {
content: {
- "application/json": components["schemas"]["ExecutionState"];
+ 'application/json': components['schemas']['ExecutionState'];
};
};
};
@@ -314,7 +335,7 @@ export interface operations {
/** @description Autosuggest */
200: {
content: {
- "application/json": components["schemas"]["Suggestion"][];
+ 'application/json': components['schemas']['Suggestion'][];
};
};
};
@@ -322,14 +343,14 @@ export interface operations {
explore_export_optic: {
requestBody: {
content: {
- "application/json": components["schemas"]["ExploreExportOpticParams"];
+ 'application/json': components['schemas']['ExploreExportOpticParams'];
};
};
responses: {
/** @description Export explored sites as an optic */
200: {
content: {
- "text/plain": string;
+ 'text/plain': string;
};
};
};
@@ -337,14 +358,14 @@ export interface operations {
fact_check_route: {
requestBody: {
content: {
- "application/json": components["schemas"]["FactCheckParams"];
+ 'application/json': components['schemas']['FactCheckParams'];
};
};
responses: {
/** @description Fact check the given claim against the given evidence */
200: {
content: {
- "application/json": components["schemas"]["FactCheckResponse"];
+ 'application/json': components['schemas']['FactCheckResponse'];
};
};
};
@@ -352,14 +373,14 @@ export interface operations {
api: {
requestBody: {
content: {
- "application/json": components["schemas"]["ApiSearchQuery"];
+ 'application/json': components['schemas']['ApiSearchQuery'];
};
};
responses: {
/** @description Search results */
200: {
content: {
- "application/json": components["schemas"]["ApiSearchResult"];
+ 'application/json': components['schemas']['ApiSearchResult'];
};
};
};
@@ -367,14 +388,14 @@ export interface operations {
sites_export_optic: {
requestBody: {
content: {
- "application/json": components["schemas"]["SitesExportOpticParams"];
+ 'application/json': components['schemas']['SitesExportOpticParams'];
};
};
responses: {
/** @description Export site rankings as an optic */
200: {
content: {
- "text/plain": string;
+ 'text/plain': string;
};
};
};
@@ -390,7 +411,7 @@ export interface operations {
/** @description Summarize a website */
200: {
content: {
- "text/plain": string;
+ 'text/plain': string;
};
};
};
@@ -405,7 +426,7 @@ export interface operations {
/** @description Whether the site is known */
200: {
content: {
- "application/json": components["schemas"]["KnowsSite"];
+ 'application/json': components['schemas']['KnowsSite'];
};
};
};
@@ -413,14 +434,14 @@ export interface operations {
similar_sites: {
requestBody: {
content: {
- "application/json": components["schemas"]["SimilarSitesParams"];
+ 'application/json': components['schemas']['SimilarSitesParams'];
};
};
responses: {
/** @description List of similar sites */
200: {
content: {
- "application/json": components["schemas"]["ScoredSite"][];
+ 'application/json': components['schemas']['ScoredSite'][];
};
};
};
diff --git a/frontend/src/lib/components/Button.svelte b/frontend/src/lib/components/Button.svelte
index 1df414ab..85e166f6 100644
--- a/frontend/src/lib/components/Button.svelte
+++ b/frontend/src/lib/components/Button.svelte
@@ -1,7 +1,15 @@
<script lang="ts">
import { twMerge } from 'tailwind-merge';
- type Kind = 'brand' | 'amber' | 'red';
+ type Kind =
+ | 'primary'
+ | 'seconday'
+ | 'accent'
+ | 'neutral'
+ | 'info'
+ | 'success'
+ | 'warning'
+ | 'error';
export let title: string | undefined = void 0;
export let form: string | undefined = void 0;
@@ -9,7 +17,7 @@
export let pale: boolean = false;
export let padding: boolean = true;
- export let kind: Kind = 'brand';
+ export let kind: Kind = 'primary';
</script>
<button
@@ -18,47 +26,61 @@
{form}
{type}
class={twMerge(
- 'noscript:hidden rounded-full py-2 transition',
+ 'rounded-full py-2 transition active:scale-[98%]',
padding ? 'px-4' : 'px-2',
- 'text-white dark:text-white',
'border border-transparent',
pale
? [
- kind == 'brand' && [
- 'text-brand-900 dark:text-brand-50',
- 'bg-white hover:bg-brand-50 active:bg-brand-100',
- 'dark:bg-transparent dark:hover:bg-brand-800 dark:active:bg-brand-700',
- 'border-brand-100 hover:border-brand-200 active:border-brand-300',
- 'dark:border-brand-600 dark:hover:border-brand-500 dark:active:border-brand-400',
+ kind == 'primary' && [
+ 'text-primary hover:text-primary-focus',
+ 'bg-transparent hover:bg-primary/5 active:bg-primary/20',
+ 'border-primary/20 hover:border-primary active:border-primary',
],
- kind == 'amber' && [
- 'text-amber-900 dark:text-amber-50',
- 'bg-white hover:bg-amber-50 active:bg-amber-100',
- 'dark:bg-transparent dark:hover:bg-amber-800 dark:active:bg-amber-700',
- 'border-amber-100 hover:border-amber-200 active:border-amber-300',
- 'dark:border-amber-600 dark:hover:border-amber-500 dark:active:border-amber-400',
+ kind == 'seconday' && [
+ 'text-secondary hover:text-secondary-focus',
+ 'bg-transparent hover:bg-secondary/5 active:bg-secondary/20',
+ 'border-secondary/20 hover:border-secondary active:border-secondary',
],
- kind == 'red' && [
- 'text-red-900 dark:text-red-50',
- 'bg-white hover:bg-red-50 active:bg-red-100',
- 'dark:bg-transparent dark:hover:bg-red-800 dark:active:bg-red-700',
- 'border-red-100 hover:border-red-200 active:border-red-300',
- 'dark:border-red-600 dark:hover:border-red-500 dark:active:border-red-400',
+ kind == 'accent' && [
+ 'text-accent hover:text-accent-focus',
+ 'bg-transparent hover:bg-accent/5 active:bg-accent/20',
+ 'border-accent/20 hover:border-accent active:border-accent',
],
- ]
- : [
- kind == 'brand' && [
- 'bg-brand-500 hover:bg-brand-600 active:bg-brand-700',
- 'dark:bg-brand-800 dark:hover:bg-brand-700 dark:active:bg-brand-600',
+ kind == 'neutral' && [
+ 'text-neutral hover:text-neutral-focus',
+ 'bg-transparent hover:bg-neutral/5 active:bg-neutral/20',
+ 'border-neutral/20 hover:border-neutral active:border-neutral',
+ ],
+ kind == 'info' && [
+ 'text-info hover:text-info-focus',
+ 'bg-transparent hover:bg-info/5 active:bg-info/20',
+ 'border-info/20 hover:border-info active:border-info',
],
- kind == 'amber' && [
- 'bg-amber-500 hover:bg-amber-600 active:bg-amber-700',
- 'dark:bg-amber-800 dark:hover:bg-amber-700 dark:active:bg-amber-600',
+ kind == 'success' && [
+ 'text-success hover:text-success-focus',
+ 'bg-transparent hover:bg-success/5 active:bg-success/20',
+ 'border-success/20 hover:border-success active:border-success',
],
- kind == 'red' && [
- 'bg-red-500 hover:bg-red-600 active:bg-red-700',
- 'dark:bg-red-800 dark:hover:bg-red-700 dark:active:bg-red-600',
+ kind == 'warning' && [
+ 'text-warning hover:text-warning-focus',
+ 'bg-transparent hover:bg-warning/5 active:bg-warning/20',
+ 'border-warning/20 hover:border-warning active:border-warning',
],
+ kind == 'error' && [
+ 'text-error hover:text-error-focus',
+ 'bg-transparent hover:bg-error/5 active:bg-error/20',
+ 'border-error/20 hover:border-error active:border-error',
+ ],
+ ]
+ : [
+ kind == 'primary' && 'bg-primary text-primary-content hover:bg-primary-focus',
+ kind == 'seconday' && 'bg-secondary text-secondary-content hover:bg-secondary-focus',
+ kind == 'accent' && 'bg-accent text-accent-content hover:bg-accent-focus',
+ kind == 'neutral' && 'bg-neutral text-neutral-content hover:bg-neutral-focus',
+ kind == 'info' && 'bg-info text-info-content hover:bg-info-focus',
+ kind == 'success' && 'bg-success text-success-content hover:bg-success-focus',
+ kind == 'warning' && 'bg-warning text-warning-content hover:bg-warning-focus',
+ kind == 'error' && 'bg-error text-error-content hover:bg-error-focus',
],
)}
>
diff --git a/frontend/src/lib/components/Callout.svelte b/frontend/src/lib/components/Callout.svelte
new file mode 100644
index 00000000..fb1278fe
--- /dev/null
+++ b/frontend/src/lib/components/Callout.svelte
@@ -0,0 +1,46 @@
+<script lang="ts">
+ import type { ComponentType } from 'svelte';
+ import XMark from '~icons/heroicons/x-mark';
+ import InformationCircle from '~icons/heroicons/information-circle';
+ import CheckCircle from '~icons/heroicons/check-circle';
+ import ExclamationCircle from '~icons/heroicons/exclamation-circle';
+ import Fire from '~icons/heroicons/fire';
+ import { twJoin } from 'tailwind-merge';
+
+ export let kind: 'info' | 'success' | 'warning' | 'error' | 'neutral';
+ export let icon: null | ComponentType = {
+ info: InformationCircle,
+ success: CheckCircle,
+ warning: ExclamationCircle,
+ error: Fire,
+ neutral: null,
+ }[kind];
+ export let title: string = kind;
+</script>
+
+<div
+ class={twJoin(
+ 'divide-y rounded p-2 shadow',
+ kind == 'info' && 'divide-info-content/20 bg-info text-info-content',
+ kind == 'success' && 'divide-success-content/20 bg-success text-success-content',
+ kind == 'warning' && 'divide-warning-content/20 bg-warning text-warning-content',
+ kind == 'error' && 'divide-error-content/20 bg-error text-error-content',
+ kind == 'neutral' && 'divide-base-300 bg-base-200 text-neutral',
+ )}
+>
+ <div>
+ <slot name="title">
+ <div class="flex items-center space-x-1.5 pb-1 font-bold capitalize tracking-wide">
+ <svelte:component this={icon} />
+ <span>
+ {title}
+ </span>
+ <div class="m-0 flex-1" />
+ <slot name="top-right" />
+ </div>
+ </slot>
+ </div>
+ <div class="pt-1">
+ <slot />
+ </div>
+</div>
diff --git a/frontend/src/lib/components/Code.svelte b/frontend/src/lib/components/Code.svelte
index 5800cf1b..27ac0fd3 100644
--- a/frontend/src/lib/components/Code.svelte
+++ b/frontend/src/lib/components/Code.svelte
@@ -8,9 +8,7 @@
import('svelte-highlight').then(({ HighlightAuto }) => HighlightAuto);
</script>
-<div
- class="code rounded-lg bg-slate-50 text-sm text-gray-600 dark:bg-stone-800 dark:text-brand-200"
->
+<div class="code rounded-lg bg-base-200 text-sm text-neutral-focus">
<div class="overflow-auto px-3 py-2">
{#await component}
<pre><code>{code}</code></pre>
@@ -22,21 +20,21 @@
<style lang="postcss">
.code :global(.hljs-keyword) {
- @apply text-brand-600 dark:text-brand-400;
+ @apply text-primary-focus;
}
.code :global(.hljs-number) {
- @apply text-teal-700 dark:text-teal-300;
+ @apply text-secondary;
}
.code :global(.hljs-literal) {
- @apply text-teal-700 dark:text-teal-300;
+ @apply text-secondary;
}
.code :global(.hljs-string) {
- @apply text-green-700 dark:text-green-300;
+ @apply text-accent-focus;
}
.code :global(.hljs-comment) {
- @apply text-teal-800 dark:text-teal-200/50;
+ @apply text-neutral/80;
}
.code :global(.hljs-title) {
- @apply text-emerald-600 dark:text-emerald-300;
+ @apply text-secondary-focus;
}
</style>
diff --git a/frontend/src/lib/components/Header.svelte b/frontend/src/lib/components/Header.svelte
index 520b74cd..8e8ad8ed 100644
--- a/frontend/src/lib/components/Header.svelte
+++ b/frontend/src/lib/components/Header.svelte
@@ -7,6 +7,7 @@
import { page } from '$app/stores';
import Link from './Link.svelte';
import { searchQueryStore } from '$lib/stores';
+ import BiglogoBeta from '$lib/images/BiglogoBeta.svelte';
$: links = [
[`/search${typeof $searchQueryStore == 'string' ? $searchQueryStore : ''}`, 'Search'],
@@ -34,9 +35,7 @@
href={url}
class={twJoin(
'relative z-10 border-b p-2',
- $page.url.pathname.startsWith(url.split('?')[0])
- ? 'border-contrast-500'
- : 'border-transparent',
+ $page.url.pathname.startsWith(url.split('?')[0]) ? 'border-accent' : 'border-transparent',
)}
>
{name}
@@ -47,13 +46,7 @@
<div class="flex items-center justify-center">
{#if showLogo}
<a href="/" class="w-20">
- <img alt="Stract logo" class="block dark:hidden" src="/images/biglogo-beta.svg" />
- <img
- alt="Stract logo dark version"
- aria-hidden="true"
- class="hidden dark:block"
- src="/images/biglogo-beta-alt.svg"
- />
+ <BiglogoBeta />
</a>
{/if}
</div>
@@ -73,14 +66,14 @@
<nav class="group relative flex items-center justify-end text-lg sm:hidden">
<button
- class="mx-1 aspect-square rounded-full bg-transparent px-3 text-gray-400 transition group-hover:text-brand-200"
+ class="mx-1 aspect-square rounded-full bg-transparent px-3 text-neutral transition group-hover:text-neutral-focus"
>
<Bars2 />
</button>
<div
- class="pointer-events-none absolute bottom-0 right-0 z-50 translate-y-full flex-col pt-1 opacity-0 transition group-hover:pointer-events-auto group-hover:flex group-hover:opacity-100"
+ class="pointer-events-none absolute bottom-0 right-0 z-50 translate-y-[calc(100%-1px)] flex-col pt-1 opacity-0 transition group-hover:pointer-events-auto group-hover:flex group-hover:opacity-100"
>
- <div class="rounded-xl border bg-white p-2 shadow-xl dark:bg-stone-900">
+ <div class="rounded-xl border bg-base-100 p-2 shadow-xl">
<div class="flex flex-col items-start space-y-1 pb-2">
{#each nav as [url, name]}
<Link href={url}>
@@ -101,7 +94,7 @@
{#if showDivider}
<div
- class="absolute inset-x-0 -bottom-0 h-px bg-gradient-to-r from-brand-400 via-brand-500 to-brand-400"
+ class="absolute inset-x-0 -bottom-0 h-px bg-gradient-to-r from-primary via-primary-focus to-primary"
/>
{/if}
</div>
diff --git a/frontend/src/lib/components/Link.svelte b/frontend/src/lib/components/Link.svelte
index 3c1c512a..1c7591b9 100644
--- a/frontend/src/lib/components/Link.svelte
+++ b/frontend/src/lib/components/Link.svelte
@@ -6,8 +6,10 @@
export let label: string | undefined = void 0;
export let exact: boolean = false;
export let round = false;
+ export let active = false;
- $: active = exact ? $page.url.pathname == href : $page.url.pathname.startsWith(href);
+ $: isActive =
+ active || (exact ? $page.url.pathname == href : $page.url.pathname.startsWith(href));
</script>
<a
@@ -16,9 +18,8 @@
class={twMerge(
'flex justify-center rounded-full transition',
round ? 'p-2' : 'px-2 py-1',
- 'text-gray-500 hover:bg-brand-100 hover:text-brand-600 active:bg-brand-50',
- 'dark:hover:bg-brand-900 dark:hover:text-stone-50 dark:active:bg-brand-800',
- active && 'bg-brand-50 text-brand-500 dark:bg-brand-800 dark:text-stone-100',
+ 'text-neutral-focus hover:bg-primary/10 hover:text-primary-focus active:bg-primary-focus/10',
+ isActive && 'bg-primary/20 text-primary-focus',
)}
>
<slot />
diff --git a/frontend/src/lib/components/OpticSelector.svelte b/frontend/src/lib/components/OpticSelector.svelte
index 9912d842..b882376f 100644
--- a/frontend/src/lib/components/OpticSelector.svelte
+++ b/frontend/src/lib/components/OpticSelector.svelte
@@ -8,6 +8,11 @@
export let selected = '';
const optics = derived(opticsStore, ($optics) => [...$optics, ...DEFAULT_OPTICS]);
+
+ $: options = [
+ { value: '', label: 'No Optic' },
+ ...$optics.map((optic) => ({ value: optic.url, label: optic.name })),
+ ];
</script>
<div class="m-0 flex h-full flex-col justify-center p-0">
@@ -15,15 +20,9 @@
form="searchbar-form"
id="optics-selector"
name="optic"
- className="m-0 font-light dark:text-stone-400"
+ class="m-0 font-light text-neutral-focus"
submitOnChange={searchOnChange}
bind:value={selected}
- >
- <option value="">No Optic</option>
- {#each $optics as optic}
- <option value={optic.url} title={optic.description} selected={selected == optic.url}>
- {optic.name}
- </option>
- {/each}
- </Select>
+ {options}
+ />
</div>
diff --git a/frontend/src/lib/components/RegionSelect.svelte b/frontend/src/lib/components/RegionSelect.svelte
index 0bce4f0c..daefaa5d 100644
--- a/frontend/src/lib/components/RegionSelect.svelte
+++ b/frontend/src/lib/components/RegionSelect.svelte
@@ -5,6 +5,11 @@
export let searchOnChange: boolean;
export let selected: Region = ALL_REGIONS[0];
+
+ $: options = ALL_REGIONS.map((region) => ({
+ value: region,
+ label: region == 'All' ? 'All Languages' : region,
+ }));
</script>
<div class="m-0 flex h-full flex-col justify-center p-0">
@@ -12,14 +17,9 @@
form="searchbar-form"
id="region-selector"
name="gl"
- className="m-0 font-light dark:text-stone-400"
+ className="m-0 font-light text-neutral-focus"
submitOnChange={searchOnChange}
bind:value={selected}
- >
- {#each ALL_REGIONS as region (region)}
- <option value={region} title={region} selected={region == selected}>
- {region == 'All' ? 'All Languages' : region}
- </option>
- {/each}
- </Select>
+ {options}
+ />
</div>
diff --git a/frontend/src/lib/components/Searchbar.svelte b/frontend/src/lib/components/Searchbar.svelte
index dd27757c..95bc4702 100644
--- a/frontend/src/lib/components/Searchbar.svelte
+++ b/frontend/src/lib/components/Searchbar.svelte
@@ -88,12 +88,12 @@
<label
for="searchbar"
class={twJoin(
- 'group relative grid w-full grid-cols-[auto_1fr_auto] items-center rounded-3xl border border-gray-300 py-0.5 pl-5 pr-0.5 transition dark:bg-stone-800',
+ 'group relative grid w-full grid-cols-[auto_1fr_auto] items-center rounded-3xl border border-base-300 py-0.5 pl-5 pr-0.5 transition focus-within:shadow',
hasFocus && suggestions.length > 0 && 'rounded-b-none',
- hasFocus ? 'shadow dark:border-stone-600' : 'dark:border-stone-700',
+ hasFocus && 'shadow',
)}
>
- <MagnifyingGlass class="w-5 text-gray-400" />
+ <MagnifyingGlass class="w-5 text-base-content" />
<!-- svelte-ignore a11y-autofocus -->
<input
type="search"
@@ -119,15 +119,16 @@
<Button type="submit">search</Button>
{#if suggestions.length > 0}
+ <div class="absolute inset-x-5 bottom-px hidden h-px bg-base-300 group-focus-within:block" />
<div
class={twJoin(
- 'absolute inset-x-5 bottom-px h-px bg-gray-200 dark:bg-stone-700',
+ 'absolute inset-x-5 bottom-px h-px bg-base-300',
hasFocus ? 'block' : 'hidden',
)}
/>
<div
class={twJoin(
- 'absolute -inset-x-px bottom-0 translate-y-full flex-col overflow-hidden rounded-3xl rounded-t-none border border-t-0 border-gray-300 bg-white shadow dark:border-stone-600',
+ 'absolute -inset-x-px bottom-0 translate-y-full flex-col overflow-hidden rounded-3xl rounded-t-none border border-t-0 border-base-300 bg-base-100 shadow',
hasFocus ? 'flex' : 'hidden',
)}
role="listbox"
@@ -136,8 +137,8 @@
{#each suggestions as s, index}
<button
class={twJoin(
- 'flex space-x-3 py-1.5 pl-5 hover:bg-gray-50 dark:bg-stone-800 dark:hover:bg-stone-900',
- selected == index && 'bg-gray-50 dark:bg-stone-900',
+ 'flex space-x-3 py-1.5 pl-5 hover:bg-base-200',
+ selected == index && 'bg-base-200',
)}
on:click={() => {
selectSuggestion(s);
@@ -145,13 +146,13 @@
}}
type="submit"
>
- <MagnifyingGlass class="w-4 text-gray-400" />
+ <MagnifyingGlass class="w-4 text-neutral" />
<span>
{@html splitAtOverlap(s)[0]}<span class="font-medium"
>{@html splitAtOverlap(s)[1]}</span
>
- </span>
- </button>
+ </span></button
+ >
{/each}
</div>
{/if}
diff --git a/frontend/src/lib/components/Select.svelte b/frontend/src/lib/components/Select.svelte
index a87cc620..a8dd9c48 100644
--- a/frontend/src/lib/components/Select.svelte
+++ b/frontend/src/lib/components/Select.svelte
@@ -1,27 +1,48 @@
-<script lang="ts">
- import { twMerge } from 'tailwind-merge';
+<script lang="ts" generics="T">
+ import { createEventDispatcher } from 'svelte';
- interface $$Props extends Omit<Partial<HTMLSelectElement>, 'form'> {
- form: string;
+ type Option = { value: T; label: string; title?: string };
+
+ interface $$Props extends Omit<Partial<HTMLSelectElement>, 'form' | 'value' | 'options'> {
+ class?: string;
+ value: T;
+ form?: string;
submitOnChange?: boolean;
+ options: Option[];
}
- export let value: string = '';
+ export let value: T;
export let form: string | undefined = void 0;
export let submitOnChange = false;
+ export let options: $$Props['options'];
+
+ const dispatch = createEventDispatcher<{ change: T }>();
</script>
-<select
- {...$$restProps}
- on:change
- bind:value
- {form}
- on:change={(e) => {
- if (submitOnChange && e?.target && e.target instanceof HTMLSelectElement)
- e.target.form?.submit();
- }}
- class={twMerge('rounded py-0 pl-1 pr-5', $$restProps.className)}
- style="background-color: rgba(0, 0, 0, 0); background-image: url(&quot;data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7' /%3E%3C/svg%3E&quot;); background-position: right center; background-repeat: no-repeat; text-align: right; cursor: pointer; font-size: 0.9rem; background-size: 1em 1em; border: none; appearance: none;"
->
- <slot />
-</select>
+<div>
+ <select
+ {...$$restProps}
+ {form}
+ on:change={(e) => {
+ if (!e?.target || !(e.target instanceof HTMLSelectElement)) return;
+
+ const chosen = options[e.target.options.selectedIndex];
+ value = chosen.value;
+ dispatch('change', chosen.value);
+
+ if (submitOnChange) e.target.form?.submit();
+ }}
+ >
+ {#each options as option}
+ <option value={option.value} selected={option.value == value} title={option.title}
+ >{option.label}</option
+ >
+ {/each}
+ </select>
+</div>
+
+<style lang="postcss">
+ select {
+ @apply rounded border-none bg-transparent py-0 text-right;
+ }
+</style>
diff --git a/frontend/src/lib/components/Site.svelte b/frontend/src/lib/components/Site.svelte
index 9069e8f0..f0e4349d 100644
--- a/frontend/src/lib/components/Site.svelte
+++ b/frontend/src/lib/components/Site.svelte
@@ -7,28 +7,26 @@
const dispatch = createEventDispatcher<{ delete: null }>();
</script>
-<span class="group flex overflow-hidden rounded-lg bg-brand-500 transition dark:bg-brand-800">
+<span class="group flex overflow-hidden rounded-lg bg-secondary transition">
<a
{href}
target="_blank"
class={twMerge(
- 'bg-brand-500 py-2',
- 'text-white',
- 'transition hover:bg-brand-600 active:bg-brand-700',
- 'dark:bg-brand-800 dark:hover:bg-brand-700 dark:active:bg-brand-600',
+ 'bg-secondary py-2',
+ 'text-primary-content',
+ 'transition hover:bg-secondary-focus',
'pl-3 pr-2',
)}
>
<slot />
</a>
- <span class="my-2 w-px bg-brand-100 transition group-hover:bg-transparent dark:bg-brand-950" />
+ <span class="my-2 w-px bg-primary-content transition group-hover:bg-transparent" />
<button
- class={twMerge(`
- remove-site cursor-pointer bg-brand-500 px-2 text-sm
- text-white
- transition hover:bg-brand-600 active:bg-brand-700
- dark:bg-brand-800 dark:hover:bg-brand-700 dark:active:bg-brand-600
- `)}
+ class={twMerge(
+ 'cursor-pointer bg-secondary px-2 text-sm',
+ 'text-primary-content',
+ 'transition hover:bg-secondary-focus',
+ )}
on:click={() => dispatch('delete')}
>
×
diff --git a/frontend/src/lib/components/ThemeSelect.svelte b/frontend/src/lib/components/ThemeSelect.svelte
new file mode 100644
index 00000000..a3ec9f7d
--- /dev/null
+++ b/frontend/src/lib/components/ThemeSelect.svelte
@@ -0,0 +1,14 @@
+<script lang="ts">
+ import Select from './Select.svelte';
+ import { themeStore } from '$lib/stores';
+ import { THEMES } from '$lib/themes';
+
+ $: options = [
+ { value: void 0, label: 'Auto' },
+ ...THEMES.map((t) => ({ value: t.class, label: t.name })),
+ ];
+</script>
+
+<div class="noscript:hidden">
+ <Select bind:value={$themeStore} class="text-neutral-focus" {options} />
+</div>
diff --git a/frontend/src/lib/images/BiglogoBeta.svelte b/frontend/src/lib/images/BiglogoBeta.svelte
new file mode 100644
index 00000000..1826b0fe
--- /dev/null
+++ b/frontend/src/lib/images/BiglogoBeta.svelte
@@ -0,0 +1,10 @@
+<svg class="block" viewBox="0 0 158 53" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <path
+ class="fill-primary-focus"
+ d="M14.3 31.2c-2.1 0-4-.3-6-1-1.8-.8-3.2-1.7-4.2-2.8l.9-1.5c1 1 2.3 1.8 4 2.5 1.6.7 3.4 1 5.2 1a12 12 0 0 0 4.6-.7 6 6 0 0 0 2.6-2c.6-.8 1-1.8 1-2.8 0-1.2-.4-2.1-1-2.9a6.7 6.7 0 0 0-2.6-1.7 251.2 251.2 0 0 1-7.1-2A18 18 0 0 1 8.3 16a7 7 0 0 1-2.6-2.2c-.6-.9-.9-2-.9-3.6 0-1.3.4-2.5 1-3.6.8-1.2 1.8-2 3.3-2.8 1.5-.7 3.4-1 5.6-1a15.6 15.6 0 0 1 8.5 2.5L22.4 7a13.5 13.5 0 0 0-12.1-1.6c-1.2.5-2 1.1-2.6 2-.6.8-.8 1.8-.8 2.8 0 1.2.3 2.2.9 2.9.6.7 1.5 1.3 2.5 1.7 1 .4 2.2.8 3.4 1a84.3 84.3 0 0 1 7.2 2.3c1 .6 1.8 1.3 2.5 2.2a6.8 6.8 0 0 1-3.4 10c-1.5.6-3.4.9-5.7.9Zm22-.2V4.8H26.2V3h22.2v1.8H38.3V31h-2Zm17.1 0V3h10c2.4 0 4.4.4 6.1 1.1 1.7.8 3 1.8 3.9 3.3a9 9 0 0 1 1.4 5c0 2-.5 3.7-1.4 5a9 9 0 0 1-3.9 3.3 14 14 0 0 1-6 1.1h-9l1-1V31h-2ZM73 31l-7.3-10.2H68L75.2 31h-2.3ZM55.5 21l-1-1h9c3 0 5.3-.6 6.8-2a7 7 0 0 0 2.4-5.6c0-2.4-.8-4.3-2.4-5.6-1.5-1.3-3.8-2-6.8-2h-9l1-1V21Zm22 10 13-28h2l12.8 28h-2.2L91 4.3h.9L79.7 31h-2.2Zm4.8-7.9.6-1.7h16.8l.7 1.7H82.3Zm39.6 8.1a14.2 14.2 0 0 1-13.4-8.5c-.8-1.8-1.1-3.6-1.1-5.7a14.4 14.4 0 0 1 4-10.2 15 15 0 0 1 10.4-4c2 0 3.9.3 5.6 1a11 11 0 0 1 4.4 2.9L130.6 8c-1.2-1.2-2.6-2-4-2.5a13.4 13.4 0 0 0-9.6.1 12.2 12.2 0 0 0-6.7 6.5 12.7 12.7 0 0 0 0 9.8 12.2 12.2 0 0 0 6.6 6.5 13.8 13.8 0 0 0 9.6.2c1.5-.6 2.9-1.4 4-2.6l1.3 1.3a11.8 11.8 0 0 1-4.4 3c-1.7.6-3.6.9-5.5.9Zm21.8-.2V4.8h-10.1V3h22.2v1.8h-10V31h-2.1Z"
+ />
+ <path
+ class="fill-neutral-focus"
+ d="M54.9 51V37h5.8a6 6 0 0 1 3.6 1 3 3 0 0 1 1.3 2.6 3.3 3.3 0 0 1-2 3.1c-.7.2-1.4.4-2.2.4l.4-.4c1 0 1.7.1 2.4.4a4 4 0 0 1 1.6 1.2c.3.5.5 1.2.5 2 0 1.2-.4 2-1.3 2.7-.8.7-2.1 1-3.9 1H55Zm1-.9h5.2c1.4 0 2.4-.2 3.1-.7.7-.4 1-1.2 1-2.2 0-1-.3-1.7-1-2.2a6 6 0 0 0-3-.7h-5.4v-.8h4.9c1.2 0 2.2-.3 2.8-.7.7-.5 1-1.2 1-2.1 0-1-.3-1.7-1-2.1-.6-.5-1.6-.7-2.8-.7h-4.8V50Zm15-6.7h7.5v1h-7.6v-1Zm0 6.7h8.7v.9h-9.7V37h9.4v1H71v12Zm15 .9V38h-5v-1h11.2v1h-5v13H86Zm5.6 0L98 37h1l6.4 14h-1l-6.1-13.4h.4l-6 13.4h-1.2Zm2.4-4 .3-.8h8.4l.4.9h-9.1Z"
+ />
+</svg>
diff --git a/frontend/src/lib/images/BiglogoWithText.svelte b/frontend/src/lib/images/BiglogoWithText.svelte
new file mode 100644
index 00000000..aa527239
--- /dev/null
+++ b/frontend/src/lib/images/BiglogoWithText.svelte
@@ -0,0 +1,10 @@
+<svg xmlns="http://www.w3.org/2000/svg" fill="none" class="h-full w-full" viewBox="0 0 366 125">
+ <path
+ class="fill-neutral"
+ d="M18.23 102.35h2.34a7.47 7.47 0 0 1-.96 3.01 5.64 5.64 0 0 1-2.21 2.11c-.95.52-2.14.77-3.56.77A6.31 6.31 0 0 1 8.8 106a7.77 7.77 0 0 1-1.42-2.6 11.1 11.1 0 0 1-.48-3.4v-1.77c0-1.24.16-2.37.49-3.38a7.63 7.63 0 0 1 1.43-2.6 6.37 6.37 0 0 1 2.26-1.68c.88-.4 1.86-.59 2.96-.59 1.35 0 2.48.25 3.4.76a5.3 5.3 0 0 1 2.17 2.1c.52.89.84 1.92.96 3.09h-2.34a6.53 6.53 0 0 0-.63-2.14 3.3 3.3 0 0 0-1.32-1.4 4.48 4.48 0 0 0-2.24-.48 4.2 4.2 0 0 0-3.59 1.73c-.4.56-.7 1.22-.9 2-.2.77-.3 1.63-.3 2.57v1.8c0 .86.09 1.68.26 2.45.2.76.47 1.43.85 2.01.37.58.85 1.04 1.42 1.37a4.1 4.1 0 0 0 2.06.49c1 0 1.8-.16 2.39-.48.6-.32 1.04-.77 1.34-1.37.31-.59.53-1.3.66-2.13Zm4.61-.8v-.29c0-.95.14-1.83.42-2.65a6.3 6.3 0 0 1 1.2-2.13 5.34 5.34 0 0 1 1.89-1.42 5.87 5.87 0 0 1 2.49-.51c.93 0 1.76.17 2.5.51a6.04 6.04 0 0 1 3.11 3.55c.28.82.42 1.7.42 2.65v.28c0 .95-.14 1.84-.42 2.65a6.35 6.35 0 0 1-1.2 2.14 5.54 5.54 0 0 1-4.39 1.91 5.67 5.67 0 0 1-5.6-4.05 8.17 8.17 0 0 1-.42-2.65Zm2.26-.29v.28c0 .66.08 1.28.23 1.87.16.58.4 1.1.7 1.54.32.45.71.8 1.18 1.06.48.25 1.03.38 1.65.38.62 0 1.16-.13 1.63-.38a3.4 3.4 0 0 0 1.17-1.06c.3-.45.54-.96.7-1.54.16-.59.24-1.2.24-1.87v-.28a6.5 6.5 0 0 0-.95-3.39 3.29 3.29 0 0 0-2.8-1.46c-.63 0-1.18.12-1.65.38-.46.26-.85.62-1.17 1.08-.3.45-.54.96-.7 1.55a7.1 7.1 0 0 0-.23 1.84Zm14.85-3.84V108h-2.27V94.8h2.14l.13 2.62Zm-.47 3.48-1.05-.04c.01-.9.13-1.74.36-2.5.22-.78.56-1.45 1.01-2.02.45-.57 1-1 1.67-1.32a5.34 5.34 0 0 1 2.32-.47c.62 0 1.19.09 1.71.27a3.44 3.44 0 0 1 2.25 2.25c.2.6.31 1.3.31 2.13v8.8h-2.25v-8.7c0-.68-.12-1.24-.36-1.65a2.02 2.02 0 0 0-.97-.9 3.5 3.5 0 0 0-1.5-.3c-.66 0-1.22.12-1.67.36-.44.23-.8.56-1.07.97-.27.42-.46.9-.59 1.43a7.99 7.99 0 0 0-.17 1.69Zm8.56-1.25-1.51.46a5.84 5.84 0 0 1 1.36-3.87 5.15 5.15 0 0 1 3.88-1.7c.71 0 1.34.1 1.88.29a3.4 3.4 0 0 1 1.4.87c.38.38.67.87.86 1.47a7 7 0 0 1 .3 2.15V108h-2.27v-8.7c0-.74-.12-1.32-.36-1.72-.23-.42-.55-.7-.98-.87a3.9 3.9 0 0 0-2.8 0c-.39.17-.7.4-.97.7a3.27 3.27 0 0 0-.79 2.24Zm13.84-2.32v15.75h-2.27V94.79h2.08l.2 2.54Zm8.9 3.96v.25c0 .96-.11 1.85-.34 2.68a6.57 6.57 0 0 1-1 2.12c-.43.6-.97 1.07-1.6 1.4a5.57 5.57 0 0 1-4.4.08 4.38 4.38 0 0 1-1.64-1.2 6.17 6.17 0 0 1-1.08-1.9 11 11 0 0 1-.53-2.5v-1.37c.1-.98.28-1.85.54-2.63.27-.77.63-1.43 1.07-1.98a4.3 4.3 0 0 1 1.62-1.25 5.2 5.2 0 0 1 2.2-.44 4.72 4.72 0 0 1 3.83 1.85c.44.6.77 1.3.99 2.14.23.82.34 1.74.34 2.75Zm-2.27.25v-.25c0-.66-.07-1.28-.2-1.86a4.69 4.69 0 0 0-.65-1.54 3.08 3.08 0 0 0-2.7-1.44 3.22 3.22 0 0 0-2.55 1.09c-.3.32-.54.7-.72 1.12-.18.42-.32.85-.4 1.3v3.16c.16.57.38 1.1.68 1.6.3.5.68.9 1.17 1.22.49.3 1.1.45 1.84.45a3.1 3.1 0 0 0 1.58-.38c.45-.26.81-.61 1.1-1.06.29-.45.5-.96.64-1.54a8 8 0 0 0 .21-1.87Zm7.6-12.29V108h-2.26V89.25h2.27Zm9.11 19c-.92 0-1.75-.16-2.5-.47a5.68 5.68 0 0 1-3.14-3.36 7.43 7.43 0 0 1-.42-2.56v-.51a8 8 0 0 1 .47-2.87 6.4 6.4 0 0 1 1.3-2.15 5.54 5.54 0 0 1 6.44-1.3c.7.33 1.26.79 1.7 1.37.44.58.76 1.26.97 2.05.22.79.32 1.64.32 2.57v1.01H80.5v-1.84h7.6v-.17a5.63 5.63 0 0 0-.36-1.71 3.02 3.02 0 0 0-.98-1.37 2.85 2.85 0 0 0-1.83-.54 3.07 3.07 0 0 0-2.53 1.29c-.3.42-.55.94-.72 1.55a7.86 7.86 0 0 0-.25 2.1v.52c0 .63.08 1.22.25 1.77.18.55.44 1.03.77 1.44.34.42.75.74 1.23.98.5.23 1.05.35 1.66.35.8 0 1.48-.16 2.03-.49a5.02 5.02 0 0 0 1.45-1.3l1.37 1.08a5.33 5.33 0 0 1-2.71 2.19c-.63.24-1.39.36-2.26.36Zm13.3-13.46v1.74H91.4v-1.74h7.14Zm-4.72-3.2h2.26v13.14c0 .45.07.78.2 1.01.15.23.33.38.55.45.22.08.45.11.7.11a3.66 3.66 0 0 0 1.07-.14V108a5.39 5.39 0 0 1-1.75.24c-.54 0-1.05-.1-1.51-.32a2.46 2.46 0 0 1-1.11-1.1 4.61 4.61 0 0 1-.4-2.1V91.58Zm12.86 16.65a5.68 5.68 0 0 1-5.64-3.82 7.42 7.42 0 0 1-.43-2.56v-.51a8 8 0 0 1 .48-2.87c.31-.85.75-1.56 1.3-2.15a5.55 5.55 0 0 1 6.44-1.3c.69.33 1.25.79 1.7 1.37.43.58.76 1.26.97 2.05.21.79.32 1.64.32 2.57v1.01h-9.87v-1.84h7.6v-.17a5.64 5.64 0 0 0-.36-1.71 3.07 3.07 0 0 0-.97-1.37 2.85 2.85 0 0 0-1.84-.54 3.07 3.07 0 0 0-2.52 1.29c-.31.42-.55.94-.72 1.55a7.85 7.85 0 0 0-.26 2.1v.52c0 .63.09 1.22.26 1.77.18.55.43 1.03.77 1.44.34.42.75.74 1.23.98.49.23 1.04.35 1.66.35.8 0 1.47-.16 2.03-.49a5.01 5.01 0 0 0 1.45-1.3l1.37 1.08a5.33 5.33 0 0 1-2.71 2.19 6.3 6.3 0 0 1-2.26.36Zm10.23-18.99V108h-2.27V89.25h2.27Zm7.33 17.38 3.68-11.84h2.41l-5.3 15.25c-.12.32-.28.67-.48 1.05-.2.38-.45.74-.76 1.08a3.6 3.6 0 0 1-2.67 1.16 6.52 6.52 0 0 1-1.27-.2l-.01-1.82a6.09 6.09 0 0 0 .6.05c.52 0 .95-.07 1.31-.21.36-.13.66-.36.9-.67a4 4 0 0 0 .65-1.28l.94-2.57Zm-2.7-11.84 3.44 10.26.58 2.38-1.62.83-4.86-13.47h2.47Zm31.06 3.76v1.12c0 1.34-.17 2.54-.5 3.6a7.72 7.72 0 0 1-1.44 2.7 6.24 6.24 0 0 1-2.26 1.69 7.1 7.1 0 0 1-2.93.58 6.5 6.5 0 0 1-5.16-2.28 7.9 7.9 0 0 1-1.48-2.7 11.4 11.4 0 0 1-.52-3.59v-1.12c0-1.33.17-2.53.5-3.57a7.9 7.9 0 0 1 1.49-2.7 6.33 6.33 0 0 1 2.25-1.71c.88-.4 1.85-.59 2.9-.59 1.08 0 2.06.2 2.93.59.88.39 1.63.96 2.25 1.7a7.6 7.6 0 0 1 1.46 2.7c.34 1.05.51 2.25.51 3.58Zm-2.33 1.12v-1.14c0-1.06-.11-2-.33-2.81a5.8 5.8 0 0 0-.94-2.05 4.05 4.05 0 0 0-1.53-1.26 4.63 4.63 0 0 0-2.02-.43 4.21 4.21 0 0 0-3.5 1.68 6.15 6.15 0 0 0-.97 2.06c-.23.81-.34 1.75-.34 2.8v1.15c0 1.07.11 2.02.34 2.84.23.81.55 1.5.98 2.06a4.32 4.32 0 0 0 3.51 1.68 4.7 4.7 0 0 0 2.04-.42c.6-.29 1.1-.7 1.5-1.26.42-.56.73-1.25.94-2.06.21-.83.32-1.77.32-2.84Zm7.78-2.34v15.75h-2.28V94.79h2.08l.2 2.54Zm8.9 3.96v.25c0 .96-.12 1.85-.35 2.68a6.56 6.56 0 0 1-1 2.12c-.43.6-.96 1.07-1.6 1.4a5.57 5.57 0 0 1-4.4.08 4.39 4.39 0 0 1-1.64-1.2 6.2 6.2 0 0 1-1.07-1.9 10.7 10.7 0 0 1-.54-2.5v-1.37c.1-.98.28-1.85.55-2.63.27-.77.62-1.43 1.06-1.98.45-.55.99-.97 1.62-1.25a5.2 5.2 0 0 1 2.2-.44c.83 0 1.57.16 2.21.49.64.31 1.18.77 1.62 1.36.44.6.77 1.3 1 2.14.22.82.33 1.74.33 2.75Zm-2.28.25v-.25c0-.66-.07-1.28-.2-1.86a4.7 4.7 0 0 0-.65-1.54 3.08 3.08 0 0 0-2.7-1.44 3.22 3.22 0 0 0-2.55 1.09c-.3.32-.53.7-.72 1.12-.18.42-.31.85-.4 1.3v3.16c.16.57.39 1.1.68 1.6.3.5.68.9 1.17 1.22.5.3 1.1.45 1.84.45a3.1 3.1 0 0 0 1.58-.38c.45-.26.81-.61 1.1-1.06.3-.45.5-.96.65-1.54.13-.59.2-1.2.2-1.87Zm10.64 6.7a5.68 5.68 0 0 1-5.64-3.82 7.42 7.42 0 0 1-.43-2.56v-.51c0-1.08.16-2.03.47-2.87a6.4 6.4 0 0 1 1.3-2.15 5.55 5.55 0 0 1 6.44-1.3c.7.33 1.26.79 1.7 1.37.44.58.77 1.26.98 2.05.2.79.31 1.64.31 2.57v1.01h-9.86v-1.84h7.6v-.17a5.64 5.64 0 0 0-.36-1.71 3.02 3.02 0 0 0-.98-1.37 2.85 2.85 0 0 0-1.83-.54 3.07 3.07 0 0 0-2.52 1.29c-.31.42-.55.94-.72 1.55a7.85 7.85 0 0 0-.26 2.1v.52c0 .63.08 1.22.26 1.77s.43 1.03.76 1.44a3.67 3.67 0 0 0 2.9 1.33c.8 0 1.47-.16 2.02-.49a5.02 5.02 0 0 0 1.46-1.3l1.36 1.08a5.27 5.27 0 0 1-2.71 2.19 6.3 6.3 0 0 1-2.25.36Zm10.03-10.63V108h-2.26V94.8h2.14l.12 2.81Zm-.54 3.29-.94-.04c.01-.9.15-1.74.4-2.5.27-.78.63-1.45 1.1-2.02a4.9 4.9 0 0 1 3.87-1.8c.66 0 1.24.1 1.76.28.52.17.97.44 1.33.83.38.38.66.88.86 1.49.2.6.29 1.33.29 2.2V108h-2.27v-8.68c0-.7-.1-1.24-.3-1.66-.2-.42-.5-.73-.9-.91-.39-.2-.87-.3-1.44-.3a3.34 3.34 0 0 0-2.72 1.33 4.92 4.92 0 0 0-1.04 3.12Zm28.12 2.6a3 3 0 0 0-.2-1.1 2.1 2.1 0 0 0-.66-.87c-.3-.26-.74-.5-1.3-.74a18.2 18.2 0 0 0-2.07-.73 19 19 0 0 1-2.38-.86c-.7-.33-1.31-.7-1.82-1.11a4.06 4.06 0 0 1-1.56-3.27 4.34 4.34 0 0 1 1.65-3.45 5.92 5.92 0 0 1 1.91-1.02 7.88 7.88 0 0 1 2.48-.37c1.34 0 2.47.26 3.4.77a5.35 5.35 0 0 1 2.87 4.6h-2.35c0-.66-.14-1.25-.43-1.77a2.94 2.94 0 0 0-1.29-1.22 4.73 4.73 0 0 0-2.2-.45c-.84 0-1.53.13-2.07.38-.55.25-.95.6-1.22 1.02-.26.44-.4.93-.4 1.48a2.2 2.2 0 0 0 .98 1.87c.34.26.78.5 1.3.72.53.22 1.16.43 1.89.63 1 .29 1.88.6 2.61.96.73.35 1.34.74 1.8 1.18.49.43.84.92 1.07 1.48.24.54.35 1.16.35 1.85a4.27 4.27 0 0 1-1.7 3.47 6.2 6.2 0 0 1-1.96.97 9.13 9.13 0 0 1-4.97-.02 7.24 7.24 0 0 1-2.16-1.02 4.68 4.68 0 0 1-2.12-4.03h2.34c0 .6.12 1.13.36 1.57.23.44.55.8.96 1.08.42.28.88.5 1.4.63a6.83 6.83 0 0 0 3.74-.14c.57-.23 1-.56 1.3-.98.3-.42.45-.92.45-1.5Zm10.5 4.74a5.68 5.68 0 0 1-5.64-3.82 7.42 7.42 0 0 1-.42-2.56v-.51c0-1.08.16-2.03.47-2.87a6.4 6.4 0 0 1 1.3-2.15 5.55 5.55 0 0 1 6.44-1.3c.7.33 1.26.79 1.7 1.37.44.58.77 1.26.98 2.05.2.79.31 1.64.31 2.57v1.01h-9.86v-1.84h7.6v-.17a5.64 5.64 0 0 0-.36-1.71 3.02 3.02 0 0 0-.98-1.37 2.85 2.85 0 0 0-1.83-.54 3.07 3.07 0 0 0-2.52 1.29c-.31.42-.55.94-.72 1.55a7.85 7.85 0 0 0-.26 2.1v.52c0 .63.08 1.22.26 1.77a3.8 3.8 0 0 0 2 2.42c.49.23 1.04.35 1.66.35.8 0 1.47-.16 2.02-.49a5.01 5.01 0 0 0 1.46-1.3l1.36 1.08a5.27 5.27 0 0 1-2.71 2.19c-.63.24-1.38.36-2.25.36Zm15.57-2.5v-6.8c0-.52-.1-.97-.32-1.35-.2-.4-.51-.7-.93-.9a3.36 3.36 0 0 0-1.53-.32c-.57 0-1.07.1-1.5.29-.43.2-.76.45-1 .77s-.36.66-.36 1.02h-2.26c0-.47.12-.94.37-1.4.24-.46.6-.88 1.05-1.26a5.25 5.25 0 0 1 1.66-.9 6.54 6.54 0 0 1 2.17-.34c.96 0 1.8.16 2.54.49a3.8 3.8 0 0 1 1.73 1.47c.43.65.64 1.47.64 2.46v6.15c0 .44.03.9.1 1.4.09.5.2.93.36 1.29v.19h-2.35a4.2 4.2 0 0 1-.27-1.04 7.7 7.7 0 0 1-.1-1.22Zm.39-5.75.02 1.59h-2.28c-.64 0-1.22.05-1.72.16-.5.1-.93.25-1.27.45a2.04 2.04 0 0 0-1.05 1.83c0 .42.1.8.28 1.14.19.34.47.61.84.81.39.2.85.3 1.4.3a3.72 3.72 0 0 0 3.1-1.52c.31-.42.48-.83.5-1.23l.97 1.09c-.05.34-.2.72-.46 1.13a5.41 5.41 0 0 1-2.5 2.14c-.57.24-1.22.36-1.93.36-.9 0-1.68-.17-2.36-.52a3.72 3.72 0 0 1-2.11-3.4c0-.7.14-1.32.42-1.86.27-.55.67-1 1.2-1.36a5.69 5.69 0 0 1 1.87-.83 9.93 9.93 0 0 1 2.46-.28h2.62Zm7.68-3.12V108h-2.26V94.8h2.2l.06 2.07Zm4.13-2.15-.02 2.1a5.7 5.7 0 0 0-1.1-.1c-.52 0-.98.08-1.38.24-.4.17-.73.4-1 .69-.29.3-.5.64-.67 1.05-.15.4-.25.84-.3 1.32l-.64.36c0-.8.08-1.54.23-2.24.17-.7.42-1.32.75-1.86s.75-.97 1.27-1.27a3.57 3.57 0 0 1 2.85-.3Zm7.12 11.67a3.19 3.19 0 0 0 2.62-1.23c.29-.4.46-.84.5-1.33h2.14a4 4 0 0 1-.79 2.18 5.41 5.41 0 0 1-4.47 2.23c-.99 0-1.86-.17-2.6-.52a5.17 5.17 0 0 1-1.83-1.44 6.44 6.44 0 0 1-1.08-2.1 8.86 8.86 0 0 1-.36-2.53v-.51c0-.89.12-1.73.36-2.52.24-.8.6-1.5 1.08-2.1a5.16 5.16 0 0 1 1.83-1.45 6.03 6.03 0 0 1 2.6-.52c1.04 0 1.94.2 2.71.63a4.94 4.94 0 0 1 2.55 4.15h-2.14a3.24 3.24 0 0 0-.47-1.47 3 3 0 0 0-2.65-1.45c-.69 0-1.27.13-1.74.4-.47.28-.84.64-1.11 1.1-.27.46-.47.97-.59 1.53a8.39 8.39 0 0 0-.17 1.7v.51c0 .58.06 1.15.17 1.71.12.56.3 1.07.58 1.53.27.45.64.82 1.1 1.1.48.26 1.06.4 1.76.4Zm10.06-17.14V108h-2.26V89.25h2.26Zm-.54 11.65-.94-.04c.01-.9.15-1.74.4-2.5.27-.78.63-1.45 1.1-2.02a4.9 4.9 0 0 1 3.88-1.8c.65 0 1.23.1 1.75.28.52.17.97.44 1.33.83.38.38.66.88.86 1.49a7 7 0 0 1 .3 2.2V108h-2.28v-8.68c0-.7-.1-1.24-.3-1.66-.2-.42-.5-.73-.9-.91a3.2 3.2 0 0 0-1.44-.3 3.34 3.34 0 0 0-2.72 1.33 4.92 4.92 0 0 0-1.04 3.12Zm29.89 5.18V108h-9.41v-1.92h9.4Zm-8.94-15.85V108h-2.35V90.23h2.35Zm7.7 7.64v1.91h-8.17v-1.91h8.16Zm1.12-7.64v1.93h-9.3v-1.93h9.3Zm4.95 7.38V108h-2.26V94.8h2.14l.12 2.81Zm-.53 3.29-.94-.04c0-.9.14-1.74.4-2.5.26-.78.62-1.45 1.1-2.02a4.9 4.9 0 0 1 3.87-1.8c.65 0 1.23.1 1.75.28.52.17.97.44 1.33.83.38.38.66.88.86 1.49a7 7 0 0 1 .3 2.2V108h-2.28v-8.68c0-.7-.1-1.24-.3-1.66-.2-.42-.5-.73-.9-.91-.39-.2-.87-.3-1.44-.3a3.34 3.34 0 0 0-2.72 1.33 4.92 4.92 0 0 0-1.03 3.12Zm20.65-6.1h2.05v12.92c0 1.16-.24 2.16-.7 2.98a4.6 4.6 0 0 1-1.99 1.86 6.1 6.1 0 0 1-2.9.65 7.15 7.15 0 0 1-3.42-.94 4.5 4.5 0 0 1-1.48-1.35l1.19-1.34a4.77 4.77 0 0 0 1.73 1.39c.61.26 1.21.39 1.8.39a4 4 0 0 0 1.86-.4 2.8 2.8 0 0 0 1.21-1.2c.3-.52.44-1.17.44-1.93V97.7l.2-2.9Zm-9.1 6.74v-.25c0-1.01.12-1.93.36-2.75.24-.83.59-1.54 1.04-2.14a4.66 4.66 0 0 1 3.82-1.85c.83 0 1.55.14 2.17.44.63.28 1.16.7 1.59 1.25.44.55.78 1.2 1.03 1.98.26.78.43 1.65.53 2.63v1.12c-.09.97-.26 1.84-.53 2.61-.25.78-.6 1.43-1.03 1.98-.43.55-.96.96-1.59 1.26a5.26 5.26 0 0 1-4.35-.08 4.9 4.9 0 0 1-1.63-1.4c-.46-.6-.8-1.31-1.05-2.12a9.66 9.66 0 0 1-.36-2.68Zm2.26-.25v.25c0 .66.07 1.28.2 1.86.14.58.34 1.08.62 1.52.29.44.65.79 1.09 1.04.44.25.96.37 1.57.37.75 0 1.37-.16 1.86-.48.49-.32.87-.73 1.16-1.26a7.1 7.1 0 0 0 .68-1.7v-2.93a6.04 6.04 0 0 0-.41-1.3c-.18-.42-.42-.8-.71-1.12a3.13 3.13 0 0 0-2.56-1.09 3.1 3.1 0 0 0-2.68 1.44c-.28.44-.48.95-.62 1.54-.13.58-.2 1.2-.2 1.86Zm14.77-6.5V108h-2.27V94.8h2.27Zm-2.44-3.5c0-.37.11-.68.33-.93.23-.25.56-.38 1-.38.43 0 .76.13 1 .38.23.25.34.56.34.93 0 .35-.11.65-.35.9-.23.25-.56.37-.99.37-.44 0-.77-.12-1-.37a1.33 1.33 0 0 1-.33-.9Zm8.33 6.32V108h-2.26V94.8h2.14l.12 2.81Zm-.54 3.29-.94-.04c0-.9.14-1.74.4-2.5.26-.78.63-1.45 1.1-2.02a4.9 4.9 0 0 1 3.87-1.8c.65 0 1.24.1 1.76.28.52.17.96.44 1.33.83.37.38.66.88.85 1.49a7 7 0 0 1 .3 2.2V108h-2.27v-8.68c0-.7-.1-1.24-.3-1.66-.21-.42-.5-.73-.9-.91a3.2 3.2 0 0 0-1.44-.3 3.34 3.34 0 0 0-2.72 1.33 4.9 4.9 0 0 0-1.04 3.12Zm17.58 7.34a5.67 5.67 0 0 1-5.64-3.82 7.42 7.42 0 0 1-.43-2.56v-.51a8 8 0 0 1 .48-2.87c.31-.85.75-1.56 1.3-2.15a5.55 5.55 0 0 1 6.44-1.3c.69.33 1.25.79 1.7 1.37.43.58.76 1.26.97 2.05.21.79.32 1.64.32 2.57v1.01h-9.87v-1.84h7.6v-.17a5.6 5.6 0 0 0-.36-1.71 3.07 3.07 0 0 0-.97-1.37 2.85 2.85 0 0 0-1.84-.54 3.08 3.08 0 0 0-2.52 1.29c-.31.42-.55.94-.72 1.55a7.86 7.86 0 0 0-.26 2.1v.52c0 .63.09 1.22.26 1.77.18.55.43 1.03.77 1.44.34.42.75.74 1.23.98.49.23 1.04.35 1.66.35.8 0 1.47-.16 2.03-.49a5.02 5.02 0 0 0 1.45-1.3l1.37 1.08a5.33 5.33 0 0 1-2.71 2.19 6.3 6.3 0 0 1-2.26.36Z"
+ />
+ <path
+ class="fill-primary"
+ d="M69.22 66.35c-3.64 0-7.1-.6-10.36-1.82-3.22-1.26-5.72-2.87-7.5-4.83l1.62-2.66a20.49 20.49 0 0 0 6.86 4.41 25 25 0 0 0 9.3 1.75c3.27 0 5.93-.42 7.99-1.26 2.1-.89 3.64-2.05 4.62-3.5a8.15 8.15 0 0 0 1.54-4.83c0-2.1-.56-3.78-1.68-5.04a11.74 11.74 0 0 0-4.41-3.01 40.46 40.46 0 0 0-5.95-1.89 439 439 0 0 1-6.51-1.61c-2.2-.6-4.2-1.38-6.02-2.31a12 12 0 0 1-4.41-3.78c-1.08-1.63-1.61-3.73-1.61-6.3a12 12 0 0 1 1.82-6.44 12.9 12.9 0 0 1 5.67-4.76c2.56-1.21 5.85-1.82 9.87-1.82 2.7 0 5.36.4 7.98 1.19 2.66.8 4.92 1.87 6.79 3.22l-1.33 2.87a22.12 22.12 0 0 0-6.65-3.08c-2.34-.7-4.6-1.05-6.8-1.05-3.12 0-5.7.44-7.76 1.33a9.96 9.96 0 0 0-4.55 3.57 8.54 8.54 0 0 0-1.47 4.9c0 2.1.53 3.78 1.6 5.04a11.74 11.74 0 0 0 4.42 3.01c1.82.75 3.82 1.38 6.02 1.89 2.2.51 4.36 1.07 6.5 1.68 2.15.56 4.14 1.3 5.96 2.24a12 12 0 0 1 4.4 3.78c1.13 1.59 1.69 3.64 1.69 6.16 0 2.29-.63 4.43-1.9 6.44-1.25 1.96-3.19 3.55-5.8 4.76-2.57 1.17-5.88 1.75-9.94 1.75Zm38.47-.35V20.22H90.05V17h38.85v3.22h-17.64V66h-3.57Zm30.06 0V17h17.57c4.11 0 7.63.65 10.57 1.96a15.2 15.2 0 0 1 6.8 5.67c1.58 2.43 2.37 5.39 2.37 8.89 0 3.4-.79 6.35-2.38 8.82a15.73 15.73 0 0 1-6.79 5.67c-2.94 1.3-6.46 1.96-10.57 1.96h-15.6l1.6-1.68V66h-3.57Zm34.02 0-12.74-17.78h4.06L175.83 66h-4.06Zm-30.45-17.5-1.6-1.68h15.6c5.28 0 9.27-1.17 11.97-3.5 2.76-2.33 4.13-5.6 4.13-9.8 0-4.25-1.37-7.51-4.13-9.8-2.7-2.33-6.7-3.5-11.97-3.5h-15.6l1.6-1.75V48.5ZM179.95 66l22.54-49h3.56l22.54 49h-3.84l-21.28-46.76H205L183.8 66h-3.86Zm8.26-13.79 1.19-3.01h29.32l1.2 3.01H188.2Zm69.32 14.14c-3.64 0-7.03-.6-10.15-1.82a24.77 24.77 0 0 1-8.05-5.25 23.82 23.82 0 0 1-5.32-7.84 25.66 25.66 0 0 1-1.9-9.94c0-3.6.64-6.88 1.9-9.87a23.63 23.63 0 0 1 5.32-7.91 24.64 24.64 0 0 1 8.12-5.18 26.37 26.37 0 0 1 10.08-1.89c3.45 0 6.67.56 9.66 1.68a20 20 0 0 1 7.77 5.11l-2.24 2.31a18.7 18.7 0 0 0-7-4.41 23 23 0 0 0-8.05-1.4c-3.13 0-6.05.54-8.75 1.61-2.66 1.07-5 2.59-7 4.55a21.68 21.68 0 0 0-4.62 6.86 22.25 22.25 0 0 0-1.61 8.54c0 3.08.53 5.93 1.6 8.54a21.68 21.68 0 0 0 4.63 6.86c2 1.96 4.34 3.48 7 4.55a23.52 23.52 0 0 0 8.75 1.61c2.84 0 5.53-.44 8.05-1.33 2.56-.93 4.9-2.45 7-4.55l2.24 2.31a20.69 20.69 0 0 1-7.77 5.18 27.3 27.3 0 0 1-9.66 1.68Zm38.15-.35V20.22h-17.64V17h38.85v3.22h-17.64V66h-3.57Z"
+ />
+</svg>
diff --git a/frontend/src/lib/stores.ts b/frontend/src/lib/stores.ts
index d8c080fe..d5b1600c 100644
--- a/frontend/src/lib/stores.ts
+++ b/frontend/src/lib/stores.ts
@@ -26,7 +26,12 @@ const writableLocalStorage = <T>(
: defaultValue,
);
store.subscribe(($value) => {
- if (storage) storage.setItem(key, JSON.stringify($value));
+ if (storage)
+ if (typeof $value == 'undefined') {
+ storage.removeItem(key);
+ } else {
+ storage.setItem(key, JSON.stringify($value));
+ }
});
return store;
};
@@ -50,6 +55,15 @@ export const searchQueryStore = writableLocalStorage<string | undefined>(
browser && sessionStorage,
);
+const THEME_KEY = 'theme';
+export const themeStore = writableLocalStorage<string | void>(THEME_KEY, void 0);
+if (browser)
+ themeStore.subscribe(($theme) => {
+ const c = document.documentElement.className.replace(/theme-[^ ]+/, ``);
+ const theme = $theme?.toLowerCase() || '';
+ document.documentElement.className = `${c} ${theme}`.trim();
+ });
+
export const summariesStore = writable<
Record<string, { inProgress: boolean; data: string } | undefined>
>({});
diff --git a/frontend/src/lib/themes.ts b/frontend/src/lib/themes.ts
new file mode 100644
index 00000000..93fe78f6
--- /dev/null
+++ b/frontend/src/lib/themes.ts
@@ -0,0 +1,12 @@
+const theme = (name: string, c: string) => ({ name, class: c });
+
+export const THEMES = [
+ theme('Light', 'theme-light'),
+ theme('Pastel', 'theme-pastel'),
+ theme('Nord Light', 'theme-nord-light'),
+ theme('Retro', 'theme-ugly'),
+ theme('Dark', 'theme-dark'),
+ theme('Primer Dark', 'theme-primer-dark'),
+ theme('Nord', 'theme-nord'),
+ theme('Ayu Mirage', 'theme-ayu-mirage'),
+];
diff --git a/frontend/src/routes/+error.svelte b/frontend/src/routes/+error.svelte
new file mode 100644
index 00000000..604bea7b
--- /dev/null
+++ b/frontend/src/routes/+error.svelte
@@ -0,0 +1,16 @@
+<script lang="ts">
+ import { page } from '$app/stores';
+</script>
+
+<main class="grid h-full place-items-center">
+ <div class="flex flex-col items-center justify-center text-center">
+ <h1 class="text-4xl">{$page.error?.message}</h1>
+ <p class="text-xl"><span class="select-none text-transparent">...</span>An error occured...</p>
+ <br />
+ <a
+ class="rounded bg-base-200 px-2 py-1 text-neutral"
+ href={$page.url.toString()}
+ on:click|preventDefault={() => location.reload()}>Try again</a
+ >
+ </div>
+</main>
diff --git a/frontend/src/routes/+layout.svelte b/frontend/src/routes/+layout.svelte
index ae5512ca..c8a84baa 100644
--- a/frontend/src/routes/+layout.svelte
+++ b/frontend/src/routes/+layout.svelte
@@ -9,9 +9,7 @@
<title>{$page.data.globals?.title || 'Stract'}</title>
</svelte:head>
-<div
- class="grid min-h-screen grid-rows-[auto_1fr_auto] font-light dark:bg-stone-900 dark:text-white"
->
+<div class="grid min-h-screen grid-rows-[auto_1fr_auto] font-light">
<Header />
<slot />
diff --git a/frontend/src/routes/+page.svelte b/frontend/src/routes/+page.svelte
index 05e76902..324338b3 100644
--- a/frontend/src/routes/+page.svelte
+++ b/frontend/src/routes/+page.svelte
@@ -1,16 +1,17 @@
<script lang="ts">
import OpticSelector from '$lib/components/OpticSelector.svelte';
import Searchbar from '$lib/components/Searchbar.svelte';
+ import BiglogoWithText from '$lib/images/BiglogoWithText.svelte';
</script>
<div class="mt-[25vh] flex w-full flex-1 flex-col items-center justify-start">
<div class="mb-6 flex w-64">
- <img alt="stract logo" src="/images/biglogo-with-text.svg" class="h-full w-full" />
+ <BiglogoWithText />
</div>
<div class="w-full md:mx-0 md:max-w-2xl">
<Searchbar autofocus={true} />
</div>
- <div class="mt-3 flex space-x-2 text-gray-600 dark:text-gray-500">
+ <div class="mt-3 flex space-x-2 text-neutral">
<div>
Customise your search with an{' '}
<a class="font-medium underline" href="/settings/optics">optic</a>:
diff --git a/frontend/src/routes/components/+page.svelte b/frontend/src/routes/components/+page.svelte
index ef65a957..16d70837 100644
--- a/frontend/src/routes/components/+page.svelte
+++ b/frontend/src/routes/components/+page.svelte
@@ -1,18 +1,203 @@
<script lang="ts">
+ import IconGitHub from '~icons/simple-icons/github';
+ import IconDiscord from '~icons/simple-icons/discord';
+ import HandThumbUp from '~icons/heroicons/hand-thumb-up-solid';
import Button from '$lib/components/Button.svelte';
+ import Callout from '$lib/components/Callout.svelte';
+ import Link from '$lib/components/Link.svelte';
+ import { THEMES } from '$lib/themes';
+ import { themeStore } from '$lib/stores';
</script>
-<main class="mx-auto flex w-full max-w-xl flex-col space-y-10 py-10">
+<main class="relative mx-auto flex w-full max-w-2xl flex-col space-y-10 py-10">
+ <div
+ class="fixed translate-x-[calc(-100%-5rem)] space-y-2 rounded border bg-base-200 px-2 py-2 shadow"
+ >
+ <h1 class="text-2xl font-semibold">Themes</h1>
+ <div class="flex flex-col space-y-1">
+ {#each THEMES as theme}
+ <button
+ class="flex space-x-2 p-1 {theme.class} items-center rounded border bg-base-100 text-base-content"
+ on:mouseenter={() => ($themeStore = theme.class)}
+ >
+ <span class="inline-flex flex-1 justify-center px-2 text-center font-bold">
+ <span>
+ {theme.name}
+ </span>
+ </span>
+ <div class="flex overflow-hidden rounded border [&>*]:aspect-square [&>*]:w-10">
+ <div class="bg-primary" />
+ <div class="bg-secondary" />
+ <div class="bg-accent" />
+ </div>
+ </button>
+ {/each}
+ </div>
+ </div>
+
<section class="flex flex-col space-y-2">
<h1 class="text-3xl font-semibold">Buttons</h1>
- <div class="rounded-xl border p-4 shadow-xl">
+ <div class="flex flex-wrap items-center gap-x-2 rounded-xl border p-4 shadow-xl">
<Button>click me</Button>
- <Button kind="amber">click me</Button>
- <Button kind="red">click me</Button>
- <hr class="my-2" />
+ <Button padding={false}><HandThumbUp /></Button>
+ <Button kind="seconday">click me</Button>
+ <Button kind="seconday" padding={false}><HandThumbUp /></Button>
+ <Button kind="accent">click me</Button>
+ <Button kind="accent" padding={false}><HandThumbUp /></Button>
+ <Button kind="neutral">click me</Button>
+ <Button kind="neutral" padding={false}><HandThumbUp /></Button>
+ <hr class="my-2 w-full" />
<Button pale>click me</Button>
- <Button pale kind="amber">click me</Button>
- <Button pale kind="red">click me</Button>
+ <Button pale padding={false}><HandThumbUp /></Button>
+ <Button pale kind="seconday">click me</Button>
+ <Button pale kind="seconday" padding={false}><HandThumbUp /></Button>
+ <Button pale kind="accent">click me</Button>
+ <Button pale kind="accent" padding={false}><HandThumbUp /></Button>
+ <Button pale kind="neutral">click me</Button>
+ <Button pale kind="neutral" padding={false}><HandThumbUp /></Button>
+ <hr class="my-2 w-full" />
+ <Button kind="info">click me</Button>
+ <Button kind="info" padding={false}><HandThumbUp /></Button>
+ <Button kind="success">click me</Button>
+ <Button kind="success" padding={false}><HandThumbUp /></Button>
+ <Button kind="warning">click me</Button>
+ <Button kind="warning" padding={false}><HandThumbUp /></Button>
+ <Button kind="error">click me</Button>
+ <Button kind="error" padding={false}><HandThumbUp /></Button>
+ <hr class="my-2 w-full" />
+ <Button pale kind="info">click me</Button>
+ <Button pale kind="info" padding={false}><HandThumbUp /></Button>
+ <Button pale kind="success">click me</Button>
+ <Button pale kind="success" padding={false}><HandThumbUp /></Button>
+ <Button pale kind="warning">click me</Button>
+ <Button pale kind="warning" padding={false}><HandThumbUp /></Button>
+ <Button pale kind="error">click me</Button>
+ <Button pale kind="error" padding={false}><HandThumbUp /></Button>
+ </div>
+ </section>
+ <section class="flex flex-col space-y-2">
+ <h1 class="text-3xl font-semibold">Links</h1>
+ <!-- svelte-ignore a11y-invalid-attribute -->
+ <div class="rounded-xl border p-4 shadow-xl">
+ <div class="flex items-center space-x-2">
+ <Link href="#">This is a</Link>
+ <Link href="#">Link to somewhere</Link>
+ <Link href="#" round><IconDiscord /></Link>
+ <Link href="#" round><IconGitHub /></Link>
+ <a href="#" class="inline-flex pl-4 text-link">I haven't been here</a>
+ </div>
+ <hr class="my-2" />
+ <div class="flex items-center space-x-2">
+ <Link href="#" active>This is a</Link>
+ <Link href="#" active>Link to somewhere</Link>
+ <Link href="#" active round><IconDiscord /></Link>
+ <Link href="#" active round><IconGitHub /></Link>
+ <a href="#" class="inline-flex pl-4 text-link-visited">I have been here</a>
+ </div>
+ </div>
+ </section>
+ <section class="flex flex-col space-y-2">
+ <h1 class="text-3xl font-semibold">Callouts</h1>
+ <div class="space-y-4 rounded-xl border p-4 shadow-xl">
+ <Callout kind="info">This is a info callout</Callout>
+ <Callout kind="success">This is a success callout</Callout>
+ <Callout kind="warning">This is a warning callout</Callout>
+ <Callout kind="error">This is a error callout</Callout>
+ <Callout kind="neutral">This is a neutral callout</Callout>
+ </div>
+ </section>
+ <section class="flex flex-col space-y-2">
+ <h1 class="text-3xl font-semibold">Colors</h1>
+ <div class="flex flex-wrap gap-4 rounded-xl border p-4 shadow-xl">
+ <div class="color-sample">
+ <h2>primary</h2>
+ <div>
+ <div class="bg-primary" />
+ <div class="bg-primary-focus" />
+ <div class="bg-primary-content" />
+ </div>
+ </div>
+ <div class="color-sample">
+ <h2>secondary</h2>
+ <div>
+ <div class="bg-secondary" />
+ <div class="bg-secondary-focus" />
+ <div class="bg-secondary-content" />
+ </div>
+ </div>
+ <div class="color-sample">
+ <h2>accent</h2>
+ <div>
+ <div class="bg-accent" />
+ <div class="bg-accent-focus" />
+ <div class="bg-accent-content" />
+ </div>
+ </div>
+ <div class="color-sample">
+ <h2>neutral</h2>
+ <div>
+ <div class="bg-neutral" />
+ <div class="bg-neutral-focus" />
+ <div class="bg-neutral-content" />
+ </div>
+ </div>
+ <div class="color-sample">
+ <h2>base</h2>
+ <div>
+ <div class="bg-base-100" />
+ <div class="bg-base-200" />
+ <div class="bg-base-300" />
+ <div class="bg-base-content" />
+ </div>
+ </div>
+ <div class="color-sample">
+ <h2>info</h2>
+ <div>
+ <div class="bg-info" />
+ <div class="bg-info-focus" />
+ <div class="bg-info-content" />
+ </div>
+ </div>
+ <div class="color-sample">
+ <h2>success</h2>
+ <div>
+ <div class="bg-success" />
+ <div class="bg-success-focus" />
+ <div class="bg-success-content" />
+ </div>
+ </div>
+ <div class="color-sample">
+ <h2>warning</h2>
+ <div>
+ <div class="bg-warning" />
+ <div class="bg-warning-focus" />
+ <div class="bg-warning-content" />
+ </div>
+ </div>
+ <div class="color-sample">
+ <h2>error</h2>
+ <div>
+ <div class="bg-error" />
+ <div class="bg-error-focus" />
+ <div class="bg-error-content" />
+ </div>
+ </div>
+ <div class="color-sample">
+ <h2>link</h2>
+ <div>
+ <div class="bg-link" />
+ <div class="bg-link-visited" />
+ </div>
+ </div>
</div>
</section>
</main>
+
+<style lang="postcss">
+ .color-sample h2 {
+ @apply mb-1 text-lg font-semibold capitalize;
+ }
+ .color-sample > div {
+ @apply inline-flex overflow-hidden rounded border border-base-300 [&>*]:aspect-square [&>*]:w-8;
+ }
+</style>
diff --git a/frontend/src/routes/explore/+page.svelte b/frontend/src/routes/explore/+page.svelte
index c4c92dd7..c4f1ac7c 100644
--- a/frontend/src/routes/explore/+page.svelte
+++ b/frontend/src/routes/explore/+page.svelte
@@ -1,19 +1,22 @@
<script lang="ts">
+ import XMark from '~icons/heroicons/x-mark';
import PlusCircleOutline from '~icons/heroicons/plus-circle';
import ChevronDown from '~icons/heroicons/chevron-down';
import { api, type ScoredSite } from '$lib/api';
import Button from '$lib/components/Button.svelte';
import Site from '$lib/components/Site.svelte';
+ import Select from '$lib/components/Select.svelte';
import { flip } from 'svelte/animate';
import { fade, slide } from 'svelte/transition';
import { twJoin } from 'tailwind-merge';
import { match } from 'ts-pattern';
+ import Callout from '$lib/components/Callout.svelte';
const LIMIT_OPTIONS = [10, 25, 50, 125, 250, 500, 1000];
let inputWebsite = '';
let limit = LIMIT_OPTIONS[0];
- let chosenSites: string[] = [];
+ let chosenSites: string[] = ['facebook.com'];
let similarSites: ScoredSite[] = [];
let errorMessage = false;
@@ -65,12 +68,9 @@
</p>
</div>
<form
- class={twJoin(`
- mb-2 flex w-full max-w-lg rounded-full border border-gray-300
- bg-white p-[2px]
- pl-3 transition focus-within:shadow dark:border-stone-700
- dark:bg-stone-800 focus-within:dark:border-stone-600
- `)}
+ class={twJoin(
+ 'mb-2 flex w-full max-w-lg rounded-full border border-base-200 bg-base-100 p-[2px] pl-3 transition focus-within:shadow',
+ )}
id="site-input-container"
on:submit|preventDefault={() => addWebsite(inputWebsite, true)}
>
@@ -87,9 +87,15 @@
<Button>Add</Button>
</form>
{#if errorMessage}
- <label class="mb-4 text-red-600" for="site-input">
- Unfortunately, we don't know about that site yet.
- </label>
+ <div class="my-2" transition:slide>
+ <Callout kind="warning" title="Unable to add page">
+ <button slot="top-right" on:click={() => (errorMessage = false)}>
+ <XMark />
+ </button>
+
+ Unfortunately, we don't know about that site yet.
+ </Callout>
+ </div>
{/if}
<div class="flex flex-wrap justify-center gap-x-5 gap-y-3" id="sites-list">
{#each chosenSites as site (site)}
@@ -110,15 +116,12 @@
<div class="grid grid-cols-[auto_auto_1fr_auto] items-center gap-5">
<h2 class="text-2xl font-bold">Similar sites</h2>
<div class="flex space-x-1">
- <select
+ <Select
id="limit"
- class="styled-selector cursor-pointer rounded border-none dark:bg-transparent"
+ class="cursor-pointer rounded border-none dark:bg-transparent"
bind:value={limit}
- >
- {#each LIMIT_OPTIONS as l}
- <option value={l}>{l}</option>
- {/each}
- </select>
+ options={LIMIT_OPTIONS.map((value) => ({ value, label: value.toString() }))}
+ />
</div>
<div />
<Button on:click={exportAsOptic}>Export as optic</Button>
@@ -140,10 +143,8 @@
>
<PlusCircleOutline
class={twJoin(
- 'text-xl transition group-hover:scale-105',
- chosenSites.includes(site.site)
- ? 'rotate-45 text-red-500 hover:text-red-400 active:text-red-300'
- : 'text-green-500 hover:text-green-400 active:text-green-300',
+ 'text-xl transition group-hover:scale-105 group-active:scale-95',
+ chosenSites.includes(site.site) ? 'rotate-45 text-error' : 'text-success',
)}
/>
</button>
@@ -157,7 +158,7 @@
</div>
<div class="flex w-full justify-center">
<button
- class="h-6 w-6 cursor-pointer rounded-full text-contrast-500"
+ class="h-6 w-6 cursor-pointer rounded-full text-accent"
aria-label="Show more similar sites"
on:click={() => {
if (limit == LIMIT_OPTIONS[LIMIT_OPTIONS.length - 1]) {
diff --git a/frontend/src/routes/search/+page.svelte b/frontend/src/routes/search/+page.svelte
index a6460adb..8fa6a30f 100644
--- a/frontend/src/routes/search/+page.svelte
+++ b/frontend/src/routes/search/+page.svelte
@@ -1,7 +1,7 @@
<script lang="ts">
- import HandThumbDown from '~icons/heroicons/hand-thumb-down';
- import HandThumbUp from '~icons/heroicons/hand-thumb-up';
- import NoSymbol from '~icons/heroicons/no-symbol';
+ import HandThumbDown from '~icons/heroicons/hand-thumb-down-solid';
+ import HandThumbUp from '~icons/heroicons/hand-thumb-up-solid';
+ import NoSymbol from '~icons/heroicons/no-symbol-solid';
import ChevronLeft from '~icons/heroicons/chevron-left';
import ChevronRight from '~icons/heroicons/chevron-right';
import OpticSelector from '$lib/components/OpticSelector.svelte';
@@ -69,6 +69,10 @@
modal = void 0;
}
+ // $: {
+ // results.discussions = results.webpages;
+ // }
+
$: {
if (browser && results.type == 'websites') updateQueryId({ query, webpages: results.webpages });
}
@@ -76,17 +80,17 @@
const rankingChoices = [
{
ranking: 'liked',
- kind: 'brand',
+ kind: 'success',
Icon: HandThumbUp,
},
{
ranking: 'disliked',
- kind: 'amber',
+ kind: 'warning',
Icon: HandThumbDown,
},
{
ranking: 'blocked',
- kind: 'red',
+ kind: 'error',
Icon: NoSymbol,
},
] as const;
@@ -107,7 +111,7 @@
<div
class={twJoin(
'absolute -translate-y-1/2 transition-all',
- 'h-fit w-52 flex-col items-center overflow-hidden rounded-lg border bg-white px-2 py-5 text-sm drop-shadow-md dark:border-stone-700 dark:bg-stone-800',
+ 'h-fit w-52 flex-col items-center overflow-hidden rounded-lg border bg-base-100 px-2 py-5 text-sm drop-shadow-md',
)}
style="top: {modal.top}px; left: calc({modal.left}px + 1rem)"
transition:scale={{ duration: 150 }}
@@ -147,9 +151,7 @@
<Searchbar {query} />
</div>
<div class="mx-auto flex w-full justify-between">
- <div
- class="flex h-full flex-col justify-center space-x-2 text-sm text-gray-600 dark:text-stone-500"
- >
+ <div class="flex h-full flex-col justify-center space-x-2 text-sm text-neutral">
<p class="h-fit">
Found {results.numHits.toLocaleString()} results in {(
(results.searchDurationMs ?? 0) / 1000
@@ -208,18 +210,18 @@
<div class="grid grid-cols-[repeat(3,auto)] items-center justify-center gap-2">
{#if data.prevPageSearchParams}
<a href="/search?{data.prevPageSearchParams}">
- <ChevronLeft class="text-xl text-brand-500 hover:text-brand-600" />
+ <ChevronLeft class="text-xl text-primary hover:text-primary-focus" />
</a>
{:else}
- <ChevronLeft class="text-xl text-gray-500" />
+ <ChevronLeft class="text-xl text-neutral" />
{/if}
<div>Page {data.currentPage}</div>
{#if data.nextPageSearchParams}
<a href="/search?{data.nextPageSearchParams}">
- <ChevronRight class="text-xl text-brand-500 hover:text-brand-600" />
+ <ChevronRight class="text-xl text-primary hover:text-primary-focus" />
</a>
{:else}
- <ChevronRight class="text-xl text-gray-500" />
+ <ChevronRight class="text-xl text-neutral" />
{/if}
</div>
</div>
diff --git a/frontend/src/routes/search/+page.ts b/frontend/src/routes/search/+page.ts
index 52f2891b..ea3cd4fc 100644
--- a/frontend/src/routes/search/+page.ts
+++ b/frontend/src/routes/search/+page.ts
@@ -26,7 +26,7 @@ export const load: PageLoad = async ({ fetch, url }) => {
);
const results = await data;
- if (results.type == "bang") {
+ if (results.type == 'bang') {
throw redirect(300, results.redirectTo);
}
diff --git a/frontend/src/routes/search/DirectAnswer.svelte b/frontend/src/routes/search/DirectAnswer.svelte
index 036def72..8210a27f 100644
--- a/frontend/src/routes/search/DirectAnswer.svelte
+++ b/frontend/src/routes/search/DirectAnswer.svelte
@@ -9,14 +9,14 @@
<div class="mb-5 text-sm [&>b]:font-bold">{@html directAnswer.snippet}</div>
<div class="flex flex-col">
<a
- class="m-0 inline-block max-w-[calc(100%-30px)] truncate p-0 text-sm text-gray-800 hover:no-underline"
+ class="m-0 inline-block max-w-[calc(100%-30px)] truncate p-0 text-sm text-neutral hover:no-underline"
href={directAnswer.url}
>
{directAnswer.prettyUrl}
</a>
<div class="answer-title">
<a
- class="inline-block max-w-[calc(100%-30px)] truncate text-xl font-medium text-blue-800 visited:text-purple-800"
+ class="inline-block max-w-[calc(100%-30px)] truncate text-xl font-medium text-link visited:text-link-visited"
href={directAnswer.url}
>
{directAnswer.title}
diff --git a/frontend/src/routes/search/Discussions.svelte b/frontend/src/routes/search/Discussions.svelte
index 149bf10a..a0a2b851 100644
--- a/frontend/src/routes/search/Discussions.svelte
+++ b/frontend/src/routes/search/Discussions.svelte
@@ -3,6 +3,7 @@
import ChatBubbleLeftRight from '~icons/heroicons/chat-bubble-left-right';
import type { Webpage } from '$lib/api';
import TextSnippet from '$lib/components/TextSnippet.svelte';
+ import Button from '$lib/components/Button.svelte';
export let discussions: Webpage[];
@@ -37,9 +38,9 @@
</summary>
{#if discussion.snippet.type == 'normal'}
- <div class="mb-3 text-sm font-normal text-snippet">
+ <div class="mb-3 text-sm font-normal text-neutral-focus">
{#if typeof discussion.snippet.date == 'string'}
- <span class="text-gray-500">{discussion.snippet.date}</span>
+ <span class="text-neutral">{discussion.snippet.date}</span>
{/if}
<span class="[&:nth-child(2)]:before:content-['—']">
<TextSnippet snippet={discussion.snippet.text} />
@@ -49,11 +50,10 @@
</details>
</div>
{/each}
- <button
- class="noscript:hidden mt-3 w-fit rounded-full border px-2 py-1 hover:cursor-pointer hover:bg-neutral-100"
- on:click={() => (showMore = !showMore)}
- >
- {showMore ? 'Show less' : 'Show more'}
- </button>
+ <div class="noscript:hidden mt-2">
+ <Button kind="neutral" pale on:click={() => (showMore = !showMore)}
+ >{showMore ? 'Show less' : 'Show more'}</Button
+ >
+ </div>
</div>
</div>
diff --git a/frontend/src/routes/search/Entity.svelte b/frontend/src/routes/search/Entity.svelte
index a03b2965..2d17d7d9 100644
--- a/frontend/src/routes/search/Entity.svelte
+++ b/frontend/src/routes/search/Entity.svelte
@@ -27,7 +27,7 @@
<span class="italic">
source:{' '}
<a
- class="text-blue-600 hover:underline"
+ class="text-link visited:text-link-visited hover:underline"
href="https://en.wikipedia.org/wiki/{encodeURI(entity.title)}"
>
wikipedia
@@ -38,14 +38,14 @@
<div class="mb-2 mt-7 flex w-full flex-col px-4 text-sm">
<div class="grid grid-cols-[auto_1fr] gap-x-4 gap-y-2">
{#each entity.info as [key, value] (key)}
- <div class="text-gray-500">{@html key}</div>
+ <div class="text-neutral">{@html key}</div>
<div>{@html value}</div>
{/each}
</div>
</div>
{/if}
{#if entity.relatedEntities.length > 0}
- <div class="mt-5 flex w-full flex-col text-gray-500">
+ <div class="mt-5 flex w-full flex-col text-neutral">
<div class="font-light">Related Searches</div>
<div class="flex overflow-scroll">
{#each entity.relatedEntities as related (related.title)}
diff --git a/frontend/src/routes/search/Result.svelte b/frontend/src/routes/search/Result.svelte
index 9027f392..c82b486a 100644
--- a/frontend/src/routes/search/Result.svelte
+++ b/frontend/src/routes/search/Result.svelte
@@ -23,7 +23,7 @@
<div class="flex min-w-0 grow flex-col space-y-1">
<div class="flex items-center text-sm">
<a
- class="max-w-[calc(100%-100px)] truncate text-gray-800 dark:text-brand-100"
+ class="max-w-[calc(100%-100px)] truncate text-neutral-focus"
href={webpage.url}
use:improvements={resultIndex}
>
@@ -31,7 +31,7 @@
</a>
</div>
<a
- class="max-w-[calc(100%-30px)] truncate text-xl font-medium text-blue-800 visited:text-purple-800 hover:underline dark:text-blue-500 dark:visited:text-purple-500"
+ class="max-w-[calc(100%-30px)] truncate text-xl font-medium text-link visited:text-link-visited hover:underline"
title={webpage.title}
href={webpage.url}
use:improvements={resultIndex}
@@ -40,14 +40,14 @@
</a>
</div>
<button
- class="noscript:hidden hidden w-5 min-w-fit items-center justify-center bg-transparent text-gray-700/50 hover:cursor-pointer hover:text-gray-700 dark:text-stone-400 dark:hover:text-stone-300 md:flex"
+ class="noscript:hidden hidden w-5 min-w-fit items-center justify-center bg-transparent text-neutral hover:cursor-pointer hover:text-neutral-focus md:flex"
bind:this={button}
on:click|stopPropagation={() => dispatch('modal', button)}
>
<AdjustVertical class="text-xl" />
</button>
</div>
- <div class="text-sm font-normal text-snippet dark:text-stone-400 [&>b]:font-bold">
+ <div class="text-sm font-normal text-neutral-focus [&>b]:font-bold">
{#if $summary}
<Summary {...$summary} on:hide={() => clearSummary(webpage)} />
{:else if webpage.snippet.type == 'normal'}
diff --git a/frontend/src/routes/search/StackOverflow.svelte b/frontend/src/routes/search/StackOverflow.svelte
index 817f69cf..e3683b76 100644
--- a/frontend/src/routes/search/StackOverflow.svelte
+++ b/frontend/src/routes/search/StackOverflow.svelte
@@ -7,9 +7,7 @@
export let answer: StackOverflowAnswer;
</script>
-<div
- class="flex flex-col space-y-5 overflow-hidden rounded-lg border p-5 dark:border-stone-700 md:max-w-lg"
->
+<div class="flex flex-col space-y-5 overflow-hidden rounded-lg border p-5 md:max-w-lg">
<div class="flex flex-col space-y-1">
<div class="flex grow justify-between space-x-2">
<a class="flex text-lg font-medium leading-6" href={answer.url}>{title}</a>
diff --git a/frontend/src/routes/search/Summary.svelte b/frontend/src/routes/search/Summary.svelte
index 19715680..f57e6e84 100644
--- a/frontend/src/routes/search/Summary.svelte
+++ b/frontend/src/routes/search/Summary.svelte
@@ -1,4 +1,6 @@
<script lang="ts">
+ import XMark from '~icons/heroicons/x-mark';
+ import Callout from '$lib/components/Callout.svelte';
import { createEventDispatcher } from 'svelte';
export let inProgress: boolean;
@@ -7,16 +9,11 @@
const dispatch = createEventDispatcher<{ hide: null }>();
</script>
-<div class="rounded-lg bg-slate-100 p-4 dark:bg-stone-800">
- <div class="mb-2 flex justify-between font-light">
- <span>Summary</span>
- <button
- class="rounded bg-slate-200 px-2 text-xs text-slate-700 dark:bg-stone-700 dark:text-stone-100"
- on:click={() => dispatch('hide')}
- >
- hide summary
- </button>
- </div>
+<Callout kind="neutral" title="Summary">
+ <button slot="top-right" on:click={() => dispatch('hide')} title="Hide summary">
+ <XMark />
+ </button>
+
<p class="line-clamp-3">
{#if data}
{data}
@@ -31,4 +28,4 @@
</span>
{/if}
</p>
-</div>
+</Callout>
diff --git a/frontend/src/routes/search/Widget.svelte b/frontend/src/routes/search/Widget.svelte
index d629b5b1..656c8780 100644
--- a/frontend/src/routes/search/Widget.svelte
+++ b/frontend/src/routes/search/Widget.svelte
@@ -6,7 +6,7 @@
{#if widget.type == 'calculator'}
<div class="flex flex-col items-end rounded-xl border p-5">
- <div class="flex w-fit text-xs text-gray-500">
+ <div class="flex w-fit text-xs text-neutral">
{widget.value.input} =
</div>
<div class="flex w-fit text-3xl font-bold">
diff --git a/frontend/src/routes/settings/+page.svelte b/frontend/src/routes/settings/+page.svelte
index cdd14896..22ebcfdd 100644
--- a/frontend/src/routes/settings/+page.svelte
+++ b/frontend/src/routes/settings/+page.svelte
@@ -1,36 +1,56 @@
<script lang="ts">
+ import ThemeSelect from '$lib/components/ThemeSelect.svelte';
import { safeSearchStore } from '$lib/stores';
const safeSearchOptions = [
['on', true],
['off', false],
] as const;
+
+ const settings = [
+ {
+ title: 'Safe Search',
+ description: 'Remove explicit content from search results',
+ type: 'safe-search',
+ },
+ {
+ title: 'Theme',
+ description: 'Pick a color scheme',
+ type: 'theme',
+ },
+ ] as const;
</script>
<div class="[&_a]:font-medium [&_a]:underline">
<div class="space-y-3">
<h1 class="text-2xl font-medium">Preferences</h1>
<div>
- <h2 class="text-lg">Safe Search</h2>
- <div class="flex flex-col space-y-1 pr-5 sm:flex-row sm:justify-between sm:space-y-0">
- <p>Remove explicit content from search results</p>
- <div class="flex space-x-4">
- {#each safeSearchOptions as [name, state]}
- <label class="flex cursor-pointer flex-col items-center" for="safe-search-{state}">
- <input
- type="radio"
- name="safe-search"
- id="safe-search-{state}"
- value={state}
- bind:group={$safeSearchStore}
- />
- <span class="capitalize">{name}</span>
- </label>
- {/each}
+ {#each settings as setting}
+ <h2 class="text-lg">{setting.title}</h2>
+ <div class="flex flex-col space-y-1 pr-5 sm:flex-row sm:justify-between sm:space-y-0">
+ <p>{setting.description}</p>
+ {#if setting.type == 'safe-search'}
+ <div class="flex space-x-4 pr-2">
+ {#each safeSearchOptions as [name, state]}
+ <label class="flex cursor-pointer flex-col items-center" for="safe-search-{state}">
+ <input
+ type="radio"
+ name="safe-search"
+ id="safe-search-{state}"
+ value={state}
+ bind:group={$safeSearchStore}
+ />
+ <span class="capitalize">{name}</span>
+ </label>
+ {/each}
+ </div>
+ {:else if setting.type == 'theme'}
+ <ThemeSelect />
+ {/if}
</div>
- </div>
+ {/each}
- <p class="pt-5 text-neutral-300 dark:text-stone-500">More to come soon</p>
+ <p class="pt-5 text-neutral/50">More to come soon</p>
</div>
</div>
</div>
diff --git a/frontend/src/routes/settings/optics/+page.svelte b/frontend/src/routes/settings/optics/+page.svelte
index 8508ae86..4940d9c2 100644
--- a/frontend/src/routes/settings/optics/+page.svelte
+++ b/frontend/src/routes/settings/optics/+page.svelte
@@ -5,6 +5,7 @@
import { DEFAULT_OPTICS, fetchRemoteOptic, type OpticOption } from '$lib/optics';
import { derived } from 'svelte/store';
import { slide } from 'svelte/transition';
+ import Callout from '$lib/components/Callout.svelte';
let name = '';
let url = '';
@@ -97,16 +98,12 @@
/>
</form>
{#if error}
- <details
- class="space-y-2 rounded-xl border border-red-200 bg-red-50 px-3 py-2"
- transition:slide
- >
- <summary class="cursor-pointer text-lg text-red-800">Validating optic failed</summary>
+ <Callout kind="error" title="Validating optic failed">
<p>
Failed while trying to <code class="text-sm">fetch</code> the optic url. Check your browser
console for details.
</p>
- </details>
+ </Callout>
{/if}
<div class="mt-5">
<div class="grid w-full grid-cols-[auto_1fr_2fr_auto] gap-5" id="optics-list">
@@ -121,7 +118,7 @@
disabled={!removable}
>
<MinusCircle
- class="transition group-enabled:text-red-500 group-enabled:group-hover:text-red-400"
+ class="transition group-enabled:text-error group-enabled:group-hover:text-error"
/>
</button>
<div class="text-sm">{optic.name}</div>
diff --git a/frontend/src/routes/webmasters/README.md b/frontend/src/routes/webmasters/README.md
index b5db1e20..22a57435 100644
--- a/frontend/src/routes/webmasters/README.md
+++ b/frontend/src/routes/webmasters/README.md
@@ -1,15 +1,18 @@
# Stract Crawler
+
Stract is an [open source](https://github.com/StractOrg/stract/) web search engine. StractBot is the name of our crawler that collects pages from the web in order to build the index.
It is written in Rust and the source code can be found [here](https://github.com/StractOrg/stract/tree/main/core/src/crawler).
The crawler uses the user agent `Mozilla/5.0 (compatible; StractBot/0.1; open source search engine; +https://trystract.com/webmasters)`.
## Politeness
+
StractBot is a polite crawler. It respects the [robots.txt](https://en.wikipedia.org/wiki/Robots.txt) file of the website it is crawling and tries to not overload the server.
-It does this by waiting a certain amount of time between requests to the same domain. The waiting time is calculated by *min(max(fetchtime * politeness, 1 sec), 60 sec)* where *fetchtime* is the time it took to fetch the page. The crawler will wait at least 1 sec between requests and at most 60 seconds.
+It does this by waiting a certain amount of time between requests to the same domain. The waiting time is calculated by _min(max(fetchtime _ politeness, 1 sec), 60 sec)* where *fetchtime\* is the time it took to fetch the page. The crawler will wait at least 1 sec between requests and at most 60 seconds.
This dynamic waiting time tries to prevent us from disrupting servers that cannot handle the load, while not giving unnecessary politeness to servers that can. The politeness factor starts at 1 and is doubled every time the crawler gets a 429 response from the server (to at most 2048).
The crawler looks for the token `StractBot` in the robots.txt file to determine which pages (if any) the crawler is allowed to crawl.
The robots.txt file is cached for 1 hour, so changes to the file should be respected quite quickly.
## Contact us
+
If you have any concerns or bad experiences with our crawler, please don't hesitate to reach out to us at [[email protected]](mailto:[email protected]). Chances are that others experience the same problems and we would love to fix them.
diff --git a/frontend/src/themes/ayu.ts b/frontend/src/themes/ayu.ts
new file mode 100644
index 00000000..0b0b8043
--- /dev/null
+++ b/frontend/src/themes/ayu.ts
@@ -0,0 +1,58 @@
+import { theme } from './base';
+
+const mirage = [
+ '#ffffff',
+ '#171b24',
+ '#1a1f29',
+ '#1c212b',
+ '#1f2430',
+ '#242936',
+ '#73d0ff',
+ '#6dcbfa',
+ '#80bfff',
+ '#90e1c6',
+ '#95e6cb',
+ '#5ccfe6',
+ '#686868',
+ '#707a8c',
+ '#c7c7c7',
+ '#cccac2',
+ '#d5ff80',
+ '#87d96c',
+ '#dabafa',
+ '#dfbfff',
+ '#c594c5',
+ '#695380',
+ '#ffdfb3',
+ '#ffd173',
+ '#facc6e',
+ '#ffcc66',
+ '#fac761',
+ '#ffad66',
+ '#f29e74',
+ '#f28779',
+ '#ed8274',
+ '#f27983',
+ '#ff6666',
+];
+
+export const ayuMirageTheme = theme({
+ name: 'ayu-mirage',
+ scheme: 'dark',
+ colors: {
+ primary: mirage[27],
+ secondary: mirage[23],
+ accent: mirage[16],
+ neutral: mirage[14],
+ neutralFocus: mirage[15],
+ base100: mirage[5],
+ base200: mirage[4],
+ base300: mirage[3],
+ info: mirage[11],
+ success: mirage[17],
+ warning: mirage[28],
+ error: mirage[32],
+ link: mirage[11],
+ linkVisited: mirage[19],
+ },
+});
diff --git a/frontend/src/themes/base.ts b/frontend/src/themes/base.ts
new file mode 100644
index 00000000..5f51c766
--- /dev/null
+++ b/frontend/src/themes/base.ts
@@ -0,0 +1,213 @@
+import colors from 'tailwindcss/colors';
+import plugin from 'tailwindcss/plugin';
+import { colord } from 'colord';
+
+type Color = string;
+
+type Colors = {
+ primary: Color;
+ primaryFocus?: Color;
+ primaryContent?: Color;
+
+ secondary: Color;
+ secondaryFocus?: Color;
+ secondaryContent?: Color;
+
+ accent: Color;
+ accentFocus?: Color;
+ accentContent?: Color;
+
+ neutral: Color;
+ neutralFocus?: Color;
+ neutralContent?: Color;
+
+ base100: Color;
+ base200?: Color;
+ base300?: Color;
+ baseContent?: Color;
+
+ info: Color;
+ infoFocus?: Color;
+ infoContent?: Color;
+
+ success: Color;
+ successFocus?: Color;
+ successContent?: Color;
+
+ warning: Color;
+ warningFocus?: Color;
+ warningContent?: Color;
+
+ error: Color;
+ errorFocus?: Color;
+ errorContent?: Color;
+
+ link: Color;
+ linkVisited: Color;
+};
+
+type ThemeOpts = {
+ name: string;
+ scheme: 'light' | 'dark';
+ colors: Colors;
+};
+
+export const theme = (opts: ThemeOpts) => {
+ // const foreground = (c: string) => (colord(c).isDark() ? '255 255 255' : '0 0 0');
+ const foreground = (c: string) =>
+ colord(c).isDark() ? colord(c).lighten(0.9).toHex() : colord(c).darken(0.9).toHex();
+ const focus = (c: string) =>
+ opts.scheme == 'light' ? colord(c).darken().toHex() : colord(c).lighten().toHex();
+
+ const colors: Required<Colors> = {
+ ...opts.colors,
+ primaryFocus: opts.colors?.primaryFocus ?? focus(opts.colors.primary),
+ primaryContent: opts.colors?.primaryContent ?? foreground(opts.colors.primary),
+ secondaryFocus: opts.colors?.secondaryFocus ?? focus(opts.colors.secondary),
+ secondaryContent: opts.colors?.secondaryContent ?? foreground(opts.colors.secondary),
+ accentFocus: opts.colors?.accentFocus ?? focus(opts.colors.accent),
+ accentContent: opts.colors?.accentContent ?? foreground(opts.colors.accent),
+ neutralFocus: opts.colors?.neutralFocus ?? focus(opts.colors.neutral),
+ neutralContent: opts.colors?.neutralContent ?? foreground(opts.colors.neutral),
+ base200: opts.colors?.base200 ?? colord(opts.colors.base100).darken().toHex(),
+ base300: opts.colors?.base300 ?? colord(opts.colors.base100).darken().darken().toHex(),
+ baseContent: opts.colors?.baseContent ?? foreground(opts.colors.base100),
+ infoFocus: opts.colors?.infoFocus ?? focus(opts.colors.info),
+ infoContent: opts.colors?.infoContent ?? foreground(opts.colors.info),
+ successFocus: opts.colors?.successFocus ?? focus(opts.colors.success),
+ successContent: opts.colors?.successContent ?? foreground(opts.colors.success),
+ warningFocus: opts.colors?.warningFocus ?? focus(opts.colors.warning),
+ warningContent: opts.colors?.warningContent ?? foreground(opts.colors.warning),
+ errorFocus: opts.colors?.errorFocus ?? focus(opts.colors.error),
+ errorContent: opts.colors?.errorContent ?? foreground(opts.colors.error),
+ };
+
+ return plugin(({ addComponents }) => {
+ const toKebabCase = (s: string) => s.replaceAll(/([A-Z0-9]+)/g, (x) => `-${x.toLowerCase()}`);
+
+ addComponents({
+ [`.theme-${opts.name}`]: Object.fromEntries(
+ Object.entries(colors).map(([shade, color]) => [`--${toKebabCase(shade)}`, hex2rgb(color)]),
+ ),
+ });
+ });
+};
+
+export const hex2rgb = (hex: string) => {
+ hex = colord(hex).toHex();
+ const pick = (n: number) => parseInt(hex.slice(n, n + 2), 16);
+ return hex.startsWith('#') ? `${pick(1)} ${pick(3)} ${pick(5)}` : hex;
+};
+
+export const base = {
+ ...colors,
+ // https://tailwind.ink?p=10.f4f9fadcf1fbb5dff785bfec539adc3f77cd345cb92a45961e2e6c121c45f7f9fbe4f0fdc7d8fb9fb5f37c8deb6568e4534bd74039b82c278a181857f9fafbefeffbded3f8c1adedad83e1955ed67c42c45d32a0402271241643fdfcfbfbeff1f7cbe4ee9ec7ec6ea5e14a89cc3168a6254c7a1a314b111afdfcfafbf0ebf8cfd7eea2b0ea7286dd4e64c635469f2833721c22461113fcfbf8faf0d8f5d7aee6ae7bd9814dc35e2ea6441d80331859231238160cfbfaf4f9f0bcf1dd80dbb94eba8f2a9b70157d560d60400c412c0b2b1b08faf9f3f7f0b9ede07bd2bd4aa69526847712695e0c51460b37300a251d08f1f6f3dbf0eaade6d072cca230ac722191491d7b351a5e2c1440220e271bf0f6f6d3f0f6a0e5eb68c9d12ea9b0218c8e1d73741a585a143c420d252e
+ navy: {
+ 50: '#f4f9fa',
+ 100: '#dcf1fb',
+ 200: '#b5dff7',
+ 300: '#85bfec',
+ 400: '#539adc',
+ 500: '#3f77cd',
+ 600: '#345cb9',
+ 700: '#2a4596',
+ 800: '#1e2e6c',
+ 900: '#121c45',
+ },
+ indigo: {
+ 50: '#f9fafb',
+ 100: '#efeffb',
+ 200: '#ded3f8',
+ 300: '#c1aded',
+ 400: '#ad83e1',
+ 500: '#955ed6',
+ 600: '#7c42c4',
+ 700: '#5d32a0',
+ 800: '#402271',
+ 900: '#241643',
+ },
+ cerise: {
+ 50: '#fdfcfb',
+ 100: '#fbeff1',
+ 200: '#f7cbe4',
+ 300: '#ee9ec7',
+ 400: '#ec6ea5',
+ 500: '#e14a89',
+ 600: '#cc3168',
+ 700: '#a6254c',
+ 800: '#7a1a31',
+ 900: '#4b111a',
+ },
+ cerise2: {
+ 50: '#fdfcfa',
+ 100: '#fbf0eb',
+ 200: '#f8cfd7',
+ 300: '#eea2b0',
+ 400: '#ea7286',
+ 500: '#dd4e64',
+ 600: '#c63546',
+ 700: '#9f2833',
+ 800: '#721c22',
+ 900: '#461113',
+ },
+ cocoa: {
+ 50: '#fcfbf8',
+ 100: '#faf0d8',
+ 200: '#f5d7ae',
+ 300: '#e6ae7b',
+ 400: '#d9814d',
+ 500: '#c35e2e',
+ 600: '#a6441d',
+ 700: '#803318',
+ 800: '#592312',
+ 900: '#38160c',
+ },
+ gold: {
+ 50: '#fbfaf4',
+ 100: '#f9f0bc',
+ 200: '#f1dd80',
+ 300: '#dbb94e',
+ 400: '#ba8f2a',
+ 500: '#9b7015',
+ 600: '#7d560d',
+ 700: '#60400c',
+ 800: '#412c0b',
+ 900: '#2b1b08',
+ },
+ lemon: {
+ 50: '#faf9f3',
+ 100: '#f7f0b9',
+ 200: '#ede07b',
+ 300: '#d2bd4a',
+ 400: '#a69526',
+ 500: '#847712',
+ 600: '#695e0c',
+ 700: '#51460b',
+ 800: '#37300a',
+ 900: '#251d08',
+ },
+ green: {
+ 50: '#f1f6f3',
+ 100: '#dbf0ea',
+ 200: '#ade6d0',
+ 300: '#72cca2',
+ 400: '#30ac72',
+ 500: '#219149',
+ 600: '#1d7b35',
+ 700: '#1a5e2c',
+ 800: '#144022',
+ 900: '#0e271b',
+ },
+ island: {
+ 50: '#f0f6f6',
+ 100: '#d3f0f6',
+ 200: '#a0e5eb',
+ 300: '#68c9d1',
+ 400: '#2ea9b0',
+ 500: '#218c8e',
+ 600: '#1d7374',
+ 700: '#1a585a',
+ 800: '#143c42',
+ 900: '#0d252e',
+ },
+} as const;
diff --git a/frontend/src/themes/dark.ts b/frontend/src/themes/dark.ts
new file mode 100644
index 00000000..aa1f63ed
--- /dev/null
+++ b/frontend/src/themes/dark.ts
@@ -0,0 +1,43 @@
+import { base, theme } from './base';
+
+export const darkTheme = theme({
+ name: 'dark',
+ scheme: 'dark',
+ colors: {
+ primary: base.navy[600],
+ primaryFocus: base.navy[500],
+ primaryContent: '#fff',
+
+ secondary: base.island[500],
+ secondaryFocus: base.island[400],
+ secondaryContent: '#fff',
+
+ accent: base.cocoa[500],
+ accentFocus: base.cocoa[400],
+ accentContent: '#fff',
+
+ neutral: base.stone[400],
+ neutralFocus: base.stone[300],
+ neutralContent: base.stone[100],
+
+ base100: base.stone[900],
+ base200: base.stone[800],
+ base300: base.stone[700],
+ baseContent: base.island[50],
+
+ info: base.navy[700],
+ infoContent: base.navy[200],
+
+ success: base.green[600],
+ successContent: base.green[100],
+
+ warning: base.amber[600],
+ warningContent: base.amber[100],
+
+ error: base.cerise2[600],
+ errorContent: base.cerise2[100],
+
+ link: base.sky[400],
+ linkVisited: base.purple[500],
+ },
+});
diff --git a/frontend/src/themes/index.ts b/frontend/src/themes/index.ts
new file mode 100644
index 00000000..60a81dc4
--- /dev/null
+++ b/frontend/src/themes/index.ts
@@ -0,0 +1,18 @@
+import { ayuMirageTheme } from './ayu';
+import { darkTheme } from './dark';
+import { primerDarkTheme } from './primer';
+import { lightTheme } from './light';
+import { nordLightTheme, nordTheme } from './nord';
+import { pastelTheme } from './pastel';
+import { uglyTheme } from './ugly';
+
+export const themes = [
+ lightTheme,
+ pastelTheme,
+ darkTheme,
+ nordTheme,
+ nordLightTheme,
+ ayuMirageTheme,
+ primerDarkTheme,
+ uglyTheme,
+];
diff --git a/frontend/src/themes/light.ts b/frontend/src/themes/light.ts
new file mode 100644
index 00000000..8ffa1eed
--- /dev/null
+++ b/frontend/src/themes/light.ts
@@ -0,0 +1,41 @@
+import { base, theme } from './base';
+
+export const lightTheme = theme({
+ name: 'light',
+ scheme: 'light',
+ colors: {
+ primary: 'rgb(40, 156, 255)',
+ primaryContent: '#fff',
+
+ secondary: base.sky[400],
+ secondaryFocus: base.sky[500],
+ secondaryContent: '#fff',
+
+ accent: 'rgb(255, 105, 11)',
+ accentContent: '#fff',
+
+ neutral: base.slate[600],
+ neutralFocus: base.slate[800],
+ neutralContent: base.island[100],
+
+ base100: '#fff',
+ base200: base.slate[100],
+ base300: base.slate[200],
+ baseContent: base.slate[900],
+
+ info: base.navy[500],
+ infoContent: base.navy[50],
+
+ success: base.emerald[600],
+ successContent: base.emerald[50],
+
+ warning: base.amber[400],
+ warningContent: base.amber[50],
+
+ error: base.rose[600],
+ errorContent: base.rose[50],
+
+ link: base.blue[800],
+ linkVisited: base.purple[800],
+ },
+});
diff --git a/frontend/src/themes/nord.ts b/frontend/src/themes/nord.ts
new file mode 100644
index 00000000..cf42cbc5
--- /dev/null
+++ b/frontend/src/themes/nord.ts
@@ -0,0 +1,67 @@
+import { theme } from './base';
+
+const nord = {
+ 0: '#2e3440',
+ 1: '#3b4252',
+ 2: '#434c5e',
+ 3: '#4c566a',
+ 4: '#d8dee9',
+ 5: '#e5e9f0',
+ 6: '#eceff4',
+ 7: '#8fbcbb',
+ 8: '#88c0d0',
+ 9: '#81a1c1',
+ 10: '#5e81ac',
+ 11: '#bf616a',
+ 12: '#d08770',
+ 13: '#ebcb8b',
+ 14: '#a3be8c',
+ 15: '#b48ead',
+};
+
+export const nordTheme = theme({
+ name: 'nord',
+ scheme: 'dark',
+ colors: {
+ primary: nord[10],
+ primaryFocus: nord[9],
+ secondary: nord[7],
+ accent: nord[15],
+ neutral: nord[4],
+ neutralFocus: nord[5],
+ neutralContent: nord[0],
+ base100: nord[0],
+ base200: nord[1],
+ base300: nord[2],
+ info: nord[8],
+ success: nord[14],
+ warning: nord[13],
+ error: nord[11],
+ link: nord[8],
+ linkVisited: nord[15],
+ },
+});
+
+export const nordLightTheme = theme({
+ name: 'nord-light',
+ scheme: 'light',
+ colors: {
+ primary: nord[10],
+ primaryFocus: nord[9],
+ secondary: nord[8],
+ accent: nord[15],
+ neutral: nord[2],
+ neutralFocus: nord[1],
+ neutralContent: nord[4],
+ base100: 'rgb(255, 255, 255)',
+ base200: nord[6],
+ base300: nord[5],
+ baseContent: 'rgb(0, 0, 0)',
+ info: nord[8],
+ success: nord[14],
+ warning: nord[13],
+ error: nord[11],
+ link: nord[10],
+ linkVisited: nord[15],
+ },
+});
diff --git a/frontend/src/themes/pastel.ts b/frontend/src/themes/pastel.ts
new file mode 100644
index 00000000..72b8369f
--- /dev/null
+++ b/frontend/src/themes/pastel.ts
@@ -0,0 +1,43 @@
+import { base, theme } from './base';
+
+export const pastelTheme = theme({
+ name: 'pastel',
+ scheme: 'light',
+ colors: {
+ primary: base.island[400],
+ primaryFocus: base.island[500],
+ primaryContent: 'rgb(255, 255, 255)',
+
+ secondary: base.navy[400],
+ secondaryFocus: base.navy[500],
+ secondaryContent: 'rgb(255, 255, 255)',
+
+ accent: base.cocoa[400],
+ accentFocus: base.cocoa[500],
+ accentContent: 'rgb(255, 255, 255)',
+
+ neutral: base.slate[600],
+ neutralFocus: base.slate[700],
+ neutralContent: base.island[100],
+
+ base100: 'rgb(255, 255, 255)',
+ base200: base.slate[100],
+ base300: base.slate[200],
+ baseContent: base.slate[900],
+
+ info: base.navy[300],
+ infoContent: base.navy[800],
+
+ success: base.green[300],
+ successContent: base.green[800],
+
+ warning: base.gold[200],
+ warningContent: base.gold[900],
+
+ error: base.cerise2[300],
+ errorContent: base.cerise2[800],
+
+ link: base.blue[700],
+ linkVisited: base.indigo[600],
+ },
+});
diff --git a/frontend/src/themes/primer.ts b/frontend/src/themes/primer.ts
new file mode 100644
index 00000000..3588ddc7
--- /dev/null
+++ b/frontend/src/themes/primer.ts
@@ -0,0 +1,135 @@
+import { theme } from './base';
+
+const primer = {
+ black: '#010409',
+ white: '#ffffff',
+ gray: [
+ '#f0f6fc',
+ '#c9d1d9',
+ '#b1bac4',
+ '#8b949e',
+ '#6e7681',
+ '#484f58',
+ '#30363d',
+ '#21262d',
+ '#161b22',
+ '#0d1117',
+ ],
+ blue: [
+ '#cae8ff',
+ '#a5d6ff',
+ '#79c0ff',
+ '#58a6ff',
+ '#388bfd',
+ '#1f6feb',
+ '#1158c7',
+ '#0d419d',
+ '#0c2d6b',
+ '#051d4d',
+ ],
+ green: [
+ '#aff5b4',
+ '#7ee787',
+ '#56d364',
+ '#3fb950',
+ '#2ea043',
+ '#238636',
+ '#196c2e',
+ '#0f5323',
+ '#033a16',
+ '#04260f',
+ ],
+ yellow: [
+ '#f8e3a1',
+ '#f2cc60',
+ '#e3b341',
+ '#d29922',
+ '#bb8009',
+ '#9e6a03',
+ '#845306',
+ '#693e00',
+ '#4b2900',
+ '#341a00',
+ ],
+ orange: [
+ '#ffdfb6',
+ '#ffc680',
+ '#ffa657',
+ '#f0883e',
+ '#db6d28',
+ '#bd561d',
+ '#9b4215',
+ '#762d0a',
+ '#5a1e02',
+ '#3d1300',
+ ],
+ red: [
+ '#ffdcd7',
+ '#ffc1ba',
+ '#ffa198',
+ '#ff7b72',
+ '#f85149',
+ '#da3633',
+ '#b62324',
+ '#8e1519',
+ '#67060c',
+ '#490202',
+ ],
+ purple: [
+ '#eddeff',
+ '#e2c5ff',
+ '#d2a8ff',
+ '#bc8cff',
+ '#a371f7',
+ '#8957e5',
+ '#6e40c9',
+ '#553098',
+ '#3c1e70',
+ '#271052',
+ ],
+ pink: [
+ '#ffdaec',
+ '#ffbedd',
+ '#ff9bce',
+ '#f778ba',
+ '#db61a2',
+ '#bf4b8a',
+ '#9e3670',
+ '#7d2457',
+ '#5e103e',
+ '#42062a',
+ ],
+ coral: [
+ '#ffddd2',
+ '#ffc2b2',
+ '#ffa28b',
+ '#f78166',
+ '#ea6045',
+ '#cf462d',
+ '#ac3220',
+ '#872012',
+ '#640d04',
+ '#460701',
+ ],
+};
+
+export const primerDarkTheme = theme({
+ name: 'primer-dark',
+ scheme: 'dark',
+ colors: {
+ primary: primer.purple[5],
+ secondary: primer.blue[5],
+ accent: primer.pink[5],
+ neutral: primer.gray[2],
+ neutralFocus: primer.gray[3],
+ base100: primer.gray[9],
+ base200: primer.gray[7],
+ base300: primer.gray[5],
+ info: primer.blue[4],
+ success: primer.green[5],
+ warning: primer.orange[3],
+ error: primer.red[5],
+ link: primer.blue[5],
+ linkVisited: primer.purple[5],
+ },
+});
diff --git a/frontend/src/themes/ugly.ts b/frontend/src/themes/ugly.ts
new file mode 100644
index 00000000..b780f0fa
--- /dev/null
+++ b/frontend/src/themes/ugly.ts
@@ -0,0 +1,26 @@
+import { base, theme } from './base';
+
+export const uglyTheme = theme({
+ name: 'ugly',
+ scheme: 'light',
+ colors: {
+ primary: 'rgb(239, 153, 149)',
+ primaryContent: 'rgb(40, 36, 37)',
+ secondary: 'rgb(164, 203, 180)',
+ secondaryContent: 'rgb(40, 36, 37)',
+ accent: 'rgb(220, 136, 80)',
+ accentContent: 'rgb(40, 36, 37)',
+ neutral: 'rgb(46, 40, 42)',
+ neutralContent: 'rgb(237, 230, 212)',
+ base100: 'rgb(228, 216, 180)',
+ base200: 'rgb(219, 202, 154)',
+ base300: 'rgb(212, 191, 135)',
+ baseContent: 'rgb(40, 36, 37)',
+ info: 'rgb(37, 99, 235)',
+ success: 'rgb(22, 163, 74)',
+ warning: 'rgb(217, 119, 6)',
+ error: 'rgb(220, 38, 38)',
+ link: base.blue[700],
+ linkVisited: base.indigo[600],
+ },
+});
diff --git a/frontend/tailwind.config.ts b/frontend/tailwind.config.ts
index 9ecce1d2..4c16c0f2 100644
--- a/frontend/tailwind.config.ts
+++ b/frontend/tailwind.config.ts
@@ -5,6 +5,8 @@ import plugin from 'tailwindcss/plugin';
import typographyPlugin from '@tailwindcss/typography';
import formsPlugin from '@tailwindcss/forms';
+import { themes } from './src/themes';
+
const noscriptPlugin = plugin(({ addComponents }) => {
// NOTE: We cannot choose where Tailwind puts the generated CSS, so we
// manually add these classes to routes/+layout.svelte
@@ -13,38 +15,34 @@ const noscriptPlugin = plugin(({ addComponents }) => {
});
});
+const color = (name: string) => ({
+ [`${name}`]: `rgb(var(--${name}) / <alpha-value>)`,
+});
+const colorFocusContent = (name: string) => ({
+ ...color(`${name}`),
+ ...color(`${name}-focus`),
+ ...color(`${name}-content`),
+});
+
export default {
content: ['./src/**/*.{html,js,svelte,ts}'],
theme: {
extend: {
colors: {
- snippet: '#4d5156',
- brand: {
- '50': 'rgb(237 249 255 / <alpha-value>)',
- '100': 'rgb(215 239 255 / <alpha-value>)',
- '200': 'rgb(185 228 255 / <alpha-value>)',
- '300': 'rgb(136 213 255 / <alpha-value>)',
- '400': 'rgb(80 189 255 / <alpha-value>)',
- '500': 'rgb(40 156 255 / <alpha-value>)',
- '600': 'rgb(11 123 255 / <alpha-value>)',
- '700': 'rgb(10 102 235 / <alpha-value>)',
- '800': 'rgb(15 82 190 / <alpha-value>)',
- '900': 'rgb(19 72 149 / <alpha-value>)',
- '950': 'rgb(17 45 90 / <alpha-value>)',
- },
- contrast: {
- '50': 'rgb(255 247 237 / <alpha-value>)',
- '100': 'rgb(255 236 212 / <alpha-value>)',
- '200': 'rgb(255 213 168 / <alpha-value>)',
- '300': 'rgb(255 183 112 / <alpha-value>)',
- '400': 'rgb(255 140 55 / <alpha-value>)',
- '500': 'rgb(255 105 11 / <alpha-value>)',
- '600': 'rgb(240 80 6 / <alpha-value>)',
- '700': 'rgb(199 58 7 / <alpha-value>)',
- '800': 'rgb(158 46 14 / <alpha-value>)',
- '900': 'rgb(127 41 15 / <alpha-value>)',
- '950': 'rgb(69 17 5 / <alpha-value>)',
- },
+ ...colorFocusContent('primary'),
+ ...colorFocusContent('secondary'),
+ ...colorFocusContent('accent'),
+ ...colorFocusContent('neutral'),
+ ...color('base-100'),
+ ...color('base-200'),
+ ...color('base-300'),
+ ...color('base-content'),
+ ...colorFocusContent('info'),
+ ...colorFocusContent('success'),
+ ...colorFocusContent('warning'),
+ ...colorFocusContent('error'),
+ ...color('link'),
+ ...color('link-visited'),
},
fontFamily: {
sans: ['Helvetica', 'Arial', 'sans-serif', ...defaultTheme.fontFamily.sans],
@@ -57,5 +55,5 @@ export default {
},
},
},
- plugins: [typographyPlugin, formsPlugin, noscriptPlugin],
+ plugins: [typographyPlugin, formsPlugin, noscriptPlugin, ...themes],
} satisfies Config;