Skip to content

Commit 3490804

Browse files
committed
feat: basic light mode for base theme
1 parent b22bde8 commit 3490804

6 files changed

Lines changed: 182 additions & 55 deletions

File tree

root/app/www/public/ajax/starr.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@
214214
</td>
215215
</tr>
216216
</table>
217-
<div class="bg-dark w-100 p-3 text-center" style="position: sticky; bottom: 0px;">
217+
<div class="bg-dark w-100 text-center" style="position: sticky; bottom: -20px; padding: 12px;">
218218
<button class="btn btn-success" onclick="saveAppStarrAccess('<?= $app ?>', <?= $_POST['id'] ?>)"><i class="far fa-save"></i> Enable access</button>
219219
</div>
220220
<?php

root/app/www/public/includes/header.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,23 @@
9696
<li class="nav-item <?= !$settingsTable['uiHeaderHelp'] ? 'd-none' : '' ?>">
9797
<a class="nav-link <?= $page == 'help' ? 'active' : '' ?>" href="/?page=help"><i class="far fa-question-circle"></i></a>
9898
</li>
99+
<li class="nav-item">
100+
<a class="nav-link dropdown-toggle d-flex align-items-center" href="#" id="theme-menu" aria-expanded="false" data-bs-toggle="dropdown" data-bs-display="static" aria-label="Toggle theme" style="transform: translateY(3px);">
101+
<i class="fas fa-cloud-sun"></i>
102+
</a>
103+
<ul class="dropdown-menu dropdown-menu-end">
104+
<li>
105+
<button type="button" class="dropdown-item d-flex align-items-center" data-bs-theme-value="light" onclick="swapLightDark('light')">
106+
<i class="bi bi-sun-fill"></i><span class="ms-2">Light</span>
107+
</button>
108+
</li>
109+
<li>
110+
<button type="button" class="dropdown-item d-flex align-items-center" data-bs-theme-value="dark" onclick="swapLightDark('dark')">
111+
<i class="bi bi-moon-stars-fill"></i><span class="ms-2">Dark</span>
112+
</button>
113+
</li>
114+
</ul>
115+
</li>
99116
</ul>
100117
</div>
101118
</div>

