CSS Styling with Claymorphism
Here, the CSS elevates the button's visual appeal using claymorphism, providing it with a tactile 3D-like appearance.
.sculpture-container {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.bounce-button {
display: inline-block;
border: none;
padding: 15px 25px;
border-radius: 35px;
color: #fff;
font-size: 20px;
font-weight: bold;
background: linear-gradient(145deg, #e1e3e8, #f4f6f9);
box-shadow: 20px 20px 60px #c5c7ca, -20px -20px 60px #fff;
transition: background 0.4s ease, transform 0.4s ease;
cursor: pointer;
}
By applying box-shadow and a gentle gradient, we achieve an embossed clay feel for the button. The transitions enhance its interactivity, allowing quick changes in appearance when toggled.
Focus and Accessibility Styles
Ensuring the button is keyboard-friendly and attention-catching, we provide a custom outline focus style:
.bounce-button:focus {
outline: 2px dashed #333;
outline-offset: 4px;
}
The focus style is distinct, offering a visible cue for users navigating through keyboard.
Comments