Merge pull request #6 from ifraimka1/feature/lab-cards-animation

анимация карточек
This commit is contained in:
Ifraim Solomonov authored and GitHub committed 2024-02-28 12:52:58 +03:00
commit ea96a5acaa
5 files changed
+74 -28

No files matched your search

+2 -1
View File
@@ -2,4 +2,5 @@ export { default as car } from './car.jpeg';
export { default as newsMock } from './newsMock.png';
export { default as scb } from './scb.svg';
export { default as fileUpload } from './fileUpload.svg';
export { default as arrow } from './arrow.svg';
export { default as arrow } from './arrow.svg';
export { default as labMock } from './labMock.jpeg';
Binary file not shown.

After

Width:  |  Height:  |  Size: 240 KiB

+8 -5
View File
@@ -2,12 +2,15 @@ import { Link } from 'react-router-dom';
function LabCard({ lab }) {
return (
<Link to={ lab.link } className="card">
<div className="text">
<h2>{ lab.name }</h2>
<p>{ lab.desc }</p>
<Link to={lab.link} className="card lab">
<img src={lab.img} alt="" className="image" />
<div className="content">
<h2>{lab.name}</h2>
<div className="hidden">
<p>{lab.desc}</p>
<div className="link-label">Перейти &rarr;</div>
</div>
</div>
<div className="link-label">Перейти &rarr;</div>
</Link>
);
}
+8
View File
@@ -1,5 +1,7 @@
import BlockHeading from '../BlockHeading';
import LabCard from './LabCard';
import { labMock } from '../../../../images';
import './Labs.styles.scss';
const mock = [
@@ -7,31 +9,37 @@ const mock = [
name: "Лаборатория кибернетики",
desc: "Управление робототехническими системами, создание аппаратных и программных продуктов, а также проектирование программных систем.",
link: "/labs",
img: labMock,
},
{
name: "Лаборатория компьютерного зрения",
desc: "Работа с методами и технологиями сегментации изображений, ИИ и нейронными сетями.",
link: "/labs",
img: labMock,
},
{
name: "Лаборатория SmartTech",
desc: "Проектирование систем в концепции “Интернета вещей” и технологии “Умного дома”.",
link: "/labs",
img: labMock,
},
{
name: "Лаборатория VR и AR",
desc: "Разработка приложений для виртуальной и дополненной реальности, 3D-моделирование.",
link: "/labs",
img: labMock,
},
{
name: "Лаборатория мобильной разработки",
desc: "Разработка приложений для портативных устройств, создание дизайна и проектов мобильных приложений.",
link: "/labs",
img: labMock,
},
{
name: "Лаборатория 3D-печати и прототипирования",
desc: "Проектирование 3D-модели, работа с 3D-принтером и создание качественных трёхмерных макетов.",
link: "/labs",
img: labMock,
},
];
+56 -22
View File
@@ -3,46 +3,80 @@
display: flex;
flex-wrap: wrap;
justify-content: space-between;
row-gap: 32px;
gap: 26px;
.card {
display: flex;
flex-direction: column;
justify-content: space-between;
flex: 1 1 30%;
height: 300px;
max-width: calc(100%/3 - 64px);
min-height: max-content;
padding: 16px 24px;
overflow: hidden;
position: relative;
border-radius: 8px;
border-width: 1px;
border-style: solid;
border-color: #D9D9D9;
color: black;
color: white;
background: black;
.image {
position: absolute;
object-fit: cover;
width: 100%;
height: 100%;
opacity: 0.9;
transition: opacity .2s ease-out;
}
.content {
position: absolute;
inset: auto 20px 10px 20px;
transition: inset .3s;
background: none !important;
.text {
h2 {
margin-top: 0;
margin: 0;
font-size: 24px;
font-weight: 600;
line-height: 29px;
line-height: 28px;
}
p {
font-size: 16px;
font-weight: 400;
line-height: 24px;
.hidden {
max-height: 0;
transition: max-height 0.3s ease-out, opacity 0.3s 0.3s ease-out;
opacity: 0;
max-width: 80%;
p {
font-size: 16px;
font-weight: 400;
line-height: 20px;
}
.link-label {
font-size: 20px;
font-weight: 500;
line-height: 24px;
}
}
}
.link-label {
text-align: right;
font-size: 20px;
font-weight: 500;
line-height: 24px;
color: #767676;
&:hover .content {
bottom: 20px;
}
&:hover .content .hidden {
max-height: 200px;
opacity: 1;
transition: max-height 0.3s ease-out, opacity .1s ease-in;
}
&:hover .image {
transition: opacity .3s ease-in;
opacity: 0.5;
}
}
}
}
}