-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(3d-hover-effect-glow): prevent flashing when a 3d element i jus…
…t loaded Before this change, the component would be rendered before the styling applies. It wouldn't be visible then, since it's unstyled, but it would have a default opacity of 1. Then the styling applies, which set's the opacity to 0.1. But due to the transition on the `Host` element, there would be an undesired effect of "lightning flash" when the component is loaded.
- Loading branch information
1 parent
46c99d1
commit 29cf173
Showing
3 changed files
with
18 additions
and
11 deletions.
There are no files selected for viewing
21 changes: 14 additions & 7 deletions
21
src/components/3d-hover-effect-glow/3d-hover-effect-glow.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,28 @@ | ||
:host(limel-3d-hover-effect-glow) { | ||
transition: background, opacity; | ||
transition-timing-function: ease-out; // Must be the same as the 3D Element itself | ||
transition-duration: 0.8s; // Must be the same as the 3D Element itself | ||
|
||
display: block; | ||
pointer-events: none; | ||
|
||
position: absolute; | ||
inset: 0; | ||
|
||
opacity: 0.1; | ||
mix-blend-mode: plus-lighter; | ||
} | ||
|
||
div { | ||
position: absolute; | ||
inset: 0; | ||
|
||
transition: background, opacity; | ||
transition-timing-function: ease-out; // Must be the same as the 3D Element itself | ||
transition-duration: 0.8s; // Must be the same as the 3D Element itself | ||
|
||
border-radius: inherit; | ||
|
||
opacity: var(--limel-3d-hover-effect-glow-opacity, 0.1); | ||
|
||
background-image: radial-gradient( | ||
circle at var(--limel-3d-hover-effect-glow-position, 50% -20%), | ||
rgb(var(--color-white), 0.3), | ||
rgb(var(--color-white), 0) | ||
); | ||
|
||
mix-blend-mode: plus-lighter; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters