Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
freem
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Openai/66f0882e-055c-8007-b449-397616914d13
(section)
Add languages
Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Assistant: Thanks for sharing that example! === Thanks for sharing that example! Based on your working animation, hereβs how to create a similar ripple effect animation like the one from the CodePen you referenced, integrated into the custom:button-card format you've provided: <syntaxhighlight lang="yaml">type: custom:button-card entity: fan.cabby_cabby_fan name: Fan icon: mdi:fan aspect_ratio: 1/1 show_state: true styles: card: * border-radius: 20px * position: relative * overflow: hidden * box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) extra_styles: | :host { --ripple-color: rgba(255, 255, 255, 0.5); } .button-card:active::after { content: ""; position: absolute; top: 50%; left: 50%; width: 300%; height: 300%; background: var(--ripple-color); border-radius: 50%; transform: translate(-50%, -50%) scale(0); animation: ripple 0.6s linear forwards; z-index: 0; } @keyframes ripple { to { transform: translate(-50%, -50%) scale(1); opacity: 0; } } </syntaxhighlight> ===== - Ripple Effect: The ripple effect is created using a pseudo-element (::after) that scales from the center of the button. ===== * Animation: The @keyframes ripple animation expands the circle and fades it out. * Styling: You can customize the --ripple-color to match your desired aesthetic. This setup should give you a nice ripple effect on click. Let me know if you need any further adjustments!
Summary:
Please note that all contributions to freem are considered to be released under the Creative Commons Attribution-ShareAlike 4.0 (see
Freem:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)