Skip to content

A self-hosted media server and file management system

simplify darkmode

aminnausin325d41c6f51c
diff --git a/resources/js/App.vue b/resources/js/App.vue
index 4e237bc9..24450108 100644
--- a/resources/js/App.vue
+++ b/resources/js/App.vue
@@ -8,13 +8,18 @@ const props = defineProps({
import {RouterView} from 'vue-router'
import { useAuthStore } from './stores/AuthStore';
const authStore = useAuthStore();
+
+ const { auth, toggleDarkMode } = authStore;
- onMounted(() => {
+ onMounted(async () => {
fetch(`/sanctum/csrf-cookie`, {
method: 'get'
}).catch((error) => {
console.log(error);
});
+ toggleDarkMode(true);
+
+ // await auth();
})
</script>
diff --git a/resources/js/components/layout/Layout.vue b/resources/js/components/layout/Layout.vue
index 6de1fd41..0d01626c 100644
--- a/resources/js/components/layout/Layout.vue
+++ b/resources/js/components/layout/Layout.vue
@@ -1,13 +1,19 @@
<script setup>
import NavBar from './NavBar.vue';
+ import { useAuthStore } from '../../stores/AuthStore'
+ import { storeToRefs } from 'pinia';
+
+ const authStore = useAuthStore();
+
+ const {selectedSideBar} = storeToRefs(authStore);
</script>
<template>
<main class="p-6 flex gap-6 flex-row-reverse flex-wrap-reverse lg:flex-nowrap snap-y">
- <section id="list-card" class="invisible dark:bg-neutral-900 shadow-xl p-3 pb-6 rounded-2xl light-mode w-full lg:w-1/6 lg:max-w-72 shrink-0 space-y-2 scroll-mt-6">
+ <section id="list-card" :class="{ invisible: !selectedSideBar}" class="dark:bg-neutral-900 dark:text-[#e2e0e2] shadow-xl p-3 pb-6 rounded-2xl w-full lg:w-1/6 lg:max-w-72 shrink-0 space-y-2 scroll-mt-6">
<slot name="sidebar"></slot>
</section>
- <section id="content-card" class=" dark:bg-neutral-900 shadow-xl p-6 pt-3 rounded-2xl light-mode w-full">
+ <section id="content-card" class="dark:bg-neutral-900 dark:text-[#e2e0e2] shadow-xl p-6 pt-3 rounded-2xl w-full">
<NavBar/>
<slot name="content"></slot>
</section>
diff --git a/resources/views/auth/register.blade.php b/resources/views/auth/register.blade.php
index 689769ec..dde166ed 100644
--- a/resources/views/auth/register.blade.php
+++ b/resources/views/auth/register.blade.php
@@ -1,7 +1,7 @@
<x-app-layout>
<main class="min-h-screen flex flex-col sm:justify-center items-center pt-6 sm:pt-0 m-auto bg-gray-100">
- <section id="content-card" class=" hidden shadow-xl m-[1%] p-[2%] pt-[1%] rounded-[15px] light-mode w-full md:w-[30%] ">
+ <section id="content-card" class="dark:bg-neutral-900 dark:text-[#e2e0e2] hidden shadow-xl m-[1%] p-[2%] pt-[1%] rounded-[15px] w-full md:w-[30%] ">
</section>
<section id="content-sign-up" class=" w-full sm:max-w-md mt-6 px-6 py-4 bg-white dark:bg-neutral-900 shadow-md overflow-hidden rounded-lg">
<form method="POST" action="/register">
diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php
index f955e025..8dfe49e3 100644
--- a/resources/views/layouts/app.blade.php
+++ b/resources/views/layouts/app.blade.php
@@ -56,7 +56,7 @@
</script>
</head>
- <body class="light-mode font-sans text-gray-900 antialiased" id="root">
+ <body class="dark:bg-[#121216] dark:text-[#e2e0e2] font-sans text-gray-900 antialiased" id="root">
@vite('resources/js/app.js')
<div id='app' :user="{{ Auth::user() }}"></div>
{{ $slot }}