Initial commit

This commit is contained in:
root committed 2026-04-29 10:03:27 +00:00
commit d1c730a53a
257 files changed
+19025

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;
+175
View File
@@ -0,0 +1,175 @@
#root {
position: relative;
background-repeat: no-repeat;
background-position: center bottom;
background-size: 100% auto;
z-index: 0;
opacity: 0;
min-height: 100vh;
background-image: url("../../shared/assets/images/backround/bg_footer_02.svg");
&::before {
content: "";
position: absolute;
top: 160px;
left: 0;
width: 100%;
height: 364px;
background-image: url("../../shared/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;
}
}
&.main-page {
background-image: url("../../shared/assets/images/backround/bg_footer.svg");
&::before {
background-image: none;
}
}
&.inner-page {
background-image: url("../../shared/assets/images/backround/bg_footer_02.svg");
&::before {
background-image: url("../../shared/assets/images/backround/bg_news_block.svg");
}
}
}
.page-loaded #root {
opacity: 1;
visibility: visible;
}
#layout-wrapper {
display: flex;
flex-direction: column;
min-height: 100vh;
}
#react-page {
flex: 1;
margin-top: calc($navbar-height + 5 * $navbar-padding-tb);
@media (max-width: 768px) {
margin-top: calc($navbar-height + 2 * $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;
border-radius: 8px;
display: flex;
flex-direction: column;
}
}
#react-page:has(.noMargin) {
margin-top: 0;
}
.block .heading a,
#navbar .nav-link {
position: relative;
&::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;
bottom: 7.5vh;
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;
}
@media (max-width: 768px) {
display: none;
}
}
@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);
}
}
+109
View File
@@ -0,0 +1,109 @@
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 = () => {
const duration = 900;
const start = window.scrollY;
const startTime = performance.now();
const animateScroll = (currentTime: number) => {
const timeElapsed = currentTime - startTime;
const progress = Math.min(timeElapsed / duration, 1);
const ease = 1 - Math.pow(1 - progress, 3);
window.scrollTo(0, start * (1 - ease));
if (timeElapsed < duration) {
requestAnimationFrame(animateScroll);
}
};
requestAnimationFrame(animateScroll);
};
// Определяем, находимся ли мы на главной странице
const isHomePage = location.pathname === "/";
return (
<RootContext.Provider value={{ setRef }}>
<div id="layout-wrapper">
<Navbar />
<main id="react-page" style={{ marginTop: isHomePage ? "0px" : "" }}>
<Outlet />
</main>
<Footer />
</div>
{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 { createHashRouter } from "react-router-dom";
export const appRouter = createHashRouter([
{
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";
@import url("https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap");
@font-face {
font-family: "Montserrat", sans-serif;
font-style: normal;
font-weight: 100 900;
font-display: swap;
}
.app {
min-height: 100%;
overflow: hidden;
}
#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.
+127
View File
@@ -0,0 +1,127 @@
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');
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', sans-serif;
}
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%;
color: $btn-primary-text;
}
.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;
}
}
h2 {
margin-bottom: 1em;
}
#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.50);
$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.
+9
View File
@@ -0,0 +1,9 @@
import App from "@/app/App";
import React from "react";
import ReactDOM from "react-dom/client";
ReactDOM.createRoot(document.getElementById("root")!).render(
<React.StrictMode>
<App />
</React.StrictMode>
);
+11
View File
@@ -0,0 +1,11 @@
import { skbEndpoint } from "@/shared/api/wp-client";
export const submitContactForm = async (formData: FormData) => {
const response = await fetch(`${skbEndpoint}skbkit/v1/sendcontactform`, {
method: "POST",
body: formData,
});
if (!response.ok) throw new Error("Form submission failed");
return response;
};
@@ -0,0 +1,10 @@
import { useMutation } from "@tanstack/react-query";
import { submitContactForm } from "../api/post";
export const useContactForm = () => {
return useMutation({
mutationFn: submitContactForm,
onSuccess: () => console.log("Форма успешно отправлена"),
onError: (error: Error) => console.error("Ошибка отправки:", error),
});
};
+4
View File
@@ -0,0 +1,4 @@
export { useMedia } from "./media/hooks/useMedia";
export { usePostById } from "./posts/hooks/usePostById";
export { useNews } from "./news/hooks/useNews";
export { useContactForm } from "./contact/hooks/useContactForm";
+63
View File
@@ -0,0 +1,63 @@
import { wp } from "@/shared/api/wp-client";
import { WPv2 } from "@/shared/types/app";
export interface MediaItem {
id: number;
src: string;
category: string;
name: string;
team_name?: string;
team_job?: string;
}
function decodeHtml(html: string) {
const tempDiv = document.createElement('div');
tempDiv.innerHTML = html;
return tempDiv.textContent || tempDiv.innerText || '';
}
/**
* Функция для получения всех медиафайлов с учетом пагинации
*/
export const fetchMedia = async (): Promise<MediaItem[]> => {
let page = 1;
let allMedia: MediaItem[] = [];
let hasMore = true;
while (hasMore) {
try {
// Запрашиваем медиа с указанной страницы
const media = (await wp.media().page(page)) as WPv2.MediaWithPaging;
console.log('unfilteredMedia', media);
// Преобразуем данные и добавляем в общий массив
const transformedMedia = media.map(({ id, source_url, alt_text, caption, title }) => {
const [category = "uncategorized", name = "unknown"] =
alt_text?.split("_") || [];
const newItem: MediaItem = { id, src: source_url, category, name };
if (category === "team") {
newItem.team_name = title.rendered;
newItem.team_job = decodeHtml(caption.rendered);
}
return newItem;
});
allMedia = [...allMedia, ...transformedMedia];
if (media._paging.totalPages === page) {
hasMore = false;
break;
}
page++;
} catch (error) {
hasMore = false;
console.error("Ошибка при загрузке медиа:", error);
}
}
console.log("media", allMedia);
return allMedia;
};
+10
View File
@@ -0,0 +1,10 @@
import { fetchMedia } from "@/modules/media/api/get";
import { useQuery } from "@tanstack/react-query";
export const useMedia = () => {
return useQuery({
queryKey: ["media"],
queryFn: fetchMedia,
staleTime: 1000 * 60 * 5, // 5 минут
});
};
+27
View File
@@ -0,0 +1,27 @@
import { skbEndpoint } from "@/shared/api/wp-client";
import { SKBKit } from "@/shared/types/app";
export const fetchNews = async <T = SKBKit.News[]>(params?: {
count?: number;
offset?: number;
}): Promise<SKBKit.ApiResponse<T>> => {
const url = new URL(`${skbEndpoint}skbkit/v1/getnews`);
if (params) {
if (params.count) url.searchParams.set("count", params.count.toString());
if (params.offset) url.searchParams.set("offset", params.offset.toString());
}
const response = await fetch(url.toString());
const data: T = await response.json();
return {
data,
headers: {
"x-wp-total": response.headers.get("x-wp-total") || "0",
"x-wp-totalpages": response.headers.get("x-wp-totalpages") || "0",
},
status: response.status,
statusText: response.statusText,
};
};
+11
View File
@@ -0,0 +1,11 @@
import { fetchNews } from "@/modules/news/api/get";
import { keepPreviousData, useQuery } from "@tanstack/react-query";
export const useNews = (params?: { count?: number; offset?: number }) => {
return useQuery({
queryKey: ["news", params],
queryFn: () => fetchNews(params),
select: (news) => news.data,
placeholderData: keepPreviousData,
});
};
+17
View File
@@ -0,0 +1,17 @@
import { useQuery } from "@tanstack/react-query";
import { skbEndpoint } from "@/shared/api/wp-client";
import { SKBKit } from "@/shared/types/app";
export const fetchNewsById = async (id: string): Promise<SKBKit.News> => {
const response = await fetch(`${skbEndpoint}skbkit/v1/getnewsbyid?id=${id}`);
if (!response.ok) throw new Error("Ошибка при загрузке новости");
const data = await response.json();
return data;
};
export const useNewsById = (id: string) => {
return useQuery<SKBKit.News>({
queryKey: ["news", id],
queryFn: () => fetchNewsById(id),
enabled: !!id,
});
};
@@ -0,0 +1,29 @@
// posts/api/get.ts
import { wp } from "@/shared/api/wp-client";
import { parseContent } from "@/shared/api/parseContent";
import { App, WPv2 } from "@/shared/types/app";
export const fetchPostById = async (id: number): Promise<App.WpPostPage> => {
const [post, categories] = await Promise.all([
wp.posts().id(id).get() as Promise<WPv2.Post>,
wp.categories().get() as Promise<WPv2.Category[]>,
]);
const categoryMap = new Map<number, string>(
categories.map((c) => [c.id, c.name])
);
const postCategories = post.categories.map(
(id) => categoryMap.get(id) || ""
);
const result: App.WpPostPage = {
id: post.id,
title: post.title.rendered,
content: parseContent(post.content.rendered),
tag: post.tags[0],
categories: postCategories,
};
return result;
};
@@ -0,0 +1,49 @@
// posts/api/get/getPostProjects.ts
import { wp } from "@/shared/api/wp-client";
import { fetchMedia } from "@/modules/media/api/get";
import { App, WPv2 } from "@/shared/types/app";
export const fetchPostProjects = async (tag: number): Promise<App.Card[]> => {
const categories = await wp.categories().get() as WPv2.Category[];
const catId = categories.find(item => item.name === "projects")?.id || -1;
const isLabPage = tag !== -1; // Если передали тег, значит, это страница лаборатории
// Одновременно отфильтровать и по тегу, по категории WP не дает
// Если тега нет, проще взять категорию projects
// Если тег есть, надо искать по нему
const postsRequest = wp.posts();
if (isLabPage) {
postsRequest.tags(tag);
} else {
postsRequest.categories(catId);
}
const [posts, mediaLibrary] = await Promise.all([
postsRequest.get() as Promise<WPv2.Post[]>,
fetchMedia(),
]);
// При выборке по тегу подтянется еще и лаборатория, ее нужно убрать из массива
if (isLabPage) {
const labIndex = posts.findIndex((post) => {
return !post.categories.includes(catId);
});
posts.splice(labIndex, 1);
}
const result: App.Card[] = [];
for (const post of posts) {
const image = mediaLibrary.find((item) => item.id === post.featured_media);
const newPost: App.Card = {
id: post.id,
title: post.title.rendered,
preview: image?.src || "",
};
result.push(newPost);
}
return result;
};
+63
View File
@@ -0,0 +1,63 @@
// posts/api/get.ts
import { wp } from "@/shared/api/wp-client";
import { fetchMedia } from "@/modules/media/api/get";
import { App, WPv2 } from "@/shared/types/app";
import Parse from "html-react-parser";
import { parseContent } from "@/shared/api/parseContent";
export const fetchPosts = async (): Promise<App.PostsResult> => {
const [posts, categories, mediaLibrary] = await Promise.all([
wp.posts().param("per_page", 100).get() as Promise<WPv2.Post[]>,
wp.categories().get() as Promise<WPv2.Category[]>,
fetchMedia(),
]);
const categoryMap = new Map<number, string>(
categories.map((c) => [c.id, c.name])
);
const result: App.PostsResult = {
projects: {},
labs: {},
other: [],
};
for (const post of posts) {
const image = mediaLibrary.find((item) => item.id === post.featured_media);
const postCategories = post.categories.map(
(id) => categoryMap.get(id) || ""
);
const newPost: App.WpPost = {
id: post.id,
title: post.title.rendered,
};
if (postCategories.includes("projects")) {
const newProject: App.Card = {
...newPost,
preview: image?.src || "",
};
result.projects[post.id] = newProject;
} else if (postCategories.includes("labs")) {
//@ts-ignore
const excerptElement = Parse(post.excerpt.rendered)[0];
const newLab: App.LabCard = {
...newPost,
preview: image?.src || "",
previewText: (excerptElement as any)?.props?.children || "",
};
result.labs[post.id] = newLab;
} else {
const newWpPostPage: App.WpPostPage = {
...newPost,
content: parseContent(post.content.rendered),
tag: post.tags[0],
categories: postCategories,
};
result.other.push(newWpPostPage);
}
}
return result;
};
+12
View File
@@ -0,0 +1,12 @@
// posts/api/usePostById.ts
import { fetchPostById } from "@/modules/posts/api/get/fetchPostById";
import { useQuery } from "@tanstack/react-query";
import { App } from "@/shared/types/app";
export const usePostById = (id: number) => {
return useQuery<App.WpPostPage>({
queryKey: ["post", id],
queryFn: () => fetchPostById(id),
enabled: !!id,
});
};
@@ -0,0 +1,12 @@
// posts/api/useProjects.ts
import { fetchPostProjects } from "@/modules/posts/api/get/fetchPostProjects";
import { useQuery } from "@tanstack/react-query";
import { App } from "@/shared/types/app";
export const usePostProjects = (tag: number) => {
return useQuery<App.Card[]>({
queryKey: ["projects", tag],
queryFn: () => fetchPostProjects(tag),
enabled: !!tag,
});
};
+12
View File
@@ -0,0 +1,12 @@
// posts/api/usePosts.ts
import { fetchPosts } from "@/modules/posts/api/get/fetchPosts";
import { App } from "@/shared/types/app";
import { useQuery } from "@tanstack/react-query";
export const usePosts = () => {
return useQuery<App.PostsResult>({
queryKey: ["posts"],
queryFn: fetchPosts,
staleTime: 1000 * 60 * 5,
});
};
+26
View File
@@ -0,0 +1,26 @@
import { CategoryPage } from "@/widgets/CategoryPage/CategoryPage";
import Team from "@/widgets/Team";
import PhotoGallery from "@/widgets/PhotoGallery";
import { Helmet } from "react-helmet";
export default function AboutUs() {
return (
<>
<Helmet>
<title>О нас | СКБ "Компьютерное инновационное творчество"</title>
<meta
name="keywords"
content="СКБ, о нас, команда, Студенческое конструкторское бюро, Компьютерное инновационное творчество, ИКТИБ, ЮФУ, история СКБ, миссия, цели, задачи, коллектив, сотрудники, преподаватели, студенты"
/>
<meta
name="description"
content="Узнайте больше о Студенческом конструкторском бюро 'Компьютерное инновационное творчество' ИКТИБ ЮФУ - нашей команде, истории, миссии и целях. Мы создаем инновационные проекты и развиваем таланты в области IT."
/>
<meta name="robots" content="index,follow" />
</Helmet>
<CategoryPage category="aboutus" />
<Team />
<PhotoGallery />
</>
);
}
+1
View File
@@ -0,0 +1 @@
export { default } from './AboutUs';
+190
View File
@@ -0,0 +1,190 @@
export namespace WPv2 {
export interface Title {
raw: string;
rendered: string;
}
export interface Content {
raw: string;
rendered: string;
block_version?: number;
protected?: boolean;
}
export interface Excerpt {
raw: string;
rendered: string;
protected?: boolean;
}
export interface Meta {
inline_featured_image?: boolean;
footnotes?: string;
[key: string]: any;
}
export interface Links {
self: Link[];
collection: Link[];
about?: Link[];
author?: EmbeddedLink[];
replies?: EmbeddedLink[];
"version-history"?: VersionHistoryLink[];
"predecessor-version"?: VersionLink[];
"wp:featuredmedia"?: EmbeddedLink[];
"wp:attachment"?: Link[];
"wp:term"?: TermLink[];
curies?: Cury[];
}
export interface Link {
href: string;
targetHints?: {
allow: ("GET" | "POST" | "PUT" | "PATCH" | "DELETE")[];
};
}
export interface EmbeddedLink extends Link {
embeddable: boolean;
}
export interface VersionHistoryLink {
count: number;
href: string;
}
export interface VersionLink {
id: number;
href: string;
}
export interface TermLink {
taxonomy: string;
embeddable: boolean;
href: string;
}
export interface Cury {
name: "wp";
href: string;
templated: true;
}
export interface Post {
id: number;
date: string;
date_gmt: string;
guid: { rendered: string };
modified: string;
modified_gmt: string;
slug: string;
status: "publish" | "draft" | "inherit" | string;
type: "post" | "page" | "attachment" | string;
link: string;
title: Title;
content: Content;
excerpt: Excerpt;
author: number;
featured_media?: number;
comment_status: "open" | "closed";
ping_status: "open" | "closed";
sticky: boolean;
template: string;
format: "standard" | string;
meta: Meta;
categories: number[];
tags: number[];
class_list: string[];
_links: Links;
}
export interface GetPostsParams {
context?: "view" | "embed" | "edit";
page?: number;
per_page?: number;
search?: string;
after?: string;
before?: string;
author?: number[];
author_exclude?: number[];
exclude?: number[];
include?: number[];
offset?: number;
order?: "asc" | "desc";
orderby?:
| "author"
| "date"
| "id"
| "include"
| "modified"
| "parent"
| "relevance"
| "slug"
| "title";
slug?: string[];
status?: string[];
}
export interface CreatePostParams extends Partial<Post> {}
}
export namespace SKBKit {
export interface News {
id: number;
title: string;
content: string;
date: string;
author: string;
categories: string[];
tags: string[];
image_url?: string;
excerpt?: string;
}
export interface GetNewsResponse {
news: News[];
}
export interface GetNewsByIdParams {
id: number;
}
export interface SendContactFormParams {
name: string;
email: string;
message: string;
subject?: string;
phone?: string;
company?: string;
position?: string;
}
export interface Event {
id: number;
title: string;
date: string;
location: string;
description: string;
organizer?: string;
participants?: number;
image_url?: string;
}
export interface GetEventsResponse {
events: Event[];
}
export interface VKCallbackParams {
type: string;
object: any;
group_id: number;
event_id?: string;
}
export interface ApiResponse<T> {
data: T;
headers: Record<string, string>;
status: number;
statusText: string;
}
}
+60
View File
@@ -0,0 +1,60 @@
@import "../../widgets/ContactForm/ContactForm.styles.scss";
#page-contact {
.top-block {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
flex: 1 1 50%;
margin-bottom: 2em;
margin-top: 48px;
@media (max-width: 768px) {
margin-top: 0;
}
h1 {
margin-top: 0;
font-size: 36px;
@media (max-width: 768px) {
font-size: 24px;
}
}
div:has(> ymaps) {
ymaps[class*="inner-panes"] {
border-radius: 8px;
}
}
// div:has(> ymaps)
div:has(> ymaps) > * {
width: auto !important;
height: 100% !important;
aspect-ratio: 1;
}
}
.contact-form {
.row {
flex-direction: row;
flex-wrap: wrap;
justify-content: space-between;
align-items: center;
.submit-container {
margin: 0;
max-width: 35%;
}
}
.row > * {
flex: 1 1 calc(50% - ($gap / 2));
}
}
}
#contact-form-anchor {
position: relative;
top: -100px;
}
+60
View File
@@ -0,0 +1,60 @@
import { YMaps, Map, Placemark } from "@pbe/react-yandex-maps";
import { Helmet } from "react-helmet";
import "./Contact.styles.scss";
import ContactForm from "@/widgets/ContactForm";
function Contact() {
return (
<div id="page-contact" className="mainContainer">
<Helmet>
<title>Контакты | СКБ "Компьютерное инновационное творчество"</title>
<meta
name="keywords"
content="СКБ, контакты, связаться, Студенческое конструкторское бюро, Компьютерное инновационное творчество, ИКТИБ, ЮФУ, адрес, телефон, email, карта, местоположение, Таганрог"
/>
<meta
name="description"
content="Свяжитесь с нами! Контактная информация Студенческого конструкторского бюро 'Компьютерное инновационное творчество' ИКТИБ ЮФУ. Наш адрес: г. Таганрог, пер. Тургеневский, 44, ауд. 208."
/>
<meta name="robots" content="index,follow" />
</Helmet>
<div className="top-block">
<div>
<h1>Контакты</h1>
<div className="contact">
<p>
Контактное лицо:
<br />
Кутковой Владимир Сергеевич
<br />
Руководитель СКБ «КИТ»
<br />
Email: skb@sfedu.ru
<br />
Адрес: г. Таганрог, пер. Тургеневский, 44
</p>
</div>
</div>
<YMaps>
<Map
defaultState={{
center: [47.20669, 38.929113],
zoom: 17,
controls: ["zoomControl", "fullscreenControl"],
}}
modules={["control.ZoomControl", "control.FullscreenControl"]}
width="500px"
height="200px"
>
<Placemark defaultGeometry={[47.20669, 38.929113]} />
</Map>
</YMaps>
</div >
<div id="contact-form-anchor"></div>
<ContactForm />
</div>
);
}
export default Contact;
+1
View File
@@ -0,0 +1 @@
export { default } from './Contact';
@@ -0,0 +1,550 @@
#pageheader {
position: relative;
overflow: hidden;
min-height: 100vh;
padding: 0 10%;
margin: 0;
margin-bottom: 64px;
color: rgba(18, 18, 18, 1);
background-image: url("/src/shared/assets/images/LabBoard/fond.png");
background-blend-mode: multiply;
background-position: center;
background-size: cover;
img {
pointer-events: none;
}
.headerContent {
display: flex;
justify-content: space-between;
align-items: center;
height: 100vh;
}
.container {
flex: 1;
max-width: 50%;
@media (max-width: 768px) {
max-width: 100%;
padding: $navbar-padding-tb 5%;
}
h1 {
font-size: 52px;
font-weight: 600;
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: 20px;
line-height: 28px;
}
}
.btn {
margin: 0;
margin-top: 24px;
}
}
.microcontrollerImage {
flex: 1;
max-width: 40%;
height: auto;
object-fit: contain;
@media (max-width: 768px) {
display: none;
}
}
@media (max-width: 768px) {
padding: 0 5%;
margin-bottom: 32px;
}
}
#padding {
padding: 0 10%;
@media (max-width: 768px) {
padding: 0 5%;
}
}
#padding2 {
padding: 0 10%;
@media (max-width: 769px) {
padding: 0 2.5%;
}
}
#page_container {
padding: 0 10%;
@media (max-width: 768px) {
padding: 0 5%;
}
h2 {
font-size: 36px;
}
h4 {
font-weight: 600;
}
img {
pointer-events: none;
}
p {
margin-bottom: 32px;
}
.title {
font-size: 36px;
font-weight: 600;
line-height: 44px;
margin-top: 0;
margin-bottom: 8px;
@include mediaMax($tablet-max-width) {
font-size: 24px;
margin-top: 0;
}
}
.numbersContainer {
display: flex;
justify-content: space-between;
gap: 32px;
background-color: #f5f5f7;
border-radius: 16px;
margin-bottom: 64px;
@media (max-width: 768px) {
flex-direction: column;
gap: 24px;
margin-bottom: 32px;
}
}
.numberBlock {
flex: 1;
padding: 32px;
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
}
.number {
font-size: 64px;
font-weight: 600;
font-family: 'Montserrat', sans-serif;
background: linear-gradient(to right, #0867F4, #072AC8);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
display: inline-block;
line-height: 1;
margin: 0;
padding: 0;
margin-bottom: 16px;
@media (max-width: 768px) {
font-size: 48px;
}
}
.numberLabel {
font-size: 18px;
color: #333;
margin: 0;
@media (max-width: 768px) {
font-size: 16px;
}
}
.imagesContainer {
display: flex;
gap: 32px;
margin-bottom: 64px;
@media (max-width: 768px) {
flex-direction: column;
gap: 24px;
margin-bottom: 32px;
}
}
.imageBlock {
flex: 1;
background-color: #f5f5f7;
border-radius: 16px;
padding: 32px 48px 48px 48px;
display: flex;
flex-direction: column;
}
.imageTitle {
font-weight: 550;
margin-bottom: 16px
}
.microcontrollerPhoto {
width: 100%;
height: auto;
object-fit: contain;
max-height: 300px;
}
}
.featuresContainer {
display: flex;
gap: 32px;
margin-bottom: 64px;
padding-top: 24px;
@media (max-width: 768px) {
flex-direction: column;
gap: 0px;
margin-bottom: 32px;
}
}
.featuresList {
flex: 1;
display: flex;
flex-direction: column;
gap: 32px;
@media (max-width: 768px) {
gap: 0;
}
}
.featureItemWrapper {
@media (max-width: 768px) {
margin-bottom: 8px;
}
}
.featureItem {
display: flex;
gap: 8px;
align-items: center;
cursor: pointer;
font-size: 24px;
font-weight: 600;
&.active {
color: #072AC8;
}
img {
width: 24px;
height: 24px;
}
@media (max-width: 768px) {
padding: 12px;
background-color: #f5f5f7;
border-radius: 8px;
font-size: 18px;
margin-bottom: 0;
}
}
.mobileFeatureContent {
display: none;
@media (max-width: 768px) {
display: block;
padding: 0 12px;
background-color: #f5f5f7;
border-radius: 0 0 8px 8px;
margin-top: -8px;
margin-bottom: 16px;
}
}
.desktopFeatureContent {
flex: 0 0 700px;
@media (max-width: 768px) {
display: none;
}
}
.featureContent {
flex: 0 0 600px;
@media (max-width: 768px) {
flex: 1;
width: 100%;
}
}
.featureDescription {
animation: fadeIn 0.3s ease;
white-space: pre-line;
margin-bottom: 1em;
}
.mcuContainer {
display: flex;
gap: 32px;
margin-bottom: 0;
@media (max-width: 768px) {
flex-direction: column;
gap: 24px;
}
}
// слайдер
.sliderHeaderContainer {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 32px;
width: 100%;
flex-wrap: wrap;
@media (max-width: 768px) {
flex-direction: column;
align-items: flex-start;
gap: 16px;
}
h2 {
font-size: 36px;
font-weight: 600;
}
}
.sliderNav {
display: flex;
gap: 16px;
}
.sliderButton {
width: 40px;
height: 40px;
border-radius: 50%;
background: #f5f5f7;
border: none;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
img {
width: 16px;
height: 16px;
}
}
.slideActive,
.slideNext {
background: #f5f5f7;
border-radius: 16px;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.5s ease-in-out;
opacity: 1;
transform: scale(1);
}
.slideActive {
flex: 2;
padding: 48px;
border: 2px solid #0867F4;
.activeImage {
width: 100%;
height: 300px;
object-fit: contain;
pointer-events: none;
}
}
.slideNext {
flex: 1;
padding: 32px;
.nextImage {
width: 100%;
max-height: 200px;
height: auto;
object-fit: contain;
}
}
.slideActive.fade-out,
.slideNext.fade-out,
.fadeOut {
opacity: 0;
transform: scale(0.98);
}
@media (max-width: 768px) {
.slideActive,
.slideNext {
width: 100%;
flex: none;
}
.slideNext {
display: none;
}
.sliderNav {
display: none;
}
.swiper-slide {
opacity: 1 !important;
transition: none !important;
height: 48vh !important;
.slide-image {
height: 350px !important;
}
}
.slideActive .activeImage {
height: 200px; // или auto, если хочешь, чтобы она заполняла контейнер
max-height: 60vh; // чтобы не вылезала за экран
width: 100%;
object-fit: contain;
}
.swiper-slide {
height: auto; // либо установи нужную высоту, например: 60vh
}
.slideActive {
padding: 16px; // уменьшить паддинги, чтобы картинка влезала лучше
}
}
.swiper-slide {
opacity: 0.5;
transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
height: 65vh;
.slide-image {
height: 500px;
}
}
.swiper-slide-active {
opacity: 1;
transform: scale(1);
}
.swiper-slide-prev,
.swiper-slide-next {
opacity: 0.7;
transform: scale(0.9);
@media (max-width: 768px) {
opacity: 1;
transform: none;
}
}
.sliderWrapper {
display: flex;
align-items: center;
gap: 16px;
width: 100%;
margin-bottom: 34px;
@media (max-width: 768px) {
.sliderNav {
display: none;
}
}
}
.sliderContainer {
display: flex;
gap: 32px;
width: 100%;
margin-bottom: 32px;
@media (max-width: 768px) {
flex: 1;
gap: 0;
.slideNext {
display: none;
}
}
}
.sliderButton2 {
width: 40px;
height: 40px;
border-radius: 50%;
background: #f5f5f7;
border: none;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
img {
width: 16px;
height: 16px;
}
@media (min-width: 769px) {
display: none;
}
}
.infinitySymbol {
width: 96px;
height: 64px;
margin-bottom: 16px;
display: flex;
align-items: center;
justify-content: center;
svg {
display: block;
margin: 0 auto;
}
}
@media (max-width: 768px) {
.infinitySymbol {
width: 72px;
height: 48px;
}
}
@@ -0,0 +1,293 @@
import styles from "./LabBoard.module.scss";
import { HashLink } from "react-router-hash-link";
import { useState, useEffect, useRef } from 'react';
import angle_small_down from "@/shared/assets/images/LabBoard/angle-small-down.svg";
import angle_small_down_one from "@/shared/assets/images/LabBoard/angle-small-down-one.svg";
import microcontroller_left from "@/shared/assets/images/LabBoard/microcontroller_left.svg";
import microcontroller_rear from "@/shared/assets/images/LabBoard/microcontroller_rear.svg";
import Group_one from "@/shared/assets/images/LabBoard/Group_one.svg";
import Group_two from "@/shared/assets/images/LabBoard/Group_two.svg";
import Vector from "@/shared/assets/images/LabBoard/Vector.svg";
import { useSwipeable } from 'react-swipeable';
import ContactUs from "@/widgets/ContactUs";
function LabBoard() {
const [activeFeature, setActiveFeature] = useState<number | null>(0);
const sliderRef = useRef<HTMLDivElement>(null);
const features = [
{
title: "USB POWER",
content: "Встроенные силовые блоки «Motors Driver», «Voltage Regulator» и разъёмы блока «Ports» VOUT обеспечиваются отдельным питанием через блок «USB POWER». Для подачи внешнего питания нужно подключить блок через кабель USB Type-C к 5V зарядному устройству мощностью не менее 15W.\n\nСветодиодный индикатор LD71 сообщает о подачи питания от USB разъёма, а индикатор LD70 горит если самовосстанавливающийся 3A предохранитель находится в исправном состоянии и питание может быть передано в другие модули. Для активации питания силовых модулей необходимо подать высокий сигнал на: PH12 – активация блока «Voltage Regulator», PH11 – активация блока «Motors Driver», PH10 – активация блока «Ports» для разъёмов VOUT. Если установить перемычку CN34, то можно запитать основную систему от внешнего источника силовых модулей.\n\nЧтобы задействовать дополнительные режимы с питанием 9V и 12V необходимо использовать при подключении к блоку зарядное устройство с функцией QC3.0. Затем использовать PH2 и PH3 для выбора требуемого напряжения."
},
{
title: "Input",
content: "Пользователь может осуществить взаимодействие с микроконтроллером с помощью ввода данных посредством встроенных в блок «Input» элементов.\n\nДва энкодера ENC1 и ENC2 с кнопками и индикаторами оборотов, позволяют точно отслеживать поворот ручки и используют контакты микроконтроллера PB12 и PB13 с копкой PI1 для первого и PB10, PB11 с копкой PI4 для второго. Потенциометр POT1 подключён к PC3, а POT2 к PC2 напряжение из которых можно считать с помощью АЦП. Клавиатура KEYPAD с 15 тактовыми кнопками использует контакты PE0-PE3 и демонстрирует код нажатой клавиши на панели «KEY CODE». Три независимых кнопки с индикаторами нажатия подключены к PE4, PE5 и PE6. При нажатии любой из независимых кнопок или кнопок на панели KEYPAD будет выставлен высокий сигнал на PD3. Двухосевой джойстик с кнопкой на PE14 использует вывод микроконтроллера PC0 для оси X и PC1 для Y."
},
{
title: "Motors Driver",
content: "Силовой блок позволяет управлять одновременно двумя щёточными моторами постоянного тока или одним шаговым двигателем. Генерация широтно-импульсной модуляции микроконтроллером задаёт мощность вращения двигателей и переключает полярность мостовой схемы драйвера.\n\nДля подачи сигнала для двигателя M1 используются контакты микроконтроллера PI5, PI6 и активируются сигналом PD6. Двигатель M2 подключен к PI2, PI7 с активацией на PI3. Таймер TIM8 управляет генерацией ШИМ каналами CH1, CH2, CH3 и CH4 Оптимальная работа драйвера достигается при частоте ШИМ равной 16KHz. Выбор входящего питания управляется с помощью блока «USB POWER» и максимально возможное напряжение 12V. Нагрузка на каждый мост драйвера не должна превышать 8W. При длительной работе поверхность блока «Motors Driver» может нагреваться, поэтому к ней нельзя прикасаться и заслонять теплоотводные вырезы. Для возможности управления шаговым двигателем требуется задействовать оба драйвера одновременно."
},
{
title: "Voltage Regulator",
content: "С помощью силового блока регулирования напряжения или тока можно запитать устройство с напряжением от 1.5V до 11.5V, мощностью не превышающей 16W. Блок позволяет снимать показания текущего напряжения и тока на выходе.\n\nУправление исходящим напряжением осуществляется с помощью ШИМ сигнала таймером TIM12 на канале CH1 контактом микроконтроллера PH6. Оптимальная частота работы устройства 40KHz. Показания напряжения идут на вывод МК PA1 с делителем 12/3.3, показания тока на PA6 с делителем 1:1. В качестве драйвера полумоста используется микросхема IR2302S, а датчиком тока является INA139. При длительной работе поверхность блока «Voltage Regulator» может нагреваться, поэтому к ней нельзя прикасаться и заслонять теплоотводные вырезы. Исходящий ток не должен превышать 3A во избежание перегрева компонентов и выхода их из строя."
},
{
title: "IO Expander",
content: "Если при подключении к микроконтроллеру требуется большее количество портов ввода/вывода, то применяется микросхема расширения MCP23016.\n\nОна имеет 16 независимых каналов, которые могут использоваться как входы и выходы. Для связи с микроконтроллером используется шина I2C3 подключённая к выводам МК: PH7 – линия тактирования SCL, PH8 – линия данных SDA. Скорость передачи данных может достигать 400Kbps. Адрес устройства 0x20. Вывод микроконтроллера PB7 может быть использован для активации обработчика внешнего прерывания при изменении сигнала на портах ввода микросхемы. Ток каналов вывода ограничен 11mA."
},
{
title: "Ports",
content: "Для подключения внешних устройств используется панель дополнительных портов. Они напрямую подключены к микроконтроллеру и ограничены током 11mA.\n\nПанель 3-PHASE PWM позволяет задействовать таймер TIM1 для генерации ШИМ сигналов при управлении 3-х фазным инвертором. Используются каналы таймера: CH1 – вывод PE8 отрицательный и PE9 положительный, CH2 – вывод PE10 отрицательный и PE11 положительный, CH3 – вывод PE12 отрицательный и PE13 положительный.\n\nПанель DIGITAL IO использует контакты контроллера PF0-PF2 и PF11-PF15. Они могут быть запрограммированы на вход и выход, а также подсвечиваются светодиодными индикаторами при появлении на них высокого сигнала. Принимают на вход напряжение до 5V. Выводы VOUT питают подключенные к ним устройства напряжением 5V-12V в зависимости от режима QC выбранного в блоке «USB POWER». Светодиодный индикатор сообщает о наличии питания.\n\nПанель DIGITAL IO / ANALOG IN использует контакты контроллера PF3-PF10. Они могут быть запрограммированы на вход и выход, а также с помощью встроенного в микроконтроллер АЦП ADC3 измерять входящее аналоговое напряжение до 3.3V. Принимают на вход напряжение до 5V, но в аналоговом режиме входящее напряжение не должно превышать 3.3V. Выводы VOUT питают подключенные к ним устройства напряжением 5V-12V в зависимости от режима QC выбранного в блоке «USB POWER». Светодиодный индикатор сообщает о наличии питания.\n\nПанель UART-1 подключена к UART4 и использует контакты контроллера PC10 для передатчика и PC11 для приёмника.\n\nПанель UART-2 подключена к UART5 и использует контакты контроллера PC12 для передатчика и PD2 для приёмника.\n\nПанель I2C подключена к шине I2C1 и использует контакты контроллера PB8 для тактирования и PB9 для обмена данных.\n\nПанель CAN подключена к шине CAN1 и использует контакты контроллера PD1 для передатчика и PD0 для приёмника.\n\nПанель SPI подключена к шине SPI1 и использует контакты контроллера PB3 для тактирования, PB4 для приёма данных, PB5 для передачи данных и PA15 выбор устройства.\n\nПанель DAC подключена к выходам ЦАП и использует контакты контроллера PА4 – OUT1 и PA5 – OUT2. При использовании на вход подключаемое напряжение не должно превышать 3.3V."
}
];
const toggleFeature = (index: number) => {
setActiveFeature(activeFeature === index ? null : index);
};
const [currentSlide, setCurrentSlide] = useState(0);
const slides = [
{
image: Group_one, title: "Блок \"MCU\"",
description1: "Основным вычислительным устройством лабораторного стенда является микроконтроллер STM32F407IG использующий архитектуру ARMv7-M и работающий с максимальной частотой 168MHz. На борту устройства установлено 192Kb оперативной памяти (RAM) и 1Mb постоянной FLASH (ROM). Тактирование осуществляется с помощью двух кварцевых резонаторов: 8MHz для основной системы тактирования и 32.768KHz для встроенных часов реального времени (RTC). Напряжение питания микроконтроллера и логических выводов 3.3V, но большинство контактов толерантных к 5V логике."
, description2: "Для взаимодействия с микроконтроллером на панели блока \"MCU\" установлены три тактовых выключателя: RESET - сброс MK, TEST - пользовательская кнопка, BOOT - переход в режим встроенного загрузчика. Выключатель TEST подаёт на контакт PI10 высокий сигнал. Светодиод LD110 управляется контактом PI11 и может использоваться программой пользователя для индикации режима работы. Питания встроенных часов реального времени осуществляется с помощью батареи CR1220."
},
{ image: Group_two, title: "Блок «Serial Wire Debugger»", description1: "Для загрузки и отладки программ, написанных для микроконтроллера в стенде используется блок отладки «Serial Wire Debugger». Он основан на микроконтроллере STM32F103CB и поддерживает связь с основным МК с помощью интерфейса SWD.\n\nДля работы блока требуется чтобы в разъём SWD были установлены джамперы: NRST – аппаратный сброс, CLK – линия тактирования, DIO – приём и передача отладочных данных. Если необходимо задействовать передачу пользовательской отладочной информации, то нужно установить джампер в разъём SWO. Разъём VCP позволяет задействовать драйвер виртуального серийного порта.", description2: "Чтобы задействовать блок «SWD» нужно подключить его к компьютеру используя кабель USB Type-C. Отладчик использует протокол отладки SWD ST-Link 2.1 и работает с максимальной скоростью 4MHz. Если при работе основного МК использование отладчика не нужно, то следует изъять джампер NRST из разъёма SWD (чтобы не потерять джампер можно установить его в отсек GND). Блок «SWD» питает напряжением 5V от USB разъема все блоки стенда с малой нагрузкой через самовосстанавливающийся предохранитель на 1A." },
{
image: Group_one, title: "Блок \"MCU\"",
description1: "Основным вычислительным устройством лабораторного стенда является микроконтроллер STM32F407IG использующий архитектуру ARMv7-M и работающий с максимальной частотой 168MHz. На борту устройства установлено 192Kb оперативной памяти (RAM) и 1Mb постоянной FLASH (ROM). Тактирование осуществляется с помощью двух кварцевых резонаторов: 8MHz для основной системы тактирования и 32.768KHz для встроенных часов реального времени (RTC). Напряжение питания микроконтроллера и логических выводов 3.3V, но большинство контактов толерантных к 5V логике."
, description2: "Для взаимодействия с микроконтроллером на панели блока \"MCU\" установлены три тактовых выключателя: RESET - сброс MK, TEST - пользовательская кнопка, BOOT - переход в режим встроенного загрузчика. Выключатель TEST подаёт на контакт PI10 высокий сигнал. Светодиод LD110 управляется контактом PI11 и может использоваться программой пользователя для индикации режима работы. Питания встроенных часов реального времени осуществляется с помощью батареи CR1220."
},
{ image: Group_two, title: "Блок «Serial Wire Debugger»", description1: "Для загрузки и отладки программ, написанных для микроконтроллера в стенде используется блок отладки «Serial Wire Debugger». Он основан на микроконтроллере STM32F103CB и поддерживает связь с основным МК с помощью интерфейса SWD.\n\nДля работы блока требуется чтобы в разъём SWD были установлены джамперы: NRST – аппаратный сброс, CLK – линия тактирования, DIO – приём и передача отладочных данных. Если необходимо задействовать передачу пользовательской отладочной информации, то нужно установить джампер в разъём SWO. Разъём VCP позволяет задействовать драйвер виртуального серийного порта.", description2: "Чтобы задействовать блок «SWD» нужно подключить его к компьютеру используя кабель USB Type-C. Отладчик использует протокол отладки SWD ST-Link 2.1 и работает с максимальной скоростью 4MHz. Если при работе основного МК использование отладчика не нужно, то следует изъять джампер NRST из разъёма SWD (чтобы не потерять джампер можно установить его в отсек GND). Блок «SWD» питает напряжением 5V от USB разъема все блоки стенда с малой нагрузкой через самовосстанавливающийся предохранитель на 1A." }
];
const [fade, setFade] = useState(false);
const nextSlide = () => {
setFade(true);
setTimeout(() => {
setCurrentSlide((prev) => (prev + 1) % slides.length);
setFade(false);
}, 200);
};
const prevSlide = () => {
setFade(true);
setTimeout(() => {
setCurrentSlide((prev) => (prev - 1 + slides.length) % slides.length);
setFade(false);
}, 200);
};
// Обработчик колеса мыши
useEffect(() => {
const handleWheel = (e: WheelEvent) => {
if (sliderRef.current && sliderRef.current.contains(e.target as Node)) {
e.preventDefault();
if (e.deltaY > 0) {
nextSlide();
} else if (e.deltaY < 0) {
prevSlide();
}
}
};
const sliderElement = sliderRef.current;
if (sliderElement) {
sliderElement.addEventListener('wheel', handleWheel, { passive: false });
}
return () => {
if (sliderElement) {
sliderElement.removeEventListener('wheel', handleWheel);
}
};
}, [currentSlide]);
return (
<div className="noMargin">
<div id={styles.pageheader}>
<div className={styles.headerContent}>
<section className={styles.container}>
<h1>LabBoard 1.1</h1>
<h2>
Лучшее устройство для изучения<br />
принципов работы микроконтроллеров
</h2>
<HashLink smooth to="#contact-us" className={"btn " + styles.btn}>
Связаться с нами
</HashLink>
</section>
<img src={microcontroller_left} className={styles.microcontrollerImage} />
</div>
</div>
<div id={styles.page_container}>
<h2 className={styles.title}>LabBoard в цифрах</h2>
<div className={styles.numbersContainer}>
<div className={styles.numberBlock}>
<p className={styles.number}>25</p>
<label className={styles.numberLabel}>независимых модулей</label>
</div>
<div className={styles.numberBlock}>
<p className={styles.number}>1</p>
<label className={styles.numberLabel}>микроконтроллер STM32</label>
</div>
<div className={styles.numberBlock}>
<div className={styles.infinitySymbol}>
<svg
width="96"
height="64"
viewBox="0 0 96 64"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<defs>
<linearGradient id="infinityGradient" x1="0%" y1="0%" x2="100%" y2="0%">
<stop offset="0%" stopColor="#0867F4" />
<stop offset="100%" stopColor="#072AC8" />
</linearGradient>
</defs>
<path
d="M12 32C12 18 36 18 48 32C60 46 84 46 84 32C84 18 60 18 48 32C36 46 12 46 12 32Z"
stroke="url(#infinityGradient)"
strokeWidth="7"
strokeLinecap="round"
/>
</svg>
</div>
<label className={styles.numberLabel}>опыта</label>
</div>
</div>
<h2 className={styles.title}>Об устройстве</h2>
<p>
Для изучения принципов работы микроконтроллеров, их
интерфейсов и подключаемой периферии был разработан
лабораторный учебный стенд «LabBoard 1.1». Он состоит из 25
независимых блоков, соединённых с микроконтроллером.
</p>
<div className={styles.imagesContainer}>
<div className={styles.imageBlock}>
<p className={styles.imageTitle}>Лицевая сторона</p>
<img src={microcontroller_left} />
</div>
<div className={styles.imageBlock}>
<p className={styles.imageTitle}>Тыльная сторона</p>
<img src={microcontroller_rear} />
</div>
</div>
<div>
<h2 className={styles.title}>Характеристики</h2>
<div className={styles.featuresContainer}>
<div className={styles.featuresList}>
{features.map((feature, index) => (
<div key={index} className={styles.featureItemWrapper}>
<div
className={`${styles.featureItem} ${activeFeature === index ? styles.active : ''}`}
onClick={() => toggleFeature(index)}
>
<span>{feature.title}</span>
<img
src={activeFeature === index ? angle_small_down : angle_small_down_one}
alt={activeFeature === index ? "Свернуть" : "Развернуть"}
/>
</div>
{/* моб. версия */}
<div className={styles.mobileFeatureContent}>
{activeFeature === index && (
<div className={styles.featureDescription}>
<p>{feature.content}</p>
</div>
)}
</div>
</div>
))}
</div>
{/* пк версия */}
<div className={styles.desktopFeatureContent}>
{activeFeature !== null && (
<div className={styles.featureDescription}>
<p>{features[activeFeature].content}</p>
</div>
)}
</div>
</div>
</div>
<div className={styles.sliderHeaderContainer}>
<h2 className={styles.title}>Подробнее о модулях стенда</h2>
<div className={styles.sliderNav}>
<button onClick={prevSlide} className={styles.sliderButton}>
<img src={Vector} style={{ transform: 'scaleX(-1)' }} alt="Previous" />
</button>
<button onClick={nextSlide} className={styles.sliderButton}>
<img src={Vector} alt="Next" />
</button>
</div>
</div>
</div>
<div id={styles.padding2} className={styles.sliderWrapper}>
<button onClick={prevSlide} className={styles.sliderButton2}>
<img src={Vector} style={{ transform: 'scaleX(-1)' }} alt="Previous" />
</button>
<div
className={styles.sliderContainer}
{...useSwipeable({
onSwipedLeft: nextSlide,
onSwipedRight: prevSlide,
preventScrollOnSwipe: true,
trackMouse: true,
})}
ref={sliderRef}
>
<div className={`${styles.slideActive} ${fade ? styles.fadeOut : ''}`}>
<img
src={slides[currentSlide].image}
alt={slides[currentSlide].title}
className={styles.activeImage}
/>
</div>
<div className={`${styles.slideNext} ${fade ? styles.fadeOut : ''}`}>
<img
src={slides[(currentSlide + 1) % slides.length].image}
alt={slides[(currentSlide + 1) % slides.length].title}
className={styles.nextImage}
/>
</div>
</div>
<button onClick={nextSlide} className={styles.sliderButton2}>
<img src={Vector} alt="Next" />
</button>
</div>
<div id={styles.padding}>
<h4><div className={styles.slideDescription}>
{slides[currentSlide]?.title}
</div></h4>
<div className={styles.mcuContainer}>
<p>
<div className={styles.slideDescription}>
{slides[currentSlide]?.description1}
</div>
</p>
<p>
<div className={styles.slideDescription}>
{slides[currentSlide]?.description2}
</div>
</p>
</div>
</div>
<div id={styles.padding}>
<ContactUs /></div>
</div>
);
}
export default LabBoard;
+5
View File
@@ -0,0 +1,5 @@
import { MainPageAsync } from './ui/MainPage/MainPage.async';
export {
MainPageAsync as MainPage,
};
@@ -0,0 +1,3 @@
import { lazy } from "react";
export const MainPageAsync = lazy(() => import("./MainPage"));
@@ -0,0 +1,212 @@
.mainContainer {
margin: 0 10% 0 10%;
@include mediaMax($mobile-xs-width) {
margin: 0 5% 0 5%;
}
}
$news-card-gap: 1em;
body {
overflow-x: hidden; // Скрываем горизонтальный скролл
}
#mainpageheader {
position: relative;
overflow: hidden;
min-height: 100vh;
padding: 0 10%;
margin: 0;
margin-bottom: 20px;
color: $text-secondary;
//background-image: url("/src/shared/assets/images/art.bmp");
background-color: $bg-image;
background-blend-mode: multiply;
background-position: center;
background-size: cover;
.container {
position: absolute;
top: 40%;
display: flex;
flex-direction: column;
@media (max-width: 768px) {
top: 30%;
padding: $navbar-padding-tb 5%;
}
h1 {
font-size: 52px;
font-weight: 600;
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;
}
}
}
.block {
background: transparent !important;
h1 {
font-family: 'Montserrat', sans-serif;
font-size: 36px;
font-weight: 600;
margin-top: 1.5rem;
margin-bottom: 1.5rem;
@media (max-width: 768px) {
font-size: 24px;
}
}
.heading {
display: flex;
justify-content: space-between;
align-items: center;
a {
font-size: 20px;
font-weight: 500;
text-align: right;
color: $text-primary;
@media (max-width: 768px) {
font-size: 16px;
}
}
}
#news-list .row {
grid-template-columns: repeat(4, calc((100% - $news-card-gap * 3) / 4));
justify-content: space-between;
gap: $news-card-gap;
}
}
.block:not(:last-child) {
margin-bottom: 32px;
}
@media (max-width: 768px) {
#mainpageheader {
padding: 0;
}
}
.block:not(:last-child) {
margin-bottom: 32px;
}
@media (max-width: 768px) {
#mainpageheader {
padding: 0;
}
}
.LabListContainer {
position: relative;
&::before {
content: '';
position: absolute;
bottom: 5%;
left: 0;
width: 100%;
height: 363px;
background-image: url('/src/shared/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;
}
}
}
.GalleryContainer {
position: relative;
padding: 0 10%;
@media (max-width: 768px) {
padding: 0 5%;
}
&::before {
content: '';
position: absolute;
bottom: 5%;
left: 0;
width: 100%;
height: 436px;
background-image: url('/src/shared/assets/images/backround/bg_labs_block.svg');
background-repeat: no-repeat;
background-position: left center;
background-size: contain;
z-index: -1;
@media (max-width: 768px) {
display: none;
}
}
}
.NumbersContainer {
position: relative;
padding: 0 10%;
@media (max-width: 768px) {
padding: 0 5%;
}
&::before {
content: '';
position: absolute;
bottom: 5%;
left: 0;
width: 100%;
height: 459px;
background-image: url('/src/shared/assets/images/backround/bg_projects_block.svg');
background-repeat: no-repeat;
background-position: right center;
background-size: contain;
z-index: -1;
@media (max-width: 768px) {
display: none;
}
}
}
.mainpage-container {
display: flex;
flex-direction: column;
margin-top: 40px;
gap: 40px;
}
+105
View File
@@ -0,0 +1,105 @@
import { useContext, useEffect, useState } from "react";
import styles from "./MainPage.module.scss";
import { HashLink } from "react-router-hash-link";
import { RootContext } from "@/app/Layout/Root";
import Partners from "@/widgets/Partners";
import Gallery from "@/pages/MainPage/ui/components/Gallery";
import ContactUs from "@/widgets/ContactUs";
import { Helmet } from "react-helmet";
import { LabsList, NewsList, ProjectsList } from "@/widgets/CardList/CardList";
import { useMedia } from "@/modules/media/hooks/useMedia";
import Numbers from "@/widgets/Numbers";
const MainPage = () => {
const { setRef } = useContext(RootContext);
const [headerBgUrl, setHeaderBgUrl] = useState("");
const { data: mediaData, isLoading, isError } = useMedia();
useEffect(() => {
const artMedia = mediaData?.filter((el) => el.category === "art");
if (artMedia && artMedia.length > 0) {
setHeaderBgUrl(artMedia[0].src);
let index = 0;
const intervalId = setInterval(() => {
const nextIndex = (index + 1) % artMedia.length;
const nextImage = artMedia[nextIndex].src;
setTimeout(() => {
setHeaderBgUrl(nextImage);
index = nextIndex;
}, 1000);
}, 600000); // 10 минут
return () => clearInterval(intervalId);
}
}, [mediaData]);
if (isLoading) {
return <div>Loading...</div>;
}
if (isError) {
console.error("Error loading media");
}
return (
<div>
<Helmet>
<title>СКБ "Компьютерное инновационное творчество"</title>
<meta
name="keywords"
content="СКБ, Студенческое конструкторское бюро, Компьютерное инновационное творчество, ИКТИБ, ЮФУ, программирование, IT, инновации, проекты, лаборатории, Таганрог, образование, технологии, разработка, студенческие проекты"
/>
<meta
name="description"
content="Студенческое конструкторское бюро 'Компьютерное инновационное творчество' ИКТИБ ЮФУ - площадка для реализации творческих и инновационных проектов студентов в области IT, робототехники, компьютерного зрения, VR/AR и других современных технологий."
/>
<meta name="robots" content="index,follow,archive" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</Helmet>
<div
id={styles.mainpageheader}
ref={(element) => setRef(element)}
style={{
backgroundImage: headerBgUrl ? `url(${headerBgUrl})` : "none",
}}
>
<section className={styles.container}>
<h1>Думай иначе, будь креативным!</h1>
<h2>
Студенческое конструкторское бюро
<br />
"Компьютерное инновационное творчество"
</h2>
<HashLink smooth to="#contact-us" className={"btn " + styles.btn}>
Связаться с нами
</HashLink>
</section>
</div>
<div className={styles.mainpageContainer}>
<ProjectsList limit={6}/>
<div className={styles.NumbersContainer}>
<Numbers />
</div>
<NewsList limit={6} />
<div className={styles.GalleryContainer}>
<Gallery />
</div>
<div className={styles.LabListContainer}>
<LabsList />
</div>
<div className={styles.mainContainer}>
<Partners />
</div>
<div className={styles.mainContainer}>
<ContactUs />
</div>
</div>
</div>
);
};
export default MainPage;
@@ -0,0 +1,46 @@
import labMock from "@/shared/assets/images/labMock.jpeg";
export const labItems = {
cyber: {
name: "Лаборатория кибернетики",
previewText:
"Управление робототехническими системами, создание аппаратных и программных продуктов, а также проектирование программных систем.",
link: "/labs",
preview: labMock,
},
cv: {
name: "Лаборатория компьютерного зрения",
previewText:
"Работа с методами и технологиями сегментации изображений, ИИ и нейронными сетями.",
link: "/labs",
preview: labMock,
},
st: {
name: "Лаборатория SmartTech",
previewText:
"Проектирование систем в концепции “Интернета вещей” и технологии “Умного дома”.",
link: "/labs",
preview: labMock,
},
vr: {
name: "Лаборатория VR и AR",
previewText:
"Разработка приложений для виртуальной и дополненной реальности, 3D-моделирование.",
link: "/labs",
preview: labMock,
},
mobile: {
name: "Лаборатория мобильной разработки",
previewText:
"Разработка приложений для портативных устройств, создание дизайна и проектов мобильных приложений.",
link: "/labs",
preview: labMock,
},
print: {
name: "Лаборатория 3D-печати и прототипирования",
previewText:
"Проектирование 3D-модели, работа с 3D-принтером и создание качественных трёхмерных макетов.",
link: "/labs",
preview: labMock,
},
};
@@ -0,0 +1,20 @@
#gallery {
margin-left: 0;
margin-right: 0;
h1 {
width: 80%;
margin-left: auto;
margin-right: auto;
font-size: 28px;
font-weight: 400;
line-height: 35px;
letter-spacing: 0em;
text-align: center;
@media (max-width: 768px) {
font-size: 22px;
}
}
}
@@ -0,0 +1,19 @@
import Slider from "@/widgets/Slider/Slider";
import "./Gallery.styles.scss";
function Gallery() {
return (
<div id="gallery">
<h1>
СКБ «КИТ» - реальные технологические
<br />
проекты под руководством наставников
<br />
из университета и бизнеса.
</h1>
<Slider category="gallery" />
</div>
);
}
export default Gallery;
@@ -0,0 +1 @@
export { default } from './Gallery';
+58
View File
@@ -0,0 +1,58 @@
#news-item-page .row {
display: flex;
justify-content: space-between;
margin-top: 2em;
>* {
display: inline-block;
width: fit-content;
}
.icon {
height: $main-font-size;
}
#right {
text-align: right;
color: rgb(100, 100, 100);
.icon {
margin-right: 0.5em;
}
p {
display: inline-block;
}
#date {
margin-left: 1em;
}
}
}
#news-item-page {
.single-image-container {
height: 600px;
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 20px;
img {
max-height: 100%;
width: auto;
max-width: 100%;
object-fit: contain;
pointer-events: none;
}
@media (max-width: 768px) {
height: auto;
img {
width: 100%;
height: auto;
object-fit: contain;
}
}
}
}
+127
View File
@@ -0,0 +1,127 @@
import { useParams } from "react-router-dom";
import { Helmet } from "react-helmet";
import extLink from "@/shared/assets/images/extLink.svg";
import views from "@/shared/assets/images/views.svg";
import { SkeletonPost } from "@/shared/Components/SkeletonPost/SkeletonPost";
import "./NewsItem.styles.scss";
import { useNewsById } from "@/modules/news/hooks/useNewsById";
import { PageContent, PageHeader } from "@/widgets/WpPost";
import Slider from "@/widgets/Slider/Slider";
export const vkWallUrl = "https://vk.com/skbkit?w=wall-172789021";
import { useEffect } from "react";
import { useLocation } from "react-router-dom";
import { stripHtmlTags } from "@/shared/utils/sanitizeText";
export const ScrollToTop = () => {
const { pathname } = useLocation();
useEffect(() => {
window.scrollTo({ top: 0, left: 0, behavior: "instant" });
}, [pathname]);
return null;
};
function NewsItem() {
const params = useParams();
const newsID = params.id;
const { data: news, isLoading, isError } = useNewsById(newsID || "");
const formatDate = (timestamp: number) => {
const date = new Date(timestamp * 1000);
const day = String(date.getDate()).padStart(2, "0");
const month = String(date.getMonth() + 1).padStart(2, "0");
const year = date.getFullYear();
return `${day}.${month}.${year}`; // DD.MM.YYYY
};
if (isLoading)
return (
<div className="mainContainer">
<ScrollToTop />
{[...Array(1)].map((_, index) => (
<SkeletonPost key={index} />
))}
</div>
);
if (isError)
return (
<>
<Helmet>
<title>
Ошибка загрузки новости | СКБ «Компьютерное инновационное
творчество»
</title>
<meta name="robots" content="noindex,nofollow" />
</Helmet>
<center>Ошибка при загрузке новости</center>
</>
);
const newsUrl = `${vkWallUrl}_${newsID}`;
return (
<>
{news && (
<>
<Helmet>
<title>
{news.heading || "Новость"} | СКБ «Компьютерное инновационное
творчество»
</title>
<meta
name="description"
content={
news.text?.[0]?.replace(/<[^>]*>/g, "").slice(0, 160) ||
"Новость СКБ 'Компьютерное инновационное творчество' ИКТИБ ЮФУ"
}
/>
<meta
name="keywords"
content={`СКБ, новости, ${news.heading || ""
}, ИКТИБ, ЮФУ, студенческие проекты, инновации`}
/>
<meta name="robots" content="index,follow" />
</Helmet>
<PageHeader className="header">
<h1>{stripHtmlTags(news.heading)}</h1>
</PageHeader>
<PageContent className="content" id="news-item-page">
{news.photos.length !== 0 &&
(news.photos.length === 1 ? (
<div className="single-image-container">
<img src={news.photos[0]} alt={news.heading} />
</div>
) : (
<Slider images={news.photos} category="news" />
))
}
{news.text.map((textRow, index) => (
<p key={index} dangerouslySetInnerHTML={{ __html: textRow }} />
))}
<div className="row">
<p>
<a href={newsUrl} target="_blank" rel="noreferrer">
Ссылка на новость{" "}
<img className="icon" src={extLink} alt="" />
</a>
</p>
<div id="right">
<p>
<img className="icon" src={views} alt="" />
{news.views}
</p>
<p id="date">Дата публикации: {formatDate(news.date)}</p>
</div>
</div>
</PageContent>
</>
)}
</>
);
}
export default NewsItem;
+19
View File
@@ -0,0 +1,19 @@
import { Helmet } from "react-helmet";
export const NotFoundPage = () => {
return (
<>
<Helmet>
<title>
Страница не найдена | СКБ "Компьютерное инновационное творчество"
</title>
<meta name="robots" content="noindex,nofollow" />
<meta
name="description"
content="Запрашиваемая страница не найдена. Вернитесь на главную страницу СКБ 'Компьютерное инновационное творчество'."
/>
</Helmet>
<div>Такой страницы нету</div>
</>
);
};
+91
View File
@@ -0,0 +1,91 @@
import { usePostById } from "@/modules";
import { WpPost } from "@/widgets/WpPost";
import { useParams } from "react-router-dom";
import { ProjectsList } from "@/widgets/CardList/CardList";
import { SkeletonPost } from "@/shared/Components/SkeletonPost/SkeletonPost";
import { Helmet } from "react-helmet";
import { useEffect } from "react";
function WpPostPage() {
const params = useParams();
const postId = params.id ? parseInt(params.id, 10) : null;
const { data: post, isLoading, isError } = usePostById(postId || -1);
useEffect(() => {
if (post) {
window.scrollTo({ top: 0, behavior: "auto" });
}
}, [post]);
if (!postId) {
return (
<>
<Helmet>
<title>
Пост не найден | СКБ "Компьютерное инновационное творчество"
</title>
<meta name="robots" content="noindex,nofollow" />
</Helmet>
<div>Не указан ID поста</div>
</>
);
}
if (isLoading) {
return (
<div className="mainContainer">
{[...Array(1)].map((_, index) => (
<SkeletonPost key={index} />
))}
</div>
);
}
if (isError) {
return (
<>
<Helmet>
<title>
Ошибка загрузки | СКБ "Компьютерное инновационное творчество"
</title>
<meta name="robots" content="noindex,nofollow" />
</Helmet>
<center>Ошибка при загрузке данных</center>
</>
);
}
return (
<>
{post && (
<>
<Helmet>
<title>
{post.title || "Пост"} | СКБ "Компьютерное инновационное
творчество"
</title>
<meta
name="description"
content={
"Публикация СКБ 'Компьютерное инновационное творчество' ИКТИБ ЮФУ"
}
/>
<meta
name="keywords"
content={`СКБ, ${post.title || ""}, ${post.categories?.join(", ") || ""
}, ИКТИБ, ЮФУ`}
/>
<meta name="robots" content="index,follow" />
</Helmet>
<WpPost post={post} />
{post?.categories?.includes("labs") && (
<ProjectsList tag={post?.tag || -1} />
)}
</>
)}
</>
);
}
export default WpPostPage;
+254
View File
@@ -0,0 +1,254 @@
.card {
position: relative;
display: block;
border-radius: 8px;
overflow: hidden;
transition: all 0.3s ease;
&__lab {
height: 300px;
border: 1px solid transparent;
color: $text-secondary;
.image {
position: absolute;
width: 100%;
height: 100%;
object-fit: cover;
transition: filter 0.3s ease;
pointer-events: none;
z-index: 0;
}
.content {
position: absolute;
bottom: -10px;
left: 0;
padding: 0 30px;
z-index: 2;
transition: bottom 0.3s ease;
}
&::before {
content: "";
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 60%;
background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
z-index: 1;
pointer-events: none;
}
.description {
max-height: 0;
opacity: 0;
margin: 0;
overflow: hidden;
transition: max-height 0.3s ease, opacity 0.3s ease;
}
.link {
opacity: 0;
transform: translateY(10px);
transition: opacity 0.3s ease, transform 0.3s ease;
}
&:hover {
.description {
max-height: 200px;
opacity: 1;
margin-top: 10px;
}
.link {
opacity: 1;
transform: translateY(0);
}
.image {
filter: brightness(0.7);
}
.content {
bottom: 20px;
}
}
}
&__news {
height: 250px;
position: relative;
overflow: hidden;
border-radius: 8px;
.slide_background {
position: absolute;
top: -10%;
left: -10%;
right: -10%;
bottom: -10%;
background-size: cover;
background-position: center;
filter: blur(12px) brightness(0.9);
transform: scale(1.05);
z-index: 1;
opacity: 0.8;
pointer-events: none;
}
.image {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: contain;
object-position: center;
z-index: 1;
pointer-events: none;
transition: transform 0.3s ease;
transform: translateZ(0);
}
.content {
position: absolute;
bottom: 0;
left: 0;
right: 0;
padding: 20px 20px;
color: white;
z-index: 3;
max-height: 60%;
overflow: hidden;
}
.title {
display: -webkit-box;
-webkit-line-clamp: 4;
-webkit-box-orient: vertical;
overflow: hidden;
}
&::before {
content: "";
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 60%;
background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
z-index: 2;
pointer-events: none;
}
}
&__project {
height: 250px;
position: relative;
.image {
position: absolute;
width: 100%;
height: 100%;
object-fit: cover;
transition: filter 0.3s ease;
pointer-events: none;
z-index: 0;
}
.content {
position: absolute;
left: 11px;
bottom: 0;
padding: 20px 20px;
color: $text-card-project;
z-index: 2;
}
&::before {
content: "";
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 60%;
background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
z-index: 1;
pointer-events: none;
}
}
}
.title {
font-size: clamp(1.25rem, 1.0011rem + 0.5199vw, 1.625rem);
font-weight: 600;
}
.description {
p {
font-size: clamp(1rem, 0.8755rem + 0.26vw, 1.1875rem);
line-height: 140%;
display: -webkit-box;
-webkit-line-clamp: 5;
-webkit-box-orient: vertical;
overflow: hidden;
}
margin: 0;
}
.link {
font-size: clamp(12px, 1.5vw, 20px);
font-weight: 500;
}
@media (max-width: 768px) {
.card {
height: 215px !important;
&--lab {
.content {
left: 10px;
right: 10px;
}
}
}
.card__lab {
&:hover {
.title {
font-size: 20px;
}
}
}
.title {
font-size: 22px;
}
.description {
p {
font-size: 16px;
line-height: 18px;
}
}
.link {
font-size: 18px;
}
}
.placeholder {
position: absolute;
width: 100%;
height: 100%;
background-color: #2A3451;
background-image: url("/src/shared/assets/images/kit.svg");
background-repeat: no-repeat;
background-position: center center;
background-size: 70%;
z-index: 0;
}
+52
View File
@@ -0,0 +1,52 @@
import { Link } from "react-router-dom";
import styles from "./Card.module.scss";
import { classNames } from "@/shared/lib/classNames/classNames";
import type { CardData } from "@/widgets/CardList/types";
import { stripHtmlTags } from "@/shared/utils/sanitizeText";
interface CardProps {
data: CardData & { variant?: "lab" | "news" | "project" };
}
export const Card = ({ data }: CardProps) => {
const { id, name, previewText, preview, link, variant = "lab" } = data;
return (
<Link
className={classNames(styles.card, {}, [styles[`card__${variant}`]])}
to={link || `/${id || name}`}
>
{preview ? (
<>
<div
className={styles.slide_background}
style={{ backgroundImage: `url(${preview})` }}
/>
<img
src={preview}
alt={name}
className={styles.image}
loading="lazy"
/>
<div className={styles.content}>
<h3 className={styles.title}>{stripHtmlTags(name)}</h3>
{previewText && variant === "lab" && (
<div className={styles.description}>
<p>{previewText}</p>
</div>
)}
{variant === "lab" && (
<div className={styles.link}>
<span>Перейти ⟶</span>
</div>
)}
</div>
</>
) : (
<div className={styles.placeholder} />
)}
</Link>
);
};
+14
View File
@@ -0,0 +1,14 @@
// Тип для вариантов карточки
export interface CardData {
id?: string; // Опционально, если используется name как уникальный идентификатор
name: string; // Название лаборатории
previewText: string; // Описание
link: string; // Ссылка
preview: string; // URL изображения
variant?: "lab" | "news" | "project"; // Вариант карточки
}
// Пропсы компонента Card
export interface CardProps {
data: CardData;
}
@@ -0,0 +1,175 @@
// .field {
// padding: 12px 16px;
// border: none;
// border-radius: 8px;
// font-size: 16px;
// font-weight: 400;
// }
// .field.big {
// height: 200px;
// line-height: 30px;
// resize: none;
// }
// .file-input {
// position: relative;
// width: fit-content;
// input {
// position: absolute;
// z-index: -1;
// opacity: 0;
// display: block;
// width: 0;
// height: 0;
// }
// .upload-file-btn {
// display: flex;
// cursor: pointer;
// .icon {
// margin-right: 6px;
// height: 22px;
// }
// span {
// display: inline-block;
// font-size: 18px;
// }
// }
// }
// .file-input input:focus + .upload-file-btn {
// outline: -webkit-focus-ring-color auto 1px;
// }
.field-container {
display: flex;
flex-wrap: wrap;
gap: 8px;
.field {
width: 100%;
}
}
.error-message {
color: rgb(239, 68, 68);
}
// Field.styles.scss
.field-container {
width: 100%;
position: relative;
.field,
.field.big,
.submit.btn {
width: 100%;
padding: 12px 16px;
border: 1px solid #ccc;
border-radius: 4px;
font-size: 1rem;
transition: all 0.3s ease;
// Стили для disabled состояния
&:disabled {
opacity: 0.7;
background-color: #f5f5f5;
cursor: not-allowed;
border-color: #e0e0e0;
color: #a0a0a0;
}
&:focus {
outline: none;
border-color: #007bff;
box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}
}
.field.big {
min-height: 120px;
resize: vertical;
}
.submit.btn {
border-radius: 8px;
&:hover:not(:disabled) {
background-color: #0069d9;
}
&:disabled {
background-color: #b0c4de;
}
}
.file-input-container {
display: flex;
align-items: center;
gap: 8px;
.file-input {
flex-grow: 1;
input[type="file"] {
display: none;
}
.upload-file-btn {
display: flex;
align-items: center;
gap: 8px;
padding: 12px 16px;
border: 1px dashed #ccc;
border-radius: 4px;
cursor: pointer;
transition: all 0.3s ease;
&:hover:not(:disabled) {
border-color: #007bff;
background-color: #f8f9fa;
}
&:disabled {
opacity: 0.7;
cursor: not-allowed;
background-color: #f5f5f5;
}
}
}
.remove-btn {
background: none;
border: none;
cursor: pointer;
padding: 0;
display: flex;
align-items: center;
&:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.icon.remove {
width: 16px;
height: 16px;
opacity: 0.7;
transition: opacity 0.2s;
&:hover {
opacity: 1;
}
}
}
}
.error-message {
color: #dc3545;
font-size: 0.875rem;
margin-top: 4px;
display: block;
}
}
+112
View File
@@ -0,0 +1,112 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import "./Field.styles.scss";
import cross from "@/shared/assets/images/cross.svg";
import fileUpload from "@/shared/assets/images/fileUpload.svg";
import { ForwardedRef, forwardRef } from "react";
import {
FieldError,
FieldErrorsImpl,
Merge,
UseFormRegisterReturn,
} from "react-hook-form";
type FieldType =
| "text"
| "email"
| "submit"
| "file"
| "textarea"
| "textarea"
| "password"
| "tel";
interface FieldProps {
type: FieldType;
name: string;
placeholder?: string;
disabled?: boolean;
fileAttached?: boolean;
error?:
| string
| FieldError
| Merge<FieldError, FieldErrorsImpl<any>>
| undefined;
handleRemoveFile?: () => void;
register?: UseFormRegisterReturn;
}
const Field = forwardRef(
(
{
type,
placeholder,
disabled = false,
fileAttached = false,
error,
handleRemoveFile,
register,
}: FieldProps,
ref: ForwardedRef<HTMLInputElement | HTMLTextAreaElement>
) => {
const className =
type === "submit"
? "submit btn"
: type === "textarea"
? "field big"
: "field";
return (
<div className="field-container">
{type === "textarea" ? (
<textarea
className={className}
placeholder={placeholder}
disabled={disabled}
ref={ref as ForwardedRef<HTMLTextAreaElement>}
{...register}
/>
) : type === "file" ? (
<div className="file-input-container">
<label className="file-input">
<input
type="file"
accept=".doc,.docx,.txt,.pdf,.ppt,.pptx"
disabled={disabled}
{...register}
/>
<div className="upload-file-btn">
<img src={fileUpload} alt="" className="icon" />
<span>
{fileAttached ? "Файл прикреплен" : "Прикрепить файл"}
</span>
</div>
</label>
{fileAttached && (
<button
type="button"
className="remove-btn icon"
onClick={handleRemoveFile}
>
<img src={cross} alt="Открепить файл" className="icon remove" />
</button>
)}
</div>
) : (
<input
className={className}
type={type}
placeholder={placeholder}
disabled={disabled}
ref={ref as ForwardedRef<HTMLInputElement>}
{...register}
/>
)}
{error && <span className="error-message">{String(error)}</span>}
</div>
);
}
);
Field.displayName = "Field";
export default Field;
+1
View File
@@ -0,0 +1 @@
export { default } from './Field';
@@ -0,0 +1,88 @@
.card {
position: relative;
width: 100%;
height: 250px;
border-radius: 8px;
background-color: #e0e0e0;
overflow: hidden;
@media (max-width: 768px) {
height: 215px !important;
}
}
.pic {
width: 100%;
height: 100%;
border-radius: 8px;
background-color: #ddd;
position: relative;
}
.shimmer {
position: absolute;
top: 0;
left: -150%;
width: 100%;
height: 100%;
background: linear-gradient(90deg,
rgba(255, 255, 255, 0) 0%,
rgba(255, 255, 255, 0.6) 50%,
rgba(255, 255, 255, 0) 100%);
animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
0% {
left: -150%;
}
100% {
left: 150%;
}
}
.labsCard {
height: 300px;
@media (max-width: 768px) {
height: 215px !important;
}
}
.titleSkeleton {
margin: 0 10%;
@include mediaMax($mobile-xs-width) {
margin: 0 5%;
}
height: 40px;
width: 25.3%;
border-radius: 4px;
background-color: #e0e0e0;
position: relative;
overflow: hidden;
margin-bottom: 16px;
@media (max-width: 768px) {
height: 32px;
width: 70%;
margin-bottom: 16px;
}
}
.titleSkeleton::after {
content: "";
position: absolute;
top: 0;
left: -150%;
width: 100%;
height: 100%;
background: linear-gradient(
90deg,
rgba(255, 255, 255, 0) 0%,
rgba(255, 255, 255, 0.6) 50%,
rgba(255, 255, 255, 0) 100%
);
animation: shimmer 1.5s infinite;
}
@@ -0,0 +1,23 @@
// shared/Components/SkeletonCard/SkeletonCard.tsx
import styles from "./SkeletonCard.module.scss";
interface SkeletonCardProps {
variant?: "default" | "lab";
}
const SkeletonCard = ({ variant = "default" }: SkeletonCardProps) => {
const cardClass =
variant === "lab"
? `${styles.card} ${styles.labsCard}`
: styles.card;
return (
<div className={cardClass}>
<div className={styles.pic}>
<div className={styles.shimmer}></div>
</div>
</div>
);
};
export default SkeletonCard;
@@ -0,0 +1,15 @@
.skeletonGrid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 2rem;
width: 100%;
margin: 0 10%;
@media (max-width: 768px) {
grid-template-columns: repeat(1, 1fr);
}
@media (min-width: 769px) and (max-width: 1024px) {
grid-template-columns: repeat(2, 1fr);
}
}
@@ -0,0 +1,32 @@
import React from "react";
import SkeletonCard from "./SkeletonCard";
import styles from "@/shared/styles/cardGrid.module.scss";
interface SkeletonGridProps {
count?: number;
gridConfig?: { desktop: number; tablet: number; mobile: number };
variant?: "default" | "lab";
}
export const SkeletonGrid = ({
count = 3,
gridConfig = { desktop: 3, tablet: 2, mobile: 1 },
variant = "default",
}: SkeletonGridProps) => {
return (
<div className={styles.mainContainer}>
<div
className={styles.gridСontainer}
style={{
"--desktop-columns": gridConfig.desktop,
"--tablet-columns": gridConfig.tablet,
"--mobile-columns": gridConfig.mobile,
} as React.CSSProperties}
>
{[...Array(count)].map((_, index) => (
<SkeletonCard key={index} variant={variant} />
))}
</div>
</div>
);
};
@@ -0,0 +1,109 @@
// shared/Components/SkeletonGallery/SkeletonGallery.module.scss
.skeletonGallery {
margin: 0 10%;
text-align: left;
display: block;
@media (max-width: $mobile-xs-width) {
margin: 0 5%;
}
}
.title {
height: 44px;
width: 25%;
background-color: #e0e0e0;
border-radius: 4px;
margin-bottom: 16px;
margin-top: 20px;
position: relative;
overflow: hidden;
@media (max-width: $tablet-max-width) {
height: 32px;
}
&::after {
content: '';
position: absolute;
top: 0;
left: -150%;
width: 100%;
height: 100%;
background: linear-gradient(
90deg,
rgba(255, 255, 255, 0) 0%,
rgba(255, 255, 255, 0.6) 50%,
rgba(255, 255, 255, 0) 100%
);
animation: shimmer 1.5s infinite;
}
}
.images {
display: grid;
grid-template-columns: repeat(6, 1fr);
gap: 32px;
@media (max-width: $tablet-max-width) {
grid-template-columns: repeat(2, 1fr);
}
@media (max-width: $mobile-xs-width) {
grid-template-columns: 1fr;
}
}
.imageContainer {
height: 352px;
background-color: #e0e0e0;
border-radius: 8px;
position: relative;
overflow: hidden;
&::after {
content: '';
position: absolute;
top: 0;
left: -150%;
width: 100%;
height: 100%;
background: linear-gradient(
90deg,
rgba(255, 255, 255, 0) 0%,
rgba(255, 255, 255, 0.6) 50%,
rgba(255, 255, 255, 0) 100%
);
animation: shimmer 1.5s infinite;
}
}
.wide {
grid-column: span 4;
}
.narrow {
grid-column: span 2;
}
@keyframes shimmer {
0% {
left: -150%;
}
100% {
left: 150%;
}
}
@media (max-width: $tablet-max-width) {
.wide,
.narrow {
grid-column: span 1;
}
}
@media (max-width: $mobile-xs-width) {
.wide,
.narrow {
grid-column: span 1;
}
}
@@ -0,0 +1,21 @@
import styles from "./SkeletonGallery.module.scss";
export const SkeletonGallery = () => {
return (
<div className={styles.skeletonGallery}>
<div className={styles.title}></div>
<div className={styles.images}>
<div className={`${styles.imageContainer} ${styles.wide}`}></div>
<div className={`${styles.imageContainer} ${styles.narrow}`}></div>
<div className={`${styles.imageContainer} ${styles.narrow}`}></div>
<div className={`${styles.imageContainer} ${styles.narrow}`}></div>
<div className={`${styles.imageContainer} ${styles.narrow}`}></div>
<div className={`${styles.imageContainer} ${styles.narrow}`}></div>
<div className={`${styles.imageContainer} ${styles.wide}`}></div>
</div>
</div>
);
};
@@ -0,0 +1,51 @@
.card {
position: relative;
width: 100%;
height: 250px;
border-radius: 8px;
background-color: #e0e0e0;
overflow: hidden;
@media (max-width: 768px) {
height: 215px !important;
}
}
.pic {
width: 100%;
height: 100%;
border-radius: 8px;
background-color: #ddd;
position: relative;
}
.shimmer {
position: absolute;
top: 0;
left: -150%;
width: 100%;
height: 100%;
background: linear-gradient(90deg,
rgba(255, 255, 255, 0) 0%,
rgba(255, 255, 255, 0.6) 50%,
rgba(255, 255, 255, 0) 100%);
animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
0% {
left: -150%;
}
100% {
left: 150%;
}
}
.labsCard {
height: 300px;
@media (max-width: 768px) {
height: 215px !important;
}
}
@@ -0,0 +1,23 @@
// shared/Components/SkeletonCard/SkeletonCard.tsx
import styles from "./SkeletonCard.module.scss";
interface SkeletonCardProps {
variant?: "default" | "lab";
}
const SkeletonCard = ({ variant = "default" }: SkeletonCardProps) => {
const cardClass =
variant === "lab"
? `${styles.card} ${styles.labsCard}`
: styles.card;
return (
<div className={cardClass}>
<div className={styles.pic}>
<div className={styles.shimmer}></div>
</div>
</div>
);
};
export default SkeletonCard;
@@ -0,0 +1,15 @@
.skeletonGrid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 2rem;
width: 100%;
margin: 0 10%;
@media (max-width: 768px) {
grid-template-columns: repeat(1, 1fr);
}
@media (min-width: 769px) and (max-width: 1024px) {
grid-template-columns: repeat(2, 1fr);
}
}
@@ -0,0 +1,33 @@
// shared/ui/SkeletonGrid/SkeletonGrid.tsx
import React from "react";
import SkeletonCard from "./SkeletonCard";
import styles from "@/shared/styles/cardGrid.module.scss";
interface SkeletonGridProps {
count?: number;
gridConfig?: { desktop: number; tablet: number; mobile: number };
variant?: "default" | "lab";
}
export const SkeletonGrid = ({
count = 3,
gridConfig = { desktop: 3, tablet: 2, mobile: 1 },
variant = "default",
}: SkeletonGridProps) => {
return (
<div className={styles.mainContainer}>
<div
className={styles.gridСontainer}
style={{
"--desktop-columns": gridConfig.desktop,
"--tablet-columns": gridConfig.tablet,
"--mobile-columns": gridConfig.mobile,
} as React.CSSProperties}
>
{[...Array(count)].map((_, index) => (
<SkeletonCard key={index} variant={variant} />
))}
</div>
</div>
);
};
@@ -0,0 +1,101 @@
.skeletonPost {
padding-top: 10px;
padding-bottom: 20px;
display: flex;
flex-direction: column;
width: 100%;
gap: 16px;
}
.topLine {
height: 32px;
width: 300px;
background-color: #e0e0e0;
border-radius: 4px;
position: relative;
overflow: hidden;
&::after {
content: '';
position: absolute;
top: 0;
left: -150%;
width: 100%;
height: 100%;
background: linear-gradient(
90deg,
rgba(255, 255, 255, 0) 0%,
rgba(255, 255, 255, 0.6) 50%,
rgba(255, 255, 255, 0) 100%
);
animation: shimmer 1.5s infinite;
}
}
.textLine {
height: 32px;
background-color: #e0e0e0;
border-radius: 4px;
position: relative;
overflow: hidden;
&::after {
content: '';
position: absolute;
top: 0;
left: -150%;
width: 100%;
height: 100%;
background: linear-gradient(
90deg,
rgba(255, 255, 255, 0) 0%,
rgba(255, 255, 255, 0.6) 50%,
rgba(255, 255, 255, 0) 100%
);
animation: shimmer 1.5s infinite;
}
}
.splitLine {
display: flex;
justify-content: space-between;
gap: 16px;
background: none;
overflow: visible;
> div {
height: 32px;
border-radius: 4px;
background-color: #e0e0e0;
position: relative;
overflow: hidden;
&::after {
content: '';
position: absolute;
top: 0;
left: -150%;
width: 100%;
height: 100%;
background: linear-gradient(
90deg,
rgba(255, 255, 255, 0) 0%,
rgba(255, 255, 255, 0.6) 50%,
rgba(255, 255, 255, 0) 100%
);
animation: shimmer 1.5s infinite;
}
}
}
.thirty { width: 30%; }
.seventy { width: 70%; }
@keyframes shimmer {
0% {
left: -150%;
}
100% {
left: 150%;
}
}
@@ -0,0 +1,22 @@
import styles from "./SkeletonPost.module.scss";
export const SkeletonPost = () => {
return (
<div className={styles.skeletonPost}>
<div className={styles.topLine}></div>
<div className={styles.textLine}></div>
<div className={styles.splitLine}>
<div className={styles.seventy}></div>
<div className={styles.thirty}></div>
</div>
<div className={styles.textLine}></div>
<div className={styles.splitLine}>
<div className={styles.thirty}></div>
<div className={styles.seventy}></div>
</div>
<div className={styles.textLine}></div>
</div>
);
};
@@ -0,0 +1,60 @@
.sliderSkeleton {
width: 100%;
margin: 0 auto;
position: relative;
padding: 10px 0;
}
.slideContainer {
display: flex;
gap: 20px;
@media (max-width: 768px) {
flex-direction: column;
gap: 15px;
}
}
.slide {
flex: 1;
position: relative;
overflow: hidden;
border-radius: 8px;
}
.image {
width: 100%;
height: 350px;
background-color: #e0e0e0;
position: relative;
overflow: hidden;
@media (max-width: 768px) {
height: 250px;
}
&::after {
content: '';
position: absolute;
top: 0;
left: -150%;
width: 100%;
height: 100%;
background: linear-gradient(
90deg,
rgba(255, 255, 255, 0) 0%,
rgba(255, 255, 255, 0.6) 50%,
rgba(255, 255, 255, 0) 100%
);
animation: shimmer 1.5s infinite;
}
}
@keyframes shimmer {
0% {
left: -150%;
}
100% {
left: 150%;
}
}
@@ -0,0 +1,17 @@
import styles from "./SkeletonSlider.module.scss";
export const SkeletonSlider = () => {
const skeletonCount = window.innerWidth > 768 ? 2 : 1;
return (
<div className={styles.sliderSkeleton}>
<div className={styles.slideContainer}>
{[...Array(skeletonCount)].map((_, index) => (
<div key={index} className={styles.slide}>
<div className={styles.image}></div>
</div>
))}
</div>
</div>
);
};
@@ -0,0 +1,41 @@
// shared/lib/withLoading/withLoading.tsx
import React from "react";
import { SkeletonGrid } from "../SkeletonGrid/SkeletonGrid";
import styles from "../Skeleton/SkeletonCard.module.scss";
interface WithLoadingProps {
isLoading: boolean;
isError: boolean;
count?: number;
gridConfig?: { desktop: number; tablet: number; mobile: number };
variant?: "default" | "lab";
children: React.ReactNode;
}
export const WithLoading = ({
isLoading,
isError,
count = 3,
gridConfig = { desktop: 3, tablet: 2, mobile: 1 },
variant = "default",
children,
}: WithLoadingProps) => {
if (isLoading) {
return (
<div>
<div className={styles.titleSkeleton}></div>
<SkeletonGrid
count={count}
gridConfig={gridConfig}
variant={variant}
/>
</div>
);
}
if (isError) {
return <center>Ошибка при загрузке данных</center>;
}
return <>{children}</>;
};
+65
View File
@@ -0,0 +1,65 @@
import Parse from "html-react-parser";
export type ParsedContent =
| { type: "html"; element: any } // Сохраняем исходные HTML-элементы
| { type: "mediablock"; value: string[] } // Группируем медиа-элементы
| { type: "slider"; value: string[] }; // Группируем картинки под слайдер
export const parseContent = (html: string): ParsedContent[] => {
const elements = Parse(html);
const result: ParsedContent[] = [];
let mediaBuffer: string[] = [];
const processNode = (node: any) => {
if (typeof node === "string") {
// Пустые строки (например, переносы строк) игнорируем
if (node.trim() !== "") {
result.push({ type: "html", element: node });
}
return;
}
// Обработка медиа-элементов (img внутри figure)
if (node.type === "figure" && node.props.className.includes('wp-block-image')) {
const imgSrc = node.props.children?.props?.src;
if (imgSrc) {
mediaBuffer.push(imgSrc);
}
return; // Пропускаем добавление figure в результат
}
// Если есть накопленные медиа-элементы, добавляем их как mediablock
if (mediaBuffer.length > 0) {
result.push({ type: "mediablock", value: [...mediaBuffer] });
mediaBuffer = [];
}
if (node.props.className?.includes('wp-block-gallery')) {
const slider = [];
for (const child of node.props.children) {
const imgSrc = child.props?.children.props?.src;
if (imgSrc) {
slider.push(imgSrc);
}
}
result.push({ type: "slider", value: slider });
return;
}
// Сохраняем текущий элемент как есть
result.push({ type: "html", element: node });
};
if (Array.isArray(elements)) {
elements.forEach(processNode);
} else {
processNode(elements);
}
// Добавляем оставшиеся медиа-элементы, если они есть
if (mediaBuffer.length > 0) {
result.push({ type: "mediablock", value: [...mediaBuffer] });
}
return result;
};
+34
View File
@@ -0,0 +1,34 @@
import { useEffect, useState } from "react";
interface AcfField {
mainpage_header_bg?: {
url: string;
};
}
interface WpPage {
acf?: AcfField;
}
export function useWpMainPageData() {
const [bgImage, setBgImage] = useState<string>("");
useEffect(() => {
// Заменяй slug на нужный слаг твоей главной страницы в WP
fetch("http://10.131.170.140/wp-json/wp/v2/pages?slug=main")
.then((res) => res.json())
.then((data: WpPage[]) => {
if (data && data.length > 0) {
const page = data[0];
if (page.acf && page.acf.mainpage_header_bg) {
setBgImage(page.acf.mainpage_header_bg.url);
}
}
})
.catch((err) => {
console.error("Ошибка при загрузке данных WP:", err);
});
}, []);
return { bgImage };
}
@@ -0,0 +1,93 @@
Copyright 2024 The Montserrat.Git Project Authors (https://github.com/JulietaUla/Montserrat.git)
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
https://openfontlicense.org
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -0,0 +1,81 @@
Montserrat Variable Font
========================
This download contains Montserrat as both variable fonts and static fonts.
Montserrat is a variable font with this axis:
wght
This means all the styles are contained in these files:
Montserrat-VariableFont_wght.ttf
Montserrat-Italic-VariableFont_wght.ttf
If your app fully supports variable fonts, you can now pick intermediate styles
that aren’t available as static fonts. Not all apps support variable fonts, and
in those cases you can use the static font files for Montserrat:
static/Montserrat-Thin.ttf
static/Montserrat-ExtraLight.ttf
static/Montserrat-Light.ttf
static/Montserrat-Regular.ttf
static/Montserrat-Medium.ttf
static/Montserrat-SemiBold.ttf
static/Montserrat-Bold.ttf
static/Montserrat-ExtraBold.ttf
static/Montserrat-Black.ttf
static/Montserrat-ThinItalic.ttf
static/Montserrat-ExtraLightItalic.ttf
static/Montserrat-LightItalic.ttf
static/Montserrat-Italic.ttf
static/Montserrat-MediumItalic.ttf
static/Montserrat-SemiBoldItalic.ttf
static/Montserrat-BoldItalic.ttf
static/Montserrat-ExtraBoldItalic.ttf
static/Montserrat-BlackItalic.ttf
Get started
-----------
1. Install the font files you want to use
2. Use your app's font picker to view the font family and all the
available styles
Learn more about variable fonts
-------------------------------
https://developers.google.com/web/fundamentals/design-and-ux/typography/variable-fonts
https://variablefonts.typenetwork.com
https://medium.com/variable-fonts
In desktop apps
https://theblog.adobe.com/can-variable-fonts-illustrator-cc
https://helpx.adobe.com/nz/photoshop/using/fonts.html#variable_fonts
Online
https://developers.google.com/fonts/docs/getting_started
https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Fonts/Variable_Fonts_Guide
https://developer.microsoft.com/en-us/microsoft-edge/testdrive/demos/variable-fonts
Installing fonts
MacOS: https://support.apple.com/en-us/HT201749
Linux: https://www.google.com/search?q=how+to+install+a+font+on+gnu%2Blinux
Windows: https://support.microsoft.com/en-us/help/314960/how-to-install-or-remove-a-font-in-windows
Android Apps
https://developers.google.com/fonts/docs/android
https://developer.android.com/guide/topics/ui/look-and-feel/downloadable-fonts
License
-------
Please read the full license text (OFL.txt) to understand the permissions,
restrictions and requirements for usage, redistribution, and modification.
You can use them in your products & projects – print or digital,
commercial or otherwise.
This isn't legal advice, please consider consulting a lawyer and see the full
license for all details.
Loaded 100 of 257 files, more files were not shown because too many files have changed in this diff. Show more