Skip to content

Commit fbd76d1

Browse files
committed
feat: Focus rings & ui improvs
1 parent 49f6051 commit fbd76d1

9 files changed

Lines changed: 121 additions & 74 deletions

File tree

src/lib/component/Footer.svelte

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,43 @@
1+
<div class="container">
2+
<div class="col-4 mx-auto">
3+
<div class="card mt-5 ratio ratio-1x1">
4+
<div class="card-body">
5+
<div class="row">
6+
<div class="col-4">
7+
<p>
8+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Error aut,
9+
accusantium cum itaque, est nisi labore, quia temporibus pariatur
10+
fuga necessitatibus. Quia modi labore atque dicta eligendi tempore
11+
molestiae itaque!
12+
</p>
13+
</div>
14+
<div class="col-8">
15+
<p>
16+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Error aut,
17+
accusantium cum itaque, est nisi labore, quia temporibus pariatur
18+
fuga necessitatibus. Quia modi labore atque dicta eligendi tempore
19+
molestiae itaque!
20+
</p>
21+
</div>
22+
</div>
23+
</div>
24+
</div>
25+
</div>
26+
27+
</div>
28+
129
<!-- Footer -->
2-
<div class="container text-center my-3">
3-
<small>
4-
{@html themeSettings.footerContent || $_("footer.been-created-with", {
5-
values: {
6-
pano: `<a href="${PANO_WEBSITE_URL}" target="_blank" rel="noreferrer">Pano</a>`,
7-
},
8-
})}
9-
</small>
30+
<div class="container my-3">
31+
<div class="text-center">
32+
<small>
33+
{@html themeSettings.footerContent ||
34+
$_("footer.been-created-with", {
35+
values: {
36+
pano: `<a href="${PANO_WEBSITE_URL}" class="rounded focus-ring" target="_blank" rel="noreferrer">Pano</a>`,
37+
},
38+
})}
39+
</small>
40+
</div>
1041
</div>
1142

1243
<!-- Footer End -->

src/lib/component/Header.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<!-- Header -->
66
<div class:container={headerWidthOption !== "FULL_SIZE"}>
77
<div
8-
class="rounded-bottom position-relative p-0 bg-gradient"
8+
class="rounded-bottom position-relative p-0 bg-gradient border"
99
class:bg-white={!themeSettings.headerBgColor}
1010
id="header"
1111
style="background-position: center; height: {themeSettings.headerHeight || '256'}px;">

src/lib/component/Navbar.svelte

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,13 @@
2222
{#if $session.user && $session.user.panelAccess}
2323
<li class="nav-item">
2424
<a
25-
class="btn btn-secondary rounded-pill"
25+
class="nav-link"
2626
href={PANEL_URL}
2727
target="_blank"
2828
rel="noreferrer">
29-
<i class="fa-solid fa-up-right-from-square me-1"></i>
30-
{$_("nav-links.panel")}
29+
<i class="fa-solid fa-user-tie"></i>
30+
<span class="d-none d-lg-inline ms-2">
31+
{$_("nav-links.panel")}</span>
3132
</a>
3233
</li>
3334
{/if}
@@ -65,7 +66,7 @@
6566
<div class="list-group list-group-flush">
6667
{#each $quickNotifications as notification, index (notification)}
6768
<button
68-
class="list-group-item list-group-item-action"
69+
class="list-group-item list-group-item-action focus-ring"
6970
type="button"
7071
title={$_("buttons.view")}
7172
on:click={() => onNotificationClick(notification)}
@@ -113,7 +114,7 @@
113114
</div>
114115
{/if}
115116

116-
<a class="dropdown-item bg-transparent" href="/notifications">
117+
<a class="dropdown-item bg-transparent focus-ring" href="/notifications">
117118
<button class="btn btn-sm btn-primary w-100">
118119
{$_("buttons.show-all")}</button>
119120
</a>
@@ -142,16 +143,13 @@
142143
<li>
143144
<a
144145
class:active={matching($page.url.pathname, "/profile")}
145-
class="dropdown-item"
146+
class="dropdown-item focus-ring"
146147
href="/profile">{$_("buttons.profile")}</a>
147148
</li>
148149
<li>
149150
<a
150-
class:active={matching(
151-
$page.url.pathname,
152-
"/tickets",
153-
)}
154-
class="dropdown-item"
151+
class:active={matching($page.url.pathname, "/tickets")}
152+
class="dropdown-item focus-ring"
155153
href="/tickets">{$_("buttons.tickets")}</a>
156154
</li>
157155
<li>
@@ -160,13 +158,13 @@
160158
$page.url.pathname,
161159
"/profile/settings",
162160
)}
163-
class="dropdown-item"
161+
class="dropdown-item focus-ring"
164162
href="/profile/settings">{$_("buttons.settings")}</a>
165163
</li>
166164
<li>
167165
<button
168166
type="button"
169-
class="dropdown-item link-danger"
167+
class="dropdown-item focus-ring link-danger"
170168
on:click={logout}>{$_("buttons.logout")}</button>
171169
</li>
172170
</ul>

