Add parallax to floaty homepage cards #524
Reference in New Issue
Block a user
Delete Branch "kurt/parallax-to-floaty-cards"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Sorry some formatting changes here to, but the crux of it is adding perspective to the homepage scroll body so that I could push the floaty cards closer to the user so they would move faster than the other elements when scrolling. Took me a while because I it was late that I realised I had to stop the div where the react component in injected from scrolling
https://user-images.githubusercontent.com/29681384/134250874-3e428ea1-5eb8-45e7-a51b-506da87b4427.mov
@@ -15,3 +15,3 @@<body><div id="redwood-app"><div id="redwood-app" style="height: 100vh;"><%= prerenderPlaceholder %>Stoping this from being the scroll body
This becomes the scroll body and we set perspective on it
@@ -172,0 +198,4 @@{scadCode.map((line, index) => (<div key={index}><span className="w-12 pr-6 text-blue-200 text-opacity-50 inline-block text-right">{index + 1}bringing the element forward 0.3px to get parallax and scaling down so it's still the same size. (0.3px is enough because the perspective is only 1px).
Few position tweaks too on x and y
Same as above
Just taking a closer look at this because I can't see it working in Firefox but I would expect it to still work, that 1px perspective trick usually does work cross-browser.
Getting just a bit of x-axis overflow on Chrome and FF:
Thanks for pointing out the parallax issue in fx, as we discussed on discord was able fix with your tip of selecting all children and setting them to
transform-style: preserve-3da8d251ae92, would there be any benefit to usingtransform-style: inheritinstead.I also noticed as issue that the model reacting to the mouse had been broken by adding parallax I think because an element moved in front of the canvas. I was able to fix for safari and chrome by using
pointer-events: none, but that didn't fix it for ff, and honestly I don't think it's worth labouring over.@franknoirot I'm confused about the x-axis overflow. I can't replicate it. Does it happen at a certain screen size or is it always there? I've added
overflow-x-hiddenine6c0199748for safety but can't really test it 😑Nice @Irev-Dev! Confirmed fixed on FF, and not seeing any
overflow-x.Live now