Improve formatting of pages and route names

This commit is contained in:
Lewin Kelly 2023-07-10 22:05:54 +01:00
parent cbc20426a6
commit 4b9ac604d3
No known key found for this signature in database
GPG Key ID: C103AD9C84014FD7
8 changed files with 48 additions and 48 deletions

View File

@ -48,21 +48,31 @@ hr
::-webkit-scrollbar ::-webkit-scrollbar
position: fixed position: fixed
width: 0.5rem width: 1rem
height: 0.5rem height: 0.5rem
&-track, &-corner &-track, &-corner
background: none
&-thumb
border-radius: 0.2rem
background: #282625 background: #282625
&:hover
background: #464443
@media (prefers-color-scheme: light) @media (prefers-color-scheme: light)
background: white background: white
&-thumb
background: #181615
border: 0.2rem solid #282625
border-radius: 1rem
width: 0.5rem
&:hover
background: #464443
&:active
background: #3f3d3c
@media (prefers-color-scheme: light)
background: #d6d4d3
border: 0.2rem solid white
&:hover &:hover
background: #a6a4a3 background: #a6a4a3
&:active
background: #bfbdbc
// Utility classes // Utility classes

View File

@ -1,6 +1,6 @@
<div <div
class="bg-#1f1d1c @light:bg-white lg:w-90 lg:h-a lg:pt-42 class="bg-#1f1d1c @light:bg-white lg:w-90 lg:h-a lg:pt-42
fixed flex w-full flex-wrap pb-3 ps-6 lg:static lg:flex-col"> z-1 fixed flex w-full flex-wrap pb-3 ps-6 lg:static lg:flex-col">
<span class="me-12 mt-3 hidden sm:inline-block lg:me-0"> <span class="me-12 mt-3 hidden sm:inline-block lg:me-0">
<a <a
href="/" href="/"
@ -14,7 +14,8 @@
flex-wrap justify-self-center lg:flex-col"> flex-wrap justify-self-center lg:flex-col">
<a href="/">Home</a> <a href="/">Home</a>
<a href="/about">About</a> <a href="/about">About</a>
<a href="/index">Revival Index</a> <a href="/revivals">Revival Index</a>
<a href="/revivals">Reviews</a>
<a href="/blog">Blog</a> <a href="/blog">Blog</a>
</nav> </nav>
</div> </div>
@ -33,7 +34,6 @@
@media (prefers-color-scheme: light) @media (prefers-color-scheme: light)
color: black color: black
@media screen and (min-width: 1024px) @media screen and (min-width: 1024px)
&::before &::before
color: #aaa color: #aaa

10
src/lib/when.ts Normal file
View File

@ -0,0 +1,10 @@
export default (date: Date) => {
const d = new Date(date).toLocaleDateString("en-GB", {
year: "numeric",
month: "long",
day: "numeric",
hour: "numeric",
minute: "numeric",
})
return d == "Invalid Date" ? "Not yet published" : `Published ${d}`
}

View File

