Skip to content

A self-hosted media server and file management system

toggle styling

aminnausinb9b3353050af
diff --git a/resources/css/app.css b/resources/css/app.css
index dae5b42d..8580c944 100755
--- a/resources/css/app.css
+++ b/resources/css/app.css
@@ -10,102 +10,11 @@
}
input[type='number'] {
- -moz-appearance: textfield;
+ appearance: textfield;
}
}
@layer base {
- .toggle-switch {
- position: relative;
- width: 60px;
- height: 30px;
- --light: #d8dbe0;
- --dark: #28292c;
- --disabled: #d8dbe0;
- --enabled: #28292c;
- --accent: #28292c;
- --link: rgb(27, 129, 112);
- --link-hover: rgb(24, 94, 82);
- }
-
- .switch-label {
- position: absolute;
- width: 100%;
- height: 30px;
- background-color: var(--dark);
- border-radius: 15px;
- cursor: pointer;
- border: 2px solid var(--dark);
- }
-
- .checkbox {
- position: absolute;
- display: none;
- }
-
- .slider {
- position: absolute;
- width: 100%;
- height: 100%;
- border-radius: 15px;
- -webkit-transition: 0.3s;
- transition: 0.3s;
- }
-
- .sliderBase {
- position: absolute;
- width: 100%;
- height: 100%;
- border-radius: 15px;
- -webkit-transition: 0.3s;
- transition: 0.3s;
- }
-
- .checkbox:checked ~ .slider,
- .checkbox:checked ~ .sliderBase {
- background-color: var(--light);
- }
-
- .slider::before {
- content: '';
- position: absolute;
- top: 6px;
- left: 6px;
- width: 15px;
- height: 15px;
- border-radius: 50%;
- -webkit-box-shadow: inset 7px -2px 0px 0px var(--light);
- box-shadow: inset 7px -2px 0px 0px var(--light);
- background-color: var(--dark);
- -webkit-transition: 0.3s;
- transition: 0.3s;
- }
-
- .sliderBase::before {
- content: '';
- position: absolute;
- top: 6px;
- left: 6px;
- width: 15px;
- height: 15px;
- border-radius: 50%;
- -webkit-box-shadow: inset 15px 0px 0px 0px var(--disabled);
- box-shadow: inset 15px 0px 0px 0px var(--disabled);
- background-color: var(--enabled);
- -webkit-transition: 0.3s;
- transition: 0.3s;
- }
-
- .checkbox:checked ~ .slider::before,
- .checkbox:checked ~ .sliderBase::before {
- -webkit-transform: translateX(30px);
- -ms-transform: translateX(30px);
- transform: translateX(30px);
- background-color: var(--accent);
- -webkit-box-shadow: none;
- box-shadow: none;
- }
-
/* input:-webkit-autofill,
input:-webkit-autofill:enabled,
input:-webkit-autofill:hover,
diff --git a/resources/js/components/inputs/ToggleBase.vue b/resources/js/components/inputs/ToggleBase.vue
index 5ce4fb57..b516d5e5 100755
--- a/resources/js/components/inputs/ToggleBase.vue
+++ b/resources/js/components/inputs/ToggleBase.vue
@@ -11,3 +11,96 @@ const { name } = defineProps(['name']);
</label>
</section>
</template>
+
+<style lang="css" scoped>
+.toggle-switch {
+ position: relative;
+ width: 60px;
+ height: 30px;
+ --light: #d8dbe0;
+ --dark: #28292c;
+ --disabled: #d8dbe0;
+ --enabled: #28292c;
+ --accent: #28292c;
+ --link: rgb(27, 129, 112);
+ --link-hover: rgb(24, 94, 82);
+}
+
+.switch-label {
+ position: absolute;
+ width: 100%;
+ height: 30px;
+ background-color: var(--dark);
+ border-radius: 15px;
+ cursor: pointer;
+ border: 2px solid var(--dark);
+}
+
+.checkbox {
+ position: absolute;
+ display: none;
+}
+
+.slider {
+ position: absolute;
+ width: 100%;
+ height: 100%;
+ border-radius: 15px;
+ -webkit-transition: 0.3s;
+ transition: 0.3s;
+}
+
+.sliderBase {
+ position: absolute;
+ width: 100%;
+ height: 100%;
+ border-radius: 15px;
+ -webkit-transition: 0.3s;
+ transition: 0.3s;
+}
+
+.checkbox:checked ~ .slider,
+.checkbox:checked ~ .sliderBase {
+ background-color: var(--light);
+}
+
+.slider::before {
+ content: '';
+ position: absolute;
+ top: 6px;
+ left: 6px;
+ width: 15px;
+ height: 15px;
+ border-radius: 50%;
+ -webkit-box-shadow: inset 7px -2px 0px 0px var(--light);
+ box-shadow: inset 7px -2px 0px 0px var(--light);
+ background-color: var(--dark);
+ -webkit-transition: 0.3s;
+ transition: 0.3s;
+}
+
+.sliderBase::before {
+ content: '';
+ position: absolute;
+ top: 6px;
+ left: 6px;
+ width: 15px;
+ height: 15px;
+ border-radius: 50%;
+ -webkit-box-shadow: inset 15px 0px 0px 0px var(--disabled);
+ box-shadow: inset 15px 0px 0px 0px var(--disabled);
+ background-color: var(--enabled);
+ -webkit-transition: 0.3s;
+ transition: 0.3s;
+}
+
+.checkbox:checked ~ .slider::before,
+.checkbox:checked ~ .sliderBase::before {
+ -webkit-transform: translateX(30px);
+ -ms-transform: translateX(30px);
+ transform: translateX(30px);
+ background-color: var(--accent);
+ -webkit-box-shadow: none;
+ box-shadow: none;
+}
+</style>
diff --git a/resources/js/components/inputs/ToggleLightMode.vue b/resources/js/components/inputs/ToggleLightMode.vue
index 29d50c91..5ae5db79 100755
--- a/resources/js/components/inputs/ToggleLightMode.vue
+++ b/resources/js/components/inputs/ToggleLightMode.vue
@@ -1,6 +1,6 @@
<script setup>
import { storeToRefs } from 'pinia';
-import { useAppStore } from '../../stores/AppStore';
+import { useAppStore } from '@/stores/AppStore';
const appStore = useAppStore();
const { lightMode } = storeToRefs(appStore);
@@ -21,3 +21,96 @@ const { lightMode } = storeToRefs(appStore);
</label>
</section>
</template>
+
+<style lang="css" scoped>
+.toggle-switch {
+ position: relative;
+ width: 60px;
+ height: 30px;
+ --light: #d8dbe0;
+ --dark: #28292c;
+ --disabled: #d8dbe0;
+ --enabled: #28292c;
+ --accent: #28292c;
+ --link: rgb(27, 129, 112);
+ --link-hover: rgb(24, 94, 82);
+}
+
+.switch-label {
+ position: absolute;
+ width: 100%;
+ height: 30px;
+ background-color: var(--dark);
+ border-radius: 15px;
+ cursor: pointer;
+ border: 2px solid var(--dark);
+}
+
+.checkbox {
+ position: absolute;
+ display: none;
+}
+
+.slider {
+ position: absolute;
+ width: 100%;
+ height: 100%;
+ border-radius: 15px;
+ -webkit-transition: 0.3s;
+ transition: 0.3s;
+}
+
+.sliderBase {
+ position: absolute;
+ width: 100%;
+ height: 100%;
+ border-radius: 15px;
+ -webkit-transition: 0.3s;
+ transition: 0.3s;
+}
+
+.checkbox:checked ~ .slider,
+.checkbox:checked ~ .sliderBase {
+ background-color: var(--light);
+}
+
+.slider::before {
+ content: '';
+ position: absolute;
+ top: 6px;
+ left: 6px;
+ width: 15px;
+ height: 15px;
+ border-radius: 50%;
+ -webkit-box-shadow: inset 7px -2px 0px 0px var(--light);
+ box-shadow: inset 7px -2px 0px 0px var(--light);
+ background-color: var(--dark);
+ -webkit-transition: 0.3s;
+ transition: 0.3s;
+}
+
+.sliderBase::before {
+ content: '';
+ position: absolute;
+ top: 6px;
+ left: 6px;
+ width: 15px;
+ height: 15px;
+ border-radius: 50%;
+ -webkit-box-shadow: inset 15px 0px 0px 0px var(--disabled);
+ box-shadow: inset 15px 0px 0px 0px var(--disabled);
+ background-color: var(--enabled);
+ -webkit-transition: 0.3s;
+ transition: 0.3s;
+}
+
+.checkbox:checked ~ .slider::before,
+.checkbox:checked ~ .sliderBase::before {
+ -webkit-transform: translateX(30px);
+ -ms-transform: translateX(30px);
+ transform: translateX(30px);
+ background-color: var(--accent);
+ -webkit-box-shadow: none;
+ box-shadow: none;
+}
+</style>