исправление размера добавление фона

This commit is contained in:
mimi committed 2025-02-18 12:50:02 +03:00
1 parent 4978c36070
commit ad810c6217
36 files changed
+1553 -135

No files matched your search

+1 -1
View File
@@ -10,7 +10,7 @@ export default function ErrorPage() {
id="error-page"
>
<h1 className="mt-0">Oops!</h1>
<p>Sorry, an unexpected error has occurred.</p>
<p className="text-break text-center" >Sorry, an unexpected error has occurred.</p>
<p>
<i>{error.statusText || error.message}</i>
</p>
+1 -1
View File
@@ -41,4 +41,4 @@ function Main() {
);
}
export default Main;
export default Main;
+42 -7
View File
@@ -23,21 +23,41 @@
display: flex;
flex-direction: column;
// Телефонная версия
@media (max-width: 768px) {
top: 30%;
padding: $navbar-padding-tb 5%;
}
h1 {
font-size: 60px;
font-size: 52px; //
font-weight: 600;
line-height: 63px;
line-height: 63px; //
margin: 0;
margin-bottom: 24px;
@media (max-width: 768px) {
font-size: 32px; // Уменьшаем размер шрифта на мобильных устройствах
line-height: 40px; // Уменьшаем межстрочное расстояние
}
}
h2 {
font-size: 24px;
font-weight: 400;
line-height: 36px;
@media (max-width: 768px) {
font-size: 24px;
line-height: 28px;
}
}
.btn {
margin: 0;
margin-top: 24px;
}
}
}
@@ -48,9 +68,15 @@
font-family: Montserrat;
font-size: 36px;
font-weight: 600;
line-height: 44px;
margin-top: 1.5rem;
margin-bottom: 1.5rem;
@media (max-width: 768px) {
font-size: 24px; // Уменьшаем размер заголовка на мобильных
}
}
.heading {
@@ -59,16 +85,25 @@
align-items: center;
a {
font-size: 24px;
font-weight: 400;
line-height: 29px;
font-size: 20px;
font-weight: 500;
text-align: right;
color: $text-primary;
@media (max-width: 768px) {
font-size: 16px;
}
}
}
}
.block:not(:last-child) {
.block:not(:last-child) {
margin-bottom: 32px;
}
@media (max-width: 768px) {
#mainpageheader {
padding: 0; // Уменьшаем padding на мобильных устройствах
}
}
}
@@ -5,7 +5,7 @@ function BlockHeading({ heading, link, linkText }) {
<div className="heading">
<h1>{heading}</h1>
{link && linkText &&
<Link to={link}>{linkText} &rarr;</Link>
<Link to={link}>{linkText}</Link>// убрала стрелочку &rarr;
}
</div>
);
@@ -4,10 +4,12 @@ import './ContactUs.styles.scss';
function ContactUs() {
return (
<div className="block" id="contact-us">
<h1 className="half">Нужна помощь?<br/> Команда способных IT-специалистов готова вам помочь!</h1>
<ContactForm />
</div>
<><br />
<div className="block" id="contact-us">
<h1 className="half">Нужна помощь?<br /> Команда способных IT-специалистов готова вам помочь!</h1>
<ContactForm />
</div>
</>
);
}
@@ -11,9 +11,26 @@
.contact-form {
flex: 1 1 35%;
.row {
flex-direction: column;
}
}
}
}
@media (max-width: 768px) {
#contact-us {
gap: 0;
flex-direction: column; // Ставим элементы в колонку
align-items: stretch; // Центрируем контент
width: 100%; // Убедимся, что блок занимает всю ширину
margin: 0;
padding: 0;
}
.contact-form {
max-width: 100%; // Ограничиваем ширину формы на 100% экрана
max-width: 100%;
margin: 0; // Убираем внешние отступы
padding: 0; // Убираем внутренние отступы
box-sizing: border-box; // Учитываем границы и padding в ширине
}
}
@@ -4,10 +4,10 @@ import './Gallery.styles.scss';
function Gallery() {
return (
<div className="block gallery">
<h1>СКБ «КИТ» - реальные технологические проекты<br />
под руководством наставников<br />
из университета и бизнеса.</h1>
<div id="gallery"><br />
<h1>СКБ «КИТ» - реальные технологические<br />
проекты под руководством наставников<br />
из университета и бизнеса.</h1><br />
<Slider />
</div>
);
@@ -2,6 +2,28 @@
margin-left: 0;
margin-right: 0;
position: relative;
&::before {
content: "";
position: absolute;
top: 35%;
left: 0;
width: 100%; // Увеличиваем ширину на 10%, чтобы занять отступ
height: 307px;
background-image: url('../../../../assets/images/backround/bg_gallery_block.svg');
background-repeat: no-repeat;
background-position: right center;
background-size: contain; // Или cover, если нужно заполнить область
z-index: -1;
transform: translateX(12.5%); // Смещаем влево, компенсируя padding
@media (max-width: 768px) {
display: none; // Скрываем картинку на мобильных
}
}
h1 {
width: 80%;
margin-left: auto;
@@ -12,5 +34,9 @@
line-height: 35px;
letter-spacing: 0em;
text-align: center;
@media (max-width: 768px) {
font-size: 22px;
}
}
}
+2
View File
@@ -29,12 +29,14 @@ const mock = [
function News({ news = mock }) {
return (
<><br/>
<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 } />) }
</div>
</div>
</>
);
}
@@ -1,22 +1,61 @@
#news {
position: relative;
&::before {
content: "";
position: absolute;
top: 20%;
left: 0;
width: 100%; // Увеличиваем ширину на 10%, чтобы занять отступ
height: 364px;
background-image: url('../../../../assets/images/backround/bg_news_block.svg');
background-repeat: no-repeat;
background-position: left center;
background-size: contain; // Или cover, если нужно заполнить область
z-index: -1;
transform: translateX(-12.6%); // Смещаем влево, компенсируя padding
@media (max-width: 768px) {
display: none; // Скрываем картинку на мобильных
}
}
.row {
display: flex;
justify-content: space-between;
gap: 32px;
//gap: 32px;
@media (max-width: 768px) {
gap: 32px;
}
.card {
width: 350px;
width: 100%; /* Заменяем фиксированную ширину на 100% */
max-width: 300px; /* Ограничиваем максимальную ширину */
margin-bottom: 1em;
border: none; // Убедитесь, что граница отсутствует
font-size: 20px; //
font-weight: 500; //
@media (max-width: 768px) {
max-width: 100%; /* Ограничиваем максимальную ширину */
font-size: 16px;
}
.pic {
width: 100%;
aspect-ratio: 1;
margin-bottom: .5em;
@media (max-width: 768px) {
aspect-ratio: auto;
}
.image {
width: 100%;
height: 100%;
object-fit: cover;
@media (max-width: 768px) {
height: 215px;
}
}
}
}
@@ -1,15 +1,9 @@
#react-page .content #partners {
margin-left: 0;
margin-right: 0;
.heading {
margin-left: 10%;
margin-right: 10%;
}
.scroll-carousel-viewport {
height: 200px;
.scroll-carousel-slider {
height: 100%;
@@ -22,7 +16,7 @@
width: 100%;
height: 100%;
border-radius: 100%;
object-fit: contain;
//object-fit: contain;
}
}
}
+54 -2
View File
@@ -1,11 +1,13 @@
import { Outlet } from "react-router-dom";
import { createContext, useEffect } from 'react';
import { createContext, useEffect, useState } from 'react';
import useElementOnScreen from '../../lib/useElementOnScreen';
import Navbar from '../../components/Navbar';
import Footer from '../../components/Footer';
import './Root.styles.scss';
import { up } from '../../assets/images';
export const RootContext = createContext();
function Root() {
@@ -15,6 +17,9 @@ function Root() {
threshold: 0.6,
});
const [isVisible_, setIsVisible] = useState(false); // Состояние для видимости кнопки
const [hasScrolled, setHasScrolled] = useState(false); // Новый флаг для отслеживания прокрутки
useEffect(() => {
const navbar = document.getElementById('navbar');
if (isVisible) {
@@ -22,7 +27,46 @@ function Root() {
} else {
navbar.classList.remove('transparent');
}
}, [isVisible]);
setTimeout(() => {
document.body.classList.add('page-loaded');
}, 100); // Небольшая задержка, чтобы избежать мерцания
const handleScroll = () => {
const headerHeight = document.getElementById('mainpageheader')?.offsetHeight || 0;
if (window.scrollY > headerHeight && !hasScrolled) {
setHasScrolled(true); // Обновим флаг, когда пользователь прокрутит страницу
}
setIsVisible(window.scrollY > headerHeight); // Показываем кнопку
};
window.addEventListener('scroll', handleScroll);
return () => {
window.removeEventListener('scroll', handleScroll);
};
}, [isVisible, hasScrolled]);
// Ускоренный плавный скролл вверх
const scrollToTop = () => {
const startPosition = window.scrollY;
const startTime = performance.now();
const scrollDuration = 800; // Увеличили время для суперплавности
// Функция плавного ускорения и замедления (easeInOutCubic)
const easeInOutCubic = (t) => t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2;
const animateScroll = (currentTime) => {
const elapsedTime = currentTime - startTime;
const progress = Math.min(elapsedTime / scrollDuration, 1); // От 0 до 1
window.scrollTo(0, startPosition * (1 - easeInOutCubic(progress))); // Гладкий скролл
if (progress < 1) {
requestAnimationFrame(animateScroll);
}
};
requestAnimationFrame(animateScroll);
};
return (
<RootContext.Provider value={{ setRef }}>
@@ -31,6 +75,14 @@ function Root() {
<Outlet />
</div>
<Footer />
{hasScrolled && (
<button
className={`scroll-to-top ${isVisible_ ? 'visible' : 'hidden'}`}
onClick={scrollToTop}
>
<img src={up} alt="Scroll to top" />
</button>
)}
</RootContext.Provider>
);
}
+93 -1
View File
@@ -1,11 +1,34 @@
@import "../../assets/styles/theme.scss";
#root {
background-image: url('/assets/images/backround/bg_footer.svg');
background-repeat: no-repeat;
background-position: center bottom;
background-size: 100% auto;
z-index: 0; // Измените на 0 или больше
position: relative;
opacity: 0;
visibility: hidden;
}
.page-loaded #root {
opacity: 1;
visibility: visible;
}
#react-page {
margin-top: calc($navbar-height + 5 * $navbar-padding-tb);
.header, .content {
margin-left: 10%;
margin-right: 10%;
@media (max-width: 768px) {
margin-left: 5%;
margin-right: 5%;
}
}
.content {
@@ -39,4 +62,73 @@
#navbar .nav-link:hover:after,
#navbar .nav-link.active:after {
width: 100%;
}
}
.scroll-to-top {
position: fixed;
right: 2%;
bottom: 15%;
background-color: white;
border-radius: 50%;
width: 61px;
height: 61px;
z-index: 1000;
@media (max-width: 768px) {
width: 45px;
height: 45px;
bottom: 24px;
padding: 0;
}
border: none;
cursor: pointer;
opacity: 0;
transform: scale(0);
transition: opacity 0.3s ease, transform 0.3s ease;
animation: scaleIn 0.5s forwards; /* Анимация появления */
box-shadow: 5px 6px 15px rgba(0, 0, 0, 0.05);
&.visible {
opacity: 1;
transform: scale(1);
box-shadow: 5px 6px 15px rgba(0, 0, 0, 0.1);
}
&.hidden {
opacity: 0;
transform: scale(0);
animation: scaleOut 0.5s forwards; /* Анимация исчезновения */
}
img {
height: auto;
@media (max-width: 768px) {
width: 56%;
height: 56%;
}
}
}
/* Анимация для появления кнопки */
@keyframes scaleIn {
0% {
opacity: 0;
transform: scale(0);
}
100% {
opacity: 1;
transform: scale(1);
}
}
/* Анимация для исчезновения кнопки */
@keyframes scaleOut {
0% {
opacity: 1;
transform: scale(1);
}
100% {
opacity: 0;
transform: scale(0);
}
}