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: To ensure the rotating animation works properly in the custom:button-card, we might need to clarify the usage of CSS an… === To ensure the rotating animation works properly in the custom:button-card, we might need to clarify the usage of CSS animations and check a few details. Here's an updated approach to make sure the animation is correctly applied: <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: 10px * position: relative * overflow: hidden * padding: 2rem * z-index: 0 extra_styles: | :host { background: #000; display: flex; justify-content: center; align-items: center; height: 100%; } .button-card::before { content: ''; position: absolute; z-index: -2; left: -50%; top: -50%; width: 200%; height: 200%; background-color: #1a232a; background-repeat: no-repeat; background-position: 0 0; background-image: conic-gradient(transparent, rgba(168, 239, 255, 1), transparent 30%); animation: rotate 4s linear infinite; /'' Ensure this is correct ''/ } .button-card::after { content: ''; position: absolute; z-index: -1; left: 6px; top: 6px; width: calc(100% - 12px); height: calc(100% - 12px); background: #000; border-radius: 5px; } @keyframes rotate { 100% { transform: rotate(1turn); } } @keyframes opacityChange { 50% { opacity: 0.5; } 100% { opacity: 1; } } .button-card.conic-demo::after { animation: opacityChange 5s infinite linear; } </syntaxhighlight> ===== Key Points to Check: ===== # Animation: Ensure that the animation property in ::before is set correctly (animation: rotate 4s linear infinite;). # Z-index: Confirm that the z-index of the ::before element is negative so it stays behind the button content. # Browser Support: Make sure you are testing in a browser that supports CSS animations and conic-gradient. # Container Size: If the button card size is too small, the effect might not be visible. Consider adjusting the aspect_ratio or padding. If it still doesn’t work, try removing the conic-gradient temporarily to see if the rotation itself is functioning. Let me know how it goes!
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)