Compare commits

..

No commits in common. "e07cd844dbe15e967d4c66f12a01f97a4b98be38" and "4d43f20a9c487f4bb24c24604a4a56835c786a6f" have entirely different histories.

5 changed files with 23 additions and 98 deletions

View File

@ -1,49 +1,23 @@
<script lang="ts"> <script lang="ts">
import { ButtonType } from "$lib/IO/ButtonType.ts";
import { onMount } from "svelte"; import { onMount } from "svelte";
export let type : ButtonType = ButtonType.Primary; export let text : string = 'button';
let cssName : string; export let color : string;
const buttonTypeColors = {
[ButtonType.Primary]: '--primary',
[ButtonType.Secondary]: '--secondary',
[ButtonType.Accent]: '--accent',
};
onMount(() => { onMount(() => {
cssName = buttonTypeColors[type]; if (!color || color.length === 0)
{
color = window.getComputedStyle(document.documentElement).getPropertyValue('--primary');
}
}); });
</script> </script>
<button class="button" style="--button-color: var({cssName});"> <button style="--button-color: {color};" class="button">
<div class="content"> {text}
<slot name="content">
Click Me!
</slot>
</div>
</button> </button>
<style> <style>
.button { .button {
width: 100%;
border-radius: 6px;
border: none;
background-color: var(--button-color); background-color: var(--button-color);
display: flex;
justify-content: center;
font-size: 1.5em;
}
.button:hover {
cursor: pointer;
}
.content {
width: 100%;
color: var(--text1);
padding: 0.8em 4em;
} }
</style> </style>

View File

@ -1,5 +0,0 @@
export enum ButtonType {
Primary,
Secondary,
Accent
}

View File

@ -3,7 +3,6 @@
import NewsCard from '$lib/posts/NewsCard.svelte'; import NewsCard from '$lib/posts/NewsCard.svelte';
import ShowcaseNewsCard from '$lib/posts/ShowcaseNewsCard.svelte'; import ShowcaseNewsCard from '$lib/posts/ShowcaseNewsCard.svelte';
import Button from '$lib/IO/Button.svelte'; import Button from '$lib/IO/Button.svelte';
import { ButtonType } from '$lib/IO/ButtonType.ts';
export let data; // <- contains post data export let data; // <- contains post data
@ -36,15 +35,8 @@
{/each} {/each}
</div> </div>
</div> </div>
<footer id="news-footer"> <footer>
<div class="dummy"/> <Button text={'More Posts'} />
<div id="more-posts">
<Button type={ButtonType.Primary}>
<a slot="content" href="/post">
<span>More Posts</span>
</a>
</Button>
</div>
</footer> </footer>
</section> </section>
@ -54,10 +46,8 @@
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
transition-duration: 500ms; width: 60%;
transition-property: width; max-width: 1200px;
width: 80%;
max-width: 1400px;
margin-inline: auto; margin-inline: auto;
} }
@ -82,24 +72,8 @@
gap: 20px; gap: 20px;
} }
#news-footer { footer {
width: 100%; margin-left: auto; /* align right */
display: flex;
margin-top: 25px;
}
.dummy {
width: 100%;
}
#more-posts {
flex-grow: 1;
min-width: 10em;
}
a {
white-space: nowrap;
} }
.main-title { .main-title {
@ -113,31 +87,20 @@
font-size: 9vw; /* Change if title changes */ font-size: 9vw; /* Change if title changes */
} }
.main-title { h1 {
font-family: var(--title-font);
color: var(--text1); color: var(--text1);
} }
</style> </style>
{#if mobile} {#if mobile}
<style> <style>
#news-section { #news-section {
transition-duration: 500ms; width: 90vw !important;
transition-property: width;
width: 90% !important;
} }
.news-container { .news-container {
flex-direction: column !important; flex-direction: column !important;
} }
.dummy {
width: 0% !important;
}
/* #more-posts { */
/* flex-grow: 1 !important; */
/* } */
</style> </style>
{/if} {/if}

View File

@ -7,12 +7,7 @@
} }
body { body {
font-family: var(--main-font); font-family: 'CozetteVector';
color: var(--text1); /* Default to primary text color. */ color: var(--text2); /* Default to secondary text color. */
background-color: var(--background); background-color: var(--background);
} }
a, a:link a:visited {
color: var(--text1);
text-decoration: none;
}

View File

@ -1,12 +1,10 @@
:root { :root {
--title-font: 'CozetteVector';
--main-font: 'Segoe UI';
--text1: #fff; /* Primary text. */ --text1: #fff; /* Primary text. */
--text2: #cac9c6; /* Secondary text. */ --text2: #cac9c6; /* Secondary text. */
--text3: #b0afad; /* Third text color. */ --text3: #b0afad; /* Third text color. */
--text4: #868584; /* Fourth text color. */ --text4: #868584; /* Fourth text color. */
--background: #232222; --background: #1e2122;
--primary: #227c9d; --primary: #ff8552;
--secondary: #ffcb77; --secondary: #6c6b44;
--accent: #17c3b2; --accent: #7da16a;
} }