Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added page "home" #9

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 4 additions & 27 deletions learning-app/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,19 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Crimson+Text:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap" rel="stylesheet">
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.

Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
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>Learning App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.

You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.

To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
97 changes: 57 additions & 40 deletions learning-app/src/components/home/Home.jsx
Original file line number Diff line number Diff line change
@@ -1,51 +1,68 @@
import React, { useState } from 'react';
import React, { useState, useRef, useEffect } from 'react';
import styles from './Home.module.css';
import { RxHamburgerMenu } from "react-icons/rx";
import { IoMdMenu } from "react-icons/io";
import { RxCross2 } from "react-icons/rx";
const logo = '/generated-logo-no_backgroud.png';

const Home = () => {
// const [isMenuOpen, setIsMenuOpen] = useState(false);
const [isMenuOpen, setIsMenuOpen] = useState(false);
const [showCloseButton, setShowCloseButton] = useState(false);

// const toggleMenu = () => {
// setIsMenuOpen(!isMenuOpen);
// };
const toggleMenu = () => {
setIsMenuOpen(!isMenuOpen);
};

return (
<div className={styles.home}>
<div className={styles.head}>
<div className={styles.logo}>
<img src={logo} alt='logo'/>
<h1>ProfessionSkill<br/> Academy</h1>
</div>

</div>
</div>
);
};

export default Home;
const menuRef = useRef(null);

const handleClickOutside = (event) => {
if (menuRef.current && !menuRef.current.contains(event.target)) {
setIsMenuOpen(false);
}
};

useEffect(() => {
document.addEventListener('mousedown', handleClickOutside);
return () => {
document.removeEventListener('mousedown', handleClickOutside);
};
}, []);

useEffect(() => {
if (isMenuOpen) {
document.body.style.overflowY = 'hidden';
setShowCloseButton(true);
} else {
document.body.style.overflowY = 'auto';
setShowCloseButton(false);
}
}, [isMenuOpen]);

return (
<div className={styles.home}>
<div className={styles.navContainer}>
<button className={styles.menuButton} onClick={toggleMenu}>
{isMenuOpen ? '': <IoMdMenu size={50} color='white' />}
{/* <RxCross2 size={50} color='black' /> */}
</button>
<nav ref={menuRef} className={`${styles.menu} ${isMenuOpen ? styles.open : ''}`}>
<h1 style={{color: 'black', textAlign: 'center', fontWeight: '400'}}>Направления</h1>
<ul>
<li>Frontend-Разработчик</li>
<li>Backend-Разработчик</li>
<li>Дизайнер</li>
<li>Монтажер</li>
</ul>
</nav>
</div>
<div className={styles.logo}>
<img src={logo} alt='logo'/>
<h1>ProfessionSkill<br/> Academy</h1>
</div>
<div className={styles.lkWrap}>
<button className={styles.lk}>Личный кабинет</button>
</div>
</div>
);
};

