From 952a46aebec10e15ab2a6dae2fa980a30ded9362 Mon Sep 17 00:00:00 2001 From: tree Date: Tue, 31 Jan 2023 09:47:58 +0100 Subject: [PATCH] Dark mode tweaks --- .woodpecker.yml | 8 +- README.md | 2 +- src/app.css | 14 +- src/lib/components/CalendarList.svelte | 2 +- src/lib/components/CollectionList.svelte | 12 +- src/lib/components/DarkModeToggle.svelte | 52 ++++--- src/lib/components/EventTypeBadge.svelte | 2 +- src/lib/components/Footer.svelte | 134 ++++++++++-------- src/lib/components/Header.svelte | 7 +- src/lib/components/TimelineHeatmap.svelte | 4 +- src/lib/dataApi.js | 12 +- src/routes/+layout.svelte | 32 ++--- src/routes/[entry]/+page.svelte | 32 +++-- src/routes/[entry]/[type]/+page.svelte | 9 +- src/routes/[entry]/[type]/[slug]/+page.svelte | 38 ++--- src/routes/[entry]/day/[date]/+page.svelte | 5 +- src/routes/[entry]/schedule/+page.svelte | 4 +- static/manifest.json | 14 +- tailwind.config.cjs | 1 + 19 files changed, 223 insertions(+), 161 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index ae916336..6714da0f 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -1,5 +1,4 @@ pipeline: - build: image: node commands: @@ -10,11 +9,10 @@ pipeline: when: branch: [dev] - deploy_dev: image: rclone/rclone commands: - - "rclone sync build/ :sftp:dev/ --sftp-host frontier.gwei.cz --sftp-user pbw-deploy --sftp-port 2022 --sftp-pass $RCLONE_PASS -v" + - 'rclone sync build/ :sftp:dev/ --sftp-host frontier.gwei.cz --sftp-user pbw-deploy --sftp-port 2022 --sftp-pass $RCLONE_PASS -v' secrets: [RCLONE_PASS] when: branch: [dev] @@ -32,7 +30,7 @@ pipeline: deploy_mirror: image: rclone/rclone commands: - - "rclone sync build/ :sftp:production/ --sftp-host frontier.gwei.cz --sftp-user pbw-deploy --sftp-port 2022 --sftp-pass $RCLONE_PASS -v" + - 'rclone sync build/ :sftp:production/ --sftp-host frontier.gwei.cz --sftp-user pbw-deploy --sftp-port 2022 --sftp-pass $RCLONE_PASS -v' secrets: [RCLONE_PASS] when: - branch: [main] \ No newline at end of file + branch: [main] diff --git a/README.md b/README.md index c62160b4..4544dfc3 100644 --- a/README.md +++ b/README.md @@ -14,4 +14,4 @@ The production version is available at [explore.prgblockweek.com](https://explor ## Authors - [tree](https://github.com/burningtree) -- [cryptonda](https://github.com/cryptonda) \ No newline at end of file +- [cryptonda](https://github.com/cryptonda) diff --git a/src/app.css b/src/app.css index 671ea736..f06edc5b 100644 --- a/src/app.css +++ b/src/app.css @@ -44,7 +44,15 @@ content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13.5' height='13.5' aria-hidden='true' viewBox='0 0 24 24' class='iconExternalLink_nPIU'%3E%3Cpath fill='white' d='M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z'%3E%3C/path%3E%3C/svg%3E"); } - body.dark{ - background-color: #252525; - } + body { + @apply bg-pbw-red; + } + + .page-body { + @apply bg-pbw-white; + } + + body.dark .page-body { + @apply bg-pbw-dark; + } } diff --git a/src/lib/components/CalendarList.svelte b/src/lib/components/CalendarList.svelte index ac929bf0..a79a18bf 100644 --- a/src/lib/components/CalendarList.svelte +++ b/src/lib/components/CalendarList.svelte @@ -13,7 +13,7 @@
{#each segments as segment}
diff --git a/src/lib/components/CollectionList.svelte b/src/lib/components/CollectionList.svelte index 002a2ed5..67225d6c 100644 --- a/src/lib/components/CollectionList.svelte +++ b/src/lib/components/CollectionList.svelte @@ -66,33 +66,33 @@ {item.shortname || item.name} {#if col === 'event'} -
+
{formatItemDate(item)} {#if item.attendees}
{item.attendees} ppl{/if}
{/if} {#if col === 'media-partner'} -
{item.description}
+
{item.description}
{/if} {#if col === 'speaker'} -
+
{/if} {#if col === 'union'} -
+
{/if} {#if col === 'place'} -
{item.capacity} ppl
+
{item.capacity} ppl
{/if}
{/if}
{/each} {#if offer} -
+
+
diff --git a/src/lib/components/DarkModeToggle.svelte b/src/lib/components/DarkModeToggle.svelte index 24470226..0d9edb76 100644 --- a/src/lib/components/DarkModeToggle.svelte +++ b/src/lib/components/DarkModeToggle.svelte @@ -1,21 +1,39 @@ \ No newline at end of file + class="flex items-center text-white py-1 px-2 rounded-full hover:bg-pbw-yellow/20 dark:hover:bg-pbw-white/10" + on:click={toggleDarkMode} +> + {#if dark} + + Dark mode + {:else} + + Light mode + {/if} + diff --git a/src/lib/components/EventTypeBadge.svelte b/src/lib/components/EventTypeBadge.svelte index c8be93dd..4bb9053d 100644 --- a/src/lib/components/EventTypeBadge.svelte +++ b/src/lib/components/EventTypeBadge.svelte @@ -4,7 +4,7 @@
{type} diff --git a/src/lib/components/Footer.svelte b/src/lib/components/Footer.svelte index 2d34c06c..96eb110f 100644 --- a/src/lib/components/Footer.svelte +++ b/src/lib/components/Footer.svelte @@ -11,67 +11,83 @@ let showSource = false; -
-
-
- βš™ This page is automatically generated using the structured dataset which can be consumed as a - single JSON file β†’ data.prgblockweek.com/23/index.json. -
- πŸ“– The source data GitHub repository β†’utxo-foundation/prague-blockchain-week. Go ahead and do PRs! -
-
- {#if bundle} -
-
- Last update: {formatDistanceToNow(new Date(bundle.time))} ago -  |  - Analytics -  |  - pbw-explore {__VERSION__} - {#if item} -  |  ID: {item.id} - [{cc}]  |  - +
+
+
+
+
+ βš™ This page is automatically generated using the structured dataset which can be + consumed as a single JSON file β†’ data.prgblockweek.com/23/index.json. +
+ πŸ“– The source data GitHub repository β†’utxo-foundation/prague-blockchain-week. Go ahead and do PRs! +
+
+ {#if showSource} +

JSON source-code

+
+ {JSON.stringify(item, null, 2)} +
{/if}
- {#if showSource} -

JSON source-code

-
- {JSON.stringify(item, null, 2)} -
- {/if}
- {/if} +
+
+ +
+
+
+
+ {#if bundle} +
+
+ Last update: {formatDistanceToNow(new Date(bundle.time))} ago +  |  + Analytics +  |  + pbw-explore {__VERSION__} + {#if item} +  |  ID: {item.id} + [{cc}]  |  + + {/if} +
+
+ {/if} +
+
+
diff --git a/src/lib/components/Header.svelte b/src/lib/components/Header.svelte index 6cb53dcb..2d46db51 100644 --- a/src/lib/components/Header.svelte +++ b/src/lib/components/Header.svelte @@ -1,8 +1,8 @@
@@ -11,7 +11,7 @@

#PBW23.{type}

@@ -19,4 +19,3 @@
- diff --git a/src/lib/components/TimelineHeatmap.svelte b/src/lib/components/TimelineHeatmap.svelte index 7d11913b..07053342 100644 --- a/src/lib/components/TimelineHeatmap.svelte +++ b/src/lib/components/TimelineHeatmap.svelte @@ -123,12 +123,12 @@
{#if selectedSegment}
-
{selectedSegment.title}
+
{selectedSegment.title}
{#each selectedSegment.data.events.map((e) => { return [eventDetail(e[0]), e[1]]; diff --git a/src/lib/dataApi.js b/src/lib/dataApi.js index 537c3830..94930de9 100644 --- a/src/lib/dataApi.js +++ b/src/lib/dataApi.js @@ -1,7 +1,7 @@ import localData from '$lib/data.json'; -function isMirror (host) { - return host === "mirror.explore.prgblockweek.com" +function isMirror(host) { + return host === 'mirror.explore.prgblockweek.com'; } export async function load(entry = '23', host = null) { @@ -10,7 +10,9 @@ export async function load(entry = '23', host = null) { if (host === 'localhost') { data = localData; } else { - const resp = await fetch(`https://${isMirror(host) ? 'mirror.' : ''}data.prgblockweek.com/${entry}/index.json`); + const resp = await fetch( + `https://${isMirror(host) ? 'mirror.' : ''}data.prgblockweek.com/${entry}/index.json` + ); data = await resp.json(); } data.events.sort((a, b) => ((a.attendees || 0) < (b.attendees || 0) ? 1 : -1)); @@ -28,6 +30,8 @@ export async function load(entry = '23', host = null) { } export async function loadSchema(host) { - const resp = await fetch(`https://${isMirror(host) ? 'mirror.' : ''}data.prgblockweek.com/schema/1/bundle.json`); + const resp = await fetch( + `https://${isMirror(host) ? 'mirror.' : ''}data.prgblockweek.com/schema/1/bundle.json` + ); return resp.json(); } diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 2ec72e33..bc767449 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -7,22 +7,22 @@
-
- -
+
+ +
- {#if homepage} -
-
-

- Prague Blockchain Week 2023 -

-
June 2-11, 2023
-
-
- {/if} + {#if homepage} +
+
+

+ Prague Blockchain Week 2023 +

+
June 2-11, 2023
+
+
+ {/if}
-
- -
\ No newline at end of file +
+ +
diff --git a/src/routes/[entry]/+page.svelte b/src/routes/[entry]/+page.svelte index 3df945a6..9f4eaad8 100644 --- a/src/routes/[entry]/+page.svelte +++ b/src/routes/[entry]/+page.svelte @@ -46,7 +46,7 @@ -

+

Conferences & Hackathons ({conferences.length})

-

+

Other events ({otherEvents.length})

-

+

Speakers ({data.bundle.speakers.length})

-

International 🌎

+

+ International 🌎 +

@@ -74,7 +76,9 @@ {entry} />
-

Local - Czech πŸ‡¨πŸ‡Ώ & Slovak πŸ‡ΈπŸ‡°

+

+ Local - Czech πŸ‡¨πŸ‡Ώ & Slovak πŸ‡ΈπŸ‡° +

@@ -83,7 +87,7 @@ {entry} />
-

+

Places ({data.bundle.places.length})

{#if data.bundle.benefits} -

+

Benefits for visitors ({data.bundle.benefits.length})

{/if} {#if data.bundle['media-partners']} -

+

Media Partners & Communities ({data.bundle[ 'media-partners' ].length})

-

International 🌎

+

+ International 🌎 +

@@ -129,7 +135,9 @@ size="small" />
-

Local - Czech πŸ‡¨πŸ‡Ώ & Slovak πŸ‡ΈπŸ‡°

+

+ Local - Czech πŸ‡¨πŸ‡Ώ & Slovak πŸ‡ΈπŸ‡° +

@@ -154,7 +162,7 @@
- -
+ +