Giter VIP home page Giter VIP logo

Comments (5)

natemoo-re avatar natemoo-re commented on June 5, 2024 8

You may have discovered this already, but there are some more examples in the docs now, including this Parallax one!

from motion.

breadadams avatar breadadams commented on June 5, 2024 7

I've just checked out the example and can't help feel somethings off with it, by the time you get to the 5th of the 8 images all the parallax blocks have scrolled by already. Leaving the last 3 images without any floating magic 😿 .

Or maybe that was intentional in the example?

from motion.

mattgperry avatar mattgperry commented on June 5, 2024

Thanks natemoo! Totally forgot to update here

from motion.

imdevan avatar imdevan commented on June 5, 2024

You may have discovered this already, but there are some more examples in the docs now, including this Parallax one!

I believe the parallax image example is broken; are the images supposed to be parallax or just the containers around them?

from motion.

opr-inzn avatar opr-inzn commented on June 5, 2024

Can anybody help me out with the Parallax example? I'd like to build the re-following the following scroll-behaviour: https://www.johannclausen.com/?filter=Featured.

  • Fade-In title after some part of the image is shown
  • On scroll, move it down, but stop after moving it 300px

I'm very new to Gatsby (React) and Framer Motion, so any help would be appreciated. I found the .tsx example but couldn't get it to work

import { Override, motionValue, useTransform } from "framer"

const contentOffsetY = motionValue(0)

// Apply this override to your scroll component
export function TrackScroll(): Override {
    return { contentOffsetY: contentOffsetY }
}

// Apply this override to your parallax layer
export function ParallaxLayer(): Override {
    const y = useTransform(contentOffsetY, [0, -100], [0, 50], {
        clamp: false,
    })
    return {
        y: y,
    }
}

and the example mentioned above is very hard for me to understand. The structure of my div is the following:

import * as React from "react"
import { StaticImage } from "gatsby-plugin-image"

export default function Article() {
  return (
    <div className="entry">
      <h1>Title</h1>
      <StaticImage src="" />
    </div>
  )
}

In Vanilla JS this would be a bit easier I guess, but learning React/Gatsby, I'd rather work with those resources.

from motion.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.