{/* <div className={styles.dropDownMenu}>
<button className={styles.burgerMenu} onClick={toggleMenu}>
<RxHamburgerMenu />
</button>
{isMenuOpen && (
<div className={styles.menu}>
<ul>
<li>Frontend-Разработчик</li>
<li>Backend-Разработчик</li>
<li>Дизайнер</li>
<li>Монтажер</li>
</ul>
</div>
)}
</div>

<div className={styles.logo}>
<img src={logo} alt="Logo"/>
<h1>ProfessionSkill<br/> Academy</h1>
</div> */}
export default Home;
101 changes: 90 additions & 11 deletions learning-app/src/components/home/Home.module.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
.home{
min-height: 100vh;
padding-top: 50px;
width: 100vw;
display: flex;
background: radial-gradient(ellipse at center, #0F4DEE, #391090 80%);
& h1{
padding-top: 20px;
font-size: 4rem;
font-size: 3rem;
color: white;
}
& h2{
Expand All @@ -13,20 +15,97 @@
}
}

.head{
display: flex;
justify-content: space-between;
max-width: 90%;
margin: auto;
text-align: center;
}

.logo{
display: flex;
width: 200px;
height: 200px;
position: absolute;
top: 20px;
right: 52%;
width: 150px;
height: 150px;
text-align: center;
& h1 {
padding-top: 30px;
}
}


.menuButton {
position: fixed;
top: 30px;
left: 80px;
background: none;
border: none;
cursor: pointer;
font-size: 16px;
margin-top: 30px;
z-index: 5;
}


.navContainer {
display: flex;
justify-content: center;
margin: auto;
}

.menu {
display: flex;
flex-direction: column;
padding-top: 30px;
list-style: none;
position: fixed;
width: 400px;
height: 100vh;
background-color: #ffffff;
z-index: 3;
top: 0;
bottom: 0;
left: 0;
right: 0;
transform: translateX(-400px);
transition: transform 0.5s ease-in-out;

}

.menu.open {
transform: translateX(0px);
box-shadow: 9px 5px 15px 5px rgba(0,0,0,0.33);
}


.menu ul {
list-style-type: none;
padding: 0;
padding: 20px;
margin-top: 50px;
}

.menu ul li {
border: 2px solid #000000;
border-radius: 16px;
background-color: white;
margin-top: 20px;
font-size: 24px;
font-weight: 400;
padding: 20px 15px;
cursor: pointer;
}

.menu ul li:hover {
background-color: #f0f0f0;
}


.lkWrap{
position: absolute;
right: 50px;
top: 70px;
}

.lk{
border: 0;
background: none;
color: white;
font-size: 3rem;
}
4 changes: 3 additions & 1 deletion learning-app/src/components/login/Login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,22 @@ function Login() {
<div className={styles.login}>
<form onSubmit={handleSubmit} className={styles.formLogin}>
<input
className={styles.input}
type="text"
name="email"
value={formData.field1}
onChange={handleChange}
placeholder='[email protected]'
/>
<input
className={styles.input}
type="text"
name="password"
value={formData.field2}
onChange={handleChange}
placeholder='password'
/>
<button type="submit">Отправить</button>
<button className={styles.btn} type="submit">Отправить</button>
</form>
</div>

Expand Down
16 changes: 9 additions & 7 deletions learning-app/src/components/login/Login.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,31 @@
display: flex;
justify-content: center;
align-items: center;
background: radial-gradient(ellipse at center, #0F4DEE, #391090 80%);
}

.formLogin {
background-color: rgb(255, 255, 255);
display: flex;
flex-direction: column;
max-width: 30%;
padding: 20px; /* Добавляем отступы, чтобы форма выглядела лучше */
border-radius: 20px; /* Добавляем скругление краев формы */
padding: 20px;
border-radius: 20px;

}

input,
button {
.input,
.btn {
padding: 20px;
color: black;
font-size: 1.5rem;
margin-top: 20px;
border-radius: 20px;
border: 1px solid black; /* Убираем границы у элементов ввода и кнопки */
outline: none; /* Убираем обводку у фокусированных элементов */
border: 1px solid black;
outline: none;
}

button {
.btn {
background-color: #FFC700;
cursor: pointer;
margin-top: 50px;
Expand Down
10 changes: 5 additions & 5 deletions learning-app/src/components/registration/Registration.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,23 @@ const Registration = () => {
<div className={styles.registration}>
<form onSubmit={handleSubmit} className={styles.formRegistration}>
<div>
<input type="email" placeholder='[email protected]' value={email} onChange={(e) => setEmail(e.target.value)} required />
<input className={styles.input} type="email" placeholder='[email protected]' value={email} onChange={(e) => setEmail(e.target.value)} required />
</div>
<div>

<input type="text" placeholder='name' value={name} onChange={(e) => setName(e.target.value)} required />
<input className={styles.input} type="text" placeholder='name' value={name} onChange={(e) => setName(e.target.value)} required />
</div>
<div>

<input type="password" placeholder='password' value={password} onChange={(e) => setPassword(e.target.value)} required />
<input className={styles.input} type="password" placeholder='password' value={password} onChange={(e) => setPassword(e.target.value)} required />
</div>
<div>

<input type="password" placeholder='password' value={confirmPassword} onChange={(e) => setConfirmPassword(e.target.value)} required />
<input className={styles.input} type="password" placeholder='password' value={confirmPassword} onChange={(e) => setConfirmPassword(e.target.value)} required />
</div>
{error && <div style={{ color: 'red' }}>{error}</div>}
{successMessage && <div style={{ color: 'green' }}>{successMessage}</div>}
<button type="submit">Register</button>
<button className={styles.btn} type="submit">Register</button>
</form>
</div>
);
Expand Down
Loading