@ -10,7 +10,7 @@
Welcome to the Revival Archive, a website dedicated to keeping track of active/defunct old brickbuilding private servers. Welcome to the Revival Archive, a website dedicated to keeping track of active/defunct old brickbuilding private servers.
Check out our [blog posts](/blog), [reviews](/reviews) and most importantly, the [revival index](/index). Check out our [blog posts](/blog), [reviews](/revivals) and most importantly, the [revival index](/revivals).
--- ---
@ -27,7 +27,6 @@ You can easily find a revival perfect for you on the Revival Archive!
You can go ahead and join our [Discord](https://discord.gg/zfC3VH2WBa) server - there you can request for your/somebody else's revival to be added to the archive! You can go ahead and join our [Discord](https://discord.gg/zfC3VH2WBa) server - there you can request for your/somebody else's revival to be added to the archive!
<style lang="sass"> <style lang="sass">
h1 h1
margin-bottom: 0 margin-bottom: 0

View File

@ -1,4 +1,6 @@
<script lang="ts"> <script lang="ts">
import when from "$lib/when"
export let data export let data
</script> </script>
@ -10,20 +12,14 @@
{#each data.posts as post} {#each data.posts as post}
<a <a
href="/blog/{post.path}" href="/post/{post.path}"
class="txt @light:text-dark hover:text-#ccc class="txt @light:text-dark hover:text-#ccc
@light:hover:text-#555 bg-a rounded-3 durition-500 box-border @light:hover:text-#555 bg-a rounded-3 durition-500 box-border
block text-white transition hover:shadow-xl"> block text-white transition hover:shadow-xl">
<article class="mb-4 px-6 py-3"> <article class="mb-4 px-6 py-3">
<h2 class="my-2">{post.title}</h2> <h2 class="my-2">{post.title}</h2>
<p class="my-2"> <p class="my-2">
Published {new Date(post.date).toLocaleDateString("en-GB", { {when(post.date)}
year: "numeric",
month: "long",
day: "numeric",
hour: "numeric",
minute: "numeric",
})}
</p> </p>
</article> </article>
</a> </a>

View File

@ -1,12 +1,5 @@
<script lang="ts"> <script lang="ts">
const when = (date: Date) => import when from "$lib/when"
new Date(date).toLocaleDateString("en-GB", {
year: "numeric",
month: "long",
day: "numeric",
hour: "numeric",
minute: "numeric",
})
export let data export let data
</script> </script>
@ -31,7 +24,7 @@
<hr class="mb-8 mt-3" /> <hr class="mb-8 mt-3" />
<div class="text-justify"> <div class="text-justify">
{@html data.html} <svelte:component this={data.content}/>
</div> </div>
</div> </div>
</div> </div>
@ -41,14 +34,14 @@
<h2>Other posts</h2> <h2>Other posts</h2>
{#each data.posts as post} {#each data.posts as post}
<a <a
href="/blog/{post.path}" href="/post/{post.path}"
class="txt bg-a @light:text-dark hover:text-#ccc class="txt bg-a @light:text-dark hover:text-#ccc
@light:hover:text-#555 rounded-3 durition-500 box-border @light:hover:text-#555 rounded-3 durition-500 box-border
block text-white transition hover:shadow-xl"> block text-white transition hover:shadow-xl">
<article class="mb-4 px-6 py-3"> <article class="mb-4 px-6 py-3">
<h3 class="my-2">{post.title}</h3> <h3 class="my-2">{post.title}</h3>
<small class="pb-5"> <small class="pb-5">
Published {when(post.date)} {when(post.date)}
</small> </small>
</article> </article>
</a> </a>

View File

@ -1,15 +1,7 @@
<script lang="ts"> <script lang="ts">
import when from "$lib/when"
import Stars from "$lib/components/Stars.svelte" import Stars from "$lib/components/Stars.svelte"
const when = (date: Date) =>
new Date(date).toLocaleDateString("en-GB", {
year: "numeric",
month: "long",
day: "numeric",
hour: "numeric",
minute: "numeric",
})
export let data export let data
const ratingCategories: { [k: string]: number } = data.rating const ratingCategories: { [k: string]: number } = data.rating
@ -23,12 +15,12 @@
<div class="xl:max-w-300 flex flex-col xl:flex-row"> <div class="xl:max-w-300 flex flex-col xl:flex-row">
<article class="w-150 pt-8"> <article class="w-150 pt-8">
<div class="-ms-4"> <div class="-ms-4">
<a href="/index" class="hover:text-#888">← Back to Index</a> <a href="/revivals" class="hover:text-#888">← Back to Index</a>
<div class="ms-4"> <div class="ms-4">
<span class="mt-2 flex"> <span class="mt-2 flex">
<h1 class="text-2rem m-0">{data.name}</h1> <h1 class="text-2rem m-0">{data.name}</h1>
<span class="mt-a ms-a mb-0.5"> <span class="mt-a ms-a mb-0.5">
Published {when(data.date)} {when(data.date)}
</span> </span>
</span> </span>
@ -36,7 +28,7 @@
<article> <article>
<div class="mb-10 text-justify"> <div class="mb-10 text-justify">
{@html data.html} <svelte:component this={data.content} />
</div> </div>
<h1>Rating</h1> <h1>Rating</h1>
@ -68,7 +60,7 @@
<article class="mb-4 px-6 py-3"> <article class="mb-4 px-6 py-3">
<h3 class="my-2">{revival.name}</h3> <h3 class="my-2">{revival.name}</h3>
<small class="pb-5"> <small class="pb-5">
Published {when(revival.date)} {when(revival.date)}
</small> </small>
</article> </article>
</a> </a>

View File

@ -28,7 +28,7 @@
<h1>Revival Index</h1> <h1>Revival Index</h1>
<div class="grid gap-4 md:grid-cols-2 xl:grid-cols-3"> <div class="grid gap-4 md:grid-cols-2 xl:grid-cols-3">
{#each data.revivals as revival} {#each data.revivals.sort((a, b) => b.rating.overall - a.rating.overall) as revival}
<a <a
href="/revival/{revival.path}" href="/revival/{revival.path}"
class="txt bg-#1f1c1d @light:bg-white rounded-2 card durition-500 class="txt bg-#1f1c1d @light:bg-white rounded-2 card durition-500
@ -50,7 +50,7 @@
<div class="mt-a ms-a flex"> <div class="mt-a ms-a flex">
<span class="me-2">Rating:</span> <span class="me-2">Rating:</span>
<Stars rating={revival.rating} /> <Stars rating={revival.rating.overall} />
</div> </div>
</a> </a>
{/each} {/each}