mirror of
https://github.com/Radiquum/AniX.git
synced 2025-05-01 18:39:40 +05:00
Merge remote-tracking branch 'origin/feat_player'
This commit is contained in:
parent
bb437fe7ca
commit
25e31a7799
62 changed files with 1508 additions and 701 deletions
88
app/components/ReleaseCourusel/ReleaseCourusel.tsx
Normal file
88
app/components/ReleaseCourusel/ReleaseCourusel.tsx
Normal file
|
@ -0,0 +1,88 @@
|
|||
"use client";
|
||||
import { useEffect } from "react";
|
||||
import { ReleaseLink } from "../ReleaseLink/ReleaseLink";
|
||||
import Link from "next/link";
|
||||
|
||||
import Styles from "./ReleaseCourusel.module.css";
|
||||
import Swiper from "swiper";
|
||||
import "swiper/css";
|
||||
import "swiper/css/navigation";
|
||||
import { Navigation } from "swiper/modules";
|
||||
|
||||
export const ReleaseCourusel = (props: {
|
||||
sectionTitle: string;
|
||||
showAllLink?: string;
|
||||
content: any;
|
||||
}) => {
|
||||
useEffect(() => {
|
||||
const options: any = {
|
||||
direction: "horizontal",
|
||||
spaceBetween: 8,
|
||||
allowTouchMove: true,
|
||||
slidesPerView: "auto",
|
||||
navigation: {
|
||||
enabled: false,
|
||||
nextEl: ".swiper-button-next",
|
||||
prevEl: ".swiper-button-prev",
|
||||
},
|
||||
breakpoints: {
|
||||
450: {
|
||||
navigation: {
|
||||
enabled: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
modules: [Navigation],
|
||||
};
|
||||
new Swiper(".swiper", options);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<section className={`${Styles.section}`}>
|
||||
<div className="flex justify-between px-4 py-2 border-b-2 border-black">
|
||||
<h1 className="font-bold text-md sm:text-xl md:text-lg xl:text-xl">
|
||||
{props.sectionTitle}
|
||||
</h1>
|
||||
{props.showAllLink && (
|
||||
<Link href={props.showAllLink}>
|
||||
<div className="flex items-center">
|
||||
<p className="hidden text-xl font-bold sm:block">Показать все</p>
|
||||
<span className="w-6 h-6 iconify mdi--arrow-right"></span>
|
||||
</div>
|
||||
</Link>
|
||||
)}
|
||||
</div>
|
||||
<div className="m-4">
|
||||
<div className="swiper">
|
||||
<div className="swiper-wrapper">
|
||||
{props.content.map((release) => {
|
||||
return (
|
||||
<div
|
||||
className="swiper-slide"
|
||||
key={release.id}
|
||||
style={{ width: "fit-content" }}
|
||||
>
|
||||
<div className="xl:w-[600px] sm:w-[400px] w-[80vw] aspect-video">
|
||||
<ReleaseLink {...release} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
<div
|
||||
className={`swiper-button-prev ${Styles["swiper-button"]} after:iconify after:material-symbols--chevron-left aspect-square bg-black bg-opacity-25 backdrop-blur rounded-full after:bg-white`}
|
||||
style={
|
||||
{ "--swiper-navigation-size": "64px" } as React.CSSProperties
|
||||
}
|
||||
></div>
|
||||
<div
|
||||
className={`swiper-button-next ${Styles["swiper-button"]} after:iconify after:material-symbols--chevron-right aspect-square bg-black bg-opacity-25 backdrop-blur rounded-full after:bg-white`}
|
||||
style={
|
||||
{ "--swiper-navigation-size": "64px" } as React.CSSProperties
|
||||
}
|
||||
></div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue