"use client"
import {useState} from "react";
import { ComponentCaseOne, Maybe } from "@/types/gpl/graphql";
import s from "./index.module.scss";
import {Link} from "@/lib/i18n/navigation";
import Image from "@/modules/common/components/image";
import Button from "@/modules/common/components/button/border";
interface Props {
param: Maybe<ComponentCaseOne> | undefined;
}
export default function SloganOne({ param }: Props) {
const [currentIndex, setCurrentIndex] = useState(0);
return (
<div className={s.technologyBox}>
<div className={s.centerBox}>
<div className={s.listBox}>
{param?.list?.map((item,index)=>{
return (
<div className={s.technologyItem}>
<Link href={`application/${item?.slug}`}>
<div className={s.imgTrans}>
<Image image={item?.cover} sizes="300px" />
</div>
<div className={s.contentBox}>
<div className={s.title}>
{item?.title}
</div>
<div className={s.row}>
<div className={s.intro}>
{item?.desc}
</div>
<span className={s.more}>
<svg width="25" height="25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M7.29199 17.7084L17.7087 7.29175M17.7087 17.7084V7.29175H7.29199" stroke="currentColor" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</span>
</div>
</div>
</Link>
</div>
)
})}
</div>
</div>
</div>
);
}
.technologyBox {
padding: 20px 0;
width: 100%;
}
.centerBox {
max-width: var(--max-width);
display: flex;
flex-direction: column;
align-items: center;
margin: 0 auto;
height: 100%;
padding: 40px 20px;
@include lg {
padding: 40px 0;
}
.listBox {
display: grid;
grid-template-rows: repeat(5, 1fr);
gap: 30px;
margin-top: 20px;
width: 100%;
@include md {
grid-template-rows: repeat(3, 1fr);
grid-template-columns: repeat(2, 1fr);
}
@include lg {
grid-template-rows: repeat(2, 1fr);
grid-template-columns: repeat(3, 1fr);
}
.technologyItem:nth-child(2) {
@include lg {
grid-row: span 2;
}
}
.technologyItem:last-child {
@include md {
grid-column: span 2;
}
@include lg {
grid-column: span 1;
}
}
.technologyItem {
position: relative;
border-radius: 10px;
overflow: hidden;
&:hover {
.imgTrans {
transform: scale(1.1);
}
.contentBox {
.title {
color: var(--primary-color);
}
.more {
svg {
color: var(--primary-color);
}
}
}
}
.imgTrans {
width: 100%;
height: 100%;
transition: all 0.2s ease-in-out;
}
.contentBox {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
padding: 20px 20px;
@include lg {
padding: 20px 35px;
}
background: linear-gradient(to top, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 100%);
.title {
padding-bottom: 5px;
font-size: var(--font-lg);
font-weight: Bold;
color: #FFFFFF;
transition: all 0.2s ease-in-out;
}
.row {
display: flex;
align-items: center;
justify-content: space-between;
}
.intro {
font-size: 20px;
font-weight: 400;
color: #FFFFFF;
width: 100%;
}
.more {
width: 30px;
height: 30px;
background: #ffffff;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
svg {
width: 20px;
height: 20px;
color: #000000;
transition: all 0.2s ease-in-out;
}
}
}
}
}
}