mirror of
https://github.com/uiverse-io/galaxy.git
synced 2025-11-28 05:00:22 +08:00
91 lines
1.7 KiB
HTML
91 lines
1.7 KiB
HTML
<div class="card">
|
|
<div class="card__image">
|
|
|
|
</div>
|
|
<div class="card__content">
|
|
<p class="card__title">Card Title</p>
|
|
<p class="card__text">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
|
|
<a class="card__button" href="#">Read More</a>
|
|
</div>
|
|
</div>
|
|
|
|
<style>
|
|
/* From Uiverse.io by Satwinder04 - Tags: card */
|
|
.card {
|
|
position: relative;
|
|
width: 300px;
|
|
height: 400px;
|
|
margin: 20px;
|
|
border-radius: 10px;
|
|
overflow: hidden;
|
|
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
|
|
transition: transform 0.5s cubic-bezier(0.215, 0.61, 0.355, 1);
|
|
}
|
|
|
|
.card__image {
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
overflow: hidden;
|
|
border-radius: 10px;
|
|
}
|
|
|
|
.card__image img {
|
|
width: 100%;
|
|
height: 100%;
|
|
object-fit: cover;
|
|
transition: transform 0.5s cubic-bezier(0.215, 0.61, 0.355, 1);
|
|
}
|
|
|
|
.card__content {
|
|
position: absolute;
|
|
bottom: 0;
|
|
left: 0;
|
|
width: 100%;
|
|
padding: 20px;
|
|
background-color: #fff;
|
|
transition: transform 0.5s cubic-bezier(0.215, 0.61, 0.355, 1);
|
|
}
|
|
|
|
.card__title {
|
|
font-size: 24px;
|
|
font-weight: bold;
|
|
margin-bottom: 10px;
|
|
}
|
|
|
|
.card__text {
|
|
font-size: 16px;
|
|
line-height: 1.5;
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.card__button {
|
|
display: inline-block;
|
|
padding: 10px 20px;
|
|
background-color: #000;
|
|
color: #fff;
|
|
text-decoration: none;
|
|
border-radius: 5px;
|
|
}
|
|
|
|
.card:hover {
|
|
transform: translateY(-10px);
|
|
}
|
|
|
|
.card:hover .card__image img {
|
|
transform: scale(1.2);
|
|
}
|
|
|
|
.card:hover .card__content {
|
|
transform: translateY(-100%);
|
|
}
|
|
|
|
.card__image {
|
|
height: 400px;
|
|
width: 300px;
|
|
background-color: #000;
|
|
/* you can put img url here */
|
|
}
|
|
</style>
|