Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Redesign the landing page #401

Open
wants to merge 4 commits into
base: site-redesign
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
235 changes: 110 additions & 125 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"dependencies": {
"fuse.js": "^6.6.2",
"mixpanel-browser": "^2.47.0",
"simple-icons": "^13.3.0",
dmlb marked this conversation as resolved.
Show resolved Hide resolved
"ts-node": "^10.4.0",
"vitest": "^0.26.2"
}
Expand Down
37 changes: 37 additions & 0 deletions src/lib/components/Button.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<script lang="ts">
export let href: string = ""
export let onClick: () => void = () => {}
export let disabled: boolean = false
</script>

{#if href}
<a
{href}
class="ctaBtn bg-transparent hover:bg-blue-tertiary text-white py-2 px-4 rounded-full mx-6 sm:mr-6"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for consistency with the tailwind usage and buttons, if you have the time to turn button class into something global with tailwind's @apply?

example:

.button {
    @apply bg-transparent hover:bg-blue-tertiary text-white border border-current py-2 px-4 rounded-full mx-6 sm:mr-6;

}

>
<slot />
</a>
{:else}
<button
class="ctaBtn bg-transparent hover:bg-blue-tertiary text-white py-2 px-4 rounded-full mx-6 sm:mr-6"
on:click={() => onClick()}
{disabled}
>
<slot />
</button>
{/if}

<style>
.ctaBtn {
border: 1px solid #fff;
}

.ctaBtn:disabled {
opacity: 30%;
}

.ctaBtn:focus-visible {
box-shadow: 0 0 0 8px theme("colors.blue-primary");
Copy link
Contributor

@dmlb dmlb Aug 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

both the hover and the box-shadow currently match the background of the only use case and can't see any feedback changes from these styles 😅

Screen.Recording.2024-08-21.at.4.28.30.PM.mov

if the goal is just the size shift -- using transform: scale would be more performant

border: none;
}
</style>
14 changes: 12 additions & 2 deletions src/lib/components/DarkModeControl.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,19 @@
on:click={setColorMode}
>
{#if darkMode}
<MoonStarsFill aria-hidden="true" />
<SunFill
aria-hidden="true"
class="fill-blue-primary"
width={24}
height={24}
/>
{:else}
<SunFill aria-hidden="true" />
<MoonStarsFill
aria-hidden="true"
class="fill-blue-primary"
width={24}
height={24}
/>
{/if}
<span class="sr-only">Change Colour Scheme Mode</span>
</button>
118 changes: 118 additions & 0 deletions src/lib/components/Footer.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
<script>
import {
siYoutube,
siDiscord,
siInstagram,
siTiktok,
siLinkedin,
siPatreon,
} from "simple-icons"

const { svg: YoutubeSvg } = siYoutube
const { svg: DiscordSvg } = siDiscord
const { svg: InstagramSvg } = siInstagram
const { svg: TiktokSvg } = siTiktok
const { svg: LinkedInSvg } = siLinkedin
const { svg: PatreonSvg } = siPatreon
</script>

<footer class="max-w-7xl mx-auto mt-16">
<div class="mx-6 border-t-2 border-solid border-slate-300 py-10">
<div
class="flex flex-row mb-10 sm:justify-between justify-center flex-wrap gap-y-8 gap-x-20"
>
<div class="flex gap-8 flex-wrap justify-center">
<a
href="https://github.com/ClimateTown/knowledge-hub"
class="underline underline-offset-4"
>
Contribute
</a>
<a
href="https://github.com/ClimateTown/knowledge-hub/#contributors"
class="underline underline-offset-4"
>
Credits
</a>
<a
href="https://www.climatetownproductions.com/"
class="underline underline-offset-4"
>
Climate Town
</a>
</div>
<div class="flex flex-row gap-4">
<a href="https://www.youtube.com/c/ClimateTown">
<div class="svgWrapper fill-black dark:fill-white">
{@html YoutubeSvg}
</div>
</a>
<a href="https://discord.gg/A5Czqfgr4C">
<div class="svgWrapper fill-black dark:fill-white">
{@html DiscordSvg}
</div>
</a>
<a href="https://www.instagram.com/climatetown/">
<div class="svgWrapper fill-black dark:fill-white">
{@html InstagramSvg}
</div>
</a>
<a href="https://www.tiktok.com/@climatetown">
<div class="svgWrapper fill-black dark:fill-white">
{@html TiktokSvg}
</div>
</a>
<a href="https://www.linkedin.com/company/climate-town/">
<div class="svgWrapper fill-black dark:fill-white">
{@html LinkedInSvg}
</div>
</a>
<a href="https://www.patreon.com/ClimateTown">
<div class="svgWrapper fill-black dark:fill-white">
{@html PatreonSvg}
</div>
</a>
</div>
</div>
<div class="text-sm text-zinc-500 dark:text-zinc-400 pb-5">
<b>Legal Disclaimer:</b> This website hosts content curated and managed by
community members from the Climate Town Discord and is not directly managed
by Climate Town YouTube. While every effort is made to ensure the quality of
the content, we cannot guarantee its accuracy, completeness, or suitability
for any purpose. The opinions and views expressed on this site are those of
the individual contributors and do not necessarily reflect those of Climate
Town YouTube. By using this website, you agree to hold the site administrators
and contributors harmless from any liability arising from your use of the content.
</div>

<div class="text-sm text-zinc-500 dark:text-zinc-400 pb-5">
<b>Data Disclaimer:</b> By using this website, you consent to the
collection of usage data, including clicks on "resources", search terms
used, and pages visited. This data is solely used to monitor site usage,
and to enhance the reach of the project. As this project is open source,
you can inspect the usage of analytics. Our analytics platform is Mixpanel
(<a
href="https://mixpanel.com/legal/privacy-policy"
class="underline underline-offset-4">see their privacy policy here</a
>), with data being stored in the EU.
</div>

<div class="text-sm text-zinc-500 dark:text-zinc-400">
“Topography” by <a
href="https://heropatterns.com/"
class="underline underline-offset-4">Hero Patterns</a
>, used under
<a
href="https://creativecommons.org/licenses/by/4.0/"
class="underline underline-offset-4">CC BY 4.0</a
>
</div>
</div>
</footer>

<style>
.svgWrapper {
width: 1.5rem;
height: 1.5rem;
}
</style>
6 changes: 3 additions & 3 deletions src/lib/components/ResourceNav.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { base } from "$app/paths"
import { github_url } from "$lib/constants"
import { GITHUB_URL } from "$lib/constants"

import Download from "svelte-bootstrap-icons/lib/Download.svelte"
import FileEarmarkPlus from "svelte-bootstrap-icons/lib/FileEarmarkPlus.svelte"
Expand All @@ -12,7 +12,7 @@
<nav aria-label="Resource Navigation" class="flex flex-wrap gap-2 pb-3">
<ButtonLinks
link={true}
url="{github_url}/issues/new/choose"
url="{GITHUB_URL}/issues/new/choose"
version="hollow"
color="green"
newTab={true}
Expand All @@ -23,7 +23,7 @@

<ButtonLinks
link={true}
url="{github_url}/edit/main/data/resources.yml"
url="{GITHUB_URL}/edit/main/data/resources.yml"
version="hollow"
color="green"
newTab={true}
Expand Down
4 changes: 2 additions & 2 deletions src/lib/constants/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const github_url: string = "https://github.com/ClimateTown/knowledge-hub"
export const climate_town_url: string = "https://www.climatetownproductions.com"
export const GITHUB_URL: string = "https://github.com/ClimateTown/knowledge-hub"
export const CLIMATE_TOWN_URL: string = "https://www.climatetownproductions.com"

// Constants for infinite scroll/lazy loading
export const DEFAULT_DISPLAY_LIMIT = 18
Expand Down
Loading
Loading