From a563bf964e93ae563b24623e6cfbba91d38b21f9 Mon Sep 17 00:00:00 2001 From: Daniel Bulant Date: Wed, 24 Feb 2021 11:27:07 +0100 Subject: [PATCH] Dark mode, hide posts --- public/global.css | 8 ++++++-- src/App.svelte | 36 ++++++++++++++++++++++++++++++----- src/components/bar.svelte | 3 +++ src/components/button.svelte | 9 +++++++-- src/components/contact.svelte | 14 +++++++++++++- 5 files changed, 60 insertions(+), 10 deletions(-) diff --git a/public/global.css b/public/global.css index 0ec96eb..0609c54 100644 --- a/public/global.css +++ b/public/global.css @@ -10,10 +10,14 @@ body { box-sizing: border-box; font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; margin-top: 30px; + transition: color .3s, background-color .3s; + background-image: linear-gradient(to top, rgb(242,210,223), transparent min(180vh, 1080px)); } -html { - background-image: linear-gradient(to top, rgb(242,210,223), transparent min(180vh, 1080px)); +body.dark { + background-color: #1f1f1f; + background-image: linear-gradient(to top, rgba(94, 61, 74, 0.685), transparent min(180vh, 1080px)); + color: rgb(191, 191, 191); } h1 { diff --git a/src/App.svelte b/src/App.svelte index 743d865..0cf50f1 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -3,11 +3,24 @@ import Button from "./components/button.svelte"; import Contact from "./components/contact.svelte"; import Hero from "./components/hero.svelte"; - import Posts from "./components/posts.svelte"; + // import Posts from "./components/posts.svelte"; import Project from "./components/project.svelte"; import Split from "./components/split.svelte"; import darkmode from "./stores/darkmode"; + function toggle() { + $darkmode = !$darkmode; + } + + $: { + if(typeof document !== "undefined") { + if($darkmode) { + document.body.classList.add("dark"); + } else { + document.body.classList.remove("dark"); + } + } + } @@ -15,16 +28,17 @@ -
+

Daniel Bulant

Contact + Contact danbulant@danbulant.eu
-
+

I'm a young developer making websites and discord bots.

@@ -52,12 +66,12 @@
- +
-
+

Daniel Bulant

@@ -98,6 +112,9 @@ width: 100%; background: white; } + .dark.bottombar { + background: rgb(28, 28, 33); + } } .bottombar h3 { font-size: 18px; @@ -146,6 +163,9 @@ margin: 0 auto 30px auto; background: white; } + .dark.bar { + background: rgb(28, 28, 33); + } .bar h3 { font-size: 18px; font-weight: bold; @@ -153,6 +173,9 @@ h1, h3 { color: #282B29; } + .dark h3 { + color: rgb(191, 191, 191); + } h1 { font-size: 72px; } @@ -168,4 +191,7 @@ .bar a { color: #202020b2; } + .dark.bar a { + color: rgba(191, 191, 191, 0.698); + } \ No newline at end of file diff --git a/src/components/bar.svelte b/src/components/bar.svelte index de7979e..833d144 100644 --- a/src/components/bar.svelte +++ b/src/components/bar.svelte @@ -12,6 +12,9 @@ align-items: center; padding: 10px; } + :global(.dark nav.bar-component) { + background: rgb(28, 28, 33); + } :global(nav.bar-component > *) { margin: 10px; } diff --git a/src/components/button.svelte b/src/components/button.svelte index 3572ac1..1d7d561 100644 --- a/src/components/button.svelte +++ b/src/components/button.svelte @@ -1,12 +1,14 @@ {#if href} - + {:else} - + {/if} \ No newline at end of file diff --git a/src/components/contact.svelte b/src/components/contact.svelte index 6145649..28b4225 100644 --- a/src/components/contact.svelte +++ b/src/components/contact.svelte @@ -1,5 +1,8 @@ + -
+
Prague, Czech Republic
danbulant@danbulant.eu
@@ -26,6 +29,9 @@ .address { color: #202020d5; } + .dark .address { + color: rgba(191, 191, 191, 0.835); + } .contact > a { color: #202020; font-size: 36px; @@ -34,6 +40,9 @@ display: block; font-size: max(min(36px, 4vw), 23px); } + .dark.contact > a { + color: rgb(191, 191, 191); + } .profiles { display: flex; justify-content: center; @@ -60,6 +69,9 @@ .github { color: #333333; } + .dark .github { + color: rgb(191, 191, 191); + } .discord { color: #7289DA; }