Conversation
d0af3b5 to
46cfc90
Compare
|
Documentation has been published to https://lundalogik.github.io/lime-elements/versions/PR-3311/ |
adrianschmidt
left a comment
There was a problem hiding this comment.
Must respect prefers-reduced-motion.
09de25c to
3dfa2b4
Compare
26f49c7 to
594f13c
Compare
594f13c to
359dbbe
Compare
src/util/3d-tilt-hover-effect.ts
Outdated
| * | ||
| * Call `getMouseEventHandlers()` in your component to retrieve the `handleMouseEnter` | ||
| * and `handleMouseLeave` functions, and attach them to the target element. | ||
| * For example, if your interactive element is the host itself: |
There was a problem hiding this comment.
if your interactive element is the host itself:
The interactive element can be the host, but its parent must have these styles:
@mixin parent-of-the-3d-element {
isolation: isolate;
transform-style: preserve-3d;
perspective: 1000px;
@media (prefers-reduced-motion) {
perspective: 2000px;
}
}For the 3D effect to appear properly. For components like Card or Info tile, the only way is to use a nested element, and use it as the interactive element. Not sure if it's enough that we mention which mixins they should use, or if we should document this further.
There was a problem hiding this comment.
Ah! OK. That's maybe related to why it didn't work to move the glow-element either then…?
If the consumer needs to do stuff, we should absolutely document it. (But it's even better if we can do the stuff automatically 😊)
359dbbe to
9e7b37e
Compare
d2249cc to
aa2f393
Compare
aa2f393 to
cbb93e0
Compare
|
I realised I've been wanting to gold plate this way too much, and haven't managed to pull it off in a reasonable time. So I've pushed the not-yet-finished gold plated version on the branch Let's get this merged! 😊 |
cbb93e0 to
4640692
Compare
This enables consumer components to display a nice 3D effect, when being hovered; enabling them to follow the cursor's position and tilt towards it.
4640692 to
0a5147b
Compare
|
|
||
| public componentWillLoad() { | ||
| const { handleMouseEnter, handleMouseLeave } = getMouseEventHandlers( | ||
| this.host, |
There was a problem hiding this comment.
I realised that to make this quite right, this shouldn't actually be getting event handlers for this.host, but for the interactive element. But then it can't be called from componentWillLoad. This works for now, and I've dragged this PR out for too long already, so I say we merge like this, and then maybe I'll come back and gold plate during a hackday or something.
|
🎉 This PR is included in version 37.72.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Fair enough! 🙏 I made a new PR #3330 from a part of that |
Review:
Browsers tested:
(Check any that applies, it's ok to leave boxes unchecked if testing something didn't seem relevant.)
Windows:
Linux:
macOS:
Mobile: