Skip to content

Commit 8b2ade9

Browse files
Merge pull request #169 from MaddyGuthridge/maddy-fix-mobile-article-view
Even more CSS fixes
2 parents d9e5cc6 + 0aff989 commit 8b2ade9

File tree

6 files changed

+61
-36
lines changed

6 files changed

+61
-36
lines changed

src/app.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
1616
}
1717

18-
body {
18+
html, body {
1919
margin: 0;
2020
overflow-x: clip;
2121
}

src/components/markdown/Markdown.svelte

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@
9494
.markdown-render :global(p) {
9595
/* Justify text */
9696
text-align: justify;
97+
/* Hyphenate text in paragraphs if needed */
98+
hyphens: auto;
9799
}
98100
99101
.markdown-render :global(h1),

src/components/navbar/ControlButtons.svelte

Lines changed: 34 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -53,37 +53,32 @@
5353
}
5454
</script>
5555

56-
{#snippet buttons()}
57-
<span id="control-buttons">
58-
{#if loggedIn}
59-
{#if editable}
60-
<!-- Use the one button so that animations persist between states -->
61-
<Button
62-
onclick={editButtonClick}
63-
mode={editing ? 'confirm' : 'default'}
64-
>
65-
{editing ? 'Finish editing' : 'Edit'}
66-
</Button>
67-
{/if}
68-
<Button onclick={() => goto('/admin')}>Admin</Button>
69-
<Button onclick={logOut}>Log out</Button>
70-
{:else if loggedIn !== undefined}
71-
<!-- Only include a login button if logging in is enabled -->
72-
<Button onclick={gotoLogin}>Log in</Button>
56+
<span id="control-buttons">
57+
{#if loggedIn}
58+
{#if editable}
59+
<!-- Use the one button so that animations persist between states -->
60+
<Button onclick={editButtonClick} mode={editing ? 'confirm' : 'default'}>
61+
{editing ? 'Finish editing' : 'Edit'}
62+
</Button>
7363
{/if}
74-
<!-- About button navigates to about page -->
75-
<Button onclick={() => goto('/about')}>About</Button>
76-
<!-- In dev mode, add a quick shortcut to delete everything -->
77-
{#if dev}
64+
<Button onclick={() => goto('/admin')}>Admin</Button>
65+
<Button onclick={logOut}>Log out</Button>
66+
{:else if loggedIn !== undefined}
67+
<!-- Only include a login button if logging in is enabled -->
68+
<Button onclick={gotoLogin}>Log in</Button>
69+
{/if}
70+
<!-- About button navigates to about page -->
71+
<Button onclick={() => goto('/about')}>About</Button>
72+
<!-- In dev mode, add a quick shortcut to delete everything -->
73+
{#if dev}
74+
<div class="sep">
7875
<Separator />
79-
<Button onclick={clear} mode="warning">Clear data</Button>
80-
{/if}
81-
</span>
82-
{/snippet}
83-
84-
{@render buttons()}
76+
</div>
77+
<Button onclick={clear} mode="warning">Clear data</Button>
78+
{/if}
79+
</span>
8580

86-
<!-- TODO: Make control buttons responsive, so they change to a curtain menu on mobile devices -->
81+
<!-- TODO: Make control buttons change to a curtain menu on mobile devices -->
8782

8883
<style>
8984
#control-buttons {
@@ -94,4 +89,15 @@
9489
grid-area: control-buttons;
9590
margin-right: 20px;
9691
}
92+
93+
/* When screen is narrow, make buttons vertical and hide the separator */
94+
@media (width < 50rem) {
95+
#control-buttons {
96+
flex-direction: column;
97+
}
98+
99+
.sep {
100+
display: none;
101+
}
102+
}
97103
</style>

src/components/navbar/Navbar.svelte

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@
158158
}
159159
160160
/* If the device is wide enough, make the navbar sticky */
161-
@media (min-width: 50rem) {
161+
@media (50rem <= width) {
162162
nav {
163163
position: sticky;
164164
}
@@ -181,7 +181,22 @@
181181
182182
h1 {
183183
margin: 0px;
184-
font-size: 3em;
184+
}
185+
186+
@media (width < 30rem) {
187+
h1 {
188+
font-size: 2rem;
189+
}
190+
}
191+
@media (30rem <= width < 50rem) {
192+
h1 {
193+
font-size: 2.5rem;
194+
}
195+
}
196+
@media (50rem <= width) {
197+
h1 {
198+
font-size: 3rem;
199+
}
185200
}
186201
</style>
187202

src/routes/[...item]/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@
332332
display: flex;
333333
flex-direction: column;
334334
align-items: center;
335-
max-width: 1300px;
335+
max-width: 1000px;
336336
width: 90%;
337337
}
338338

src/routes/about/+page.svelte

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
const { data }: Props = $props();
1414
1515
const versionInfo = dev
16-
? `v${version} - dev`
16+
? `v${version}-dev`
1717
: `[v${version}](${consts.APP_GITHUB}/releases/tag/v${version})`;
1818
1919
const authorLink = `[${consts.APP_AUTHOR[0]}](${consts.APP_AUTHOR[1]})`;
@@ -32,7 +32,7 @@ ${authorLink}.
3232
3333
${contributors}
3434
35-
Here's how you can help out:
35+
Here's how you can get involved:
3636
3737
* [Learn how to deploy your own instance of ${consts.APP_NAME}](${consts.APP_DOCS}/deploy).
3838
* [View the source code on GitHub](${consts.APP_GITHUB}).
@@ -68,7 +68,7 @@ For security reasons, these details are only shown if you are logged in.
6868
data={data.portfolio}
6969
loggedIn={data.loggedIn}
7070
/>
71-
<Background color={'#ff00ff'} />
71+
<Background color={data.portfolio.info.color} />
7272

7373
<main>
7474
<div>
@@ -81,8 +81,10 @@ For security reasons, these details are only shown if you are logged in.
8181
display: flex;
8282
flex-direction: column;
8383
align-items: center;
84+
width: 100%;
8485
}
8586
main > div {
86-
min-width: 80%;
87+
max-width: 800px;
88+
padding: 20px;
8789
}
8890
</style>

0 commit comments

Comments
 (0)