Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I am making a website with a parallax header. This header needs to contain both images and video. I wanted to make a pure css approach, however that creates new "problems".
I tried http://keithclark.co.uk/articles/pure-css-parallax-websites/
Problems CSS:
- You have to put the whole page in a scrollable div with a 100% viewport height, this means that native ipad scrolling behaviour is not working anymore, things like js scrollTop are not working anymore, fixed navbars are displayed over the scrollbars and so on. See demo of this here http://keithclark.co.uk/articles/pure-css-parallax-websites/demo3/
Problems JS:
- Performance, animation looks jumpy most of the time
- Needs a lot more code
- Needs extra code to make video behave like a fixed background
I really do not want to use any third-party plugins, to prevent a "plugin overkill" for this website.
I am now at a point where I have to choose to go on and keep the CSS version or to go with javascript. What I am just curious about, is what is the best way coding wise, performance wise, to make a parallax? Hope someone can enlighten me on this.
Thanks!
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
I've been learning how to code for some time and I come to you because I'm stuck on the construction of an animation. I've been trying to figure out how to make it for two days (image attached) but it seems that I don't have the knowledge to build this animation alone. I've been looking in css but the revelation of a text at a fixed position is not possible with a moving element, and I don't master java script frameworks.
The animation starts with the right image (this is the default state), it then goes through the left image to then let appear only the orange background and the texts.
Animation description
What I can't manage to do is the progressive revelation of the text by this orange form (the two little bars are important and I want to keep them even if it's more complicated).
I simply don't know what to search on google to find the answer, nor if I should do it with css or js or a framework.
I don't necessarily want you to give me the code already pre-made but mostly a direction to exploit.
Thank you in advance for your answers.
You’ll might want to make an SVG shape, and then use clip-path to create a mask. These two articles work their way up to something like what you’re after:
https://css-tricks.com/clipping-masking-css/
https://css-tricks.com/animating-with-clip-path/
The SVG itself could be animated, or you might animate the clip-path property which is covered more in that second link.
Hope that’s helpful!
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
So I've seen a mouse-hover effect on 2 websites so far and I really like it.
This is the effect I'm talking about.
I'd be grateful if somebody can tell me how to get that effect on my webpage.
It only appears under your cursor when you hover over the page.
The site you have linked in the comments uses the HTML canvas element. But You can simply use already existing libraries for that effect.
Examples mentioned in the comments:
http://jnicol.github.io/particleground/
http://github.com/VincentGarreau/particles.js
Simply, Go to the webpage you wanted to Copy it's effects or anything from it
Right click, View page source
If the effect is made by Css, you will find it in stylesheets tab
If it's using jQuery/Js, Search the head for <script> , Read them and copy the effect (assuming that you understand js/jquery
For more simplicity, use Firebug, open it and just point the cursor at the item you want to see it's source.
But, actually
You can find it at github Here
Change what you want.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I found this site Storj.io. I really like the design of the site and was looking at the header. There is a background-image and then on top of this there are those points that are moving. How can such a animation be achieved? Is this done with html5 and how or is JavaScript used?
Inspection reveals they are using Particles.js
Particles JS
They provide documentation to get you started and achieve the effect you are looking for.
Your question is too broad for a complete answer. Try asking about smaller parts of it when you get stuck.
From Scratch: In essence you'll want to look into using the <canvas> element to draw particles. Take a look at this simple example of what can be done. Here is a blog post on particles with canvas to get you going (which culminates with the previous example).
With a library: https://storj.io is using particles.js. But that doesn't tell you how it's accomplished. On the plus side though, the library can easily be included from https://github.com/VincentGarreau/particles.js/ (see the demo on codepen).
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I recently found recently the JavaScript library - tracking.js
Is there any way to detect what div I see now by image or camera?
I have two elements on the desktop, the left and right columns, and I would like to check if I see left div ( with console.log() ) or right div. This library is simple, and I know how to add a script, but I don't know how to detect my eye and detect what element I see.
Maybe there are other ways to detect this.
Thats a bit complicated because you need detect minimal ocular movements and the common webcams, haven't resolution enough, but with some hardware like this project http://pupil-labs.com/pupil/, could do that.
A good solution is tracking.js because this library simulate human behavior with a some algorithms and should be enough to make simple decisions like the columns position.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
Soo, I have seen that I can use both javascript and css to resize my pictures to fit the browser.
Which one should I use, is there any pros / cons?
Would appreciate and example of what I could look like aswell.
Best regards
Lost boy
If you use JavaScript's resize event, there will always be some delay which could cause horizontal scrollbars to flicker on your page.
So use CSS. width:100% works perfectly.
I've voted to close, but regardless:
CSS. It's lighter weight, doesn't require javascript, runs without javascript enabled, and will render faster (javascript will have to wait for the image to load, while css will not).
It really depends on what you are doing.
If you just want an image that is 600px tall by 800px wide (or is 10% of the width of the browser, or fills the entire page), then use CSS.
If you are already doing things with javascript and want the images to adjust on another condition, then you can use javascript to resize them.
In short: if you already are using javascript, go ahead. If you aren't, CSS will do for most simple purposes.