Skip to content
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

Added Card Carousel #563

Merged
merged 3 commits into from
Feb 11, 2024
Merged
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
66 changes: 66 additions & 0 deletions Components/Carousels/Card-Carousel/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Card Carousel</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<head>
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300i,400" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="card">
<h3 class="title">Card 1</h3>
<div class="bar">
<div class="emptybar"></div>
<div class="filledbar"></div>
</div>
<div class="circle">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg">
<circle class="stroke" cx="60" cy="60" r="50"/>
</svg>
</div>
</div>
<div class="card">
<h3 class="title">Card 2</h3>
<div class="bar">
<div class="emptybar"></div>
<div class="filledbar"></div>
</div>
<div class="circle">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg">
<circle class="stroke" cx="60" cy="60" r="50"/>
</svg>
</div>
</div>
<div class="card">
<h3 class="title">Card 3</h3>
<div class="bar">
<div class="emptybar"></div>
<div class="filledbar"></div>
</div>
<div class="circle">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg">
<circle class="stroke" cx="60" cy="60" r="50"/>
</svg>
</div>
</div>
<div class="card">
<h3 class="title">Card 4</h3>
<div class="bar">
<div class="emptybar"></div>
<div class="filledbar"></div>
</div>
<div class="circle">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg">
<circle class="stroke" cx="60" cy="60" r="50"/>
</svg>
</div>
</div>
</div>
</body>
</body>
</html>
102 changes: 102 additions & 0 deletions Components/Carousels/Card-Carousel/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
body {
background-color: #100e17;
font-family: 'Open Sans', sans-serif;
}

.container {
position: absolute;
height: 300px;
width: 600px;
top: 60px;
left: calc(50% - 300px);
display: flex;
}

.card {
display: flex;
height: 280px;
width: 200px;
background-color: #17141d;
border-radius: 10px;
box-shadow: -1rem 0 3rem #000;
/* margin-left: -50px; */
transition: 0.4s ease-out;
position: relative;
left: 0px;
}

.card:not(:first-child) {
margin-left: -50px;
}

.card:hover {
transform: translateY(-20px);
transition: 0.4s ease-out;
}

.card:hover ~ .card {
position: relative;
left: 50px;
transition: 0.4s ease-out;
}

.title {
color: white;
font-weight: 300;
position: absolute;
left: 20px;
top: 15px;
}

.bar {
position: absolute;
top: 100px;
left: 20px;
height: 5px;
width: 150px;
}

.emptybar {
background-color: #2e3033;
width: 100%;
height: 100%;
}

.filledbar {
position: absolute;
top: 0px;
z-index: 3;
width: 0px;
height: 100%;
background: rgb(0,154,217);
background: linear-gradient(90deg, rgba(0,154,217,1) 0%, rgba(217,147,0,1) 65%, rgba(255,186,0,1) 100%);
transition: 0.6s ease-out;
}

.card:hover .filledbar {
width: 120px;
transition: 0.4s ease-out;
}

.circle {
position: absolute;
top: 150px;
left: calc(50% - 60px);
}

.stroke {
stroke: white;
stroke-dasharray: 360;
stroke-dashoffset: 360;
transition: 0.6s ease-out;
}

svg {
fill: #17141d;
stroke-width: 2px;
}

.card:hover .stroke {
stroke-dashoffset: 100;
transition: 0.6s ease-out;
}
13 changes: 13 additions & 0 deletions assets/html_files/carousels.html
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,19 @@ <h1>Neumorphic Carousel</h1>
</a>
</div>
</div>
<div class="box">
<h1>Card Carousel</h1>
<div class="preview">
<a href="../../Components/Carousels/Card-Carousel/index.html" title="Live Preview" target="_blank">
<img src="../images/link.png">
</a>
</div>
<div class="source">
<a href="https://github.com/Rakesh9100/Beautiify/tree/main/Components/Carousels/Card-Carousel" title="Source Code" target="_blank">
<img src="../images/github.png">
</a>
</div>
</div>
</div>
</section>

Expand Down
Loading