перенес структуру Севы со своими правками

This commit is contained in:
ifraimka1 committed 2025-04-01 15:25:46 +03:00
1 parent 3a1cac0dfe
commit 808d97eb4b
331 files changed
+12260 -19950

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
import "./styles/App.scss";
import { Suspense } from "react";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { classNames } from "@/shared/lib/classNames/classNames";
import { RouterProvider } from "react-router-dom";
import { appRouter } from "@/app/providers/router";
function App() {
// Создаём экземпляр QueryClient
const queryClient = new QueryClient();
return (
<>
<div className={classNames("app", {}, [])}>
<Suspense fallback="loading">
<div className="content-page">
<QueryClientProvider client={queryClient}>
<RouterProvider router={appRouter} />
</QueryClientProvider>
</div>
</Suspense>
</div>
</>
);
}
export default App;
+161
View File
@@ -0,0 +1,161 @@
// Общий стиль
#root {
position: relative; // Убедитесь, что #root имеет relative
background-repeat: no-repeat;
background-position: center bottom;
background-image: url("/assets/images/backround/bg_footer_02.svg");
background-size: 100% auto;
z-index: 0; // Задний план
opacity: 0; // Сделаем #root видимым сразу
min-height: 100vh; // Устанавливаем минимальную высоту для #root
// Псевдоэлемент для фона в верхней части страницы
&::before {
content: "";
position: absolute;
top: 160px;
left: 0; // Слева
width: 100%; // На всю ширину
height: 364px; // Ограничиваем максимальную высоту
background-image: url("../../assets/images/backround/bg_news_block.svg"); // Картинка
background-repeat: no-repeat;
background-position: left center;
background-size: contain;
z-index: -1; // Картинка на заднем плане, за остальными элементами
@media (max-width: 768px) {
display: none; // Прячем картинку на мобильных устройствах
}
}
}
// Для главной страницы
#root:has(> #react-page #mainpageheader) {
background-image: url("/assets/images/backround/bg_footer.svg");
&::before {
background-image: none;
}
}
#react-page:has(> #mainpageheader) {
margin-top: 0;
}
.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 {
background: $bg-primary;
//padding: 0 1em;
border-radius: 8px;
display: flex;
flex-direction: column;
//box-shadow: 0px 6px 15px rgba(0, 0, 0, 0.1);
}
}
.block .heading a,
#navbar .nav-link {
position: relative;
}
.block .heading a::after,
#navbar .nav-link::after {
position: absolute;
content: "";
left: 50%;
transform: translateX(-50%);
bottom: 0;
display: block;
width: 0;
height: 1px;
transition: 0.3s;
}
.block .heading a::after {
background: $text-primary;
}
.block .heading a:hover:after,
#navbar .nav-link:hover:after,
#navbar .nav-link.active:after {
width: 100%;
}
.scroll-to-top {
position: fixed;
right: 2vw; // Используем vw для адаптивности
bottom: 7.5vh; // Используем vh для адаптивности
background-color: white;
border-radius: 50%;
width: 61px;
height: 61px;
z-index: 10;
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;
}
}
/* Анимация для появления кнопки */
@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);
}
}
@media (max-width: 768px) {
.scroll-to-top {
display: none; // Скрыть кнопку на мобильных устройствах
}
}
+96
View File
@@ -0,0 +1,96 @@
import { Outlet, useLocation } from "react-router-dom";
import { createContext, useEffect, useState } from "react";
import "./Root.styles.scss";
import up from "@/shared/assets/images/up.svg";
import useElementOnScreen from "@/shared/lib/ElementOnScreen/ElementOnScreen";
import Navbar from "@/widgets/Navbar";
import Footer from "@/widgets/Footer";
// Тип для контекста
interface RootContextType {
setRef: (element: HTMLElement | null) => void;
}
// Создаем контекст с типом
export const RootContext = createContext<RootContextType>({ setRef: () => {} });
function Root() {
const location = useLocation(); // Хук для получения текущего пути
const [setRef, isTargetVisible] = useElementOnScreen({
root: null,
rootMargin: "0px",
threshold: 0.9,
});
const [isOnTopVisible, setIsOnTopVisible] = useState<boolean>(false); // Состояние для видимости кнопки
const [hasScrolled, setHasScrolled] = useState<boolean>(false); // Флаг для отслеживания прокрутки
// Для навбара
useEffect(() => {
const navbar = document.getElementById("navbar");
if (navbar) {
if (isTargetVisible) {
navbar.classList.add("transparent");
} else {
navbar.classList.remove("transparent");
}
}
}, [isTargetVisible]);
// Для кнопки OnTop
useEffect(() => {
setTimeout(() => {
document.body.classList.add("page-loaded");
}, 100); // Небольшая задержка, чтобы избежать мерцания
const handleScroll = () => {
const headerHeight =
document.getElementById("mainpageheader")?.offsetHeight || 0;
if (window.scrollY > headerHeight && !hasScrolled) {
setHasScrolled(true);
}
setIsOnTopVisible(window.scrollY > headerHeight); // Показываем кнопку
};
window.addEventListener("scroll", handleScroll);
return () => {
window.removeEventListener("scroll", handleScroll);
};
}, [hasScrolled]);
// Ускоренный плавный скролл вверх
const scrollToTop = () => {
window.scrollTo({
top: 0,
behavior: "smooth",
});
};
// Определяем, находимся ли мы на главной странице
const isHomePage = location.pathname === "/";
return (
<RootContext.Provider value={{ setRef }}>
<Navbar />
<div
id="react-page"
style={{ marginTop: isHomePage ? "0px" : "" }} // Устанавливаем margin-top
>
<Outlet />
</div>
<Footer />
{hasScrolled && (
<button
className={`scroll-to-top ${isOnTopVisible ? "visible" : "hidden"}`}
onClick={scrollToTop}
>
<img src={up} alt="Scroll to top" />
</button>
)}
</RootContext.Provider>
);
}
export default Root;
+3
View File
@@ -0,0 +1,3 @@
import { appRouter } from "./ui/AppRouter";
export { appRouter };
+14
View File
@@ -0,0 +1,14 @@
import Root from "@/app/Layout/Root";
import { routeConfig } from "@/shared/config/routeConfig/routeConfig";
import { createBrowserRouter } from "react-router-dom";
export const appRouter = createBrowserRouter([
{
element: <Root />,
children: Object.values(routeConfig).map((route) => ({
path: route.path,
element: route.element,
})),
},
]);
+86
View File
@@ -0,0 +1,86 @@
@import "bootstrap/scss/bootstrap";
@import "global";
@import "variables/variables";
@import "reset";
@font-face {
font-family: "Montserrat";
font-style: normal;
font-weight: 100 900;
font-display: swap;
src: url("../fonts/Montserrat/Montserrat-VariableFont_wght.ttf")
format("truetype");
}
.app {
min-height: 100%;
}
#page {
> #header,
> hr,
> #footer {
display: none;
}
}
.mainContainer {
margin: 0 10%;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
margin-bottom: 30px;
@include mediaMax($mobile-xs-width) {
margin: 0 5%;
margin-bottom: 30px;
}
}
.loader {
width: 336px; /* 48px * 7 */
height: 280px; /* 40px * 7 */
margin-top: 210px; /* 30px * 7 */
display: inline-block;
position: relative;
background: #6ebeff;
border-radius: 15% 15% 35% 35%;
}
.loader::after {
content: "";
box-sizing: border-box;
position: absolute;
left: 315px; /* 45px * 7 */
top: 56px; /* 8px * 7 */
border: 28px solid #6ebeff; /* 4px * 7 */
width: 112px; /* 16px * 7 */
height: 140px; /* 20px * 7 */
border-radius: 0 28px 28px 0; /* 4px * 7 */
}
.loader::before {
content: "";
position: absolute;
width: 7px; /* 1px * 7 */
height: 70px; /* 10px * 7 */
color: #6ebeff;
top: -105px; /* -15px * 7 */
left: 77px; /* 11px * 7 */
box-sizing: border-box;
animation: animloader 1s ease infinite;
}
@keyframes animloader {
0% {
box-shadow: 14px 0px rgba(51, 122, 183, 0),
/* 2px * 7 */ 84px 0px rgba(51, 122, 183, 0.3),
/* 12px * 7 */ 140px 0px rgba(51, 122, 183, 0); /* 20px * 7 */
}
50% {
box-shadow: 14px -35px rgba(51, 122, 183, 0.5),
/* 2px * 7, -5px * 7 */ 84px -21px rgba(51, 122, 183, 0.5),
/* 12px * 7, -3px * 7 */ 140px -14px rgba(51, 122, 183, 0.6); /* 20px * 7, -2px * 7 */
}
100% {
box-shadow: 14px -56px rgba(51, 122, 183, 0),
/* 2px * 7, -8px * 7 */ 84px -35px rgba(51, 122, 183, 0),
/* 12px * 7, -5px * 7 */ 140px -35px rgba(51, 122, 183, 0); /* 20px * 7, -5px * 7 */
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+120
View File
@@ -0,0 +1,120 @@
input {
border: none;
}
.hopeui_style-breadcrumb {
display: none !important;
}
body {
margin: 0;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
body,
input,
textarea,
button {
font-family: Montserrat;
}
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
monospace;
}
a {
text-decoration: none;
}
.btn {
display: block;
width: fit-content;
padding: 16px 24px;
margin: 0 auto;
border-radius: 8px;
border: none;
font-size: $main-font-size;
font-weight: 600;
line-height: 24px;
color: $btn-primary-text;
background: $btn-primary-bg;
background-size: 200%;
transition: 0.5s;
cursor: pointer;
}
.btn:hover {
background-position: 100%;
}
.btn[disabled] {
background: gray;
}
.list {
margin-top: 0.5em;
}
.image {
max-width: 100%;
border-radius: 8px;
}
p,
ul,
ol {
// TODO: заменить переменной
@media (max-width: 768px) {
font-size: 16px;
}
font-size: $main-font-size;
font-weight: $main-font-weight;
line-height: $main-line-height;
}
ul,
ol {
margin-top: -0.75em;
}
header h1 {
font-size: 36px;
font-weight: 600;
line-height: 44px;
margin-top: 24px;
@media (max-width: 768px) {
margin-top: 0;
font-size: 24px;
}
}
#root {
display: flex;
min-height: 100vh;
flex-direction: column;
justify-content: flex-start;
#react-page {
margin-bottom: 2em;
}
#footer {
margin-top: auto;
}
}
dl,
ol,
ul {
margin-bottom: 1rem;
margin-top: 0;
}
ol,
ul {
padding-left: 2rem;
}
+16
View File
@@ -0,0 +1,16 @@
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
input,
button,
textarea,
select {
margin: 0;
font: inherit;
}
body {
font-family: "Montserrat", sans-serif;
}
+58
View File
@@ -0,0 +1,58 @@
//Цвета
$bg-primary: white;
$bg-secondary: #343434;
$bg-footer: #222222;
$bg-form: #f5f5f7;
$bg-card-lab: black;
$bg-image: rgba(0, 0, 0, 0.75);
$text-primary: black;
$text-secondary: white;
$text-card-project: white;
$text-card-project-bg: rgba(255, 255, 255, 0.75);
$shadow-primary: rgba(0, 0, 0, 0.25);
$btn-primary-text: white;
$btn-primary-bg: linear-gradient(
93.25deg,
#4942e4 0%,
#11009e 50%,
#4942e4 100%
),
linear-gradient(0deg, #585858, #585858);
// Размеры
$navbar-height: 60px;
$navbar-height-mini: 30px;
$navbar-padding-tb: 10px;
$navbar-logo-height: 247px;
$navbar-logo-mini-height: 165px;
$row-gap: 26px;
$main-font-size: 20px;
$main-font-weight: 400;
$main-line-height: 30px;
//Разрешения
$desktop-4k-width: 2560px;
$maxDesktopWidth: 2800px;
$desktop-hd: 1920px;
$desktop-bootstrap: 100000px;
$desktop-max-width: 1441.98px;
$desktop-max-width-sec: 1400.98px;
$desktop-small-width: 1200.98px;
$small-tablet-max-width: 993.98px;
// $small-tablet-max-width-exception: 992px;
$tablet-max-width: 767.98px;
$tablet-max-width-exception: 767.98px;
$mobile-max-widthGosBlock: 531.98px;
$mobile-max-width: 500.98px;
$mobile-max-width-small: 425.98px;
$mobile-max-width-superSmall: 390.98px;
$mobile-extra-small-width: 375.98px;
$img-mobile-max-width: 580.98px;
$mobile-xs-width: 576.98px;
$mobile-xs-exception-absolute: 572px;
+97
View File
@@ -0,0 +1,97 @@
@mixin list-reset() {
list-style: none;
padding: 0;
margin: 0;
}
@mixin margin-padding-reset() {
padding: 0;
margin: 0;
}
@mixin button-reset() {
background-color: transparent;
border: 0;
padding: 0;
}
@mixin scrollbar() {
scrollbar-width: thin;
scrollbar-color: #e4e5e8;
&::-webkit-scrollbar {
width: rem(3);
height: rem(3);
}
&::-webkit-scrollbar-thumb {
background: transparent;
}
&::-webkit-scrollbar-track {
background-color: #e4e5e8;
}
}
@mixin flexbox($direction, $justify, $align) {
display: flex;
flex-direction: $direction;
justify-content: $justify;
align-items: $align;
}
@mixin scrollBar(
$color-track,
$color-thumb,
$width: rem(10),
$height: rem(10)
) {
// firefox
scrollbar-width: thin; /* "auto" или "thin" */
scrollbar-color: $color-track $color-thumb;
&::-webkit-scrollbar {
width: $width; /* ширина scrollbar */
height: $height;
}
&::-webkit-scrollbar-track {
background: $color-track; /* цвет дорожки */
}
&::-webkit-scrollbar-thumb {
background-color: $color-thumb; /* цвет плашки */
border: 0 solid #fff; /* padding вокруг плашки */
}
}
@mixin mediaMax($mediaWidth) {
@media only screen and (max-width: $mediaWidth - 1) {
@content;
}
}
@mixin mediaMin($mediaWidth) {
@media only screen and (min-width: $mediaWidth) {
@content;
}
}
@mixin mediaDistance($mediaWidthMin, $mediaWidthMax) {
@media only screen and (min-width: $mediaWidthMin) and (max-width: ($mediaWidthMax - 1)) {
@content;
}
}
@mixin isLoading(
$duration: 0s,
$bgc: #dedede,
$gradientFirst: #f1f1f1,
$gradientSecond: #d5d5d5
) {
background: $bgc;
background: linear-gradient(
110deg,
$gradientSecond 8%,
$gradientFirst 18%,
$gradientSecond 33%
);
background-size: 200% 100%;
animation: 1.5s shine $duration linear infinite;
}
View File
Whitespace-only changes.