src/lib/component/OnlineAdmins.svelte

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
<!-- Online Admins Card -->
22
<div
3-
class="card"
4-
hidden={onlineAdmins.length === 0
5-
? true
6-
: typeof themeSettings.sidebarCarts?.onlineAdmins === "undefined"
7-
? false
8-
: !themeSettings.sidebarCarts.onlineAdmins}>
3+
class="card h-100"
4+
hidden={typeof themeSettings.sidebarCarts?.onlineAdmins === "undefined"
5+
? false
6+
: !themeSettings.sidebarCarts.onlineAdmins}>
97
<div class="card-header">{$_("components.online-admins.online-admins")}</div>
108
<div class="card-body">
119
<div class="row">
1210
{#each onlineAdmins as onlineAdmin, index (onlineAdmin)}
1311
<div class="col-3">
14-
<a href="/player/{onlineAdmin}">
12+
<a href="/player/{onlineAdmin}" class="d-inline-block focus-ring rounded">
1513
<img
1614
alt={onlineAdmin}
1715
class="rounded"
@@ -21,6 +19,8 @@
2119
height="48" />
2220
</a>
2321
</div>
22+
{:else}
23+
<NoContent />
2424
{/each}
2525
</div>
2626
</div>
@@ -31,6 +31,7 @@
3131
import { _ } from "svelte-i18n";
3232
import tooltip from "$lib/tooltip.util";
3333
import { getContext } from "svelte";
34+
import NoContent from "./NoContent.svelte";
3435
3536
export let onlineAdmins;
3637

src/lib/component/Post.svelte

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div class="card rounded-4 mb-3">
2-
{#if (typeof themeSettings.postCoverImageEnabled === 'undefined' ? true : themeSettings.postCoverImageEnabled) && post.thumbnailUrl}
2+
{#if (typeof themeSettings.postCoverImageEnabled === "undefined" ? true : themeSettings.postCoverImageEnabled) && post.thumbnailUrl}
33
<a href="/post/{post.url}">
44
<div
55
style="
@@ -19,7 +19,7 @@
1919
<div class="card-body">
2020
<div class="row mb-3 justify-content-center">
2121
<div class="col">
22-
<a class="card-title text-black" href="/post/{post.url}">
22+
<a class="card-title text-black focus-ring rounded" href="/post/{post.url}">
2323
<h3 class="mb-0 d-inline-block text-break">
2424
{truncate(post.title, 100)}{@html post.title.length > 100
2525
? "&hellip;"
@@ -30,7 +30,7 @@
3030
<div class="col-auto">
3131
{#if post.category.title !== "-"}
3232
<a
33-
class="badge bg-secondary text-dark rounded-pill"
33+
class="badge text-bg-secondary text-decoration-none rounded-pill focus-ring"
3434
href="/?category={post.category.url}"
3535
use:tooltip={[$_("buttons.filter"), { placement: "bottom" }]}>
3636
{post.category.title}
@@ -43,15 +43,17 @@
4343
{@html post.text}
4444
</div>
4545
</div>
46-
<div
47-
class="card-footer d-flex align-items-center justify-content-between">
46+
<div class="card-footer d-flex align-items-center justify-content-between">
4847
{#if detail}
49-
{#if typeof themeSettings.postViewCountEnabled === 'undefined' ? true : themeSettings.postViewCountEnabled}
48+
{#if typeof themeSettings.postViewCountEnabled === "undefined" ? true : themeSettings.postViewCountEnabled}
5049
<ul class="m-0 p-0 text-muted">
5150
<li class="list-inline">
5251
<div
5352
class="list-inline-item px-1"
54-
use:tooltip={[$_("components.post.view"), { placement: "bottom" }]}>
53+
use:tooltip={[
54+
$_("components.post.view"),
55+
{ placement: "bottom" },
56+
]}>
5557
<i class="fas fa-eye me-2"></i>
5658
{post.views}
5759
</div>
@@ -63,37 +65,46 @@
6365

6466
<div>
6567
<Date time={post.date} />
66-
<a href="/player/{post.writer.username}"
67-
hidden="{typeof themeSettings.postAuthorImageEnabled === 'undefined' ? false : !themeSettings.postAuthorImageEnabled}">
68+
<a
69+
href="/player/{post.writer.username}"
70+
class="d-inline-block rounded focus-ring rounded-circle ms-2"
71+
hidden={typeof themeSettings.postAuthorImageEnabled === "undefined"
72+
? false
73+
: !themeSettings.postAuthorImageEnabled}>
6874
<img
6975
src="https://minotar.net/avatar/{post.writer.username}"
7076
alt={post.writer.username}
7177
width="32"
7278
height="32"
7379
use:tooltip={[post.writer.username, { placement: "bottom" }]}
74-
class="rounded-circle ms-2" />
80+
class="rounded-circle" />
7581
</a>
7682
</div>
7783
{:else}
78-
{#if typeof themeSettings.postReadMoreButtonEnabled === 'undefined' ? true : themeSettings.postReadMoreButtonEnabled}
79-
<a href="/post/{post.url}">
84+
{#if typeof themeSettings.postReadMoreButtonEnabled === "undefined" ? true : themeSettings.postReadMoreButtonEnabled}
85+
<a class="h6 mb-0 p-0 btn btn-link text-decoration-none focus-ring" href="/post/{post.url}">
8086
{$_("components.post.read-more")}
87+
<i class="fas fa-caret-right ms-1"></i>
8188
</a>
8289
{:else}
8390
<div></div>
8491
{/if}
8592

8693
<div>
8794
<Date time={post.date} />
88-
<a href="/player/{post.writer.username}"
89-
hidden="{typeof themeSettings.postAuthorImageEnabled === 'undefined' ? false : !themeSettings.postAuthorImageEnabled}">
95+
<a
96+
class="d-inline-block rounded focus-ring rounded-circle ms-2"
97+
href="/player/{post.writer.username}"
98+
hidden={typeof themeSettings.postAuthorImageEnabled === "undefined"
99+
? false
100+
: !themeSettings.postAuthorImageEnabled}>
90101
<img
91102
src="https://minotar.net/avatar/{post.writer.username}"
92103
alt={post.writer.username}
93104
width="32"
94105
height="32"
95106
use:tooltip={[post.writer.username, { placement: "bottom" }]}
96-
class="rounded-circle ms-2" />
107+
class="rounded-circle" />
97108
</a>
98109
</div>
99110
{/if}

src/lib/component/TicketRow.svelte

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
</th>
1414
<td class="align-middle text-nowrap">
1515
<a
16+
class="rounded focus-ring"
1617
href="/ticket/{ticket.id}"
1718
title={$_("components.ticket-row.show-ticket")}
1819
>#{ticket.id} {ticket.title}</a>
@@ -42,7 +43,9 @@
4243
import { _ } from "svelte-i18n";
4344
4445
import tooltip from "$lib/tooltip.util";
45-
import TicketStatus, { TicketStatuses } from "$lib/component/TicketStatus.svelte";
46+
import TicketStatus, {
47+
TicketStatuses,
48+
} from "$lib/component/TicketStatus.svelte";
4649
import Date from "$lib/component/Date.svelte";
4750
4851
export let ticket;

src/lib/pages/PostDetailPage.svelte

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,32 @@
1-
<Post post="{data.post}" detail="{true}" />
2-
3-
<div class="row justify-content-between">
4-
<div class="col-auto">
5-
<a
6-
href="/post/{data.previousPost === '-' ? '' : data.previousPost.url}"
7-
class="btn btn-link ps-0"
8-
class:disabled="{data.previousPost === '-'}"
9-
hidden="{typeof themeSettings.postPreviousPageEnabled === 'undefined' ? false : !themeSettings.postPreviousPageEnabled}"
10-
use:tooltip="{[data.previousPost.title, { placement: 'bottom' }]}">
11-
{$_("pages.post-detail.previous-post")}
12-
</a>
13-
</div>
14-
<div class="col-auto">
15-
<a
16-
href="/post/{data.nextPost === '-' ? '' : data.nextPost.url}"
17-
class="btn btn-link pe-0"
18-
class:disabled="{data.nextPost === '-'}"
19-
hidden="{typeof themeSettings.postNextPageEnabled === 'undefined' ? false : !themeSettings.postNextPageEnabled}"
20-
use:tooltip="{[data.nextPost.title, { placement: 'bottom' }]}">
21-
{$_("pages.post-detail.next-post")}
22-
</a>
1+
<div class="col-lg-8 mx-auto">
2+
<Post post={data.post} detail={true} />
3+
<div class="row justify-content-between">
4+
<div class="col-auto">
5+
<a
6+
href="/post/{data.previousPost === '-' ? '' : data.previousPost.url}"
7+
class="btn btn-link ps-0"
8+
class:disabled={data.previousPost === "-"}
9+
hidden={typeof themeSettings.postPreviousPageEnabled === "undefined"
10+
? false
11+
: !themeSettings.postPreviousPageEnabled}
12+
use:tooltip={[data.previousPost.title, { placement: "bottom" }]}>
13+
<i class="fas fa-caret-left me-1"></i>
14+
{$_("pages.post-detail.previous-post")}
15+
</a>
16+
</div>
17+
<div class="col-auto">
18+
<a
19+
href="/post/{data.nextPost === '-' ? '' : data.nextPost.url}"
20+
class="btn btn-link pe-0"
21+
class:disabled={data.nextPost === "-"}
22+
hidden={typeof themeSettings.postNextPageEnabled === "undefined"
23+
? false
24+
: !themeSettings.postNextPageEnabled}
25+
use:tooltip={[data.nextPost.title, { placement: "bottom" }]}>
26+
{$_("pages.post-detail.next-post")}
27+
<i class="fas fa-caret-right ms-1"></i>
28+
</a>
29+
</div>
2330
</div>
2431
</div>
2532

src/lib/pages/SupportPage.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
</div>
55
<div class="card-body">
66
<ul class="list-group list-group-horizontal text-center">
7-
<a href="/ticket/create" class="list-group-item list-group-item-action">
7+
<a href="/ticket/create" class="list-group-item list-group-item-action focus-ring">
88
<i class="fas fa-ticket fa-2x my-3"></i>
99
<h5>{$_("pages.support.options.create-ticket.title")}</h5>
1010
<small class="text-muted">
@@ -14,7 +14,7 @@
1414

1515
<a
1616
href="mailto:{$session.siteInfo.supportEmail}"
17-
class="list-group-item list-group-item-action">
17+
class="list-group-item list-group-item-action focus-ring">
1818
<i class="fas fa-envelope fa-2x my-3"></i>
1919
<div class="col-auto">
2020
<h5>{$_("pages.support.options.send-email.title")}<i class="fas fa-external-link-alt ms-2"></i></h5>

src/lib/ui-logics/page-logics/PostDetailPageLogics.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ import { error } from "@sveltejs/kit";
22

33
import { getPostDetail } from "$lib/services/posts";
44

5-
import HomeSidebar, { load as loadSidebar } from "$lib/component/sidebars/HomeSidebar.svelte";
6-
75
/**
86
* @type {import("@sveltejs/kit").Load}
97
*/
@@ -30,8 +28,6 @@ export async function processLoad(event) {
3028
nextPost: "-"
3129
};
3230

33-
await loadSidebar(event);
34-
3531
await getPostDetail({ url: event.params.url, request: event }).then(
3632
(body) => {
3733
if (body.error) {
@@ -46,5 +42,5 @@ export async function processLoad(event) {
4642
}
4743
);
4844

49-
return { ...data, sidebar: HomeSidebar };
45+
return { ...data };
5046
}

0 commit comments

Comments
 (0)