Skip to content

Commit

Permalink
Merge pull request #22 from Crudzaso/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
DiegoAndresRamirez authored Nov 3, 2024
2 parents a9e7d02 + a538a84 commit f7e29a5
Show file tree
Hide file tree
Showing 4 changed files with 292 additions and 186 deletions.
Binary file added public/assets/media/auth/agency.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 16 additions & 2 deletions resources/js/Components/Sign-in/LoginComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@
<div :style="{ background: theme.cardBackground }"
class="d-flex flex-column-fluid justify-content-center p-12">
<!-- Botón flotante para alternar tema -->
<button @click="isDarkMode = !isDarkMode"
<button @click="toggleDarkMode"
class="theme-toggle-btn p-2 rounded-full transition-transform duration-200 hover:scale-105"
:style="{ background: theme.cardBackground }">
<component :is="isDarkMode ? 'Sun' : 'Moon'" :size="24"
:color="isDarkMode ? theme.emphasis : theme.primary" />
</button>


<!-- Contenedor del formulario con ajuste de ancho y centrado -->
<div class="form-container d-flex flex-column align-items-center"
style="max-width: 500px; margin: 0 auto;">
Expand Down Expand Up @@ -107,7 +108,7 @@
</template>

<script>
import { ref, computed } from 'vue';
import { ref, computed, onMounted } from 'vue'; // Importar onMounted
import { Sun, Moon } from 'lucide-vue-next';
import { useForm } from '@inertiajs/vue3';
Expand All @@ -124,6 +125,18 @@ export default {
const isDarkMode = ref(false);
// Cargar el valor de localStorage al iniciar el componente
onMounted(() => {
const savedMode = localStorage.getItem('isDarkMode');
isDarkMode.value = savedMode === 'true'; // Convertir a booleano
});
// Cambiar el modo oscuro y guardarlo en localStorage
const toggleDarkMode = () => {
isDarkMode.value = !isDarkMode.value;
localStorage.setItem('isDarkMode', isDarkMode.value); // Guardar como string
};
const theme = computed(() => ({
primary: isDarkMode.value ? '#42A5F5' : '#1565C0',
secondary: isDarkMode.value ? '#26C6DA' : '#00A9A5',
Expand Down Expand Up @@ -161,6 +174,7 @@ export default {
submit,
loginWithGoogle,
loginWithGitHub,
toggleDarkMode, // Asegúrate de incluir toggleDarkMode en el return
};
}
};
Expand Down
Loading

0 comments on commit f7e29a5

Please sign in to comment.