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

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

+48 -52
View File
@@ -94,28 +94,26 @@ function ContactForm() {
<Form method="post" onSubmit={handleSubmit} className="half contact-form">
<h2>Свяжитесь с нами!</h2>
<div className="inputs">
<div className="row">
<Field
key={1}
type="text"
name="name"
placeholder="Имя"
value={formData.name}
onChange={handleChange}
required
isDisabled={isSubmitting}
/>
<Field
key={2}
type="email"
name="email"
placeholder="E-mail"
value={formData.email}
onChange={handleChange}
required
isDisabled={isSubmitting}
/>
</div>
<Field
key={1}
type="text"
name="name"
placeholder="Имя"
value={formData.name}
onChange={handleChange}
required
isDisabled={isSubmitting}
/>
<Field
key={2}
type="email"
name="email"
placeholder="E-mail"
value={formData.email}
onChange={handleChange}
required
isDisabled={isSubmitting}
/>
<Field
key={3}
type="textarea"
@@ -126,36 +124,34 @@ function ContactForm() {
required
isDisabled={isSubmitting}
/>
<div className="row">
<Field
key={4}
type="file"
name="file"
onChange={handleFileChange}
handleRemoveFile={handleRemoveFile}
fileAttached={formData && formData.file ? true : false}
isDisabled={isSubmitting}
/>
<div className="submit-container">
{formData.captcha &&
<Field
key={5}
type="submit"
value={isSubmitting ? 'Отправляется' : 'Отправить'}
isDisabled={isSubmitting}
/>
}
<div
className="captcha-container"
style={formData.captcha ? { display: 'none' } : { display: 'block' }}
>
<SmartCaptcha
key={6}
sitekey="ysc1_8nFqhYasby2fJ9J7pCTxdBMe0Xc3Y6CrWk4aylB03d4f0045"
onSuccess={handleCaptchaChange}
onTokenExpired={handleTokenExpired}
/>
</div>
<Field
key={4}
type="file"
name="file"
onChange={handleFileChange}
handleRemoveFile={handleRemoveFile}
fileAttached={formData && formData.file ? true : false}
isDisabled={isSubmitting}
/>
<div className="submit-container">
{formData.captcha &&
<Field
key={5}
type="submit"
value={isSubmitting ? 'Отправляется' : 'Отправить'}
isDisabled={isSubmitting}
/>
}
<div
className="captcha-container"
style={formData.captcha ? { display: 'none' } : { display: 'block' }}
>
<SmartCaptcha
key={6}
sitekey="ysc1_8nFqhYasby2fJ9J7pCTxdBMe0Xc3Y6CrWk4aylB03d4f0045"
onSuccess={handleCaptchaChange}
onTokenExpired={handleTokenExpired}
/>
</div>
</div>
</div>
@@ -12,9 +12,13 @@ $color-file-button: rgb(7, 42, 200);
h2 {
margin-top: 0;
font-size: 26px;
font-size: 28px;
font-weight: 500;
line-height: 30px;
line-height: 44px;
@media (max-width: 768px) {
font-size: 20px;
}
}
.inputs {
@@ -30,11 +34,6 @@ $color-file-button: rgb(7, 42, 200);
background: dimgrey;
}
.row {
display: flex;
gap: $gap;
}
.field {
padding: 12px 16px;
border: none;
@@ -81,6 +80,9 @@ $color-file-button: rgb(7, 42, 200);
span {
display: inline-block;
font-size: 18px;
@media (max-width: 768px) {
font-size: 16px;
}
}
}
}
@@ -114,7 +116,7 @@ $color-file-button: rgb(7, 42, 200);
}
.submit-container {
//overflow: hidden;
.submit {
width: 100%;
cursor: pointer;
@@ -125,4 +127,6 @@ $color-file-button: rgb(7, 42, 200);
}
}
}
}
}
+69
View File
@@ -1,4 +1,5 @@
@import "../../assets/styles/theme.scss";
@import "bootstrap/scss/bootstrap"; // Подключение Bootstrap
#footer {
display: flex;
@@ -10,6 +11,16 @@
margin: 2em 0 0;
background: $bg-footer;
// Добавление SVG-фона
background-image: url("../../assets/images/backround/bg_footer_gray.svg");
background-repeat: no-repeat;
background-position: center bottom;
background-size: cover; // или `contain` в зависимости от эффекта
.container-fluid {
width: 100%;
}
.logo-container {
height: 70%;
max-width: 30%;
@@ -58,4 +69,62 @@
}
}
}
@media (max-width: 768px) {
flex-direction: column;
justify-content: center;
align-items: center;
width: 100vw;
height: auto; // Теперь футер адаптируется по контенту
padding: 1.5em 10%; // Увеличьте отступы для мобильной версии
position: relative; // Исправление проблемы с заливкой
.container-fluid {
display: flex;
flex-direction: column;
align-items: center;
gap: 2rem; // Регулирует расстояние между блоками
}
.logo-container {
height: auto;
max-width: 60%; // Увеличен логотип в мобильной версии
display: flex;
justify-content: center;
.logo {
height: auto;
width: 100%;
}
}
.contacts {
text-align: center;
gap: 0.5em;
width: 100%;
padding: 10px 0;
p {
font-size: 16px;
}
}
.links {
display: flex;
justify-content: center;
gap: 10px;
.link {
width: 45px;
transition: background 0.3s ease;
&:hover {
background-color: darken($bg-primary, 10%);//
}
.icon {
width: 65%;
height: 65%;
}
}
}
}
}
+1 -1
View File
@@ -8,7 +8,7 @@ function LabCard({ lab }) {
<h2>{lab.name}</h2>
<div className="hidden">
<p>{lab.previewText}</p>
<div className="link-label">Перейти &rarr;</div>
<div className="link-label">Перейти ⟶</div> {/*&rarr;*/}
</div>
</div>
</Link>
+55 -12
View File
@@ -1,29 +1,58 @@
@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, calc((100% - $row-gap * 2) / 3));
grid-template-columns: repeat(3, minmax(0, 1fr)); /* Используем 1fr для равных колонок */
justify-content: space-between;
gap: $row-gap;
max-width: 100%; // Гарантия, что не выйдет за границы
width: 100%;
box-sizing: border-box; // Учитываем padding и border внутри ширины
.card {
display: block;
position: relative;
height: 300px;
overflow: hidden;
position: relative;
border-radius: 8px;
border-width: 1px;
border-style: solid;
border-color: transparent;
color: $text-secondary;
background: $bg-card-lab;
border: 1px solid transparent;
.image {
position: absolute;
object-fit: cover;
width: 100%;
height: 100%;
opacity: 0.9;
transition: opacity .2s ease-out;
opacity: 1;
transition: opacity 0.3s ease-out;
}
.card-content {
@@ -32,11 +61,11 @@
inset: auto 20px 10px 20px;
transition: inset .3s;
background: none !important;
z-index: 2; /* Контент всегда сверху */
h2 {
margin: 0;
font-size: 24px;
font-size: 20px;
font-weight: 600;
line-height: 28px;
}
@@ -57,6 +86,7 @@
font-size: 20px;
font-weight: 500;
line-height: 24px;
}
}
}
@@ -73,7 +103,20 @@
&:hover .image {
transition: opacity .3s ease-in;
opacity: 0.5;
filter: brightness(0.5); /* Затемняем изображение */
}
}
}
}
// Медиа-запрос для мобильных устройств
@media (max-width: 768px) {
.row.lab-list {
grid-template-columns: repeat(1, minmax(0, 1fr));
}
.card {
width: 100%; /* Карточка занимает всю ширину своей колонки */
height: 215px !important; /* Устанавливаем минимальную высоту */
}
}
+22 -2
View File
@@ -3,6 +3,9 @@ import NavbarLink from './NavbarLink';
import { scb as logo } from '../../assets/images';
import './Navbar.styles.scss';
import React, { useState } from 'react'; //
import 'bootstrap/dist/css/bootstrap.min.css'; //
const mock = [
{
text: "НОВОСТИ",
@@ -32,13 +35,30 @@ const mock = [
];
function Navbar({ links = mock }) {
const [isOpen, setIsOpen] = useState(false);
const toggleMenu = () => {
setIsOpen(!isOpen);
};
const handleLinkClick = () => {
setIsOpen(false); // Закрываем меню при клике на ссылку
};
return (
<div id="navbar">
<NavbarLink className="logo-container" link={{ to: "/" }} >
<img src={logo} className="logo" alt="SCB logo" />
</NavbarLink>
<div className="bar">
{links.map((link, index) => <NavbarLink link={link} key={index} />)}
<div className="burger" onClick={toggleMenu}>
<span className={`line ${isOpen ? 'open' : ''}`}></span>
<span className={`line ${isOpen ? 'open' : ''}`}></span>
<span className={`line ${isOpen ? 'open' : ''}`}></span>
</div>
<div className={`bar ${isOpen ? 'open' : ''}`}>
{links.map((link, index) => (
<NavbarLink link={{ ...link, onClick: handleLinkClick }} key={index} />
))}
</div>
</div>
);
+52 -4
View File
@@ -1,9 +1,11 @@
@import "../../assets/styles/theme.scss";
@import "bootstrap/scss/bootstrap"; // Подключаем Bootstrap
#navbar {
position: fixed;
top: 0;
width: 80%;
width: 100vw; // 80%
max-width: 100vw; //
height: $navbar-height;
padding: $navbar-padding-tb 10%;
background-color: $bg-secondary;
@@ -18,14 +20,15 @@
height: 100%;
.logo {
width: 100%;
height: 100%;
width: 165px; // 100%
height: auto; // 100%
}
}
.bar {
display: flex;
align-items: center;
//flex-grow: 1; // Позволяем .bar занимать доступное пространство
.nav-link {
font-size: 16px;
@@ -43,8 +46,53 @@
background: $text-secondary;
}
}
// Телефонна версия
@media (max-width: 768px) {
padding: $navbar-padding-tb 5%;
.bar {
display: none; // Скрываем меню по умолчанию
flex-direction: column; // Вертикальное расположение
position: fixed;
top: 0; // Сдвигаем меню вниз под бургер-кнопку
right: 0; // Выравниваем по левому краю
background-color: $bg-secondary; // Фон меню
width: 50%; // Ширина меню равна ширине навбара
height: 200vh;
z-index: 9; // Убедитесь, что меню выше других элементов
padding: 60px 0px;
&.open {
display: flex; // Показываем меню при открытии
}
.nav-link {
padding: 10px 5px; // Отступы: 10px сверху и снизу, 5px слева и справа
width: 100%; // Занимаем всю ширину родительского элемента
text-align: left; // Выравнивание текста по левому краю
}
}
.burger {
position: relative;
display: flex;
flex-direction: column;
z-index: 10;
.line {
width: 25px;
height: 3px;
background-color: $text-secondary;
margin: 4px 0;
transition: all 0.3s ease;
}
}
}
}
#navbar.transparent{
#navbar.transparent {
background-color: transparent;
}
@@ -1,11 +1,37 @@
@import "../../assets/styles/theme.scss";
.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;
height: 250px;
@media (max-width: 768px) {
max-width: 100%;
height: 215px;
}
border-width: 1px;
border-style: solid;
border-color: transparent;
@@ -26,8 +52,8 @@
border-radius: 4px;
font-size: 20px;
font-weight: 500;
line-height: 24px;
font-weight: 600;
line-height: 28px;
color: $text-card-project;
}
}
@@ -9,4 +9,12 @@
.card {
flex: 1 1 30%;
}
}
@media (max-width: 768px) {
.project-list {
.card {
flex: 1 1 100%; // Карточки будут занимать всю ширину на мобильных
}
}
}
+34 -5
View File
@@ -5,24 +5,53 @@
& .slide-list {
display: flex;
align-items: center;
justify-content: center; /* Центрируем изображения */
gap: 32px; /* Отступ между картинками */
width: max-content;
width: 100%;
height: 100%;
transition: transform 0.5s ease-in-out;
margin: 0 auto;
padding: 10px 100px; /* Добавляем отступы по бокам */
& .slide {
flex: 1 0 100%;
flex: 1 0 50%;
max-width: 50%; /* Ограничение ширины */
position: relative;
display: flex;
justify-content: center; /* Центрируем контент */
& .slide-image {
display: flex;
max-height: 60vh;
max-width: calc(100% - 2 * (15% + 30px));
margin: 0 auto;
max-width: 100%;
border-radius: 8px;
}
}
}
}
/* Медиа-запрос для мобильных устройств */
@media (max-width: 768px) {
.slider {
& .slide-list {
justify-content: left;
gap: 0; /* Убираем лишние отступы */
padding: 0; /* Уменьшаем отступы */
}
& .slide-list .slide {
flex: 1 0 100%; /* Одна картинка в ряд */
max-width: 100%; /* Использует всю ширину */
display: flex;
justify-content: center; /* Центрируем */
}
& .slide-list .slide .slide-image {
max-width: 90%; /* Делаем изображение большим, но с небольшими отступами */
height: auto; /* Сохраняем пропорции */
max-height: 70vh; /* Ограничиваем высоту */
border-radius: 8px;
}
}
}
@@ -9,8 +9,8 @@
align-items: center;
height: 100%;
width: calc(100% - 30% + 60px);
left: calc(15% - 30px);
left: 0;
right: 0;
margin: 0 auto;
.arrow {
@@ -30,8 +30,12 @@
&:hover {
cursor: pointer;
}
&.left {
left: 0; /* Прижимаем левую кнопку к краю */
}
&.right {
right: 0; /* Прижимаем правую кнопку к краю */
transform: rotateY(180deg);
}
}