Giter Site home page Giter Site logo

Comments (5)

daybrush avatar daybrush commented on May 18, 2024 1

@alonprince
I'm sorry. Scene is based on css, so only one easing can be used simultaneously per element.

There are ways to use the different selector as shown below.

const animate = new Scene({
    '.hand-img': {
        0: {
            top: 830 * 0.005 + 'rem'
        },
        0.8: {
            top: 950 * 0.005 + 'rem'
        },
        2: {
            top: 950 * 0.005 + 'rem'
        },
        options: {
            easing: 'ease-in',
        },
    },
    'img.hand-img': {
        0: {
            left: 500 * 0.005 + 'rem'
        },
        0.8: {
            left: 620 * 0.005 + 'rem'
        },
        2: {
            left: 620 * 0.005 + 'rem'
        },
        options: {
            easing: 'ease-out',
        },
    },
}, {
    selector: true,
    iterationCount: 'infinite',
});

animate.play();

from scenejs.

alonprince avatar alonprince commented on May 18, 2024

Thanks for your helping! It works!

from scenejs.

anybany avatar anybany commented on May 18, 2024

Hi, i am trying to achieve the same but can't make it work.
I've got like a curtain which should close with easing A and after a delay open with easing B.
the strange thing is i only see the "second" animation.
please note the different selectors
#vorhangHeader.zu .elementor-container
and
#vorhangHeader.auf .elementor-container

here is my code:

const Vorhang = new Scene({
	'#vorhangHeader.zu .elementor-container': {
		0: {
			"min-height": headerHeight + 'px'
		},
		0.3: {
			"min-height": '100vh'
		},
		options: {
			easying: 'cubic-bezier(.83,.03,.24,.65)'
		},
	},
	'#vorhangHeader.auf .elementor-container': {
		0: {
			"min-height": '100vh'
		},
		2: {
			"min-height": headerHeight + 'px'
		},
		options: {
			delay: 2,
			easying: 'cubic-bezier(.33,.01,0,.99)'
		},
	}
}, {
	selector: true,
});
Vorhang.playCSS();

can someone please tell me what i am doing wrong?

edit: here is a (not) working example: http://wordpress.p564942.webspaceconfig.de/

from scenejs.

daybrush avatar daybrush commented on May 18, 2024

@anybany

I'm sorry. If you use playCSS(), it's impossible to apply different easing to the same element.

Would you like to just play()?

from scenejs.

anybany avatar anybany commented on May 18, 2024

@daybrush

i just did that, but it doesn't work either.
it just seems to play the first animation...

from scenejs.

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.