mirror of
https://github.com/uiverse-io/galaxy.git
synced 2025-11-28 05:00:22 +08:00
94 lines
1.9 KiB
HTML
94 lines
1.9 KiB
HTML
<div class="card-container">
|
|
<div class="card">
|
|
<div class="front-content">
|
|
<p>Hover me</p>
|
|
</div>
|
|
<div class="content">
|
|
<p class="heading">Card Hover</p>
|
|
<p>
|
|
Lorem ipsum dolor sit amet, consectetur adipii
|
|
voluptas ten mollitia pariatur odit, ab
|
|
minus ratione adipisci accusamus vel est excepturi laboriosam magnam
|
|
necessitatibus dignissimos molestias.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<style>
|
|
/* From Uiverse.io by gharsh11032000 - Tags: card, hover effect, hoverme */
|
|
.card-container {
|
|
width: 300px;
|
|
height: 300px;
|
|
position: relative;
|
|
border-radius: 10px;
|
|
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
|
|
overflow: hidden;
|
|
}
|
|
|
|
.card {
|
|
width: 100%;
|
|
height: 100%;
|
|
border-radius: inherit;
|
|
}
|
|
|
|
.card .front-content {
|
|
width: 100%;
|
|
height: 100%;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
transition: all 0.6s cubic-bezier(0.23, 1, 0.320, 1)
|
|
}
|
|
|
|
.card .front-content p {
|
|
font-size: 32px;
|
|
font-weight: 700;
|
|
opacity: 1;
|
|
background: linear-gradient(-45deg, #f89b29 0%, #ff0f7b 100% );
|
|
background-clip: text;
|
|
-webkit-background-clip: text;
|
|
-webkit-text-fill-color: transparent;
|
|
transition: all 0.6s cubic-bezier(0.23, 1, 0.320, 1)
|
|
}
|
|
|
|
.card .content {
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
justify-content: center;
|
|
text-align: center;
|
|
gap: 10px;
|
|
background: linear-gradient(-45deg, #f89b29 0%, #ff0f7b 100% );
|
|
color: #e8e8e8;
|
|
padding: 20px;
|
|
line-height: 1.5;
|
|
border-radius: 5px;
|
|
pointer-events: none;
|
|
transform: translateY(96%);
|
|
transition: all 0.6s cubic-bezier(0.23, 1, 0.320, 1);
|
|
}
|
|
|
|
.card .content .heading {
|
|
font-size: 32px;
|
|
font-weight: 700;
|
|
}
|
|
|
|
.card:hover .content {
|
|
transform: translateY(0);
|
|
}
|
|
|
|
.card:hover .front-content {
|
|
transform: translateY(-30%);
|
|
}
|
|
|
|
.card:hover .front-content p {
|
|
opacity: 0;
|
|
}
|
|
|
|
|
|
</style>
|