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 implement the SCSS animation you provided into a custom:button-card, you can convert the SCSS structure to standard β¦ === To implement the SCSS animation you provided into a custom:button-card, you can convert the SCSS structure to standard CSS and then use the extra_styles property. Here's how you can achieve that: <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; } .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 Adjustments: ===== # Card Styles: Set up basic card properties and the layout. # Before/After Pseudo-elements: Use ::before and ::after to create the rotating background and inner shadow effect. # Keyframes: The animations are defined directly in the extra_styles so that they apply correctly. # Z-index Management: The z-index values are set to ensure layering works as intended. Make sure to adjust the card's size or positioning as needed for your interface. Let me know if you need further tweaks!
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)