Skip to content

feat(ui): add up/down hover animations to stats cards #2001

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions components/UI/Services.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ const Services = ({ youtubeStats, youtubeVideos }) => {
<ServicesItem
title={`${youtubeStats?.statistics?.videoCount} Videos Uploaded`}
icon="ri-film-line"
hoverDirection="down"
/>
</Col>

Expand Down
6 changes: 4 additions & 2 deletions components/UI/ServicesItem.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import React from "react";
import classes from "../../styles/services-item.module.css";

const ServicesItem = ({ title, icon }) => {
const ServicesItem = ({ title, icon, hoverDirection = "up" }) => {
const hoverClass = hoverDirection === "down" ? classes.service__item_down : classes.service__item;

return (
<div className={`${classes.service__item}`}>
<div className={hoverClass}>
<span>
<i className={icon}></i>
</span>
Expand Down
49 changes: 39 additions & 10 deletions styles/services-item.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,45 +15,74 @@
transform: translateY(-20px);
}

.service__item:hover i {
.service__item_down {
background: #171f38;
padding: 30px;
margin-bottom: 30px;
display: flex;
align-items: center;
column-gap: 1rem;
transition: 0.3s;
}

.service__item_down:hover {
background: var(--site-theme-color);
cursor: pointer;

transform: translateY(20px);
}

.service__item:hover i,
.service__item_down:hover i {
color: #171f38;
}

.service__item:hover h5 {
.service__item:hover h5,
.service__item_down:hover h5 {
color: #171f38;
}

.service__item span,
.service__item h5,
.service__item span i {
.service__item span i,
.service__item_down span,
.service__item_down h5,
.service__item_down span i {
background: transparent !important;
}

.service__item span i {
.service__item span i,
.service__item_down span i {
font-size: 3rem;
color: var(--site-theme-color);
}

.service__item h5 {
.service__item h5,
.service__item_down h5 {
font-size: 1rem;
}

.service__item:first-child {
.service__item:first-child,
.service__item_down:first-child {
border-radius: 10px 0px 10px 10px;
}

.service__item:last-child {
.service__item:last-child,
.service__item_down:last-child {
border-radius: 10px 10px 0px 10px;
}

@media only screen and (max-width: 992px) {
.service__item {
.service__item,
.service__item_down {
padding: 20px;
}
.service__item span i {
.service__item span i,
.service__item_down span i {
font-size: 2rem;
}
.service__item h5 {
.service__item h5,
.service__item_down h5 {
font-size: 0.9rem;
}
}
Loading