minor / styling

This commit is contained in:
2025-07-24 16:09:14 -04:00
parent d6a8b82349
commit 3d35b0a327
4 changed files with 15 additions and 3 deletions

View File

@@ -243,3 +243,10 @@ Custom
overscroll-behavior: contain; overscroll-behavior: contain;
} }
.d-dark > * {
background-color: rgba(35, 35, 35, 0.9) !important;
color: #ffffff;
}
.d-light > * {
background-color: rgba(255, 255, 255, 0.9) !important;
}

View File

@@ -5,6 +5,7 @@ import { Player } from './AudioPlayer.jsx';
import Memes from './Memes.jsx'; import Memes from './Memes.jsx';
import { JoyUIRootIsland } from './Components.jsx'; import { JoyUIRootIsland } from './Components.jsx';
import { PrimeReactProvider } from "primereact/api"; import { PrimeReactProvider } from "primereact/api";
import { usePrimeReactThemeSwitcher } from '@/hooks/usePrimeReactThemeSwitcher.jsx';
import CustomToastContainer from '../components/ToastProvider.jsx'; import CustomToastContainer from '../components/ToastProvider.jsx';
import LyricSearch from './LyricSearch.jsx'; import LyricSearch from './LyricSearch.jsx';
import 'primereact/resources/themes/bootstrap4-light-blue/theme.css'; import 'primereact/resources/themes/bootstrap4-light-blue/theme.css';
@@ -14,6 +15,7 @@ export default function Root({child}) {
window.toast = toast; window.toast = toast;
window.API_URL = API_URL; window.API_URL = API_URL;
const theme = document.documentElement.getAttribute("data-theme") const theme = document.documentElement.getAttribute("data-theme")
usePrimeReactThemeSwitcher(theme);
// console.log(opts.children); // console.log(opts.children);
return ( return (
<PrimeReactProvider> <PrimeReactProvider>

View File

@@ -15,7 +15,7 @@ const Memes = () => {
const [hasMore, setHasMore] = useState(true); const [hasMore, setHasMore] = useState(true);
const [selectedImage, setSelectedImage] = useState(null); const [selectedImage, setSelectedImage] = useState(null);
const observerRef = useRef(); const observerRef = useRef();
const theme = document.documentElement.getAttribute("data-theme")
const loadImages = async (pageNum, attempt = 0) => { const loadImages = async (pageNum, attempt = 0) => {
if (loading || !hasMore) return; if (loading || !hasMore) return;
setLoading(true); setLoading(true);
@@ -108,6 +108,7 @@ const Memes = () => {
visible={!!selectedImage} visible={!!selectedImage}
onHide={() => setSelectedImage(null)} onHide={() => setSelectedImage(null)}
style={{ width: '90vw', maxWidth: '720px' }} style={{ width: '90vw', maxWidth: '720px' }}
className={`d-${theme}`}
modal modal
closable closable
dismissableMask={true} dismissableMask={true}

View File

@@ -10,8 +10,10 @@ export function usePrimeReactThemeSwitcher(theme) {
? "/themes/bootstrap4-dark-blue/theme.css" ? "/themes/bootstrap4-dark-blue/theme.css"
: "/themes/bootstrap4-light-blue/theme.css"; : "/themes/bootstrap4-light-blue/theme.css";
if (themeLink.href !== newTheme) { const newHref = window.location.origin + newTheme;
themeLink.href = newTheme;
if (themeLink.href !== newHref) {
themeLink.href = newHref;
} }
}, [theme]); }, [theme]);
} }