Initial commit
This commit is contained in:
+41
@@ -0,0 +1,41 @@
|
||||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||
|
||||
# dependencies
|
||||
/node_modules
|
||||
/.pnp
|
||||
.pnp.*
|
||||
.yarn/*
|
||||
!.yarn/patches
|
||||
!.yarn/plugins
|
||||
!.yarn/releases
|
||||
!.yarn/versions
|
||||
|
||||
# testing
|
||||
/coverage
|
||||
|
||||
# next.js
|
||||
/.next/
|
||||
/out/
|
||||
|
||||
# production
|
||||
/build
|
||||
|
||||
# misc
|
||||
.DS_Store
|
||||
*.pem
|
||||
|
||||
# debug
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
.pnpm-debug.log*
|
||||
|
||||
# env files (can opt-in for committing if needed)
|
||||
.env*
|
||||
|
||||
# vercel
|
||||
.vercel
|
||||
|
||||
# typescript
|
||||
*.tsbuildinfo
|
||||
next-env.d.ts
|
||||
@@ -1,2 +1,36 @@
|
||||
# front-censo
|
||||
front censo
|
||||
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
|
||||
|
||||
## Getting Started
|
||||
|
||||
First, run the development server:
|
||||
|
||||
```bash
|
||||
npm run dev
|
||||
# or
|
||||
yarn dev
|
||||
# or
|
||||
pnpm dev
|
||||
# or
|
||||
bun dev
|
||||
```
|
||||
|
||||
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
|
||||
|
||||
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
|
||||
|
||||
This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
|
||||
|
||||
## Learn More
|
||||
|
||||
To learn more about Next.js, take a look at the following resources:
|
||||
|
||||
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
|
||||
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
|
||||
|
||||
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
|
||||
|
||||
## Deploy on Vercel
|
||||
|
||||
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
|
||||
|
||||
Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
import { dirname } from "path";
|
||||
import { fileURLToPath } from "url";
|
||||
import { FlatCompat } from "@eslint/eslintrc";
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
|
||||
const compat = new FlatCompat({
|
||||
baseDirectory: __dirname,
|
||||
});
|
||||
|
||||
const eslintConfig = [
|
||||
...compat.extends("next/core-web-vitals", "next/typescript"),
|
||||
{
|
||||
ignores: [
|
||||
"node_modules/**",
|
||||
".next/**",
|
||||
"out/**",
|
||||
"build/**",
|
||||
"next-env.d.ts",
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
export default eslintConfig;
|
||||
@@ -0,0 +1,7 @@
|
||||
import type { NextConfig } from "next";
|
||||
|
||||
const nextConfig: NextConfig = {
|
||||
/* config options here */
|
||||
};
|
||||
|
||||
export default nextConfig;
|
||||
Generated
+5782
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"name": "censo-frontend",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
"build": "next build",
|
||||
"start": "next start",
|
||||
"lint": "eslint"
|
||||
},
|
||||
"dependencies": {
|
||||
"@zxing/library": "^0.21.3",
|
||||
"next": "15.5.6",
|
||||
"react": "19.1.0",
|
||||
"react-dom": "19.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/eslintrc": "^3",
|
||||
"@types/node": "^20",
|
||||
"@types/react": "^19",
|
||||
"@types/react-dom": "^19",
|
||||
"eslint": "^9",
|
||||
"eslint-config-next": "15.5.6",
|
||||
"sass": "^1.93.2",
|
||||
"typescript": "^5"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<svg fill="none" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M14.5 13.5V5.41a1 1 0 0 0-.3-.7L9.8.29A1 1 0 0 0 9.08 0H1.5v13.5A2.5 2.5 0 0 0 4 16h8a2.5 2.5 0 0 0 2.5-2.5m-1.5 0v-7H8v-5H3v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1M9.5 5V2.12L12.38 5zM5.13 5h-.62v1.25h2.12V5zm-.62 3h7.12v1.25H4.5zm.62 3h-.62v1.25h7.12V11z" clip-rule="evenodd" fill="#666" fill-rule="evenodd"/></svg>
|
||||
|
After Width: | Height: | Size: 391 B |
@@ -0,0 +1 @@
|
||||
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><g clip-path="url(#a)"><path fill-rule="evenodd" clip-rule="evenodd" d="M10.27 14.1a6.5 6.5 0 0 0 3.67-3.45q-1.24.21-2.7.34-.31 1.83-.97 3.1M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16m.48-1.52a7 7 0 0 1-.96 0H7.5a4 4 0 0 1-.84-1.32q-.38-.89-.63-2.08a40 40 0 0 0 3.92 0q-.25 1.2-.63 2.08a4 4 0 0 1-.84 1.31zm2.94-4.76q1.66-.15 2.95-.43a7 7 0 0 0 0-2.58q-1.3-.27-2.95-.43a18 18 0 0 1 0 3.44m-1.27-3.54a17 17 0 0 1 0 3.64 39 39 0 0 1-4.3 0 17 17 0 0 1 0-3.64 39 39 0 0 1 4.3 0m1.1-1.17q1.45.13 2.69.34a6.5 6.5 0 0 0-3.67-3.44q.65 1.26.98 3.1M8.48 1.5l.01.02q.41.37.84 1.31.38.89.63 2.08a40 40 0 0 0-3.92 0q.25-1.2.63-2.08a4 4 0 0 1 .85-1.32 7 7 0 0 1 .96 0m-2.75.4a6.5 6.5 0 0 0-3.67 3.44 29 29 0 0 1 2.7-.34q.31-1.83.97-3.1M4.58 6.28q-1.66.16-2.95.43a7 7 0 0 0 0 2.58q1.3.27 2.95.43a18 18 0 0 1 0-3.44m.17 4.71q-1.45-.12-2.69-.34a6.5 6.5 0 0 0 3.67 3.44q-.65-1.27-.98-3.1" fill="#666"/></g><defs><clipPath id="a"><path fill="#fff" d="M0 0h16v16H0z"/></clipPath></defs></svg>
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 394 80"><path fill="#000" d="M262 0h68.5v12.7h-27.2v66.6h-13.6V12.7H262V0ZM149 0v12.7H94v20.4h44.3v12.6H94v21h55v12.6H80.5V0h68.7zm34.3 0h-17.8l63.8 79.4h17.9l-32-39.7 32-39.6h-17.9l-23 28.6-23-28.6zm18.3 56.7-9-11-27.1 33.7h17.8l18.3-22.7z"/><path fill="#000" d="M81 79.3 17 0H0v79.3h13.6V17l50.2 62.3H81Zm252.6-.4c-1 0-1.8-.4-2.5-1s-1.1-1.6-1.1-2.6.3-1.8 1-2.5 1.6-1 2.6-1 1.8.3 2.5 1a3.4 3.4 0 0 1 .6 4.3 3.7 3.7 0 0 1-3 1.8zm23.2-33.5h6v23.3c0 2.1-.4 4-1.3 5.5a9.1 9.1 0 0 1-3.8 3.5c-1.6.8-3.5 1.3-5.7 1.3-2 0-3.7-.4-5.3-1s-2.8-1.8-3.7-3.2c-.9-1.3-1.4-3-1.4-5h6c.1.8.3 1.6.7 2.2s1 1.2 1.6 1.5c.7.4 1.5.5 2.4.5 1 0 1.8-.2 2.4-.6a4 4 0 0 0 1.6-1.8c.3-.8.5-1.8.5-3V45.5zm30.9 9.1a4.4 4.4 0 0 0-2-3.3 7.5 7.5 0 0 0-4.3-1.1c-1.3 0-2.4.2-3.3.5-.9.4-1.6 1-2 1.6a3.5 3.5 0 0 0-.3 4c.3.5.7.9 1.3 1.2l1.8 1 2 .5 3.2.8c1.3.3 2.5.7 3.7 1.2a13 13 0 0 1 3.2 1.8 8.1 8.1 0 0 1 3 6.5c0 2-.5 3.7-1.5 5.1a10 10 0 0 1-4.4 3.5c-1.8.8-4.1 1.2-6.8 1.2-2.6 0-4.9-.4-6.8-1.2-2-.8-3.4-2-4.5-3.5a10 10 0 0 1-1.7-5.6h6a5 5 0 0 0 3.5 4.6c1 .4 2.2.6 3.4.6 1.3 0 2.5-.2 3.5-.6 1-.4 1.8-1 2.4-1.7a4 4 0 0 0 .8-2.4c0-.9-.2-1.6-.7-2.2a11 11 0 0 0-2.1-1.4l-3.2-1-3.8-1c-2.8-.7-5-1.7-6.6-3.2a7.2 7.2 0 0 1-2.4-5.7 8 8 0 0 1 1.7-5 10 10 0 0 1 4.3-3.5c2-.8 4-1.2 6.4-1.2 2.3 0 4.4.4 6.2 1.2 1.8.8 3.2 2 4.3 3.4 1 1.4 1.5 3 1.5 5h-5.8z"/></svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
@@ -0,0 +1 @@
|
||||
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1155 1000"><path d="m577.3 0 577.4 1000H0z" fill="#fff"/></svg>
|
||||
|
After Width: | Height: | Size: 128 B |
@@ -0,0 +1 @@
|
||||
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M1.5 2.5h13v10a1 1 0 0 1-1 1h-11a1 1 0 0 1-1-1zM0 1h16v11.5a2.5 2.5 0 0 1-2.5 2.5h-11A2.5 2.5 0 0 1 0 12.5zm3.75 4.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5M7 4.75a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0m1.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5" fill="#666"/></svg>
|
||||
|
After Width: | Height: | Size: 385 B |
@@ -0,0 +1,37 @@
|
||||
import "../styles/components/editar";
|
||||
export default function Page() {
|
||||
return (
|
||||
<form className="editar">
|
||||
<div className="columna">
|
||||
<label htmlFor="serie">Serie</label>
|
||||
<input type="text" id="serie" />
|
||||
<label htmlFor="marca">Marca</label>
|
||||
<input type="text" id="marca" />
|
||||
<label htmlFor="modelo">Modelo</label>
|
||||
<input type="text" id="modelo" />
|
||||
<label htmlFor="estado">Estado</label>
|
||||
<input type="text" id="estado" />
|
||||
</div>
|
||||
|
||||
<div className="columna">
|
||||
<label htmlFor="so">Sistema Operativo</label>
|
||||
<input type="text" id="so" />
|
||||
<label htmlFor="procesador">Procesador</label>
|
||||
<input type="text" id="procesador" />
|
||||
<label htmlFor="tipoUso">Tipo de uso</label>
|
||||
<input type="text" id="tipoUso" />
|
||||
<label htmlFor="observaciones">Observaciones</label>
|
||||
<input type="text" id="observaciones" />
|
||||
</div>
|
||||
|
||||
<div className="columna">
|
||||
<label htmlFor="adscripcion">Adscripción</label>
|
||||
<input type="text" id="adscripcion" />
|
||||
<label htmlFor="responsable">Responsable</label>
|
||||
<input type="text" id="responsable" />
|
||||
<label htmlFor="lugar">Lugar</label>
|
||||
<input type="text" id="lugar" />
|
||||
</div>
|
||||
</form>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useState } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import BarcodeScanner from "../../components/BarcodeScanner";
|
||||
import "../styles/components/dashboard.scss";
|
||||
|
||||
type Equipo = {
|
||||
id: string;
|
||||
nombre: string;
|
||||
estado: string;
|
||||
};
|
||||
|
||||
const initialEquipos: Equipo[] = [
|
||||
{ id: "001", nombre: "PC Aula 1", estado: "Disponible" },
|
||||
{ id: "002", nombre: "PC Aula 2", estado: "En reparación" },
|
||||
];
|
||||
|
||||
export default function Dashboard() {
|
||||
const router = useRouter();
|
||||
const [equipos, setEquipos] = useState<Equipo[]>(initialEquipos);
|
||||
const [search, setSearch] = useState("");
|
||||
const [lastScan, setLastScan] = useState("");
|
||||
|
||||
useEffect(() => {
|
||||
const loggedIn = localStorage.getItem("loggedIn");
|
||||
if (!loggedIn) router.push("/");
|
||||
}, [router]);
|
||||
|
||||
const buscarEquipo = () => {
|
||||
const resultado = equipos.filter(
|
||||
e => e.id.includes(search) || e.nombre.toLowerCase().includes(search.toLowerCase())
|
||||
);
|
||||
setEquipos(resultado);
|
||||
};
|
||||
|
||||
const cerrarSesion = () => {
|
||||
localStorage.removeItem("loggedIn");
|
||||
router.push("/");
|
||||
};
|
||||
|
||||
const handleScan = (code: string) => {
|
||||
setLastScan(code);
|
||||
|
||||
const encontrado = equipos.find(e => e.id === code);
|
||||
if (encontrado) {
|
||||
alert(`Equipo encontrado: ${encontrado.nombre} (${encontrado.estado})`);
|
||||
} else {
|
||||
const nombre = prompt("Equipo no registrado. Ingresa el nombre:");
|
||||
if (nombre) {
|
||||
setEquipos([...equipos, { id: code, nombre, estado: "Disponible" }]);
|
||||
alert("Equipo agregado al inventario");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="dashboard-container">
|
||||
<div className="header">
|
||||
<h2>Dashboard Inventario Escolar</h2>
|
||||
<button onClick={cerrarSesion}>Cerrar sesión</button>
|
||||
</div>
|
||||
|
||||
<div className="search-section">
|
||||
<h3>Buscar equipo</h3>
|
||||
<div style={{ display: "flex", marginTop: "10px" }}>
|
||||
<input type="text" placeholder="ID o nombre" value={search} onChange={(e) => setSearch(e.target.value)} />
|
||||
<button onClick={buscarEquipo}>Buscar</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="scanner-section">
|
||||
<h3>Escanear código de barras</h3>
|
||||
<BarcodeScanner onDetected={handleScan} />
|
||||
{lastScan && <p>Último código escaneado: <strong>{lastScan}</strong></p>}
|
||||
</div>
|
||||
|
||||
<div className="equipos-section">
|
||||
<h3>Equipos</h3>
|
||||
<ul>
|
||||
{equipos.map((e) => (
|
||||
<li key={e.id}>
|
||||
<span>{e.id} - {e.nombre}</span>
|
||||
<span className={e.estado === "Disponible" ? "estado-disponible" : "estado-reparacion"}>{e.estado}</span>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import Header from "../components/header";
|
||||
|
||||
|
||||
|
||||
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
||||
return (
|
||||
<html lang="es">
|
||||
<body>
|
||||
<Header />
|
||||
{children}
|
||||
</body>
|
||||
</html>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
"use client"; // <-- OBLIGATORIO
|
||||
|
||||
import { useState } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import "../app/styles/components/login.scss";
|
||||
export default function Login() {
|
||||
const router = useRouter();
|
||||
const [email, setEmail] = useState("");
|
||||
const [password, setPassword] = useState("");
|
||||
const [error, setError] = useState("");
|
||||
|
||||
const mockUsers = [
|
||||
{ email: "admin@escuela.com", password: "1234" },
|
||||
{ email: "usuario@escuela.com", password: "abcd" },
|
||||
];
|
||||
|
||||
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
|
||||
e.preventDefault();
|
||||
const user = mockUsers.find(u => u.email === email && u.password === password);
|
||||
|
||||
if (user) {
|
||||
localStorage.setItem("loggedIn", "true");
|
||||
router.push("/dashboard");
|
||||
} else {
|
||||
setError("Usuario o contraseña incorrectos");
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="login-container">
|
||||
<h2>Iniciar sesión</h2>
|
||||
{error && <p className="error">{error}</p>}
|
||||
<form onSubmit={handleSubmit}>
|
||||
<input type="email" placeholder="Correo" value={email} onChange={(e) => setEmail(e.target.value)} required />
|
||||
<input type="password" placeholder="Contraseña" value={password} onChange={(e) => setPassword(e.target.value)} required />
|
||||
<button type="submit">Ingresar</button>
|
||||
</form>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,191 @@
|
||||
.barNavigation {
|
||||
text-align: center;
|
||||
background-color: #ffffff;
|
||||
display: flex;
|
||||
width: 100%;
|
||||
top: 0;
|
||||
height: 45px;
|
||||
max-height: 40px;
|
||||
}
|
||||
|
||||
.barNavigation ul {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
width: 100%;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.barNavigation li {
|
||||
transition: all 0.3s ease;
|
||||
cursor: pointer;
|
||||
color: white;
|
||||
width: 100%;
|
||||
transition: background-color 0.3s ease;
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
.barNavigation li:hover {
|
||||
background-color: #bd8c01;
|
||||
}
|
||||
|
||||
.barNavigation ul.active {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.menuToggle {
|
||||
display: none;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
cursor: pointer;
|
||||
padding: 10px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.menuToggle div {
|
||||
width: 25px;
|
||||
height: 3px;
|
||||
background-color: black;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.subMenu {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
border-radius: 4px 4px 0 0;
|
||||
}
|
||||
|
||||
.subMenu ul {
|
||||
opacity: 0;
|
||||
max-height: 0;
|
||||
position: absolute;
|
||||
flex-direction: column;
|
||||
top: 100%;
|
||||
width: 100%;
|
||||
background-color: #003e79;
|
||||
transition: color 0.3s ease;
|
||||
transition: opacity 0.4s ease, max-height 0.4s ease;
|
||||
}
|
||||
|
||||
.subMenu ul a {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.subMenu.open ul {
|
||||
display: flex;
|
||||
color: rgba(0, 61, 121, 1);
|
||||
}
|
||||
|
||||
.subMenu ul:hover {
|
||||
color: #5b8cc9;
|
||||
}
|
||||
|
||||
.subMenu:hover ul {
|
||||
opacity: 1;
|
||||
max-height: 500px;
|
||||
}
|
||||
|
||||
.subMenu:hover ul a {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.subMenu li {
|
||||
padding: 10px 0;
|
||||
}
|
||||
|
||||
.subMenu span {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #383838;
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
.subMenu:hover > span,
|
||||
.subMenu > a:hover > span {
|
||||
color: white;
|
||||
}
|
||||
|
||||
.containerLinks {
|
||||
padding: 0 !important;
|
||||
border-radius: 0 0 4px 4px;
|
||||
}
|
||||
|
||||
.links {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
color: white;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
thead,
|
||||
tbody {
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
|
||||
@media (max-width: 800px) {
|
||||
.menuToggle {
|
||||
display: flex;
|
||||
position: relative;
|
||||
align-items: end;
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
.barNavigation {
|
||||
width: 100vw;
|
||||
}
|
||||
|
||||
.menuToggle.center {
|
||||
align-items: center;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.barNavigation {
|
||||
font-size: 15px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.barNavigation ul {
|
||||
position: absolute;
|
||||
background-color: #003e79;
|
||||
flex-direction: column;
|
||||
padding: 10px 0;
|
||||
align-items: center;
|
||||
display: none;
|
||||
z-index: 1;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.barNavigation {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.barNavigation li:hover {
|
||||
background-color: #d59f0f;
|
||||
color: white;
|
||||
border-radius: 0;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.subMenu ul {
|
||||
width: 100%;
|
||||
border-radius: 4px;
|
||||
position: relative;
|
||||
background-color: rgb(1, 92, 184);
|
||||
}
|
||||
|
||||
thead,
|
||||
tbody {
|
||||
font-size: 1rem;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
.editar{
|
||||
|
||||
max-width: 1000px;
|
||||
display: flex;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.columna{
|
||||
display: flex ;
|
||||
flex-direction: column;
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
.dashboard-container {
|
||||
max-width: 900px;
|
||||
margin: 50px auto;
|
||||
padding: 20px;
|
||||
background: #f8f9fa;
|
||||
border-radius: 15px;
|
||||
box-shadow: 0 4px 10px rgba(0,0,0,0.1);
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
|
||||
h2 {
|
||||
color: #004aad; // azul marino
|
||||
font-size: 2rem;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
button {
|
||||
background-color: #d4af37; // dorado
|
||||
color: white;
|
||||
border: none;
|
||||
padding: 8px 16px;
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
font-weight: bold;
|
||||
transition: background 0.3s;
|
||||
}
|
||||
|
||||
button:hover {
|
||||
background-color: #b5952e;
|
||||
}
|
||||
|
||||
input {
|
||||
padding: 8px 12px;
|
||||
border-radius: 8px;
|
||||
border: 1px solid #ccc;
|
||||
flex: 1;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.search-section, .scanner-section, .equipos-section {
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
||||
.search-section input, .search-section button {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.scanner-section video {
|
||||
border: 2px solid #004aad;
|
||||
border-radius: 10px;
|
||||
max-width: 400px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.equipos-section ul {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.equipos-section li {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 10px 15px;
|
||||
border-radius: 8px;
|
||||
border: 1px solid #ccc;
|
||||
margin-bottom: 10px;
|
||||
background: white;
|
||||
transition: background 0.3s;
|
||||
}
|
||||
|
||||
.equipos-section li:hover {
|
||||
background: #e6f0ff;
|
||||
}
|
||||
|
||||
.estado-disponible {
|
||||
color: green;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.estado-reparacion {
|
||||
color: red;
|
||||
font-weight: bold;
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
.logo {
|
||||
position: relative;
|
||||
filter: invert(1);
|
||||
z-index: 3;
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
.cedetecContainer {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: 300px;
|
||||
height: 100%;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
.cedetecContainer::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: linear-gradient(to right, #f9f9f9, rgba(128, 128, 128, 0));
|
||||
}
|
||||
|
||||
.yellowPart {
|
||||
position: absolute;
|
||||
content: "";
|
||||
top: 0;
|
||||
left: -20px;
|
||||
width: 65%;
|
||||
height: 30px;
|
||||
min-width: 300px;
|
||||
background: #bd8c01;
|
||||
transform: skew(-45deg);
|
||||
z-index: 0;
|
||||
}
|
||||
.header {
|
||||
display: grid;
|
||||
grid-template-columns: auto 1fr;
|
||||
padding: 0 40px;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
height: 90px;
|
||||
}
|
||||
|
||||
.header::after {
|
||||
content: "";
|
||||
top: 0;
|
||||
left: -40px;
|
||||
position: absolute;
|
||||
background-color: #003e79;
|
||||
height: 100%;
|
||||
min-width: 300px;
|
||||
transform: skew(45deg);
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.header::before {
|
||||
content: "";
|
||||
top: 0;
|
||||
left: -20px;
|
||||
position: absolute;
|
||||
background-color: rgb(1, 92, 184);
|
||||
height: 100%;
|
||||
width: 10%;
|
||||
min-width: 300px;
|
||||
transform: skew(45deg);
|
||||
z-index: 2;
|
||||
}
|
||||
@media (max-width: 800px) {
|
||||
.yellowPart {
|
||||
background: #bd8c01;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
.login-container {
|
||||
width: 300px;
|
||||
margin: 100px auto;
|
||||
padding: 30px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 10px;
|
||||
background: #f8f9fa;
|
||||
text-align: center;
|
||||
|
||||
h2 { margin-bottom: 20px; color: #004aad; }
|
||||
|
||||
input {
|
||||
width: 100%;
|
||||
padding: 10px;
|
||||
margin-bottom: 15px;
|
||||
border-radius: 5px;
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
|
||||
button {
|
||||
width: 100%;
|
||||
padding: 10px;
|
||||
background-color: #004aad;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.error { color: red; margin-bottom: 10px; }
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
"use client";
|
||||
import { useState } from "react";
|
||||
import "../app/styles/components/BarNavigation.scss";
|
||||
import Link from "next/link";
|
||||
|
||||
function BarNavigation() {
|
||||
const [openMenu, setOpenMenu] = useState(false);
|
||||
const [openSubMenu, setOpenSubMenu] = useState<number | null>(null);
|
||||
|
||||
const toggleMenu = () => setOpenMenu(!openMenu);
|
||||
const toggleSubMenu = (index: number) => {
|
||||
if (typeof window !== "undefined" && window.innerWidth <= 800) {
|
||||
setOpenSubMenu(openSubMenu === index ? null : index);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<nav className="barNavigation">
|
||||
<div className={`menuToggle ${openMenu ? "" : ""}`} onClick={toggleMenu}>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
</div>
|
||||
|
||||
<ul className={openMenu ? "active" : ""}>
|
||||
<li className={`subMenu ${openSubMenu === 0 ? "open" : ""}`}>
|
||||
<span onClick={() => toggleSubMenu(0)}>Inscripciónes</span>
|
||||
<ul className="containerLinks" onClick={toggleMenu}>
|
||||
<Link href="/AgregarTiempo" className="links">
|
||||
<li>Agregar Tiempo</li>
|
||||
</Link>
|
||||
<Link href="/Inscripcion" className="links">
|
||||
<li>Inscripción Usuario</li>
|
||||
</Link>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li className={`subMenu ${openSubMenu === 1 ? "open" : ""}`}>
|
||||
<span onClick={() => toggleSubMenu(1)}>Servicios</span>
|
||||
<ul onClick={toggleMenu}>
|
||||
<Link href="/Impresiones" className="links">
|
||||
<li>Impresiones y Ploteo</li>
|
||||
</Link>
|
||||
<Link href="/AsignacionMesas" className="links">
|
||||
<li>Asignacion de Mesas</li>
|
||||
</Link>
|
||||
<Link href="/AsignacionEquipo" className="links">
|
||||
<li>Asignacion de Equipos</li>
|
||||
</Link>
|
||||
<Link href="/Monitor" className="links">
|
||||
<li>Monitor</li>
|
||||
</Link>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li className={`subMenu ${openSubMenu === 2 ? "open" : ""}`}>
|
||||
<span onClick={() => toggleSubMenu(2)}>Equipo</span>
|
||||
<ul onClick={toggleMenu}>
|
||||
<Link href="/InformacionEquipo" className="links">
|
||||
<li>Informacion de Equipos</li>
|
||||
</Link>
|
||||
<Link href="/ActivosMantenimiento" className="links">
|
||||
<li>Activos y en Mantenimiento</li>
|
||||
</Link>
|
||||
<Link href="/Mensajes" className="links">
|
||||
<li>Mensajes</li>
|
||||
</Link>
|
||||
<Link href="/Programas" className="links">
|
||||
<li>Programas</li>
|
||||
</Link>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li className={`subMenu ${openSubMenu === 3 ? "open" : ""}`}>
|
||||
<span onClick={() => toggleSubMenu(3)}>Reportes</span>
|
||||
<ul onClick={toggleMenu}>
|
||||
<Link href="/Reportes" className="links">
|
||||
<li>Reportes</li>
|
||||
</Link>
|
||||
<Link href="/Inscritos" className="links">
|
||||
<li>Inscritos</li>
|
||||
</Link>
|
||||
<Link href="/BitacoraSanciones" className="links">
|
||||
<li>Bitacora y sanciones</li>
|
||||
</Link>
|
||||
</ul>
|
||||
</li>
|
||||
<li className="subMenu" onClick={toggleMenu}>
|
||||
<Link href="/QuitarSancion" className="links">
|
||||
<span>Quitar sanción</span>
|
||||
</Link>
|
||||
</li>
|
||||
<li className="subMenu" onClick={toggleMenu}>
|
||||
<Link href="/CambiarPass" className="links">
|
||||
<span> Cambiar contraseña</span>
|
||||
</Link>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
);
|
||||
}
|
||||
|
||||
export default BarNavigation;
|
||||
//IO
|
||||
@@ -0,0 +1,42 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useRef } from "react";
|
||||
import { BrowserMultiFormatReader } from "@zxing/library";
|
||||
|
||||
type Props = { onDetected: (code: string) => void; };
|
||||
|
||||
export default function BarcodeScanner({ onDetected }: Props) {
|
||||
const videoRef = useRef<HTMLVideoElement>(null);
|
||||
|
||||
useEffect(() => {
|
||||
const codeReader = new BrowserMultiFormatReader();
|
||||
if (!videoRef.current) return;
|
||||
|
||||
// Obtener la cámara trasera si existe
|
||||
codeReader.listVideoInputDevices().then((devices) => {
|
||||
const backDevice = devices.find(d => d.label.toLowerCase().includes("back"));
|
||||
const deviceId = backDevice ? backDevice.deviceId : devices[0].deviceId;
|
||||
|
||||
// Inicia la cámara inmediatamente
|
||||
codeReader.decodeFromVideoDevice(deviceId, videoRef.current!, (result) => {
|
||||
if (result) onDetected(result.getText());
|
||||
});
|
||||
}).catch(console.error);
|
||||
|
||||
return () => { codeReader.reset(); };
|
||||
}, [onDetected]);
|
||||
|
||||
return (
|
||||
<video
|
||||
ref={videoRef}
|
||||
style={{
|
||||
width: "100%",
|
||||
maxWidth: "600px", // Más grande
|
||||
border: "2px solid #004aad",
|
||||
borderRadius: "10px"
|
||||
}}
|
||||
autoPlay
|
||||
muted
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
"use client";
|
||||
import Image from "next/image";
|
||||
import header from "../app/styles/components/header.module.scss";
|
||||
import Link from "next/link";
|
||||
import BarNavigation from "./BarNavigation";
|
||||
|
||||
function Header() {
|
||||
return (
|
||||
<header className={header.header}>
|
||||
<Link
|
||||
href="https://www.unam.mx/"
|
||||
target="_blank"
|
||||
className={header.center}
|
||||
style={{
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
}}
|
||||
>
|
||||
<Image
|
||||
className={header.logo}
|
||||
src="/logo_fes.png"
|
||||
alt="Logo FES"
|
||||
width={200}
|
||||
height={50}
|
||||
/>
|
||||
</Link>
|
||||
<div className={header.yellowPart}></div>
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
width: "100%",
|
||||
marginLeft: "40px",
|
||||
marginTop: "45px",
|
||||
maxHeight: "50%",
|
||||
alignItems: "end",
|
||||
}}
|
||||
className=""
|
||||
>
|
||||
<BarNavigation />
|
||||
</div>
|
||||
</header>
|
||||
);
|
||||
}
|
||||
|
||||
export default Header;
|
||||
//IO
|
||||
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2017",
|
||||
"lib": ["dom", "dom.iterable", "esnext"],
|
||||
"allowJs": true,
|
||||
"skipLibCheck": true,
|
||||
"strict": true,
|
||||
"noEmit": true,
|
||||
"esModuleInterop": true,
|
||||
"module": "esnext",
|
||||
"moduleResolution": "bundler",
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"jsx": "preserve",
|
||||
"incremental": true,
|
||||
"plugins": [
|
||||
{
|
||||
"name": "next"
|
||||
}
|
||||
],
|
||||
"paths": {
|
||||
"@/*": ["./src/*"]
|
||||
}
|
||||
},
|
||||
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
Reference in New Issue
Block a user