Mobile layout adjustments

This commit is contained in:
Justin Edmund 2025-06-10 10:22:08 -07:00
parent f2a6bf3f99
commit 205244584f
12 changed files with 185 additions and 147 deletions

View file

@ -89,16 +89,13 @@
.header-content { .header-content {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center;
gap: $unit-3x; gap: $unit-3x;
pointer-events: auto; pointer-events: auto;
width: 100%; width: 100%;
max-width: 900px;
margin: 0 auto;
@include breakpoint('phone') { @include breakpoint('phone') {
gap: $unit-2x; gap: $unit-2x;
max-width: none;
justify-content: center;
} }
} }

View file

@ -1,8 +1,13 @@
<script lang="ts"> <script lang="ts">
export let noHorizontalPadding = false interface Props {
noHorizontalPadding?: boolean
class?: string
}
let { noHorizontalPadding = false, class: className = '' }: Props = $props()
</script> </script>
<section class="page" class:no-horizontal-padding={noHorizontalPadding}> <section class="page {className}" class:no-horizontal-padding={noHorizontalPadding}>
<header> <header>
<slot name="header" /> <slot name="header" />
</header> </header>

View file

@ -56,6 +56,11 @@
justify-content: center; justify-content: center;
width: 100%; width: 100%;
@include breakpoint('phone') {
box-sizing: border-box;
padding: 0 $unit-2x;
}
ul { ul {
display: flex; display: flex;
flex-direction: column; flex-direction: column;

View file

@ -29,7 +29,8 @@
.universe-feed { .universe-feed {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: $unit-3x; gap: $unit-2x;
padding: 0 $unit-2x;
} }
.empty-container { .empty-container {

View file

@ -170,7 +170,7 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
gap: $unit; gap: $unit;
font-weight: 500; font-weight: 400;
border: none; border: none;
cursor: pointer; cursor: pointer;
transition: all 0.15s ease; transition: all 0.15s ease;
@ -211,7 +211,7 @@
} }
.btn-medium { .btn-medium {
padding: $unit $unit-2x; padding: ($unit * 1.5) $unit-2x;
font-size: 14px; font-size: 14px;
border-radius: 24px; border-radius: 24px;
min-height: 36px; min-height: 36px;

View file

@ -12,6 +12,7 @@
$: ({ albums, games, error } = data) $: ({ albums, games, error } = data)
</script> </script>
<section class="about-container">
<Page> <Page>
<svelte:fragment slot="header"> <svelte:fragment slot="header">
<h2>A little about me</h2> <h2>A little about me</h2>
@ -19,8 +20,8 @@
<section class="bio"> <section class="bio">
<p> <p>
Hello! My name is <em>Justin Edmund</em>. I'm a software designer and developer living in San Hello! My name is <em>Justin Edmund</em>. I'm a software designer and developer living in
Francisco. San Francisco.
</p> </p>
<p> <p>
Right now, I'm spending my free time building a hobby journaling app called <a Right now, I'm spending my free time building a hobby journaling app called <a
@ -64,8 +65,26 @@
{/if} {/if}
</section> --> </section> -->
</Page> </Page>
</section>
<style lang="scss"> <style lang="scss">
.about-container {
display: flex;
flex-direction: column;
gap: $unit-2x;
justify-content: center;
max-width: 700px;
margin: 0 auto;
@include breakpoint('phone') {
padding: 0 $unit-2x;
}
:global(.page) {
margin: 0;
}
}
a, a,
em { em {
color: $red-60; color: $red-60;

View file

@ -39,7 +39,8 @@
padding: 0 $unit-2x; padding: 0 $unit-2x;
@include breakpoint('phone') { @include breakpoint('phone') {
padding: $unit-3x $unit; padding: 0 $unit-2x;
box-sizing: border-box;
} }
} }

View file

@ -11,6 +11,7 @@
const error = $derived(data.error as string | undefined) const error = $derived(data.error as string | undefined)
</script> </script>
<div class="project-page-container">
{#if error} {#if error}
<Page> <Page>
<div slot="header" class="error-header"> <div slot="header" class="error-header">
@ -62,10 +63,13 @@
</ProjectPasswordProtection> </ProjectPasswordProtection>
</Page> </Page>
{:else} {:else}
<Page> <Page class="project-page">
<div slot="header" class="project-header"> <div slot="header" class="project-header">
{#if project.logoUrl} {#if project.logoUrl}
<div class="project-logo" style="background-color: {project.backgroundColor || '#f5f5f5'}"> <div
class="project-logo"
style="background-color: {project.backgroundColor || '#f5f5f5'}"
>
<img src={project.logoUrl} alt="{project.title} logo" /> <img src={project.logoUrl} alt="{project.title} logo" />
</div> </div>
{/if} {/if}
@ -77,8 +81,14 @@
<ProjectContent {project} /> <ProjectContent {project} />
</Page> </Page>
{/if} {/if}
</div>
<style lang="scss"> <style lang="scss">
.project-page-container {
padding: 0 $unit-2x;
box-sizing: border-box;
}
/* Error and Loading States */ /* Error and Loading States */
.error-header h1 { .error-header h1 {
color: $red-60; color: $red-60;
@ -116,6 +126,7 @@
.project-header { .project-header {
text-align: center; text-align: center;
width: 100%; width: 100%;
padding: $unit-2x 0;
} }
.project-logo { .project-logo {

View file

@ -8,7 +8,7 @@
const error = $derived(data.error) const error = $derived(data.error)
</script> </script>
<div class="photos-page"> <div class="photos-container">
{#if error} {#if error}
<div class="error-container"> <div class="error-container">
<div class="error-message"> <div class="error-message">
@ -29,14 +29,15 @@
</div> </div>
<style lang="scss"> <style lang="scss">
.photos-page { .photos-container {
width: 100%; width: 100%;
max-width: 900px; max-width: 700px;
margin: 0 auto; margin: 0 auto;
padding: 0 $unit-3x; padding: 0 $unit-3x;
@include breakpoint('phone') { @include breakpoint('phone') {
padding: $unit-3x $unit-2x; padding: 0 $unit-2x;
box-sizing: border-box;
} }
} }

View file

@ -24,17 +24,7 @@
.universe-container { .universe-container {
max-width: 784px; max-width: 784px;
margin: 0 auto; margin: 0 auto;
padding: 0 $unit-5x; padding: 0;
@include breakpoint('phone') {
margin-top: $unit-3x;
margin-bottom: $unit-3x;
padding: 0 $unit-3x;
}
@include breakpoint('small-phone') {
padding: 0 $unit-2x;
}
} }
.error-message { .error-message {

View file

@ -39,6 +39,7 @@
{/if} {/if}
</svelte:head> </svelte:head>
<div class="universe-page-container">
{#if error || !post} {#if error || !post}
<Page> <Page>
<div class="error-container"> <div class="error-container">
@ -57,8 +58,14 @@
<DynamicPostContent {post} /> <DynamicPostContent {post} />
</Page> </Page>
{/if} {/if}
</div>
<style lang="scss"> <style lang="scss">
.universe-page-container {
padding: 0 $unit-2x;
box-sizing: border-box;
}
.error-container { .error-container {
display: flex; display: flex;
justify-content: center; justify-content: center;

View file

@ -157,9 +157,10 @@
width: 100%; width: 100%;
max-width: 700px; max-width: 700px;
margin: 0 auto; margin: 0 auto;
box-sizing: border-box;
@include breakpoint('phone') { @include breakpoint('phone') {
margin-top: $unit-3x; padding: 0 $unit-2x;
} }
:global(.page) { :global(.page) {