-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
67fb475
commit f6938f8
Showing
9 changed files
with
242 additions
and
259 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from 'react'; | ||
import Spinner from './spinner'; | ||
|
||
const LoadingScreen = () => { | ||
return ( | ||
<div className="loading-screen"> | ||
<h1>Cargando...</h1> | ||
<Spinner/> | ||
</div> | ||
); | ||
}; | ||
|
||
export default LoadingScreen; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
'use client'; | ||
|
||
/* IMPORT PRINCIPAL LIBRARYS */ | ||
import Link from 'next/link'; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
html { | ||
background-color: #333; | ||
display: flex; /* Usar flexbox */ | ||
justify-content: center; /* Centrar horizontalmente */ | ||
align-items: center; /* Centrar verticalmente */ | ||
height: 100vh; /* Hacer que el html ocupe toda la altura de la pantalla */ | ||
text-align: center; | ||
color: orange; | ||
transition: 500ms; | ||
} | ||
|
||
.spinner { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: 100px; /* Ajusta la altura según sea necesario */ | ||
transition: 500ms; | ||
} | ||
|
||
.spinner-circle { | ||
width: 50px; /* Ajusta el tamaño del círculo según sea necesario */ | ||
height: 50px; /* Ajusta el tamaño del círculo según sea necesario */ | ||
border: 5px solid #ccc; /* Cambia el color y el estilo del borde según sea necesario */ | ||
border-radius: 50%; /* Hace que el borde sea redondeado para formar un círculo */ | ||
border-top-color: #333; /* Cambia el color del borde superior para dar la apariencia de movimiento */ | ||
animation: spin 1s infinite linear; /* Agrega una animación giratoria infinita */ | ||
transition: 500ms; | ||
} | ||
|
||
@keyframes spin { | ||
0% { | ||
transform: rotate(0deg); | ||
} | ||
100% { | ||
transform: rotate(360deg); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
'use client'; | ||
|
||
import React from 'react'; | ||
import "./spinner.css"; // Corrige el nombre del archivo aquí | ||
|
||
const Spinner = () => { | ||
return ( | ||
<div className="spinner"> | ||
{/* Agrega aquí la animación de carga */} | ||
<div className="spinner-circle"></div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Spinner; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,41 @@ | ||
// layout.jsx | ||
|
||
'use client'; // Marca el componente como un componente de cliente | ||
import React, { useState, useEffect } from 'react'; | ||
import LoadingScreen from './components/LoadingScreen'; | ||
|
||
export default function RootLayout({ children }) { | ||
|
||
const [loading, setLoading] = useState(true); | ||
|
||
useEffect(() => { | ||
if (typeof window !== 'undefined') { | ||
// Simulamos un tiempo de carga utilizando un temporizador | ||
const timer = setTimeout(() => { | ||
setLoading(false); | ||
}, 2000); | ||
|
||
// Limpieza del temporizador al desmontar el componente | ||
return () => clearTimeout(timer); | ||
} | ||
}, []); | ||
|
||
|
||
// Renderiza el contenido de la página solo si loading es falso | ||
return ( | ||
<html className="html"> | ||
<html className="html"> | ||
<head> | ||
{/* Aquí puedes agregar tus etiquetas <head> */} | ||
</head> | ||
<body> | ||
|
||
<div className="main"> | ||
{children} | ||
{loading ? ( // Si loading es verdadero, muestra el spinner de carga | ||
<LoadingScreen /> | ||
) : ( | ||
children // Si loading es falso, muestra el contenido de la página | ||
)} | ||
</div> | ||
|
||
</body> | ||
</html> | ||
) | ||
</html> | ||
); | ||
} |
Oops, something went wrong.