Skip to content

Commit 9a4cead

Browse files
committed
style: Update font sizes and add border to menu items for better styling
1 parent f5ec652 commit 9a4cead

13 files changed

+69
-14
lines changed

src/handler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export async function getAppChannelsPageHandler(req: Request, res: Response) {
7272
.select('*')
7373
.from('apps')
7474
.where({ id: parseInt(req.params.id!) });
75-
return res.render('apps-id.html', {
75+
return res.render('apps-id-channels.html', {
7676
app,
7777
layout: '../layouts/app.html',
7878
});
@@ -84,7 +84,7 @@ export async function getAppNotificationsPageHandler(req: Request, res: Response
8484
.select('*')
8585
.from('apps')
8686
.where({ id: parseInt(req.params.id!) });
87-
return res.render('apps-id.html', {
87+
return res.render('apps-id-notifications.html', {
8888
app,
8989
layout: '../layouts/app.html',
9090
});

src/views/components/header.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
<header class="navbar p-10 sticky top-0 z-10 backdrop-blur-sm bg-base-100/70 border border-b border-gray-100">
22
<div class="max-w-6xl mx-auto justify-between w-full items-center">
33
<div class="flex-1">
4-
<a class="btn btn-ghost text-xl font-extrabold" href="/">Notify</a>
4+
<a class="btn btn-ghost text-3xl font-extrabold" href="/">Notify</a>
55
</div>
66

7-
<div class="flex-none">
7+
<div class="flex-none flex gap-5">
8+
<!-- theme -->
9+
<%- include('../components/theme.html') %>
10+
811
<div class="dropdown dropdown-end">
912
<div tabindex="0" role="button" class="btn btn-ghost btn-circle avatar">
1013
<div class="w-10 rounded-full">
11-
<!-- <img alt="Tailwind CSS Navbar component" src="" /> -->
1214
<div class="bg-gray-300 h-full w-full"></div>
1315
</div>
1416
</div>

src/views/components/theme.html

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<script>
2+
function setTheme(theme) {
3+
document.documentElement.setAttribute('data-theme', theme);
4+
localStorage.setItem('theme', theme);
5+
document.querySelector('.theme-controller').checked = (theme === 'business');
6+
}
7+
8+
function toggleTheme() {
9+
const currentTheme = document.documentElement.getAttribute('data-theme');
10+
const newTheme = currentTheme === 'light' ? 'business' : 'light';
11+
setTheme(newTheme);
12+
}
13+
14+
document.addEventListener('DOMContentLoaded', function () {
15+
const savedTheme = localStorage.getItem('theme') || 'light';
16+
setTheme(savedTheme);
17+
18+
const themeToggle = document.querySelector('.theme-controller');
19+
themeToggle.addEventListener('change', toggleTheme);
20+
});
21+
</script>
22+
23+
<label class="swap swap-rotate">
24+
<input type="checkbox" class="theme-controller" value="business" />
25+
26+
<!-- sun icon -->
27+
<svg class="swap-off h-10 w-10 fill-current" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
28+
<path
29+
d="M5.64,17l-.71.71a1,1,0,0,0,0,1.41,1,1,0,0,0,1.41,0l.71-.71A1,1,0,0,0,5.64,17ZM5,12a1,1,0,0,0-1-1H3a1,1,0,0,0,0,2H4A1,1,0,0,0,5,12Zm7-7a1,1,0,0,0,1-1V3a1,1,0,0,0-2,0V4A1,1,0,0,0,12,5ZM5.64,7.05a1,1,0,0,0,.7.29,1,1,0,0,0,.71-.29,1,1,0,0,0,0-1.41l-.71-.71A1,1,0,0,0,4.93,6.34Zm12,.29a1,1,0,0,0,.7-.29l.71-.71a1,1,0,1,0-1.41-1.41L17,5.64a1,1,0,0,0,0,1.41A1,1,0,0,0,17.66,7.34ZM21,11H20a1,1,0,0,0,0,2h1a1,1,0,0,0,0-2Zm-9,8a1,1,0,0,0-1,1v1a1,1,0,0,0,2,0V20A1,1,0,0,0,12,19ZM18.36,17A1,1,0,0,0,17,18.36l.71.71a1,1,0,0,0,1.41,0,1,1,0,0,0,0-1.41ZM12,6.5A5.5,5.5,0,1,0,17.5,12,5.51,5.51,0,0,0,12,6.5Zm0,9A3.5,3.5,0,1,1,15.5,12,3.5,3.5,0,0,1,12,15.5Z" />
30+
</svg>
31+
32+
<svg class="swap-on h-10 w-10 fill-current" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
33+
<path
34+
d="M21.64,13a1,1,0,0,0-1.05-.14,8.05,8.05,0,0,1-3.37.73A8.15,8.15,0,0,1,9.08,5.49a8.59,8.59,0,0,1,.25-2A1,1,0,0,0,8,2.36,10.14,10.14,0,1,0,22,14.05,1,1,0,0,0,21.64,13Zm-9.5,6.69A8.14,8.14,0,0,1,7.08,5.22v.27A10.15,10.15,0,0,0,17.22,15.63a9.79,9.79,0,0,0,2.1-.22A8.11,8.11,0,0,1,12.14,19.73Z" />
35+
</svg>
36+
</label>

src/views/layouts/app.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111

1212
<div class="p-10">
1313
<div class="mx-auto max-w-6xl w-full ">
14-
<h2 class="font-medium text-xl">Apps / <%= app.id %></h2>
14+
<h2 class="font-medium text-2xl">Apps / <%= app.id %></h2>
1515

1616
<div class="sm:grid sm:grid-cols-4 flex flex-col gap-5 mt-5">
1717

1818
<aside>
19-
<ul class="menu bg-base-100 rounded-lg">
19+
<ul class="menu bg-base-100 rounded-lg border border-gray-100">
2020
<li><a href="/apps/<%= app.id %>">App</a></li>
2121
<li><a href="/apps/<%= app.id %>/channels">Channels</a></li>
2222
<li><a href="/apps/<%= app.id %>/notifications">Notifications</a></li>

src/views/pages/apps-create.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div class="p-10">
22
<div class="mx-auto max-w-6xl w-ful">
3-
<h2 class="font-medium text-xl">Apps / New</h2>
3+
<h2 class="font-medium text-2xl">Apps / New</h2>
44
<p>Create a new app</p>
55
</div>
66
</div>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<div class="flex flex-col gap-5">
2+
<h2 class="font-medium text-xl">Channels</h2>
3+
<div class="border border-gray-100 rounded-lg bg-base-100 p-5">
4+
<pre><%= JSON.stringify(app, null, 2) %></pre>
5+
</div>
6+
</div>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<div class="flex flex-col gap-5">
2+
<h2 class="font-medium text-xl">Notifications</h2>
3+
<div class="border border-gray-100 rounded-lg bg-base-100 p-5">
4+
<pre><%= JSON.stringify(app, null, 2) %></pre>
5+
</div>
6+
</div>

src/views/pages/apps-id.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1-
<pre><%= JSON.stringify(app, null, 2) %></pre>
1+
<div class="flex flex-col gap-5">
2+
<h2 class="font-medium text-xl">App</h2>
3+
<div class="border border-gray-100 rounded-lg bg-base-100 p-5">
4+
<pre><%= JSON.stringify(app, null, 2) %></pre>
5+
</div>
6+
</div>

src/views/pages/apps.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div class="mx-auto max-w-6xl w-full">
33

44
<div class="flex justify-between items-center">
5-
<h2 class="font-medium text-xl">Apps</h2>
5+
<h2 class="font-medium text-2xl">Apps</h2>
66
<a class="link" href="/apps/create">Create a new app</a>
77
</div>
88

src/views/pages/profile.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div class="p-10">
22
<div class="mx-auto max-w-6xl w-full">
3-
<h2 class="font-medium text-xl">Profile</h2>
3+
<h2 class="font-medium text-2xl">Profile</h2>
44
<p>profile</p>
55
</div>
66
</div>

0 commit comments

Comments
 (0)