mirror of
https://github.com/uiverse-io/galaxy.git
synced 2025-11-27 20:50:21 +08:00
60 lines
1.4 KiB
HTML
60 lines
1.4 KiB
HTML
<button class="realistic-button">
|
|
Button
|
|
</button>
|
|
<style>
|
|
/* From Uiverse.io by KhaledMatalkah - Tags: material design, button, custom, hover button */
|
|
.realistic-button {
|
|
display: inline-block;
|
|
position: relative;
|
|
padding: 15px 30px;
|
|
font-size: 18px;
|
|
font-weight: bold;
|
|
text-transform: uppercase;
|
|
color: #fff;
|
|
background: linear-gradient(to bottom, #3498db, #2980b9);
|
|
border: 1px solid #2980b9;
|
|
border-radius: 5px;
|
|
box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1), inset 0px 2px 4px rgba(255, 255, 255, 0.2);
|
|
text-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);
|
|
cursor: pointer;
|
|
overflow: hidden;
|
|
transition: background-color 0.3s, transform 0.3s;
|
|
}
|
|
|
|
.realistic-button::before,
|
|
.realistic-button::after {
|
|
content: '';
|
|
position: absolute;
|
|
width: 100%;
|
|
height: 100%;
|
|
background: inherit;
|
|
z-index: -1;
|
|
transition: transform 0.3s;
|
|
}
|
|
|
|
.realistic-button::before {
|
|
top: 0;
|
|
left: -100%;
|
|
transform: skewX(-45deg);
|
|
}
|
|
|
|
.realistic-button::after {
|
|
bottom: 0;
|
|
right: -100%;
|
|
transform: skewX(45deg);
|
|
}
|
|
|
|
.realistic-button:hover {
|
|
background: linear-gradient(to bottom, #042b46, #0a525cd8);
|
|
transform: translateY(-2px);
|
|
box-shadow: 0px 6px 8px rgba(0, 195, 255, 0.2), inset 0px 2px 4px rgba(255, 255, 255, 0.1);
|
|
}
|
|
|
|
.realistic-button:hover::before {
|
|
transform: translateX(100%);
|
|
}
|
|
|
|
.realistic-button:hover::after {
|
|
transform: translateX(-100%);
|
|
}
|
|
</style>
|