Merge pull request #48 from ifraimka1/fix/fonts

Fix/fonts
This commit is contained in:
Ifraim Solomonov authored and GitHub committed 2025-05-06 13:33:27 +03:00
commit 1303ba3c89
24 files changed
+588 -55

No files matched your search

+2 -2
View File
@@ -6,8 +6,8 @@
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> <link rel="icon" type="image/svg+xml" href="/vite.svg" />
<link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap" <!-- <link href="https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap"
rel="stylesheet"> rel="stylesheet"> -->
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+2 -3
View File
@@ -2,14 +2,13 @@
@import "global"; @import "global";
@import "variables/variables"; @import "variables/variables";
@import "reset"; @import "reset";
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');
@font-face { @font-face {
font-family: "Montserrat"; font-family: 'Montserrat', sans-serif;
font-style: normal; font-style: normal;
font-weight: 100 900; font-weight: 100 900;
font-display: swap; font-display: swap;
src: url("../fonts/Montserrat/Montserrat-VariableFont_wght.ttf")
format("truetype");
} }
.app { .app {
min-height: 100%; min-height: 100%;
+3 -1
View File
@@ -1,3 +1,5 @@
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');
input { input {
border: none; border: none;
} }
@@ -16,7 +18,7 @@ body,
input, input,
textarea, textarea,
button { button {
font-family: Montserrat; font-family: 'Montserrat', sans-serif;
} }
code { code {
@@ -72,7 +72,7 @@ body {
background: transparent !important; background: transparent !important;
h1 { h1 {
font-family: Montserrat; font-family: 'Montserrat', sans-serif;
font-size: 36px; font-size: 36px;
font-weight: 600; font-weight: 600;
+5 -2
View File
@@ -2,6 +2,7 @@ import { useParams } from "react-router-dom";
import extLink from "@/shared/assets/images/extLink.svg"; import extLink from "@/shared/assets/images/extLink.svg";
import views from "@/shared/assets/images/views.svg"; import views from "@/shared/assets/images/views.svg";
import {SkeletonPost} from "@/shared/Components/SkeletonPost/SkeletonPost";
import "./NewsItem.styles.scss"; import "./NewsItem.styles.scss";
import { useNewsById } from "@/modules/news/hooks/useNewsById"; import { useNewsById } from "@/modules/news/hooks/useNewsById";
@@ -25,10 +26,12 @@ function NewsItem() {
if (isLoading) if (isLoading)
return ( return (
<div className="mainContainer"> <div className="mainContainer">
<span className="loader"></span> {[...Array(1)].map((_, index) => (
<SkeletonPost key={index} />
))}
</div> </div>
); );
if (isError) return <div>Ошибка при загрузке новости</div>; if (isError) return <center>Ошибка при загрузке новости</center>;
const newsUrl = `${vkWallUrl}_${newsID}`; const newsUrl = `${vkWallUrl}_${newsID}`;
+5 -2
View File
@@ -2,6 +2,7 @@ import { usePostById } from "@/modules";
import { WpPost } from "@/widgets/WpPost"; import { WpPost } from "@/widgets/WpPost";
import { useParams } from "react-router-dom"; import { useParams } from "react-router-dom";
import { ProjectsList } from "@/widgets/CardList/CardList"; import { ProjectsList } from "@/widgets/CardList/CardList";
import { SkeletonPost } from "@/shared/Components/SkeletonPost/SkeletonPost";
function WpPostPage() { function WpPostPage() {
const params = useParams(); const params = useParams();
@@ -16,13 +17,15 @@ function WpPostPage() {
if (isLoading) { if (isLoading) {
return ( return (
<div className="mainContainer"> <div className="mainContainer">
<span className="loader"></span> {[...Array(1)].map((_, index) => (
<SkeletonPost key={index} />
))}
</div> </div>
); );
} }
if (isError) { if (isError) {
return <div>Ошибка при загрузке данных</div>; return <center>Ошибка при загрузке данных</center>;
} }
console.log('post', post); console.log('post', post);
return (<> return (<>
@@ -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;
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,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,15 @@
import styles from "./SkeletonSlider.module.scss";
export const SkeletonSlider = () => {
return (
<div className={styles.sliderSkeleton}>
<div className={styles.slideContainer}>
{[...Array(2)].map((_, index) => (
<div key={index} className={styles.slide}>
<div className={styles.image}></div>
</div>
))}
</div>
</div>
);
};
@@ -1,6 +1,7 @@
// shared/lib/withLoading/withLoading.tsx // shared/lib/withLoading/withLoading.tsx
import React from "react"; import React from "react";
import { SkeletonGrid } from "../SkeletonGrid/SkeletonGrid"; import { SkeletonGrid } from "../SkeletonGrid/SkeletonGrid";
import styles from "../Skeleton/SkeletonCard.module.scss";
interface WithLoadingProps { interface WithLoadingProps {
isLoading: boolean; isLoading: boolean;
@@ -21,16 +22,19 @@ export const WithLoading = ({
}: WithLoadingProps) => { }: WithLoadingProps) => {
if (isLoading) { if (isLoading) {
return ( return (
<SkeletonGrid <div>
count={count} <div className={styles.titleSkeleton}></div>
gridConfig={gridConfig} <SkeletonGrid
variant={variant} count={count}
/> gridConfig={gridConfig}
variant={variant}
/>
</div>
); );
} }
if (isError) { if (isError) {
return <div>Ошибка при загрузке данных</div>; return <center>Ошибка при загрузке данных</center>;
} }
return <>{children}</>; return <>{children}</>;
+5 -2
View File
@@ -1,5 +1,6 @@
import { usePosts } from "@/modules/posts/hooks/usePosts"; import { usePosts } from "@/modules/posts/hooks/usePosts";
import { WpPost } from "@/widgets/WpPost"; import { WpPost } from "@/widgets/WpPost";
import {SkeletonPost} from "@/shared/Components/SkeletonPost/SkeletonPost";
interface CategoryPageProps { interface CategoryPageProps {
category: string; category: string;
@@ -15,10 +16,12 @@ export function CategoryPage({ category }: CategoryPageProps) {
if (isLoading) if (isLoading)
return ( return (
<div className="mainContainer"> <div className="mainContainer">
<span className="loader"></span> {[...Array(1)].map((_, index) => (
<SkeletonPost key={index} />
))}
</div> </div>
); );
if (isError) return <div>Ошибка при загрузке данных</div>; if (isError) return <center>Ошибка при загрузке данных</center>;
return ( return (
<> <>
+46 -18
View File
@@ -1,4 +1,3 @@
#footer { #footer {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
@@ -80,9 +79,11 @@
gap: 32px; gap: 32px;
justify-content: center; justify-content: center;
} }
.copyright { .copyright {
display: none; display: none;
} }
.visible { .visible {
display: block; display: block;
} }
@@ -100,6 +101,7 @@
.visible { .visible {
display: none !important; display: none !important;
} }
.copyright { .copyright {
display: block !important; // Показываем текст внизу только в мобильной версии display: block !important; // Показываем текст внизу только в мобильной версии
text-align: center; text-align: center;
@@ -122,6 +124,7 @@
display: flex; display: flex;
justify-content: center; justify-content: center;
gap: 20px; gap: 20px;
.logo { .logo {
height: auto; height: auto;
width: 100%; width: 100%;
@@ -163,37 +166,62 @@
} }
} }
} }
.footer-links-container { .footer-links-container {
display: flex; display: flex;
flex-direction: column; /* Arrange links vertically */ flex-direction: column;
justify-content: space-between; /* Spread out the items */ /* Arrange links vertically */
height: 100%; /* Make sure the container takes up full height */ justify-content: space-between;
/* Spread out the items */
height: 100%;
/* Make sure the container takes up full height */
} }
.footer-links { .footer-links {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
gap: 30px; // Между столбиками будет отступ gap: 30px; // Между столбиками будет отступ
.footer-column { .footer-column {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 20px; // Расстояние между ссылками в одном столбике gap: 20px;
a { a {
color: white; // Белый цвет текста color: white;
text-decoration: none; // Убираем подчеркивание text-decoration: none;
font-size: 16px; // Размер текста font-size: 16px;
position: relative;
&::after {
content: '';
position: absolute;
left: 50%;
bottom: -5px;
width: 0;
height: 1px;
background-color: white;
transition: width 0.3s ease, left 0.3s ease;
transform: translateX(-50%);
}
&:hover::after {
width: calc(100% + 8px);
left: 50%;
transform: translateX(-50%);
}
} }
} }
}
.privacy-policy {
align-self: flex-end; /* Align the "Политика конфиденциальности" link to the bottom */
margin-top: auto; /* Ensure the link is pushed to the bottom */
} }
.privacy-policy {
align-self: flex-end;
/* Align the "Политика конфиденциальности" link to the bottom */
margin-top: auto;
/* Ensure the link is pushed to the bottom */
}
} }
#root:has(#mainpageheader) #footer { #root:has(#mainpageheader) #footer {
+1 -1
View File
@@ -10,7 +10,7 @@ $logo-size: 200px;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
h1 { h1 {
font-family: Montserrat; font-family: 'Montserrat', sans-serif;
font-size: 36px; font-size: 36px;
font-weight: 600; font-weight: 600;
margin-bottom: 1.5rem; margin-bottom: 1.5rem;
@@ -13,7 +13,7 @@
font-weight: 600; font-weight: 600;
line-height: 44px; line-height: 44px;
margin-top: 0; margin-top: 0;
margin-bottom: 8px; margin-bottom: 16px;
@include mediaMax($tablet-max-width) { @include mediaMax($tablet-max-width) {
font-size: 24px; font-size: 24px;
+11 -9
View File
@@ -1,5 +1,6 @@
import { useState } from "react"; import { useState } from "react";
import { useMedia } from "@/modules/media/hooks/useMedia"; import { useMedia } from "@/modules/media/hooks/useMedia";
import { SkeletonGallery } from "@/shared/Components/SkeletonGallery/SkeletonGallery";
import "./PhotoGallery.style.scss" import "./PhotoGallery.style.scss"
@@ -14,16 +15,19 @@ const PhotoGallery = ({ images }: PhotoGalleryProps) => {
const filteredMedia = images const filteredMedia = images
? images.map((src, id) => ({ id, src })) ? images.map((src, id) => ({ id, src }))
: mediaData || []; // без фильтра : mediaData || [];
if (isLoading) if (isLoading) {
return ( return (
<div className="mainContainer"> <div>
<span className="loader"></span> <SkeletonGallery />
</div> </div>
); );
}
if (isError) return <div>Ошибка при загрузке медиа</div>; if (isError || !filteredMedia || filteredMedia.length === 0) {
return <center>Ошибка при загрузке медиа</center>;
}
return ( return (
<div className="mainContainer"> <div className="mainContainer">
@@ -39,12 +43,10 @@ const PhotoGallery = ({ images }: PhotoGalleryProps) => {
</div> </div>
))} ))}
</div> </div>
<div className="btn">Загрузить ещё</div>
<div className="btn">
Загрузить ещё
</div>
</div> </div>
); );
}; };
export default PhotoGallery; export default PhotoGallery;
+7 -3
View File
@@ -10,6 +10,8 @@ import "swiper/css/pagination";
import "./Slider.styles.scss"; import "./Slider.styles.scss";
import { MediaItem } from "@/modules/media/api/get"; import { MediaItem } from "@/modules/media/api/get";
import { SkeletonSlider } from "@/shared/Components/SkeletonSlider/SkeletonSlider";
interface SliderProps { interface SliderProps {
autoPlay?: boolean; autoPlay?: boolean;
autoPlayTime?: number; autoPlayTime?: number;
@@ -72,11 +74,13 @@ function Slider({
if (isLoading) if (isLoading)
return ( return (
<div className="mainContainer"> <div >
<span className="loader"></span> {[...Array(1)].map((_, index) => (
<SkeletonSlider key={index} />
))}
</div> </div>
); );
if (isError) return <div>Ошибка при загрузке медиа</div>; if (isError) return <center>Ошибка при загрузке медиа</center>;
// Create context value // Create context value
const contextValue: SliderContextType = { const contextValue: SliderContextType = {
+3 -4
View File
@@ -64,11 +64,10 @@ $btn-primary-bg: linear-gradient(
text-align: left; text-align: left;
font-size: 18px; font-size: 18px;
color: #000; color: #000;
font-family: "Montserrat"; font-family: 'Montserrat', sans-serif;
font-style: normal; font-style: normal;
font-display: swap; font-display: swap;
src: url("../fonts/Montserrat/Montserrat-VariableFont_wght.ttf") format("truetype"); }
}
.bold { .bold {
font-size: 22px; font-size: 22px;
@@ -100,5 +99,5 @@ $btn-primary-bg: linear-gradient(
font-size: 20px; font-size: 20px;
font-weight: 600; font-weight: 600;
text-align: center; text-align: center;
font-family: "Montserrat"; font-family: 'Montserrat', sans-serif;
} }