root/app/www/public/js/functions.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
function swapLightDark(theme)
2+
{
3+
document.body.setAttribute('data-bs-theme', theme);
4+
updateSetting('defaultThemeMode', theme);
5+
}
6+
// -------------------------------------------------------------------------------------------
17
function toast(title, message, type)
28
{
39
const uniqueId = Date.now() + Math.floor(Math.random() * 1000);

root/app/www/public/pages/settings.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,15 @@
111111
</td>
112112
</tr>
113113
</tbody>
114+
</table>
115+
116+
<table class="table table-no-squish table-sm table-bordered table-hover">
114117
<thead>
115118
<tr>
116119
<td colspan="2">Templates</td>
117120
</tr>
121+
</thead>
122+
<tbody>
118123
<tr>
119124
<td class="w-25">Order</td>
120125
<td>
@@ -124,7 +129,7 @@
124129
</select>
125130
</td>
126131
</tr>
127-
</thead>
132+
</tbody>
128133
</table>
129134
<br>** Refresh the page after changing UI settings
130135
</div>

root/app/www/public/pages/starr.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@
3232
<table class="table table-no-squish table-bordered" style="min-width: 750px;" align="center">
3333
<thead>
3434
<tr>
35-
<td>Name</td>
36-
<td>URL</td>
37-
<td>API Key</td>
38-
<td><i class="far fa-question-circle" title="This is only needed for corruption checks with Notifiarr" style="cursor:help;"></i> User</td>
39-
<td><i class="far fa-question-circle" title="This is only needed for corruption checks with Notifiarr" style="cursor:help;"></i> Pass</td>
35+
<td style="width: 10%;">Name</td>
36+
<td style="width: 20%;">URL</td>
37+
<td style="width: 20%;">API Key</td>
38+
<td style="width: 20%;"><i class="far fa-question-circle" title="This is only needed for corruption checks with Notifiarr" style="cursor:help;"></i> User</td>
39+
<td style="width: 20%;"><i class="far fa-question-circle" title="This is only needed for corruption checks with Notifiarr" style="cursor:help;"></i> Pass</td>
4040
<td class="w-25">&nbsp;</td>
4141
</tr>
4242
</thead>
@@ -76,15 +76,15 @@
7676
<td>
7777
<div class="input-group mb-3">
7878
<input type="text" class="form-control" id="instance-apikey-<?= $starrInstance['id'] ?>" data-apikey="<?= $starrInstance['apikey'] ?>" placeholder="12345-67890-09876-54321" value="<?= truncateMiddle($starrInstance['apikey'], 20) ?>" aria-describedby="apikey-<?= $starrInstance['id'] ?>">
79-
<button class="btn btn-primary" type="button" id="apikey-<?= $starrInstance['id'] ?>" onclick="$('#instance-apikey-<?= $starrInstance['id'] ?>').val($('#instance-apikey-<?= $starrInstance['id'] ?>').data('apikey'))">Show</button>
79+
<button class="btn btn-primary" type="button" id="apikey-<?= $starrInstance['id'] ?>" onclick="$('#instance-apikey-<?= $starrInstance['id'] ?>').val($('#instance-apikey-<?= $starrInstance['id'] ?>').data('apikey'))"><i class="fas fa-eye"></i></button>
8080
</div>
8181
</td>
8282
<td><input type="text" class="form-control" id="instance-username-<?= $starrInstance['id'] ?>" placeholder="username" value="<?= $starrInstance['username'] ?>"></td>
8383
<td><input type="password" class="form-control" id="instance-password-<?= $starrInstance['id'] ?>" placeholder="password" value="<?= $starrInstance['password'] ?>"></td>
84-
<td align="center">
85-
<button class="btn btn-outline-info" type="button" onclick="testStarr('<?= $starrInstance['id'] ?>', '<?= $app ?>')"><i class="fas fa-network-wired"></i> Test API</button>
86-
<button class="btn btn-outline-success" type="button" onclick="saveStarr('<?= $starrInstance['id'] ?>', '<?= $app ?>')"><i class="fas fa-save"></i> Save</button>
87-
<button class="btn btn-outline-danger" type="button" onclick="deleteStarr('<?= $starrInstance['id'] ?>', '<?= $app ?>')"><i class="fas fa-trash-alt"></i> Delete</button>
84+
<td align="right">
85+
<button class="btn btn-outline-info" type="button" onclick="testStarr('<?= $starrInstance['id'] ?>', '<?= $app ?>')"><i class="fas fa-network-wired"></i></button>
86+
<button class="btn btn-outline-success" type="button" onclick="saveStarr('<?= $starrInstance['id'] ?>', '<?= $app ?>')"><i class="fas fa-save"></i></button>
87+
<button class="btn btn-outline-danger" type="button" onclick="deleteStarr('<?= $starrInstance['id'] ?>', '<?= $app ?>')"><i class="fas fa-trash-alt"></i></button>
8888
</td>
8989
</tr>
9090
<?php
@@ -97,9 +97,9 @@
9797
<td><input type="text" class="form-control" id="instance-apikey-99" placeholder="12345-67890-09876-54321"></td>
9898
<td><input type="text" class="form-control" id="instance-username-99" placeholder="username"></td>
9999
<td><input type="text" class="form-control" id="instance-password-99" placeholder="password"></td>
100-
<td align="center">
101-
<button class="btn btn-outline-info" type="button" onclick="testStarr('99', '<?= $app ?>')"><i class="fas fa-network-wired"></i> Test API</button>
102-
<button class="btn btn-outline-success" type="button" onclick="saveStarr('99', '<?= $app ?>')"><i class="fas fa-plus-circle"></i> Add</button>
100+
<td align="right">
101+
<button class="btn btn-outline-info" type="button" onclick="testStarr('99', '<?= $app ?>')"><i class="fas fa-network-wired"></i></button>
102+
<button class="btn btn-outline-success" type="button" onclick="saveStarr('99', '<?= $app ?>')"><i class="fas fa-plus-circle"></i></button>
103103
</td>
104104
</tr>
105105
</tbody>

0 commit comments

Comments
 (0)