Skip to content

Commit

Permalink
add light/dark theme switcher
Browse files Browse the repository at this point in the history
add donation button
update all js deps
add information section on index page
  • Loading branch information
vintikzzz committed Sep 8, 2024
1 parent 47ce0b7 commit 2151514
Show file tree
Hide file tree
Showing 17 changed files with 5,268 additions and 5,352 deletions.
3 changes: 3 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
> 0.25%
not dead
not op_mini all
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ Some features to mention:
- [ ] Torrent => DDL
- [ ] Magnet => DDL
- [ ] Magnet => Torrent
- [ ] Misc
- [ ] Feedback form
- [ ] Allow magnet-url as query string
- [x] Chrome extension integration
- [x] Embed support
- [x] Base version
Expand Down
13 changes: 13 additions & 0 deletions assets/src/js/app/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,21 @@ window.progress = {
};

import {bindAsync} from '../lib/async';
import { themeChange } from 'theme-change';
themeChange();

function onLoad() {
let currentTheme = window.localStorage.getItem('theme');
const themeSelector = document.querySelector('[data-toggle-theme]');
const [darkTheme, lightTheme] = themeSelector.getAttribute('data-toggle-theme').split(',').map((t) => t.trim());
if (currentTheme === null) {
currentTheme = darkTheme;
if (window.matchMedia && !window.matchMedia('(prefers-color-scheme: dark)')) {
currentTheme = lightTheme;
}
}
if (currentTheme === lightTheme) themeSelector.checked = true;
document.querySelector('html').setAttribute('data-theme', currentTheme);
document.body.style.display = 'block';
hideProgress();
bindAsync({
Expand Down
12 changes: 11 additions & 1 deletion assets/src/styles/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,36 +37,46 @@
@layer components {
.progress-alert {
@apply bg-base-200 text-accent border-accent border shadow-md py-4 rounded-box popin;

position: relative;

pre {
@apply px-5 leading-8 whitespace-pre-wrap flex;

&::before {
content: "> ";

@apply shrink-0;
}

&.in-progress {
@apply loading-elipsis;
}

&.error-summary {
@apply px-5 bg-warning text-warning-content;
}

&.done-summary {
@apply px-5 bg-success text-success-content;
}
}

.close {
@apply btn btn-sm btn-accent mr-4;
}

&-oneline {
@apply flex;

pre {
@apply flex-grow;
}
}
}
}

input:-webkit-autofill,
input:-webkit-autofill:focus {
transition: background-color 600000s 0s, color 600000s 0s;
}
}
Loading

0 comments on commit 2151514

Please sign in to comment.