Jump to content

How to make such animation without JScript?

Hip

You can't.

Disable Javascript in your browser and look how it fails to render properly.

 

Seems like there's multiple background images or layers stacked on top of the other, and maybe some transparency tricks to create that motion effect.

Link to comment
Share on other sites

Link to post
Share on other sites

I think this is combination of video in background and CSS animation over the top of it.

CSS animations are simple, and they are done over "keyframes" url: https://www.w3schools.com/cssref/css3_pr_animation-keyframes.asp

 

So like in w3school example this is how one animation looks like:

@keyframes mymove {
  0% {top: 0px;}
  50% {top: 100px;}
  100% {top: 200px;}
}

@keyframes [name-of-animation] then you continue with specifying what would happen in center processing of animation time.

 

This is just behavior of animation, to stick this to element, you need to provide "animation" to element like:

"animation: [name-of-animation] [time-in-seconds]s infinite;" exp: animation: move-element 2s infinite;

Ther's a lot of different animation-* propetyies you can use like animation-delay (dealay time before animation will fire), animation-time (amount of time animation will take), animation-name...

 

Tho animation you posted link for would take a shit tone of lines (my guesstimation is around 500 lines of css code)

 

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

8 minutes ago, ekv said:

I think this is combination of video in background and CSS animation over the top of it.

CSS animations are simple, and they are done over "keyframes" url: https://www.w3schools.com/cssref/css3_pr_animation-keyframes.asp

 

So like in w3school example this is how one animation looks like:


@keyframes mymove {
  0% {top: 0px;}
  50% {top: 100px;}
  100% {top: 200px;}
}

@keyframes [name-of-animation] then you continue with specifying what would happen in center processing of animation time.

 

This is just behavior of animation, to stick this to element, you need to provide "animation" to element like:

"animation: [name-of-animation] [time-in-seconds]s infinite;" exp: animation: move-element 2s infinite;

Ther's a lot of different animation-* propetyies you can use like animation-delay (dealay time before animation will fire), animation-time (amount of time animation will take), animation-name...

 

Tho animation you posted link for would take a shit tone of lines (my guesstimation is around 500 lines of css code)

 

 

 

I see there is actually a video in the code but they did it with jscript. So you think this would also be possible with a video and css or even with css only?

Link to comment
Share on other sites

Link to post
Share on other sites

With CSS and Video it would be possible to re-create most of parts.

But you should use JS anyways, because there's no reason really not to.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×