mirror of
https://git.rdcenter.ru/RDCenter/skb-kit.git
synced 2026-12-05 04:09:45 +00:00
24 files changed
+588
-55
No files matched your search
@@ -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
|
||||
import React from "react";
|
||||
import { SkeletonGrid } from "../SkeletonGrid/SkeletonGrid";
|
||||
import styles from "../Skeleton/SkeletonCard.module.scss";
|
||||
|
||||
interface WithLoadingProps {
|
||||
isLoading: boolean;
|
||||
@@ -21,16 +22,19 @@ export const WithLoading = ({
|
||||
}: WithLoadingProps) => {
|
||||
if (isLoading) {
|
||||
return (
|
||||
<SkeletonGrid
|
||||
count={count}
|
||||
gridConfig={gridConfig}
|
||||
variant={variant}
|
||||
/>
|
||||
<div>
|
||||
<div className={styles.titleSkeleton}></div>
|
||||
<SkeletonGrid
|
||||
count={count}
|
||||
gridConfig={gridConfig}
|
||||
variant={variant}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
if (isError) {
|
||||
return <div>Ошибка при загрузке данных</div>;
|
||||
return <center>Ошибка при загрузке данных</center>;
|
||||
}
|
||||
|
||||
return <>{children}</>;
|
||||
|
||||
Reference in new issue
Block a user