Skip to content

Commit

Permalink
Solved conflicts before PR
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosmndzg committed Mar 29, 2024
2 parents f8b39c6 + 40e51ba commit 51a179f
Show file tree
Hide file tree
Showing 17 changed files with 224 additions and 44 deletions.
Binary file modified webapp/public/KaW.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added webapp/public/KaWIco.ico
Binary file not shown.
Binary file added webapp/public/KaWIco.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added webapp/public/KaW_old.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions webapp/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<link rel="icon" href="%PUBLIC_URL%/KaWIco.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
Expand All @@ -24,7 +24,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<title>Know and Win</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
9 changes: 9 additions & 0 deletions webapp/src/assets/login-solid.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions webapp/src/assets/logout-solid.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 26 additions & 2 deletions webapp/src/components/Header/Header.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
display: flex;
justify-content: space-between;
align-items: center;
padding: 20px;
padding: 15px;
transition: all 0.4s ease;
}

Expand Down Expand Up @@ -34,6 +34,30 @@
}

img {
width: 4rem;
width: 5rem;
height: auto;
margin: 0rem;
margin-left: 0.5rem;
}

.login-logout-link {
background-color: #fff;
color: #717bee;
border: none;
padding: 0.5em 1em;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 0.8em;
margin: 0.5em 1.25em 0.5em 0.2em;
cursor: pointer;
border-radius: 0.5em;
transition: background-color 0.3s ease;
white-space: nowrap;
line-height: 1.2em;
}

.login-logout-link:hover {
background-color: #636ad5;
color: #fff;
}
6 changes: 4 additions & 2 deletions webapp/src/components/Header/Header.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import './Header.css'

import { Link } from 'react-router-dom'
import { ReactComponent as BarIcon } from '../../assets/bars-solid.svg'
import { ReactComponent as SunIcon } from '../../assets/sun-solid.svg'
import { ReactComponent as MoonIcon } from '../../assets/moon-solid.svg'

