Spacing and mobile design fixes

This commit is contained in:
Justin Edmund 2025-06-10 12:06:02 -07:00
parent 510255f1bd
commit 90735d2c83
6 changed files with 79 additions and 57 deletions

View file

@ -96,10 +96,10 @@
max-width: 784px; max-width: 784px;
gap: $unit-3x; gap: $unit-3x;
margin: 0 auto; margin: 0 auto;
padding: 0 $unit-3x;
@include breakpoint('phone') { @include breakpoint('phone') {
padding: 0 $unit-2x; gap: $unit-2x;
padding: $unit-half 0;
} }
// Post type styles // Post type styles
@ -319,10 +319,6 @@
} }
} }
.post-footer {
padding-bottom: $unit-2x;
}
.back-button { .back-button {
color: $red-60; color: $red-60;
background-color: transparent; background-color: transparent;

View file

@ -1,18 +1,26 @@
<script lang="ts"> <script lang="ts">
import type { Snippet } from 'svelte'
interface Props { interface Props {
noHorizontalPadding?: boolean noHorizontalPadding?: boolean
class?: string class?: string
header?: Snippet
children?: Snippet
} }
let { noHorizontalPadding = false, class: className = '' }: Props = $props() let { noHorizontalPadding = false, class: className = '', header, children }: Props = $props()
</script> </script>
<section class="page {className}" class:no-horizontal-padding={noHorizontalPadding}> <section class="page {className}" class:no-horizontal-padding={noHorizontalPadding}>
<header> {#if header}
<slot name="header" /> <header>
</header> {@render header()}
</header>
{/if}
<slot /> {#if children}
{@render children()}
{/if}
</section> </section>
<style lang="scss"> <style lang="scss">

View file

@ -107,7 +107,13 @@
} }
@include breakpoint('phone') { @include breakpoint('phone') {
align-self: flex-start; width: 100%;
justify-content: center;
box-sizing: border-box;
:global(svg) {
display: none;
}
} }
} }
</style> </style>

View file

@ -7,16 +7,18 @@
import type { PageData } from './$types' import type { PageData } from './$types'
export let data: PageData let { data } = $props<{ data: PageData }>()
$: ({ albums, games, error } = data) let albums = $derived(data.albums)
let games = $derived(data.games)
let error = $derived(data.error)
</script> </script>
<section class="about-container"> <section class="about-container">
<Page> <Page>
<svelte:fragment slot="header"> {#snippet header()}
<h2>A little about me</h2> <h2>A little about me</h2>
</svelte:fragment> {/snippet}
<section class="bio"> <section class="bio">
<p> <p>
@ -40,16 +42,16 @@
</section> </section>
</Page> </Page>
<Page> <Page>
<svelte:fragment slot="header"> {#snippet header()}
<h2>Notable mentions</h2> <h2>Notable mentions</h2>
</svelte:fragment> {/snippet}
<MentionList /> <MentionList />
</Page> </Page>
<Page noHorizontalPadding={true}> <Page noHorizontalPadding={true}>
<svelte:fragment slot="header"> {#snippet header()}
<h2>Now playing</h2> <h2>Now playing</h2>
</svelte:fragment> {/snippet}
<RecentAlbums {albums} /> <RecentAlbums {albums} />

View file

@ -14,9 +14,11 @@
<div class="project-page-container"> <div class="project-page-container">
{#if error} {#if error}
<Page> <Page>
<div slot="header" class="error-header"> {#snippet header()}
<h1>Error</h1> <div class="error-header">
</div> <h1>Error</h1>
</div>
{/snippet}
<div class="error-content"> <div class="error-content">
<p>{error}</p> <p>{error}</p>
<a href="/labs" class="back-link">← Back to labs</a> <a href="/labs" class="back-link">← Back to labs</a>
@ -28,9 +30,11 @@
</Page> </Page>
{:else if project.status === 'list-only'} {:else if project.status === 'list-only'}
<Page> <Page>
<div slot="header" class="error-header"> {#snippet header()}
<h1>Project Not Available</h1> <div class="error-header">
</div> <h1>Project Not Available</h1>
</div>
{/snippet}
<div class="error-content"> <div class="error-content">
<p>This project is not yet available for viewing. Please check back later.</p> <p>This project is not yet available for viewing. Please check back later.</p>
<a href="/labs" class="back-link">← Back to labs</a> <a href="/labs" class="back-link">← Back to labs</a>
@ -38,46 +42,50 @@
</Page> </Page>
{:else if project.status === 'password-protected'} {:else if project.status === 'password-protected'}
<Page> <Page>
{#snippet header()}
<div class="project-header">
{#if project.logoUrl}
<div
class="project-logo"
style="background-color: {project.backgroundColor || '#f5f5f5'}"
>
<img src={project.logoUrl} alt="{project.title} logo" />
</div>
{/if}
<h1 class="project-title">{project.title}</h1>
{#if project.subtitle}
<p class="project-subtitle">{project.subtitle}</p>
{/if}
</div>
{/snippet}
<ProjectPasswordProtection <ProjectPasswordProtection
projectSlug={project.slug} projectSlug={project.slug}
correctPassword={project.password || ''} correctPassword={project.password || ''}
projectType="labs" projectType="labs"
> >
{#snippet children()} {#snippet children()}
<div slot="header" class="project-header">
{#if project.logoUrl}
<div
class="project-logo"
style="background-color: {project.backgroundColor || '#f5f5f5'}"
>
<img src={project.logoUrl} alt="{project.title} logo" />
</div>
{/if}
<h1 class="project-title">{project.title}</h1>
{#if project.subtitle}
<p class="project-subtitle">{project.subtitle}</p>
{/if}
</div>
<ProjectContent {project} /> <ProjectContent {project} />
{/snippet} {/snippet}
</ProjectPasswordProtection> </ProjectPasswordProtection>
</Page> </Page>
{:else} {:else}
<Page class="project-page"> <Page class="project-page">
<div slot="header" class="project-header"> {#snippet header()}
{#if project.logoUrl} <div class="project-header">
<div {#if project.logoUrl}
class="project-logo" <div
style="background-color: {project.backgroundColor || '#f5f5f5'}" class="project-logo"
> style="background-color: {project.backgroundColor || '#f5f5f5'}"
<img src={project.logoUrl} alt="{project.title} logo" /> >
</div> <img src={project.logoUrl} alt="{project.title} logo" />
{/if} </div>
<h1 class="project-title">{project.title}</h1> {/if}
{#if project.subtitle} <h1 class="project-title">{project.title}</h1>
<p class="project-subtitle">{project.subtitle}</p> {#if project.subtitle}
{/if} <p class="project-subtitle">{project.subtitle}</p>
</div> {/if}
</div>
{/snippet}
<ProjectContent {project} /> <ProjectContent {project} />
</Page> </Page>
{/if} {/if}

View file

@ -95,9 +95,11 @@
{/if} {/if}
</div> </div>
<Page> <Page>
<div slot="header" class="project-header"> {#snippet header()}
<ProjectHeaderContent {project} /> <div class="project-header">
</div> <ProjectHeaderContent {project} />
</div>
{/snippet}
{#if project.status === 'password-protected'} {#if project.status === 'password-protected'}
<ProjectPasswordProtection <ProjectPasswordProtection
projectSlug={project.slug} projectSlug={project.slug}