Skip to content

Commit

Permalink
solvimg styles
Browse files Browse the repository at this point in the history
  • Loading branch information
mks1313 committed Jan 2, 2025
1 parent 7979dea commit dcf8d48
Show file tree
Hide file tree
Showing 8 changed files with 285 additions and 212 deletions.
14 changes: 8 additions & 6 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,13 @@ require("./db");
// https://www.npmjs.com/package/express
const express = require("express");


// Handles the handlebars
// https://www.npmjs.com/package/hbs
const hbs = require("hbs");

const helpers = require('./config/helpers');
hbs.registerHelper(helpers);




const app = express();
const session = require('express-session');
const flash = require('express-flash');
Expand All @@ -46,13 +42,19 @@ app.use(function(req, res, next) {

app.use(express.static('public'));


app.locals.appTitle = `${capitalize(projectName)} Historical Events by Maksim`

// Configuración de la sesión y las cookies
app.use(session({
secret: 'tu_secreto',
resave: false,
saveUninitialized: false,
cookie: {
httpOnly: true, // Seguridad: no accesible desde JavaScript
secure: process.env.NODE_ENV === 'production', // Solo en HTTPS en producción
sameSite: 'lax', // Protege contra ataques CSRF (puedes usar 'strict' si es necesario)
maxAge: 24 * 60 * 60 * 1000 // Expira en 1 día (en milisegundos)
}
}));

// 👇 Start handling routes here
Expand All @@ -77,8 +79,8 @@ app.use("/search", searchRoutes);
const eventsRoutes = require("./routes/events.routes");
app.use("/events", eventsRoutes);


// ❗ To handle errors. Routes that don't exist or errors that you handle in specific routes
require("./error-handling")(app);

module.exports = app;

4 changes: 2 additions & 2 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ export default [
{
languageOptions: {
globals: {
...globals.browser, // Mantén las variables globales para el navegador
...globals.node, // Agrega las variables globales para Node.js
...globals.browser, // Manténer las variables globales para el navegador
...globals.node, // Agregar las variables globales para Node.js
},
},
},
Expand Down
404 changes: 223 additions & 181 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions public/stylesheets/event-edit.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
background-position: center;
height: 100%;
width: 100%;
min-height: 100vh;
box-sizing: border-box;
display: flex;
justify-content: center;
Expand Down
2 changes: 1 addition & 1 deletion public/stylesheets/events-archive.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
margin: 0;
padding: 0;
font-family: 'Raleway', Arial, sans-serif;
background-color: rgb(122, 173, 234);
color: #444;
}

.events-container-archive {
text-align: center;
margin: 20px;
background-color: rgb(122, 173, 234);
}

.event-cards-container-archive {
Expand Down
29 changes: 29 additions & 0 deletions public/stylesheets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
height: 100%;
object-fit: cover;
z-index: -1;
max-width: 100vw;
max-height: 100vh;
}

.bodyindex {
Expand Down Expand Up @@ -210,3 +212,30 @@
}
}

@media (max-width: 375px) {
.content-index h1 {
font-size: 2rem;
}

.btn {
width: 100px;
height: 40px;
}

.navbar a {
font-size: 0.8rem;
margin-left: 1.5rem;
}
}

@media (max-width: 320px) {
.content-index h1 {
font-size: 1.5rem;
}
}

@media (max-width: 768px) {
.icons {
display: block;
}
}
2 changes: 0 additions & 2 deletions views/index.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


<body class="{{#if isLoggedIn}}logged-in{{else}}logged-out{{/if}} bodyindex">
<video autoplay loop muted plays-inline class="background-video">
<source
Expand Down
41 changes: 21 additions & 20 deletions views/layout.hbs
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>{{appTitle}}</title>
<link rel="stylesheet" href="/stylesheets/style.css" />
<link rel="icon" href="/images/favicon-history.ico" />
<link rel="stylesheet" href="/stylesheets/events-archive.css" />
<link rel="stylesheet" href="/stylesheets/event-edit.css" />
<link rel="stylesheet" href="/stylesheets/event-single.css" />


</head>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="description" content="Historical Events website to explore past events" />
<meta property="og:title" content="{{appTitle}}" />
<meta property="og:image" content="/images/preview.png" />
<link rel="stylesheet" href="/stylesheets/style.css" />
<link rel="stylesheet" href="/stylesheets/events-archive.css" />
<link rel="stylesheet" href="/stylesheets/event-edit.css" />
<link rel="stylesheet" href="/stylesheets/event-single.css" />
<link rel="icon" href="/images/favicon-history.ico" />
<title>{{appTitle}}</title>
</head>

<body>

{{{body}}}


<body class="{{#if isLoggedIn}}logged-in{{else}}logged-out{{/if}}">

{{{body}}}

<script src="/js/script.js"></script>
</body>
<script src="/js/script.js" defer></script>

</body>

</html>

0 comments on commit dcf8d48

Please sign in to comment.