const Header = props => {
return (
<header className="header">
<img src="KaW.png" alt="Logo of Know and Win APP" />
<Link to="/">
<img src="KaW.png" alt="Logo of Know and Win APP" />
</Link>
<div className="options">
<div className="theme" onClick={props.onChangeTheme}>
{props.theme === 'light' ? <MoonIcon /> : <SunIcon />}
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/components/Login/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const Login = () => {
}

return (
<div className="login">
<div className='login'>
<form>
<h1>Login</h1>
{error && <div className="response-error">{error}</div>}
Expand Down
33 changes: 33 additions & 0 deletions webapp/src/components/Nav/Nav.css
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,36 @@
.close-button svg {
fill: #fff;
}

.nav-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 99;
pointer-events: none; /* El overlay no recibe eventos de clic */
}

.nav-overlay::before {
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
visibility: hidden;
opacity: 0;
transition: opacity 0.3s ease, visibility 0s 0.3s;
}

.nav-open .nav-overlay {
pointer-events: auto; /* El overlay recibe eventos de clic cuando el menú está abierto */
}

.nav-open .nav-overlay::before {
visibility: visible;
opacity: 1;
transition: opacity 0.3s ease;
}
68 changes: 49 additions & 19 deletions webapp/src/components/Nav/Nav.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,34 @@
import './Nav.css'

import { Link } from 'react-router-dom'

import React, { useEffect } from 'react'
import { ReactComponent as CloseIcon } from '../../assets/xmark-solid.svg'
import { ReactComponent as SquareQuestionIcon } from '../../assets/square-question.svg'
import { ReactComponent as UserIcon } from '../../assets/user-solid.svg'
import { ReactComponent as AwardIcon } from '../../assets/award-solid.svg'
import { ReactComponent as SettingsIcon } from '../../assets/gear-solid.svg'
import { ReactComponent as LoginIcon } from '../../assets/login-solid.svg'
import { ReactComponent as LogoutIcon } from '../../assets/logout-solid.svg'
import { useAuth } from '../../hooks/useAuth'

const Nav = props => {
const { user } = useAuth()
const handleCloseNav = event => {
if (event.target.closest('.nav')) {
return
}

props.onToggleNav()
}
useEffect(() => {
if (props.openNav) {
document.documentElement.classList.add('nav-open');
} else {
document.documentElement.classList.remove('nav-open');
}
}, [props.openNav]);
return (
<div className="nav-overlay" onClick={handleCloseNav}>
<div className={`nav ${props.openNav ? 'show' : ''}`}>
<div className="nav-header">
<div className="close-button" onClick={props.onToggleNav}>
Expand All @@ -19,26 +38,29 @@ const Nav = props => {

<div className="nav-body">
<Link to="/" className="nav-link">

<div className="nav-link-icon">
<UserIcon />
</div>
Home
</Link>

<Link to="game" className="nav-link">
<div className="nav-link-icon">
<SquareQuestionIcon />
</div>
Play
</Link>
{user && (
<Link to="game" className="nav-link">
<div className="nav-link-icon">
<SquareQuestionIcon />
</div>
Play
</Link>
)}

<Link to="profile" className="nav-link">
<div className="nav-link-icon">
<UserIcon />
</div>
Profile
</Link>
{user && (
<Link to="profile" className="nav-link">
<div className="nav-link-icon">
<UserIcon />
</div>
Profile
</Link>
)}

<Link to="leaderboard" className="nav-link">
<div className="nav-link-icon">
Expand All @@ -47,14 +69,22 @@ const Nav = props => {
Leaderboard
</Link>

<Link to="settings" className="nav-link">
<div className="nav-link-icon">
<SettingsIcon />
</div>
Settings
{user && (
<Link to="settings" className="nav-link">
<div className="nav-link-icon">
<SettingsIcon />
</div>
Settings
</Link>
)}

<Link to={user ? '/logout' : '/login'} className="nav-link">
{user ? <LogoutIcon /> : <LoginIcon />}
{user ? 'Logout' : 'Login'}
</Link>
</div>
</div>
</div>
)
}

Expand Down
21 changes: 21 additions & 0 deletions webapp/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
:root {
--dark-gray: #121212;
--black: #000;
--gray: #252525;
}

body {
Expand Down Expand Up @@ -72,4 +73,24 @@ main {

.dark .form-create input {
background-color: var(--dark-gray);
}

.dark .login {
background-color: var(--dark-gray);
color: #fff;
}

.dark .register {
background-color: var(--dark-gray);
color: #fff;
}

.dark .login-logout-link {
background-color: var(--dark-gray);
color: #747ae7;
}

.dark .theme {
background-color: var(--dark-gray);
color: #747ae7;
}
49 changes: 41 additions & 8 deletions webapp/src/pages/Home/Home.css
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
.App {
text-align: center;
}

.App-logo {
height: 40vmin;
pointer-events: none;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100vh;
font-family: Arial, sans-serif;
background-color: #f4f4f4;
color: #333;
}

@media (prefers-reduced-motion: no-preference) {
Expand All @@ -14,26 +17,56 @@
}

.App-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
padding: 2rem;
}

.App-link {
color: #61dafb;
margin-bottom: 2rem;
text-decoration: none;
font-size: 1.2rem;

}

@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}

to {
transform: rotate(360deg);
}
}

.homeDiv {
display: grid;
grid-template-rows: auto auto;
gap: 3rem;
justify-items: center;
align-items: start;
padding: 2rem;
width: 100%;
box-sizing: border-box;
}

.App-logo {
grid-row: 1;
height: 10rem;
width: auto;
margin: 5em;
}

.welcome-message {
grid-row: 2;
font-size: 2rem;
font-family: 'Courier New', Courier, monospace;
}

.username {
color: #61dafb;
}
Loading

0 comments on commit 51a179f

Please sign in to comment.