Adapted themings to allow for light and dark

This commit is contained in:
Luke Else 2023-10-26 10:24:30 +01:00
parent e0ea53a9d3
commit 2e07de0e71
7 changed files with 64 additions and 34 deletions

View File

@ -7,22 +7,50 @@
<link rel="icon" href="%sveltekit.assets%/favicon.png" /> <link rel="icon" href="%sveltekit.assets%/favicon.png" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/devicons/devicon@v2.15.1/devicon.min.css"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/devicons/devicon@v2.15.1/devicon.min.css">
<meta name="viewport" content="width=device-width" /> <meta name="viewport" content="width=device-width" />
<meta name="color-scheme" content="dark" />
%sveltekit.head% %sveltekit.head%
<style> <style>
:root { @media (prefers-color-scheme: dark) {
--bg: #282c34; :root {
--bg-grad: #5a606d9f; --bg: #282c34;
--bg-2: #838488; --bg-secondary: #474d57;
--fg: #ABB2BF; --bg-grad-1: #484e58;
--red: #E06C75; --bg-grad-2: #4e5560;
--green: #98C379; --bg-grad-3: #59616d;
--yellow: #E5C07B; --bg-grad-4: #606a7b;
--blue: #61AFEF; --bg-grad-5: #606978;
--purple: #C678DD; --input: #4e5560;
--cyan: #56B6C2; --fg: #ABB2BF;
--header: #E06C75;
--link: #98C379;
--hover: #56B6C2;
--glow: #C678DD;
--green: #98C379;
--red: #E06C75;
}
}
@media (prefers-color-scheme: light) {
:root {
--bg: #fff;
--bg-secondary: #ebebeb;
--bg-grad-1: #c1c1c1;
--bg-grad-2: #a1a1a1;
--bg-grad-3: #858585;
--bg-grad-4: #616161;
--bg-grad-5: #484848;
--input: #a9a9a9;
--fg: #2f2f2f;
--header: #514a4a;
--link: #df0000;
--hover: #4f4b489b;
--glow: #545454;
--green: #98C379;
--red: #E06C75;
}
}
:root {
--font: Consolas, 'Cascadia Code', Monaco, 'SF Mono', 'DejaVu Sans Mono', 'Roboto Mono'; --font: Consolas, 'Cascadia Code', Monaco, 'SF Mono', 'DejaVu Sans Mono', 'Roboto Mono';
background: var(--bg); background: var(--bg);
@ -33,12 +61,12 @@
} }
h1, h2, h3 { h1, h2, h3 {
color: var(--red); color: var(--header);
border: 0; border: 0;
} }
hr { hr {
border: .2em solid var(--bg-grad); border: .2em solid var(--bg-grad-3);
border-radius: 5em; border-radius: 5em;
width: 100%; width: 100%;
} }
@ -52,7 +80,7 @@
color: var(--fg); color: var(--fg);
} }
*::-webkit-scrollbar-thumb:hover{ *::-webkit-scrollbar-thumb:hover{
color: var(--green); color: var(--link);
} }
*::-webkit-scrollbar-thumb { *::-webkit-scrollbar-thumb {
@ -68,7 +96,7 @@
a { a {
text-decoration: none; text-decoration: none;
position: relative; position: relative;
color: var(--green); color: var(--link);
white-space: nowrap; white-space: nowrap;
} }
@ -84,26 +112,26 @@
a:hover:after { a:hover:after {
width: 100%; width: 100%;
color: var(--purple); color: var(--glow);
} }
a:hover { a:hover {
color: var(--purple); color: var(--glow);
} }
a:active { a:active {
color: var(--red); color: var(--header);
} }
.button { .button {
color: var(--fg); color: var(--fg);
background-color: var(--bg-2); background-color: var(--bg-grad-1);
box-shadow: .1em .1em .1em var(--green); box-shadow: .1em .1em .1em var(--link);
transition: all 0.2s; transition: all 0.2s;
} }
.button:hover { .button:hover {
box-shadow: .3em .3em .3em var(--red); box-shadow: .3em .3em .3em var(--header);
} }
</style> </style>
</head> </head>

View File

@ -16,13 +16,13 @@
flex-wrap: wrap; flex-wrap: wrap;
flex: 2 1 15em; flex: 2 1 15em;
padding: .5em 2.5em 2em 2.5em; padding: .5em 2.5em 2em 2.5em;
background: var(--bg-grad); background: var(--bg-secondary);
border-radius: .5em; border-radius: .5em;
scroll-snap-align: start; scroll-snap-align: start;
transition: all 0.2s; transition: all 0.2s;
} }
.card:hover { .card:hover {
box-shadow: .5em .5em .5em var(--cyan); box-shadow: .5em .5em .5em var(--hover);
} }
.card .card-header :global(div) { .card .card-header :global(div) {

View File

@ -36,7 +36,7 @@
border-right: 2em; border-right: 2em;
background: var(--bg); background: var(--bg);
color: var(--fg); color: var(--fg);
box-shadow: .5em .5em .5em var(--red); box-shadow: .5em .5em .5em var(--header);
} }
dialog::backdrop { dialog::backdrop {
background: rgba(0, 0, 0, 0.7); background: rgba(0, 0, 0, 0.7);

View File

@ -10,10 +10,10 @@
<style> <style>
.main-card { .main-card {
background-color: var(--bg-grad); background-color: var(--bg-secondary);
border-radius: 1em; border-radius: 1em;
padding: .2em 2em 2em 2em; padding: .2em 2em 2em 2em;
box-shadow: .5em .5em .5em var(--purple); box-shadow: .5em .5em .5em var(--glow);
} }
.flex-container { .flex-container {
@ -26,7 +26,7 @@
height: 8em; height: 8em;
width: 8em; width: 8em;
padding: 1em 1em 1em 1em; padding: 1em 1em 1em 1em;
border: .5em solid var(--bg-grad); border: .5em solid var(--bg-grad-3);
} }
.about { .about {

View File

@ -1,4 +1,4 @@
<script> <script lang="ts">
import Toasts from "$lib/components/Toasts/Toasts.svelte"; import Toasts from "$lib/components/Toasts/Toasts.svelte";
</script> </script>

View File

@ -9,6 +9,7 @@
if (sent == "true") { if (sent == "true") {
addToast(new Toast("Thank you! Your E-Mail has been sent. I will reply as soon as possible!", ToastType.Success, true, 5000)); addToast(new Toast("Thank you! Your E-Mail has been sent. I will reply as soon as possible!", ToastType.Success, true, 5000));
} }
// Can't use else otherwise the warning will display on load
if (sent == "false") { if (sent == "false") {
addToast(new Toast("Sorry, your E-Mail could not be sent... Please try again later!", ToastType.Error, true, 5000)); addToast(new Toast("Sorry, your E-Mail could not be sent... Please try again later!", ToastType.Error, true, 5000));
} }
@ -26,7 +27,8 @@
input, textarea { input, textarea {
padding: 1em 0em 1em 1em; padding: 1em 0em 1em 1em;
background-color: var(--bg-grad); background-color: var(--input);
color: var(--fg);
border: 0; border: 0;
outline: 0; outline: 0;
border-radius: 8px; border-radius: 8px;
@ -35,7 +37,7 @@
transition: all 0.15s; transition: all 0.15s;
&:focus, &:hover{ &:focus, &:hover{
box-shadow: .2em .2em .2em var(--red); box-shadow: .2em .2em .2em var(--green);
} }
} }

View File

@ -24,7 +24,7 @@
</TimelineOppositeContent> </TimelineOppositeContent>
<TimelineSeparator> <TimelineSeparator>
<TimelineDot style={`background-color: var(--cyan); border-color: var(--bg-grad);`} /> <TimelineDot style={`background-color: var(--link); border-color: var(--bg-grad);`} />
<TimelineConnector /> <TimelineConnector />
</TimelineSeparator> </TimelineSeparator>
<TimelineContent> <TimelineContent>
@ -39,7 +39,7 @@
.oposite-content-title { .oposite-content-title {
margin: 0; margin: 0;
padding: 0; padding: 0;
color: var(--bg-2); color: var(--bg-grad-2);
} }
.content-title { .content-title {
margin: 0; margin: 0;
@ -50,7 +50,7 @@
margin: 0; margin: 0;
padding: 0; padding: 0;
margin-top: 1rem; margin-top: 1rem;
color: var(--foreground); color: var(--fg);
font-weight: lighter; font-weight: lighter;
padding: 0.5rem 0; padding: 0.5rem 0;
} }