2024-07-12 13:49:29 +01:00
|
|
|
<script lang="ts">
|
2024-06-14 11:33:01 +01:00
|
|
|
import "@fontsource/ibm-plex-mono/400.css";
|
|
|
|
import "@fontsource/ibm-plex-mono/500.css";
|
2024-06-29 15:09:17 +01:00
|
|
|
|
2024-07-14 17:50:18 +01:00
|
|
|
import env from "$lib/env";
|
2024-07-13 14:17:03 +01:00
|
|
|
import settings from "$lib/state/settings";
|
2024-07-03 14:05:14 +01:00
|
|
|
import { device, app } from "$lib/device";
|
2024-07-14 16:10:41 +01:00
|
|
|
import { locale } from "$lib/i18n/translations";
|
2024-06-29 15:24:51 +01:00
|
|
|
import currentTheme, { statusBarColors } from "$lib/state/theme";
|
2024-06-29 15:09:17 +01:00
|
|
|
|
2024-06-24 15:23:55 +01:00
|
|
|
import Sidebar from "$components/sidebar/Sidebar.svelte";
|
2024-07-03 14:05:14 +01:00
|
|
|
import NotchSticker from "$components/misc/NotchSticker.svelte";
|
2024-07-13 14:15:43 +01:00
|
|
|
import DialogHolder from "$components/dialog/DialogHolder.svelte";
|
2024-07-12 13:49:29 +01:00
|
|
|
|
|
|
|
$: reduceMotion =
|
|
|
|
$settings.appearance.reduceMotion
|
|
|
|
|| device.prefers.reducedMotion;
|
|
|
|
$: reduceTransparency =
|
|
|
|
$settings.appearance.reduceTransparency
|
|
|
|
|| device.prefers.reducedTransparency;
|
2024-06-14 11:33:01 +01:00
|
|
|
</script>
|
|
|
|
|
2024-06-29 15:24:51 +01:00
|
|
|
<svelte:head>
|
2024-07-03 14:05:14 +01:00
|
|
|
{#if device.is.mobile}
|
2024-06-29 15:24:51 +01:00
|
|
|
<meta name="theme-color" content={statusBarColors[$currentTheme]}>
|
|
|
|
{/if}
|
2024-07-14 17:50:18 +01:00
|
|
|
|
|
|
|
{#if env.PLAUSIBLE_ENABLED}
|
|
|
|
<script
|
|
|
|
defer
|
|
|
|
data-domain="{env.HOST}"
|
|
|
|
src="https://{env.PLAUSIBLE_HOST}/js/script.js"
|
|
|
|
>
|
|
|
|
</script>
|
|
|
|
{/if}
|
2024-06-29 15:24:51 +01:00
|
|
|
</svelte:head>
|
|
|
|
|
2024-07-14 16:10:41 +01:00
|
|
|
<div style="display: contents" data-theme={$currentTheme} lang="{$locale}">
|
2024-07-12 13:49:29 +01:00
|
|
|
<div
|
|
|
|
id="cobalt"
|
2024-07-12 14:15:55 +01:00
|
|
|
data-iphone={device.is.iPhone}
|
|
|
|
data-reduce-motion={reduceMotion}
|
|
|
|
data-reduce-transparency={reduceTransparency}
|
2024-07-12 13:49:29 +01:00
|
|
|
>
|
2024-07-03 14:05:14 +01:00
|
|
|
{#if device.is.iPhone && app.is.installed}
|
|
|
|
<NotchSticker />
|
|
|
|
{/if}
|
2024-07-13 14:15:43 +01:00
|
|
|
<DialogHolder />
|
2024-06-29 15:09:17 +01:00
|
|
|
<Sidebar />
|
|
|
|
<div id="content">
|
|
|
|
<slot></slot>
|
|
|
|
</div>
|
2024-06-14 11:33:01 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
:global(:root) {
|
2024-06-14 16:48:57 +01:00
|
|
|
--primary: #ffffff;
|
|
|
|
--secondary: #000000;
|
2024-06-24 14:42:31 +01:00
|
|
|
|
2024-06-24 18:05:51 +01:00
|
|
|
--white: #ffffff;
|
2024-07-13 13:51:31 +01:00
|
|
|
--gray: #75757e;
|
2024-06-16 18:30:10 +01:00
|
|
|
--blue: #2f8af9;
|
2024-06-24 14:42:31 +01:00
|
|
|
--green: #51cf5e;
|
2024-06-14 16:48:57 +01:00
|
|
|
|
2024-06-24 14:42:31 +01:00
|
|
|
--button: #f4f4f4;
|
2024-06-15 15:39:34 +01:00
|
|
|
--button-hover: #e8e8e8;
|
2024-06-24 14:42:31 +01:00
|
|
|
--button-hover-transparent: rgba(0, 0, 0, 0.06);
|
2024-06-25 09:50:59 +01:00
|
|
|
--button-stroke: rgba(0, 0, 0, 0.05);
|
2024-06-17 13:46:52 +01:00
|
|
|
--button-text: #282828;
|
2024-06-25 15:59:25 +01:00
|
|
|
--button-box-shadow: 0 0 0 1.5px var(--button-stroke) inset;
|
2024-06-14 16:48:57 +01:00
|
|
|
|
2024-06-16 16:45:24 +01:00
|
|
|
--sidebar-bg: #000000;
|
|
|
|
--sidebar-highlight: #ffffff;
|
2024-06-25 15:59:25 +01:00
|
|
|
--sidebar-hover: rgba(255, 255, 255, 0.1);
|
2024-06-16 16:45:24 +01:00
|
|
|
|
2024-07-02 14:25:37 +01:00
|
|
|
--input-border: #adadb7;
|
2024-06-29 17:51:24 +01:00
|
|
|
|
|
|
|
--toggle-bg: var(--input-border);
|
|
|
|
--toggle-bg-enabled: var(--secondary);
|
2024-06-16 16:45:24 +01:00
|
|
|
|
2024-06-14 16:48:57 +01:00
|
|
|
--padding: 12px;
|
2024-06-16 14:51:02 +01:00
|
|
|
--border-radius: 11px;
|
2024-06-14 16:48:57 +01:00
|
|
|
|
2024-06-14 11:33:01 +01:00
|
|
|
--sidebar-width: 80px;
|
|
|
|
--sidebar-font-size: 11px;
|
2024-06-16 17:59:16 +01:00
|
|
|
--sidebar-inner-padding: 4px;
|
2024-07-12 15:22:12 +01:00
|
|
|
--sidebar-height-mobile: calc(
|
|
|
|
50px
|
|
|
|
+ calc(var(--sidebar-inner-padding) * 2)
|
|
|
|
+ env(safe-area-inset-bottom)
|
|
|
|
);
|
2024-06-16 16:45:24 +01:00
|
|
|
|
2024-07-03 14:05:14 +01:00
|
|
|
--safe-area-inset-top: env(safe-area-inset-top);
|
|
|
|
|
2024-06-29 18:31:40 +01:00
|
|
|
--switcher-padding: var(--sidebar-inner-padding);
|
|
|
|
|
2024-06-16 16:45:24 +01:00
|
|
|
--sidebar-mobile-gradient: linear-gradient(
|
|
|
|
90deg,
|
|
|
|
rgba(0, 0, 0, 0.9) 0%,
|
|
|
|
rgba(0, 0, 0, 0) 4%,
|
|
|
|
rgba(0, 0, 0, 0) 50%,
|
|
|
|
rgba(0, 0, 0, 0) 96%,
|
|
|
|
rgba(0, 0, 0, 0.9) 100%
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2024-07-12 13:49:29 +01:00
|
|
|
:global([data-theme="dark"]) {
|
2024-06-29 15:09:17 +01:00
|
|
|
--primary: #000000;
|
|
|
|
--secondary: #e1e1e1;
|
|
|
|
|
2024-07-13 13:51:31 +01:00
|
|
|
--gray: #818181;
|
2024-06-29 15:09:17 +01:00
|
|
|
--blue: #2a7ce1;
|
|
|
|
--green: #37aa42;
|
|
|
|
|
|
|
|
--button: #191919;
|
|
|
|
--button-hover: #2a2a2a;
|
|
|
|
--button-hover-transparent: rgba(225, 225, 225, 0.1);
|
|
|
|
--button-stroke: rgba(255, 255, 255, 0.05);
|
|
|
|
--button-text: #e1e1e1;
|
|
|
|
--button-box-shadow: 0 0 0 1.5px var(--button-stroke) inset;
|
|
|
|
|
|
|
|
--sidebar-bg: #101010;
|
|
|
|
--sidebar-highlight: #f2f2f2;
|
|
|
|
|
|
|
|
--input-border: #383838;
|
|
|
|
|
2024-06-29 17:51:24 +01:00
|
|
|
--toggle-bg: var(--input-border);
|
|
|
|
--toggle-bg-enabled: #777777;
|
|
|
|
|
2024-06-29 15:09:17 +01:00
|
|
|
--sidebar-mobile-gradient: linear-gradient(
|
|
|
|
90deg,
|
|
|
|
rgba(16, 16, 16, 0.9) 0%,
|
|
|
|
rgba(16, 16, 16, 0) 4%,
|
|
|
|
rgba(16, 16, 16, 0) 50%,
|
|
|
|
rgba(16, 16, 16, 0) 96%,
|
|
|
|
rgba(16, 16, 16, 0.9) 100%
|
|
|
|
);
|
2024-06-14 11:33:01 +01:00
|
|
|
}
|
2024-06-14 11:38:10 +01:00
|
|
|
|
2024-06-14 11:33:01 +01:00
|
|
|
:global(html),
|
|
|
|
:global(body) {
|
|
|
|
margin: 0;
|
2024-06-25 11:14:54 +01:00
|
|
|
height: 100vh;
|
|
|
|
overflow: hidden;
|
|
|
|
overscroll-behavior-y: none;
|
2024-06-14 16:48:57 +01:00
|
|
|
}
|
|
|
|
|
2024-07-14 15:42:32 +01:00
|
|
|
:global(body) {
|
|
|
|
background-color: var(--secondary);
|
|
|
|
}
|
|
|
|
|
2024-06-29 18:46:28 +01:00
|
|
|
#cobalt {
|
|
|
|
position: fixed;
|
|
|
|
height: 100%;
|
|
|
|
width: 100%;
|
|
|
|
display: grid;
|
2024-07-12 15:22:12 +01:00
|
|
|
grid-template-columns: calc(
|
|
|
|
var(--sidebar-width) + var(--sidebar-inner-padding) * 2
|
|
|
|
) 1fr;
|
2024-06-29 18:46:28 +01:00
|
|
|
overflow: hidden;
|
|
|
|
background-color: var(--sidebar-bg);
|
|
|
|
color: var(--secondary);
|
|
|
|
}
|
|
|
|
|
2024-07-03 14:05:14 +01:00
|
|
|
/* add padding for notch / dynamic island in landscape */
|
|
|
|
@media screen and (orientation: landscape) {
|
2024-07-12 14:15:55 +01:00
|
|
|
#cobalt[data-iphone="true"] {
|
2024-07-03 14:05:14 +01:00
|
|
|
grid-template-columns:
|
2024-07-12 15:22:12 +01:00
|
|
|
calc(
|
|
|
|
var(--sidebar-width)
|
|
|
|
+ var(--sidebar-inner-padding) * 2
|
|
|
|
+ env(safe-area-inset-left)
|
|
|
|
)
|
2024-07-12 13:49:29 +01:00
|
|
|
1fr;
|
2024-07-03 14:05:14 +01:00
|
|
|
}
|
|
|
|
|
2024-07-12 14:15:55 +01:00
|
|
|
#cobalt[data-iphone="true"] #content {
|
2024-07-03 14:05:14 +01:00
|
|
|
padding-right: env(safe-area-inset-right);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-06-29 18:46:28 +01:00
|
|
|
#content {
|
|
|
|
display: flex;
|
|
|
|
overflow: scroll;
|
|
|
|
background-color: var(--primary);
|
|
|
|
|
|
|
|
border-top-left-radius: var(--border-radius);
|
|
|
|
border-bottom-left-radius: var(--border-radius);
|
|
|
|
}
|
|
|
|
|
|
|
|
@media screen and (max-width: 535px) {
|
|
|
|
#cobalt {
|
|
|
|
display: grid;
|
|
|
|
grid-template-columns: unset;
|
2024-07-12 15:22:12 +01:00
|
|
|
grid-template-rows: 1fr var(--sidebar-height-mobile);
|
2024-06-29 18:46:28 +01:00
|
|
|
}
|
|
|
|
#content {
|
|
|
|
padding-top: env(safe-area-inset-top);
|
|
|
|
order: -1;
|
|
|
|
border-top-left-radius: 0;
|
|
|
|
border-bottom-left-radius: calc(var(--border-radius) * 2);
|
|
|
|
border-bottom-right-radius: calc(var(--border-radius) * 2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-06-14 16:48:57 +01:00
|
|
|
:global(*) {
|
2024-07-12 13:49:29 +01:00
|
|
|
font-family: "IBM Plex Mono", "Noto Sans Mono Variable",
|
|
|
|
"Noto Sans Mono", monospace;
|
2024-06-14 12:34:14 +01:00
|
|
|
user-select: none;
|
2024-06-16 14:25:30 +01:00
|
|
|
scrollbar-width: none;
|
2024-06-14 12:34:14 +01:00
|
|
|
-webkit-user-select: none;
|
2024-06-14 16:48:57 +01:00
|
|
|
-webkit-user-drag: none;
|
2024-06-16 14:25:30 +01:00
|
|
|
-webkit-tap-highlight-color: transparent;
|
|
|
|
}
|
|
|
|
|
|
|
|
:global(::-webkit-scrollbar) {
|
|
|
|
display: none;
|
2024-06-14 11:33:01 +01:00
|
|
|
}
|
2024-06-14 11:38:10 +01:00
|
|
|
|
2024-06-14 11:33:01 +01:00
|
|
|
:global(a) {
|
2024-07-13 08:45:53 +01:00
|
|
|
color: inherit;
|
|
|
|
text-underline-offset: 3px;
|
2024-06-24 14:42:31 +01:00
|
|
|
-webkit-touch-callout: none;
|
2024-06-14 11:33:01 +01:00
|
|
|
}
|
2024-06-14 11:38:10 +01:00
|
|
|
|
2024-07-13 08:45:53 +01:00
|
|
|
:global(a:visited) {
|
|
|
|
color: inherit;
|
|
|
|
}
|
|
|
|
|
2024-06-14 16:48:57 +01:00
|
|
|
:global(svg),
|
|
|
|
:global(img) {
|
|
|
|
pointer-events: none;
|
|
|
|
}
|
|
|
|
|
2024-07-07 19:18:25 +01:00
|
|
|
:global(button, .button) {
|
2024-06-14 16:48:57 +01:00
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
2024-06-17 13:46:21 +01:00
|
|
|
padding: 6px 13px;
|
|
|
|
gap: 6px;
|
2024-06-14 16:48:57 +01:00
|
|
|
border: none;
|
2024-06-16 14:51:02 +01:00
|
|
|
border-radius: var(--border-radius);
|
2024-06-17 13:46:21 +01:00
|
|
|
font-size: 14.5px;
|
2024-06-14 16:48:57 +01:00
|
|
|
cursor: pointer;
|
|
|
|
background-color: var(--button);
|
2024-06-17 13:46:52 +01:00
|
|
|
color: var(--button-text);
|
2024-06-25 15:59:25 +01:00
|
|
|
box-shadow: var(--button-box-shadow);
|
2024-06-15 15:39:34 +01:00
|
|
|
}
|
|
|
|
|
2024-06-24 18:22:19 +01:00
|
|
|
:global(:focus-visible) {
|
2024-06-16 18:30:10 +01:00
|
|
|
box-shadow: 0 0 0 2px var(--blue) inset;
|
2024-06-16 16:45:24 +01:00
|
|
|
outline: none;
|
|
|
|
z-index: 1;
|
|
|
|
}
|
|
|
|
|
2024-07-07 19:18:25 +01:00
|
|
|
:global(button:active, .button:active) {
|
2024-06-25 15:59:25 +01:00
|
|
|
background-color: var(--button-hover);
|
2024-06-14 16:48:57 +01:00
|
|
|
}
|
|
|
|
|
2024-06-24 14:42:31 +01:00
|
|
|
:global(.button.active) {
|
2024-06-19 18:04:09 +01:00
|
|
|
background: var(--secondary);
|
|
|
|
color: var(--primary);
|
|
|
|
}
|
|
|
|
|
2024-06-24 18:22:19 +01:00
|
|
|
/* important is used because active class is toggled by state */
|
|
|
|
/* and added to the end of the list, taking priority */
|
|
|
|
:global(.active:focus-visible) {
|
|
|
|
background: var(--blue) !important;
|
|
|
|
color: var(--sidebar-highlight) !important;
|
|
|
|
}
|
|
|
|
|
2024-06-16 20:12:59 +01:00
|
|
|
@media (hover: hover) {
|
|
|
|
:global(button:hover) {
|
|
|
|
background-color: var(--button-hover);
|
|
|
|
}
|
2024-06-14 16:48:57 +01:00
|
|
|
}
|
|
|
|
|
2024-06-16 15:32:09 +01:00
|
|
|
:global(.center-column-container) {
|
|
|
|
display: flex;
|
|
|
|
width: 100%;
|
|
|
|
flex-direction: column;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
}
|
|
|
|
|
2024-06-24 18:05:51 +01:00
|
|
|
:global(button) {
|
2024-06-24 15:26:45 +01:00
|
|
|
font-weight: 500;
|
|
|
|
}
|
|
|
|
|
|
|
|
:global(h1, h2, h3, h4, h5, h6) {
|
|
|
|
font-weight: 500;
|
|
|
|
margin-block: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
:global(h1) {
|
|
|
|
font-size: 24px;
|
|
|
|
letter-spacing: -1px;
|
|
|
|
}
|
|
|
|
|
|
|
|
:global(h2) {
|
|
|
|
font-size: 20px;
|
|
|
|
letter-spacing: -1px;
|
|
|
|
}
|
|
|
|
|
|
|
|
:global(h3) {
|
|
|
|
font-size: 16px;
|
|
|
|
}
|
|
|
|
|
2024-06-24 18:05:51 +01:00
|
|
|
:global(h4) {
|
|
|
|
font-size: 14.5px;
|
|
|
|
}
|
|
|
|
|
|
|
|
:global(h5) {
|
2024-06-24 15:26:45 +01:00
|
|
|
font-size: 12px;
|
|
|
|
}
|
|
|
|
|
2024-06-24 18:05:51 +01:00
|
|
|
:global(h6) {
|
|
|
|
font-size: 11px;
|
|
|
|
}
|
|
|
|
|
2024-07-13 14:15:43 +01:00
|
|
|
:global(dialog) {
|
|
|
|
max-height: 100%;
|
|
|
|
max-width: 100%;
|
|
|
|
padding: var(--padding);
|
|
|
|
border-radius: var(--border-radius);
|
|
|
|
border: none;
|
|
|
|
pointer-events: all;
|
|
|
|
}
|
|
|
|
|
2024-06-24 15:26:45 +01:00
|
|
|
:global(.subtext) {
|
2024-07-10 15:19:05 +01:00
|
|
|
font-size: 12.5px;
|
|
|
|
font-weight: 500;
|
2024-06-24 15:26:45 +01:00
|
|
|
color: var(--gray);
|
|
|
|
line-height: 1.4;
|
2024-06-29 17:51:24 +01:00
|
|
|
padding: 0 var(--padding);
|
2024-07-03 18:54:44 +01:00
|
|
|
white-space: pre-line;
|
2024-06-24 15:26:45 +01:00
|
|
|
}
|
2024-07-12 13:49:29 +01:00
|
|
|
|
2024-07-12 14:15:55 +01:00
|
|
|
[data-reduce-motion="true"] :global(*) {
|
2024-07-12 13:49:29 +01:00
|
|
|
animation: none !important;
|
|
|
|
transition: none !important;
|
|
|
|
}
|
2024-06-14 11:33:01 +01:00
|
|
|
</style>
|