add more components

This commit is contained in:
bruhmagedon 2023-07-29 12:14:17 +03:00
parent a92d422250
commit 09b1ab6237
18 changed files with 567 additions and 304 deletions

View File

@ -0,0 +1,335 @@
* {
font-family: "Roboto", sans-serif;
}
header {
position: relative;
height: 83px;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: justify;
-ms-flex-pack: justify;
justify-content: space-between;
-ms-flex-line-pack: center;
align-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
background-color: #fff;
}
.menu {
width: 435px;
height: 58px;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: left;
-ms-flex-pack: left;
justify-content: left;
-ms-flex-line-pack: center;
align-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
margin-left: 88px;
}
.menu_logo {
width: 40px;
height: 52px;
}
.menu_project_name {
margin-left: 20px;
}
.menu_project_name_text {
color: #20d37d;
font-size: 48px;
font-style: normal;
font-weight: 500;
}
.menu_hamburger {
display: block;
position: absolute;
left: 50px;
top: 17px;
-webkit-transform: translateX(-50%);
transform: translateX(-50%);
height: 50px;
width: 50px;
background-color: #20d37d;
border-radius: 9px;
}
.menu_hamburger span {
display: block;
height: 5px;
width: 32px;
background-color: #fff;
margin: 0 9px 6px 9px;
}
.menu_hamburger span:nth-child(1) {
margin-top: 12px;
}
.menu_hamburger span:nth-child(3) {
margin-bottom: 12px;
}
.menu_hamburger_active {
-webkit-transition: 0.8 all;
transition: 0.8 all;
}
.menu_hamburger_active span:nth-child(1) {
margin-top: 12px;
-webkit-transform: translateY(12px) rotate(-45deg);
transform: translateY(12px) rotate(-45deg);
}
.menu_hamburger_active span:nth-child(2) {
display: none;
}
.menu_hamburger_active span:nth-child(3) {
margin-top: 12px;
-webkit-transform: translateY(-5px) rotate(45deg);
transform: translateY(-5px) rotate(45deg);
}
.header_login {
display: block;
height: 100%;
padding-left: 19px;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
margin-right: 10px;
width: 290px;
height: 71px;
background-color: #43ca79;
border-radius: 40px;
color: #fff;
font-size: 32px;
font-style: normal;
font-weight: 500;
}
.header_login_text {
padding-top: 6px;
height: 100%;
margin-left: 10px;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
color: #000;
font-size: 22px;
font-style: normal;
font-weight: 500;
}
.universe {
position: relative;
min-height: 640px;
padding: 22px 0 30px 0;
background: -webkit-gradient(
linear,
left bottom,
left top,
from(#ececec),
to(#ececec)
),
#e8e8e8;
background: linear-gradient(0deg, #ececec 0%, #ececec 100%), #e8e8e8;
}
.universe_input_block {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
position: relative;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
height: 50px;
margin-bottom: 25px;
}
.universe_input {
padding-left: 20px;
height: 100%;
border-radius: 40px;
display: block;
width: 100%;
border: 0px;
}
.universe_input:focus {
outline: none;
border: 1px solid gray;
}
.universe_search {
height: 35px;
width: 35px;
position: absolute;
right: 30px;
}
.universe_card {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
-ms-flex-line-pack: center;
align-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
margin-left: 30px;
height: 205px;
width: 205px;
background-color: #fff;
border-radius: 44px;
}
.universe_card_text {
color: #2a2a2a;
font-size: 24px;
font-style: normal;
font-weight: 500;
}
.universe_card_text span {
color: #50d400;
font-family: Inter;
font-size: 16px;
font-style: normal;
font-weight: 500;
line-height: normal;
}
.universe_icon {
height: 130px;
width: 130px;
}
.universe_slid {
height: 18px;
width: 112px;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
position: absolute;
bottom: 30px;
left: 50%;
-webkit-transform: translateX(-50%);
transform: translateX(-50%);
}
.universe_slid_active {
width: 20px;
margin-right: 8px;
border-radius: 50%;
background-color: #fff;
}
.universe_slid_disable {
width: 20px;
margin-right: 8px;
border-radius: 50%;
background-color: #aeaeae;
}
.navigation {
background: -webkit-gradient(
linear,
left bottom,
left top,
from(#ececec),
to(#ececec)
),
#e8e8e8;
background: linear-gradient(0deg, #ececec 0%, #ececec 100%), #e8e8e8;
position: relative;
min-height: 640px;
padding: 22px 0 30px 0;
}
.navigation_input_block {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
position: relative;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
height: 60px;
margin-bottom: 60px;
}
.navigation_input {
padding-left: 20px;
height: 100%;
border-radius: 40px;
display: block;
width: 100%;
border: 0px;
font-size: 20px;
}
.navigation_input:focus {
outline: none;
border: 1px solid gray;
}
.navigation_search {
height: 35px;
width: 35px;
position: absolute;
right: 30px;
}
.navigation_info {
position: relative;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: justify;
-ms-flex-pack: justify;
justify-content: space-between;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
height: 56px;
background-color: #fff;
border-radius: 50px;
}
.navigation_info_text {
color: #545454;
font-size: 20px;
font-style: normal;
font-weight: 500;
}
.navigation_cost {
position: absolute;
right: 150px;
color: #20d37d;
font-size: 20px;
font-style: normal;
font-weight: 500;
}
.navigation_slid {
height: 18px;
width: 112px;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
position: absolute;
bottom: 30px;
left: 50%;
-webkit-transform: translateX(-50%);
transform: translateX(-50%);
}
.navigation_slid_active {
width: 20px;
margin-right: 8px;
border-radius: 50%;
background-color: #fff;
}
.navigation_slid_disable {
width: 20px;
margin-right: 8px;
border-radius: 50%;
background-color: #aeaeae;
} /*# sourceMappingURL=style.css.map */

View File

@ -1,122 +0,0 @@
* {
font-family: "Roboto", sans-serif;
}
header {
position: relative;
height: 83px;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: justify;
-ms-flex-pack: justify;
justify-content: space-between;
-ms-flex-line-pack: center;
align-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
background-color: #fff;
}
.menu {
width: 435px;
height: 58px;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: left;
-ms-flex-pack: left;
justify-content: left;
-ms-flex-line-pack: center;
align-content: center;
margin-left: 88px;
}
.menu_logo {
width: 40px;
height: 52px;
}
.menu_project_name {
margin-left: 20px;
}
.menu_project_name_text {
color: #20d37d;
font-size: 48px;
font-style: normal;
font-weight: 500;
}
.menu_hamburger {
display: block;
position: absolute;
left: 50px;
top: 17px;
-webkit-transform: translateX(-50%);
transform: translateX(-50%);
height: 50px;
width: 50px;
background-color: #20d37d;
border-radius: 9px;
}
.menu_hamburger span {
display: block;
height: 5px;
width: 32px;
background-color: #fff;
margin: 0 9px 6px 9px;
}
.menu_hamburger span:nth-child(1) {
margin-top: 12px;
}
.menu_hamburger span:nth-child(3) {
margin-bottom: 12px;
}
.menu_hamburger_active {
margin-top: 6px;
-webkit-transition: 0.8 all;
transition: 0.8 all;
}
.menu_hamburger_active span:nth-child(1) {
margin-top: -2px;
-webkit-transform: translateY(3px) rotate(-45deg);
transform: translateY(3px) rotate(-45deg);
}
.menu_hamburger_active span:nth-child(2) {
display: none;
}
.menu_hamburger_active span:nth-child(3) {
margin-top: -2px;
-webkit-transform: translateY(3px) rotate(45deg);
transform: translateY(3px) rotate(45deg);
}
.header_login {
height: 100%;
padding-left: 19px;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
margin-right: 10px;
width: 290px;
height: 71px;
background-color: #43ca79;
border-radius: 40px;
color: #fff;
font-size: 32px;
font-style: normal;
font-weight: 500;
}
.header_login_text {
padding-top: 6px;
height: 100%;
margin-left: 10px;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
color: #000;
font-size: 22px;
font-style: normal;
font-weight: 500;
} /*# sourceMappingURL=style.css.map */

View File

@ -1,7 +1,5 @@
import { Component } from "react"; import { Component } from "react";
import "./css/header.css";
import logo from "./img/logo/logoPayDay.png"; import logo from "./img/logo/logoPayDay.png";
class Header extends Component { class Header extends Component {

View File

@ -1,46 +0,0 @@
.universe {
position: relative;
min-height: 640px;
padding: 22px 0 30px 0;
background: -webkit-gradient(
linear,
left bottom,
left top,
from(#ececec),
to(#ececec)
),
#e8e8e8;
background: linear-gradient(0deg, #ececec 0%, #ececec 100%), #e8e8e8;
}
.universe_input_block {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
position: relative;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
height: 50px;
margin-bottom: 25px;
}
.universe_input {
padding-left: 20px;
height: 100%;
border-radius: 40px;
display: block;
width: 100%;
border: 0px;
}
.universe_input:focus {
outline: none;
border: 1px solid gray;
}
.universe_search {
height: 35px;
width: 35px;
position: absolute;
right: 30px;
} /*# sourceMappingURL=style.css.map */

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -1,42 +1,80 @@
import { Component } from "react"; import { Component } from "react";
import Slider from "../slider/slider"; import UniverseList from "../universe/universe-list";
import Universe from "../universe/universe"; import NavigationList from "../navigation/navigation-list";
import "./css/main.css";
import searchLogo from "./img/search.svg"; //генерятся из get запроса (будет ссылка в universeData вместо #)
import KubGu from "./img/kubgu.jpg";
import Ufu from "./img/ufu.jpg";
import Vshe from "./img/vshe.png";
class Main extends Component { class Main extends Component {
state = { state = {
universeData: [], //генерируется из get запроса
universeData: [
//вузы
{
id: "1",
name: "ЮФУ",
credit: "от 135т руб",
logo: "#",
navigation: [
//направления
{
name: "09.03.04 - Программная инженерия ",
credit: "От 5600 в мес.",
bankCount: " 10+ Банков",
},
{
name: "09.03.04 - Программная инженерия ",
credit: "От 5600 в мес.",
bankCount: " 10+ Банков",
},
{
name: "09.03.04 - Программная инженерия ",
credit: "От 5600 в мес.",
bankCount: " 10+ Банков",
},
],
},
{
id: "2",
name: "КубГУ",
credit: "от 135т руб",
logo: "#",
navigation: [],
},
{
id: "3",
name: "ВШЭ",
credit: "от 135т руб",
logo: "#",
navigation: [],
},
],
};
//Клик на карточку вуза - должны получить его id, чтобы потом предать его в навигацию
onClickToUniverse = (e) => {
console.log(e.target.name);
}; };
render() { render() {
return ( const { universeData } = this.state; //universeData генерируется через map
<section className="universe">
<div className="container container_flex">
<div className="row">
<div className="universe_input_block col-md-12">
<input
type="text"
className="universe_input"
placeholder="Введите название вуза или суза..."
/>
<img
src={searchLogo}
alt="search"
className="universe_search"
/>
</div>
<section className="universe-section"> const picturesList = [Ufu, KubGu, Vshe]; //заглушка - картинки будут приходить из universeData
{/* Генерация университетов из списка на основе пропсов*/}
<Universe /> return (
</section> //Из UniverseList приходит текущий выбранный вуз, он отправляется в NavigationList
</div> <>
</div> {/* тут проиходит переключение слайдеров (мб стоит сделать как список) */}
{/* Переключение активного слайдера в зависимости от секции */} <UniverseList
<Slider /> data={universeData}
</section> picturesList={picturesList}
onUniverseProps={this.onClickToUniverse}
/>
{/* <NavigationList /> */}
</>
); );
} }
} }

View File

@ -0,0 +1,19 @@
import { Component } from "react";
class NavigationItem extends Component {
state = {};
render() {
return (
<div class="col-md-12">
<div class="navigation_info navigation_info_text p-3">
09.03.04 - Программная инженерия{" "}
<span class="navigation_cost">От 5600 в мес.</span> 10+
Банков
</div>
</div>
);
}
}
export default NavigationItem;

View File

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -0,0 +1,55 @@
import { Component } from "react";
import NavigationItem from "../navigation-item/navigation-item";
import searchLogo from "./img/search.svg";
class NavigationList extends Component {
state = {};
render() {
const { data } = this.props;
//Тут генерим список направлений, генерируется он на основе data, в которой фильтром выбирает нужный вуз
//вуз приходит из пропсов
// const navigations = data.map((item) => {
// // const { navigation } = item;
// // return <NavigationItem key={id} {...itemProps} />;
// });
return (
<section className="navigation">
<div className="container container_flex">
<div className="row">
<div className="navigation_input_block col-md-12">
<input
type="text"
className="navigation_input"
placeholder="Введите код или название направления"
/>
<img
src={searchLogo}
alt="search"
className="navigation_search"
/>
</div>
</div>
<div className="row row-cols-lg-1 g-5 g-lg-3">
<NavigationItem />
<NavigationItem />
<NavigationItem />
<NavigationItem />
</div>
</div>
<div className="navigation_slid">
<span className="navigation_slid_disable"></span>
<span className="navigation_slid_active"></span>
<span className="navigation_slid_disable"></span>
<span className="navigation_slid_disable"></span>
</div>
</section>
);
}
}
export default NavigationList;

View File

@ -1,24 +0,0 @@
.universe_slid {
height: 18px;
width: 112px;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
position: absolute;
bottom: 30px;
left: 50%;
-webkit-transform: translateX(-50%);
transform: translateX(-50%);
}
.universe_slid_active {
width: 20px;
margin-right: 8px;
border-radius: 50%;
background-color: #fff;
}
.universe_slid_disable {
width: 20px;
margin-right: 8px;
border-radius: 50%;
background-color: #aeaeae;
}

View File

@ -1,20 +0,0 @@
import { Component } from "react";
import "./css/slider.css";
class Slider extends Component {
state = {};
render() {
return (
<div className="universe_slid">
<span className="universe_slid_active"></span>
<span className="universe_slid_disable"></span>
<span className="universe_slid_disable"></span>
<span className="universe_slid_disable"></span>
</div>
);
}
}
export default Slider;

View File

@ -0,0 +1,23 @@
import { Component } from "react";
class UniverseItem extends Component {
state = {};
render() {
const { name, credit, pic, onUniverseProps } = this.props;
return (
<div
className="col-2 universe_card universe_card_text"
onClick={onUniverseProps}
name={name}
>
<img src={pic} alt="universe" className="universe_icon" />
{name}
<span>{credit}</span>
</div>
);
}
}
export default UniverseItem;

View File

@ -1,40 +0,0 @@
.universe_card {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
-ms-flex-line-pack: center;
align-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
margin-left: 30px;
height: 205px;
width: 205px;
background-color: #fff;
border-radius: 44px;
}
.universe_card_text {
color: #2a2a2a;
font-size: 24px;
font-style: normal;
font-weight: 500;
}
.universe_card_text span {
color: #50d400;
font-family: Inter;
font-size: 16px;
font-style: normal;
font-weight: 500;
line-height: normal;
}
.universe_icon {
height: 130px;
width: 130px;
}

View File

@ -0,0 +1,10 @@
<svg width="35" height="36" viewBox="0 0 35 36" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_1_33)">
<path d="M34.8925 34.7695C34.8925 35.0977 34.7967 35.3848 34.6052 35.6309C34.4137 35.877 34.149 36 33.8111 36C33.5183 36 33.2648 35.8887 33.0508 35.666L19.7874 21.8848C18.7061 22.8105 17.5233 23.5195 16.2392 24.0117C14.9551 24.5039 13.6035 24.75 12.1842 24.75C11.0916 24.75 10.0384 24.6035 9.02462 24.3105C8.01086 24.0176 7.06468 23.6016 6.18609 23.0625C5.30749 22.5234 4.50775 21.8789 3.78685 21.1289C3.06595 20.3789 2.4408 19.541 1.91139 18.6152C1.38198 17.6895 0.982106 16.7051 0.711769 15.6621C0.441432 14.6191 0.300632 13.5234 0.289368 12.375C0.289368 11.2383 0.430168 10.1426 0.711769 9.08789C0.99337 8.0332 1.39324 7.04883 1.91139 6.13477C2.42953 5.2207 3.04906 4.38867 3.76995 3.63867C4.49085 2.88867 5.29623 2.23828 6.18609 1.6875C7.07595 1.13672 8.02213 0.720703 9.02462 0.439453C10.0271 0.158203 11.0803 0.0117188 12.1842 0C13.2768 0 14.33 0.146484 15.3437 0.439453C16.3575 0.732422 17.3037 1.14844 18.1823 1.6875C19.0609 2.22656 19.8606 2.87109 20.5815 3.62109C21.3024 4.37109 21.9276 5.20898 22.457 6.13477C22.9864 7.06055 23.3863 8.04492 23.6566 9.08789C23.9269 10.1309 24.0677 11.2266 24.079 12.375C24.079 13.8398 23.8425 15.2402 23.3694 16.5762C22.8963 17.9121 22.2148 19.1484 21.3249 20.2852L22.288 21.2871C22.7611 21.7793 23.3356 22.3652 24.0114 23.0449C24.6873 23.7246 25.4194 24.4688 26.2079 25.2773C26.9964 26.0859 27.7961 26.9121 28.6071 27.7559C29.4182 28.5996 30.201 29.4199 30.9557 30.2168C31.7104 31.0137 32.3806 31.7344 32.9663 32.3789C33.5521 33.0234 34.0195 33.5566 34.3687 33.9785C34.7179 34.4004 34.8925 34.6641 34.8925 34.7695ZM12.1842 22.5C13.5246 22.5 14.7862 22.2363 15.9689 21.709C17.1516 21.1816 18.1823 20.4551 19.0609 19.5293C19.9395 18.6035 20.6322 17.5312 21.1391 16.3125C21.646 15.0938 21.905 13.7812 21.9163 12.375C21.9163 10.9805 21.6629 9.66797 21.156 8.4375C20.6491 7.20703 19.9507 6.13477 19.0609 5.2207C18.171 4.30664 17.1404 3.58594 15.9689 3.05859C14.7974 2.53125 13.5359 2.26172 12.1842 2.25C10.8438 2.25 9.58219 2.51367 8.39947 3.04102C7.21675 3.56836 6.18609 4.29492 5.30749 5.2207C4.4289 6.14648 3.73616 7.21875 3.22928 8.4375C2.7224 9.65625 2.46333 10.9688 2.45206 12.375C2.45206 13.7695 2.7055 15.082 3.21238 16.3125C3.71927 17.543 4.41763 18.6152 5.30749 19.5293C6.19735 20.4434 7.22801 21.1641 8.39947 21.6914C9.57093 22.2188 10.8325 22.4883 12.1842 22.5Z" fill="#03D764"/>
</g>
<defs>
<clipPath id="clip0_1_33">
<rect width="34.6031" height="36" fill="white" transform="translate(0.289368)"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -0,0 +1,57 @@
import { Component } from "react";
import UniverseItem from "../universe-item/universe-item";
import searchLogo from "./img/search.svg";
class UniverseList extends Component {
state = {};
render() {
const { data, picturesList, onUniverseProps } = this.props;
//Генерация университетов из списка на основе пропсов
const universes = data.map((item) => {
const { id, ...itemProps } = item;
return (
<UniverseItem
key={id}
pic={picturesList[id - 1]}
{...itemProps}
onUniverseProps={(e) => onUniverseProps(e)}
/>
);
});
return (
<section className="universe">
<div className="container container_flex">
<div className="row">
<div className="universe_input_block col-md-12">
<input
type="text"
className="universe_input"
placeholder="Введите название вуза или суза..."
/>
<img
src={searchLogo}
alt="search"
className="universe_search"
/>
</div>
{universes}
</div>
</div>
{/* Переключение активного слайдера в зависимости от секции */}
<div className="universe_slid">
<span className="universe_slid_active"></span>
<span className="universe_slid_disable"></span>
<span className="universe_slid_disable"></span>
<span className="universe_slid_disable"></span>
</div>
</section>
);
}
}
export default UniverseList;

View File

@ -1,20 +0,0 @@
import { Component } from "react";
import "./css/universe.css";
// import logo from "./img/logo/logoPayDay.png";
class Universe extends Component {
state = {};
render() {
return (
<div className="col-2 universe_card universe_card_text">
<img src={"none"} alt="universe" className="universe_icon" />
ЮФУ <span>от 135т руб</span>
</div>
);
}
}
export default Universe;