-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🤩fy card & info-tile #3311
🤩fy card & info-tile #3311
Conversation
d0af3b5
to
46cfc90
Compare
Documentation has been published to https://lundalogik.github.io/lime-elements/versions/PR-3311/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙏
🎉 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: