внесла изменения в блок новосте, убрала баг с Баг с Наши лаборатории, мигание карточки

This commit is contained in:
mimi committed 2025-02-20 15:13:04 +03:00
1 parent d1fb20b3f0
commit 9ff2df78e8
25 files changed
+701 -126

No files matched your search

@@ -6,8 +6,11 @@ $color-file-button: rgb(7, 42, 200);
.contact-form {
padding: 20px 22px;
border-radius: 16px;
height: 700px;
background-color: $bg-form;
@media (max-width: 768px) {
height: 100%;
}
h2 {
margin-top: 0;
@@ -44,9 +47,12 @@ $color-file-button: rgb(7, 42, 200);
}
.field.big {
height: 200px;
height: 300px;
line-height: 30px;
resize: none;
@media (max-width: 768px) {
height: 200px;
}
}
.file-input-container {
+5 -1
View File
@@ -12,7 +12,7 @@
background: $bg-footer;
// Добавление SVG-фона
background-image: url("../../assets/images/backround/bg_footer_gray.svg");
background-image: url("../../assets/images/backround/bg_footer_gray_02.svg");
background-repeat: no-repeat;
background-position: center bottom;
background-size: cover; // или `contain` в зависимости от эффекта
@@ -127,4 +127,8 @@
}
}
}
#root:has(#mainpageheader) #footer {
background-image: url("../../assets/images/backround/bg_footer_gray.svg");
}
+1 -23
View File
@@ -1,28 +1,6 @@
@import "../../assets/styles/theme.scss";
.row.lab-list {
position: relative;
&::before {
content: "";
position: absolute;
top: 10%;
left: 0;
width: 100%; // Увеличиваем ширину на 10%, чтобы занять отступ
height: 436px;
background-image: url('../../assets/images/backround/bg_labs_block.svg');
background-repeat: no-repeat;
background-position: left center;
background-size: contain; // Или cover, если нужно заполнить область
z-index: -1;
transform: translateX(-11.6%); // Смещаем влево, компенсируя padding
@media (max-width: 768px) {
display: none; // Скрываем картинку на мобильных
}
}
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr)); /* Используем 1fr для равных колонок */
@@ -36,7 +14,7 @@
display: block;
position: relative;
height: 300px;
overflow: hidden; /* Чтобы контент не выходил за границы и карточка не мигала*/
border-radius: 8px;
border-width: 1px;
border-style: solid;
+13 -4
View File
@@ -1,11 +1,13 @@
import NavbarLink from './NavbarLink';
import { scb as logo } from '../../assets/images';
import { scb as logo, scb_blue as logo_02 } from '../../assets/images';
import './Navbar.styles.scss';
import React, { useState } from 'react'; //
import React, { useState, useEffect } from 'react'; //
import 'bootstrap/dist/css/bootstrap.min.css'; //
import { useLocation } from 'react-router-dom'; // Импортируем useLocation
const mock = [
{
text: "НОВОСТИ",
@@ -36,7 +38,9 @@ const mock = [
function Navbar({ links = mock }) {
const [isOpen, setIsOpen] = useState(false);
const location = useLocation(); // Получаем текущий путь
const [logoToDisplay, setLogoToDisplay] = useState(logo); // Используем useState для хранения логотипа
const toggleMenu = () => {
setIsOpen(!isOpen);
};
@@ -45,10 +49,15 @@ function Navbar({ links = mock }) {
setIsOpen(false); // Закрываем меню при клике на ссылку
};
useEffect(() => {
// Обновляем логотип в зависимости от текущего пути
setLogoToDisplay(location.pathname === "/" ? logo : logo_02);
}, [location]); // Каждый раз, когда путь изменяется, выполняется этот код
return (
<div id="navbar">
<NavbarLink className="logo-container" link={{ to: "/" }} >
<img src={logo} className="logo" alt="SCB logo" />
<img src={logoToDisplay} className="logo" alt="SCB logo" />
</NavbarLink>
<div className="burger" onClick={toggleMenu}>
<span className={`line ${isOpen ? 'open' : ''}`}></span>
+36 -9
View File
@@ -6,10 +6,10 @@
top: 0;
width: 100vw; // 80%
max-width: 100vw; //
height: $navbar-height;
height: 108px;
padding: $navbar-padding-tb 10%;
background-color: $bg-secondary;
z-index: 10;
background-color:rgb(255, 255, 255);
z-index: 100;
transition: height .3s ease-out, background-color .3s ease-out;
display: flex;
@@ -17,10 +17,12 @@
align-items: center;
.nav-link:has(> .logo) {
display: flex;
height: 100%;
align-items: center; // Центрируем элементы по высоте
.logo {
width: 165px; // 100%
width: $navbar-logo-height; // 100%
height: auto; // 100%
}
}
@@ -37,7 +39,7 @@
letter-spacing: 0em;
padding: .25em;
margin-left: 40px;
color: $text-secondary;
color: black;
text-decoration: none;
text-wrap: nowrap;
}
@@ -49,15 +51,20 @@
// Телефонна версия
@media (max-width: 768px) {
height: $navbar-height;
padding: $navbar-padding-tb 5%;
.nav-link:has(> .logo) .logo {
width: $navbar-logo-mini-height; // 100%
}
.bar {
display: none; // Скрываем меню по умолчанию
flex-direction: column; // Вертикальное расположение
position: fixed;
top: 0; // Сдвигаем меню вниз под бургер-кнопку
right: 0; // Выравниваем по левому краю
background-color: $bg-secondary; // Фон меню
background-color: white; // Фон меню
width: 50%; // Ширина меню равна ширине навбара
height: 200vh;
z-index: 9; // Убедитесь, что меню выше других элементов
@@ -83,7 +90,7 @@
.line {
width: 25px;
height: 3px;
background-color: $text-secondary;
background-color: black;
margin: 4px 0;
transition: all 0.3s ease;
}
@@ -93,6 +100,26 @@
}
#navbar.transparent {
background-color: transparent;
#root:has(#mainpageheader) #navbar {
background-color: $bg-secondary;
//height: $navbar-height;
@media (max-width: 768px) {
.bar {
background-color: $bg-secondary; // Фон меню
}}
.bar .nav-link {
color: $text-secondary;
}
.nav-link:has(> .logo) .logo {
//width: $navbar-logo-mini-height; // 100%
}
.burger .line {
background-color: $text-secondary;
}
}
#root:has(#mainpageheader) #navbar.transparent {
background-color: transparent !important;
}
+23 -14
View File
@@ -1,44 +1,53 @@
$news-card-gap: 1em;
#news {
#news-list {
.row {
display: grid;
display: flex;
flex-wrap: wrap; // Чтобы карточки корректно переносились
gap: $news-card-gap;
justify-content: space-between; // Равномерное распределение карточек
.card {
width: 100%;
aspect-ratio: 1/1;
padding: 0;
margin-bottom: 1em;
display: flex;
flex-direction: column;
position: relative;
border: none;
margin-bottom: 1em; // Отступ снизу
@media (max-width: 768px) {
width: 100%; // 1 карточка в ряд на мобильных
height: 215px; // Меньшая высота для мобильных
}
.pic {
aspect-ratio: 1 / 1;
position: relative;
width: 100%;
height: 0;
padding-top: 100%;
height: 100%;
border-radius: 8px; // Округляем углы изображения
overflow: hidden; // Обрезаем лишнее
.image {
position: absolute;
top: 0;
width: 100%;
height: 100%;
object-fit: cover;
object-position: top; // Устанавливаем позицию обрезки сверху
border-radius: 8px; // Округление углов изображения
}
.label {
position: absolute;
width: 100%;
box-sizing: border-box;
min-height:15%;
padding: 22px 16px;
left: 0;
bottom: 0;
border-radius: 0 0 8px 8px;
font-size: 20px;
font-weight: 500;
font-weight: 600;
line-height: 24px;
color: white;
background: rgba(0, 0, 0, 0.5);
background: rgba(0, 0, 0, 0.6);
}
}
}
+2 -2
View File
@@ -11,7 +11,7 @@ function NewsList({ isMainPage = false }) {
const [newsList, setNewsList] = useState();
const [isFullList, setIsFullList] = useState(false);
const count = isMainPage ? 4 : 6;
const count = isMainPage ? 4 : 8;
useEffect(() => {
const loadData = async () => {
@@ -25,7 +25,7 @@ function NewsList({ isMainPage = false }) {
return (
<>
{newsList ? (
<div id="news">
<div id="news-list">
<div className="row">
{newsList.map(item => <NewsCard key={item.id} news={item} />)}
</div>
@@ -2,28 +2,6 @@
.project-list {
position: relative;
&::before {
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%; // Увеличиваем ширину на 10%, чтобы занять отступ
height: 465px;
background-image: url('../../assets/images/backround/bg_projects_block.svg');
background-repeat: no-repeat;
background-position: right center;
background-size: contain; // Или cover, если нужно заполнить область
z-index: -1;
transform: translateX(11.3%); // Смещаем влево, компенсируя padding
@media (max-width: 768px) {
display: none; // Скрываем картинку на мобильных
}
}
.card {
display: block;
position: relative;
+1 -1
View File
@@ -1 +1 @@
export { default } from './VKvideo';
export { default } from './VKvideo.jsx';