Merge branch 'master' into feature/wpmedia

This commit is contained in:
Ifraim Solomonov authored and GitHub committed 2024-04-16 15:41:31 +03:00
commit 8b78077502
24 files changed
+205 -75

No files matched your search

+24 -5
View File
@@ -1,13 +1,32 @@
import { useContext, useEffect } from 'react';
import { HashLink } from 'react-router-hash-link';
import { News, Projects, Labs, Partners, Gallery, ContactUs } from './components';
import { RootContext } from '../Root';
import './Main.styles.scss';
function Main() {
const { setRef } = useContext(RootContext);
useEffect(() => {
const navbar = document.getElementById("navbar");
navbar.classList.add('transparent'); // Mount
return () => {
navbar.classList.remove('transparent'); // Unmount
}
}, [])
return (
<>
<header className="header">
<h1>Думай иначе, будь креативным!</h1>
<h2>Студенческое конструкторское бюро<br/>
"Компьютерное инновационное творчество"</h2>
<a className="btn" href="">Связаться с нами</a>
<header id="mainpageheader" ref={element => setRef(element)}>
<div className="container">
<h1>Думай иначе, будь креативным!</h1>
<h2>Студенческое конструкторское бюро<br />
"Компьютерное инновационное творчество"</h2>
<HashLink smooth to="#contact-us" className="btn">Связаться с нами</HashLink>
</div>
</header>
<div className="content">
<News />
+40
View File
@@ -0,0 +1,40 @@
@import "../../assets/styles/theme.scss";
#page:has(> #mainpageheader) {
margin-top: 0;
#mainpageheader {
position: relative;
height: 100vh;
padding: 0 10%;
color: $text-secondary;
background-image: url(/assets/images/car.jpeg);
background-color: $bg-image;
background-blend-mode: multiply;
background-position: center;
background-size: cover;
.container {
position: absolute;
top: 40%;
display: flex;
flex-direction: column;
h1 {
font-size: 60px;
font-weight: 600;
line-height: 63px;
margin: 0;
}
h2 {
font-size: 24px;
font-weight: 400;
line-height: 36px;
}
}
}
}
@@ -4,7 +4,7 @@ import './ContactUs.styles.scss';
function ContactUs() {
return (
<div className="block contact-us">
<div className="block" id="contact-us">
<h1 className="half">Нужна помощь?<br/> Команда способных IT-специалистов готова вам помочь!</h1>
<ContactForm />
</div>
@@ -1,10 +1,14 @@
.contact-us {
#contact-us {
display: flex;
justify-content: space-between;
align-items: flex-start;
gap: 60px;
.half {
flex: 1 1 50%;
flex: 0 0 50%;
}
.contact-form {
max-width: 500px;
}
}
@@ -1,4 +1,4 @@
#page .content .gallery {
#page .content #gallery {
margin-left: 0;
margin-right: 0;
+1 -1
View File
@@ -51,7 +51,7 @@ const mock = [
function Labs({ labs = mock }) {
return (
<div className="block labs">
<div className="block" id="labs">
<BlockHeading heading="Наши лаборатории" />
<div className="row">
{ labs.map( lab => <LabCard key={ lab.id } lab={ lab } />) }
@@ -1,6 +1,6 @@
@import "../../../../assets/styles/theme.scss";
.labs {
#labs {
.row {
display: flex;
flex-wrap: wrap;
+1 -1
View File
@@ -29,7 +29,7 @@ const mock = [
function News({ news = mock }) {
return (
<div className="block news">
<div className="block" id="news">
<BlockHeading heading='Новости' linkText='Все новости' link='https://vk.com/skbkit' />
<div className="row">
{ news.map(item => <NewsCard key={ item.id } news={ item } />) }
@@ -1,4 +1,4 @@
.news {
#news {
.row {
display: flex;
justify-content: space-between;
@@ -43,7 +43,7 @@ const mock = [
function Partners({ partners = mock }) {
return (
<div className="block partners">
<div className="block" id="partners">
<BlockHeading heading="Наши партнеры" />
<ScrollCarousel
autoplay
@@ -1,4 +1,4 @@
#page .content .partners {
#page .content #partners {
margin-left: 0;
margin-right: 0;
@@ -38,7 +38,7 @@ const mock = [
function Projects({ projects = mock }) {
return (
<div className="block projects">
<div className="block" id="projects">
<BlockHeading heading="Наши проекты" linkText="Все проекты" link="/projects" />
<div className="row">
{projects.map(item => <ProjectCard key={ item.id } project={item} />)}
@@ -1,6 +1,6 @@
@import "../../../../assets/styles/theme.scss";
.projects {
#projects {
.row {
display: flex;
+25 -4
View File
@@ -1,24 +1,45 @@
import { Outlet } from 'react-router-dom';
import { Outlet } from "react-router-dom";
import { createContext, useEffect } from 'react';
import { getMedia } from '../../api';
import { getMedia } from "../../api";
import useElementOnScreen from '../../lib/useElementOnScreen';
import Navbar from '../../components/Navbar';
import Footer from '../../components/Footer';
import './Root.styles.scss';
export const RootContext = createContext();
async function loader() {
const media = getMedia();
return { media };
}
function Root() {
const [setRef, isVisible] = useElementOnScreen({
root: null,
rootMargin: '0px',
threshold: 0.6,
});
useEffect(() => {
const navbar = document.getElementById('navbar');
if (isVisible) {
navbar.classList.add('transparent');
} else {
navbar.classList.remove('transparent');
}
}, [isVisible]);
return (
<>
<RootContext.Provider
value={{ setRef }}
>
<Navbar />
<div id="page">
<Outlet />
</div>
<Footer />
</>
</RootContext.Provider>
);
}
+5 -34
View File
@@ -1,36 +1,7 @@
@import "../../assets/styles/theme.scss";
#page {
.header {
height: 100vh;
padding: 0 10%;
display: flex;
flex-direction: column;
color: $text-secondary;
background-image: url(/assets/images/car.jpeg);
background-color: $bg-image;
background-blend-mode: multiply;
background-position: center;
background-size: cover;
h1 {
font-size: 60px;
font-weight: 600;
line-height: 63px;
margin-top: 40vh;
margin-bottom: 0;
}
h2 {
font-size: 24px;
font-weight: 400;
line-height: 36px;
}
}
margin-top: calc($navbar-height + 3 * $navbar-padding-tb);
.content {
background: $bg-primary;
@@ -65,12 +36,12 @@
}
.block .heading a,
.navbar .nav-link {
#navbar .nav-link {
position: relative;
}
.block .heading a::after,
.navbar .nav-link::after {
#navbar .nav-link::after {
position: absolute;
content: '';
left: 50%;
@@ -87,7 +58,7 @@
}
.block .heading a:hover:after,
.navbar .nav-link:hover:after,
.navbar .nav-link.active:after {
#navbar .nav-link:hover:after,
#navbar .nav-link.active:after {
width: 100%;
}
+1 -1
View File
@@ -1 +1 @@
export { default as Root, loader } from './Root';
export { default as Root, RootContext, loader } from './Root';