Animate On Scroll With Just 3 LINES Of CSS (No Libraries Needed)

  Рет қаралды 83,356

Snippets Code

Snippets Code

Ай бұрын

Hi everyone, Snippets Code here
Focus of today’s video is to create this effect, where the elements are being smoothly animated when the page is being scrolled, and various animations are also being applied. All this with 3 simple lines of css.
🔔 Subscribe now
To stay updated on our upcoming design tutorials. Don't forget to hit that notification bell so you never miss a valuable lesson.
Link to code: github.com/SnippetsDevelop/sn...
For Business 💼:
snippetsdevelop@gmail.com
#htmlcsswebsitedesigntutorial #htmlcsswebsite #htmlcsswebsitedesign #htmlcsswebsitetutorial #htmlcsswebsiteproject #htmlcsswebsiteportfolio #htmlcsswebsitelayout #htmlcsswebsiteresponsive #htmlcsswebsitedesigntutorialvisualstudiocode #htmlcsswebsiteforbeginners #animateonscroll #animation #jsanimation

Пікірлер: 149
@Snippets_Code
@Snippets_Code 28 күн бұрын
If you find this video valuable then do Like Share Comment and Subscribe to the channel: kzbin.info/door/NWGZXzuU9oGggS2egZiKxA
@cool5019
@cool5019 10 күн бұрын
Thanku 🎉
@lazyjoe597
@lazyjoe597 21 күн бұрын
So now let's wait another 5 years or so for Apple and Mozilla to implement it into their browsers so we can finally use this feature. Until then good old JS is the only way
@maestrogoldring1094
@maestrogoldring1094 26 күн бұрын
Randomly suggested to me from KZbin. It was a good suggestion. Simple and short explanation, just how I like 👍
@AestheticalMinimalism
@AestheticalMinimalism 12 күн бұрын
No JS? You're a bloody genius!
@nicolasmayorga8288
@nicolasmayorga8288 26 күн бұрын
00:00 here and trying to sleep and just found this wonder, thanks for this content and the way you explained was amazing. I really appreciate it ❤
@Fluff-9
@Fluff-9 23 күн бұрын
You are amazing. I have been searching the Internet for so long. This video answered all my questions. Thank you.
@aryanisgood
@aryanisgood 28 күн бұрын
I was just making a cafewebsite project and came across this. Gonna use it for the project. Thanks
@xViiiZe
@xViiiZe 28 күн бұрын
One of my favourite channels!!!!!!!!!!
@boomba118
@boomba118 10 күн бұрын
i like this approach, straight to the point short video, no bs talking no what is animation no hello welcome to my channel bla bla... awesome :D thank u for great tip
@jaromanda
@jaromanda 20 күн бұрын
Chrome experimental features should not be used in production
@faizbyp
@faizbyp 25 күн бұрын
thank you very much! this is exactly what I need
@SmartC2007
@SmartC2007 23 күн бұрын
Very nice and very well explained. Thank you very much.
@victoriamarchi6973
@victoriamarchi6973 25 күн бұрын
Excellent video!! Quite concise and straight to the point :) thank you!! new sub!!
@minolruckshan5396
@minolruckshan5396 23 күн бұрын
This worked perfectly on project....!!! nice...❤
@muhammad_zohaib936
@muhammad_zohaib936 23 күн бұрын
Thanks a lot I needed that kinda explanation appreciated🙏❤
@towercontrol4450
@towercontrol4450 16 күн бұрын
The only problem with this aproach is browser support, for animatio-timeline and animation-range is still low
@Atul_Thakre30
@Atul_Thakre30 28 күн бұрын
Thank you so much for this 🔥🔥
@edsHTML
@edsHTML 13 күн бұрын
i didnt know this. I now learned these css properties 😀😀
@mudyeet_
@mudyeet_ 16 күн бұрын
I hope you don't get bothered by the critics, I liked the video, it's 3 lines that are making the difference, if the critics wanna complain, they can try the intersection observer to implement the same thing and come back to say this is verbose or clickbait.
@MarcosDemian
@MarcosDemian 12 күн бұрын
Awesome tutorial and to the point. Liked and subscribed
@thewebstylist
@thewebstylist 23 күн бұрын
Amazing!
@RuTe-tr3bj
@RuTe-tr3bj 28 күн бұрын
Awesome trick 👏👏
@user-uc5kl1dw7i
@user-uc5kl1dw7i 5 күн бұрын
So cool and easy!
@RajThakur-ol8mg
@RajThakur-ol8mg 10 күн бұрын
I liked it. I'm looking exact this video 👍💯
@AhmedHuzain
@AhmedHuzain 12 күн бұрын
Thanks a lot!
@cwirus99
@cwirus99 23 күн бұрын
In video like this, where cutting edge CSS features are used, you really should mention the browser support, which at this point is not great for on-scroll animations - only Chromium has already implemented it.
@Snippets_Code
@Snippets_Code 23 күн бұрын
Sure I will try to mention that in future videos 🙂
@qewela
@qewela 23 күн бұрын
ONLY CHROMIUM? bro almost every browser is built on chromium. but u got a point
@vosyasabesquien
@vosyasabesquien 23 күн бұрын
@@qewela maybe on desktop. on ios safari does not work
@cwirus99
@cwirus99 22 күн бұрын
​@@qewela true, but still. Depending on your target market, chromium based browsers usage can be as little as 50%.
@gabrielvasconcelos2166
@gabrielvasconcelos2166 7 күн бұрын
Very nice video! Previously, I activated the animation using JavaScript, with an event listener or the Intersection Observer
@valentynsjoyjitsu
@valentynsjoyjitsu 6 күн бұрын
Nice idea 👌 thank you 🙏
@solongdygaming4729
@solongdygaming4729 21 күн бұрын
Thanks you ❤
@horaciomanuliwd
@horaciomanuliwd 6 күн бұрын
Hello GENIUS!!! I want to thank you INFINITELY for providing your knowledge. I ALREADY SUBSCRIBED TO YOUR KZbin CHANNEL, AND I STARTED FOLLOWING YOU ON GITHUB. Greetings from Buenos Aires!!!
@saranshparashar4257
@saranshparashar4257 24 күн бұрын
Really helpful. Please create more animation videos for css which includes minimum use of js.
@Iskael
@Iskael 27 күн бұрын
can not run in Safari and Firefox
@Snippets_Code
@Snippets_Code 27 күн бұрын
Yes, It is a new feature of CSS, so has limited availability. Maybe later those browsers will also become compatible
@aldyreal
@aldyreal 26 күн бұрын
You should notice this in the video btw
@ishpeeedy
@ishpeeedy 10 күн бұрын
brilliant !
@alexcostal3749
@alexcostal3749 24 күн бұрын
Amazing
@uifry
@uifry 24 күн бұрын
Amazing :)
@user-jr8zv1oz6d
@user-jr8zv1oz6d 26 күн бұрын
merci frr c tres utileee
@NicMulvaneys
@NicMulvaneys 9 күн бұрын
Nice! 🎉
@mehdimansouri1547
@mehdimansouri1547 24 күн бұрын
fantastic
@victorcano6066
@victorcano6066 17 күн бұрын
nice video bro! 🫶
@tylerpetrov8094
@tylerpetrov8094 23 күн бұрын
Great video! Not sure why everyone is giving you so much trouble about the "3 lines" deal. It seems like 3 line to me, key frames don't count lol. I'll definitely try and implement this in my projects! God bless!
@MuhammadShoaibOfficial
@MuhammadShoaibOfficial 20 күн бұрын
Safari and Firefox, both desktop and mobile versions, are not supported.
@mohaymenul-islam
@mohaymenul-islam 24 күн бұрын
awesome
@ring11037
@ring11037 21 күн бұрын
'3 lines' seems like a clickbait after all. But this is cool stuff, I'm glad that I clicked. Thanks for sharing.👍
@kevingonzalocruzmartinez8429
@kevingonzalocruzmartinez8429 21 күн бұрын
Wow thanks you bro, the video very short and direct, saludos desde México
@dominikrodler8010
@dominikrodler8010 26 күн бұрын
sick
@merlinmeraldz
@merlinmeraldz 6 күн бұрын
nice tip, hopefully firefox and safari support comes fast
@LedaseLikdsewa
@LedaseLikdsewa 14 күн бұрын
amazing
@HamzaAli-rn1cc
@HamzaAli-rn1cc 11 күн бұрын
Bro is genious
@ib4112
@ib4112 11 күн бұрын
Nice way of doing it. can you also do a video on GSAP animation.
@Snippets_Code
@Snippets_Code 11 күн бұрын
Sure 🙂
@yonatandawit8112
@yonatandawit8112 13 күн бұрын
Nice
@kellog89
@kellog89 4 күн бұрын
Very interesting from a technical point of view. However, are animations necessary or even enjoyable from a UX point?
@itsatomtech
@itsatomtech 23 күн бұрын
A fairly new addition... and not standard yet...
@DANNFIGDESIGNS
@DANNFIGDESIGNS 17 күн бұрын
Three lines. 🥳🎉
@nishantkr5759
@nishantkr5759 25 күн бұрын
I was searching for this exact css for days You have no idea how much this video means to me 😘 I had to subscribe Btw is this how react loads and unhide contents on scroll ? Or react uses something else ?
@Snippets_Code
@Snippets_Code 25 күн бұрын
I think there won't be any change of effect on this with react
@nishantkr5759
@nishantkr5759 25 күн бұрын
@@Snippets_Code Yeah but I'm learning react and they say react is fast because it loads only those contents the user views which makes the app faster So is the same as the react thing ?
@Snippets_Code
@Snippets_Code 25 күн бұрын
No no, it is isn't that way, the meaning of the statement is that, it loads those components first which are being utilised and remaining can have lazy loading. Anyway once a component is loaded the css gets applied to it, so whenever the component enters the view port, this effect gets applied.
@nishantkr5759
@nishantkr5759 25 күн бұрын
@@Snippets_Code 😐 but I've seen way websites where they have this scroll effect and when I incept it then shows react components.. So if this is not the way then how do they achive this load on scroll using react ...?? I'm sorry I might be asking out of context question but I couldn't find the answer on KZbin nor in Chat...
@Snippets_Code
@Snippets_Code 25 күн бұрын
Can you share any reference site, so that I can understand, what scroll effects you mean. But at the end, it also depends on the way you use your components, modules you use and mainly on the functionality you want to achieve. 🙂
@CristianKirk
@CristianKirk 22 күн бұрын
Great but beware of browser support.
@Snippets_Code
@Snippets_Code 22 күн бұрын
🙂
@thegabeserna
@thegabeserna 23 күн бұрын
cool stuff but it’s not really “in only 3 lines”
@Tanishkmalviya
@Tanishkmalviya 22 күн бұрын
It's 3 lines You just don't know that fact that he used 1 line = 4 lines 😂
@MauroAmador
@MauroAmador 18 күн бұрын
Nice effect, but just compatible in chrome and edge, hope fully compatible
@saurabhp94
@saurabhp94 13 күн бұрын
This is still under development, not supported yet with browser hosting deployed server
@satwikpanda2469
@satwikpanda2469 25 күн бұрын
if there is any overflow-hidden it won't work instead change it to overflow-clip
@wlockuz4467
@wlockuz4467 27 күн бұрын
Is it possible to do it only once? I don't want the reverse animation if I am scrolling up.
@Snippets_Code
@Snippets_Code 27 күн бұрын
Maybe that is a little complicated, and you might need to introduce JS to detect backward scroll and pause the animation. But if I find any pure CSS solution, I will surely let you know 🙂
@upyrov
@upyrov 26 күн бұрын
this is most likely impossible, you need to have a state. use IntersectionObserver API
@atharva6738
@atharva6738 19 күн бұрын
The best thing we can use is aos (animation on scroll)
@shiva_mahto
@shiva_mahto 18 күн бұрын
That library has not been updated, even touched in 6 years, why would you use a library when you can achieve the same result with plain css.
@ScientificZoom
@ScientificZoom 22 күн бұрын
✌️👌✋👌
@blackpurple9163
@blackpurple9163 26 күн бұрын
How's the browser support for these?
@Snippets_Code
@Snippets_Code 26 күн бұрын
As these are new advanced features of CSS, chrome and edge are currently supporting these. Maybe safari and firefox might become compatible soon
@blackpurple9163
@blackpurple9163 26 күн бұрын
@@Snippets_Code doubt about Firefox, I've seen it fall behind a lot compared to it's older days 😔 I prefer FF and this frustrates me a lot
@usernameusernameusername12
@usernameusernameusername12 25 күн бұрын
How do i set it to make the animation dont replay again when i scroll up
@Snippets_Code
@Snippets_Code 25 күн бұрын
Currently there isn't anything that could detect backward scroll, and stop animation, in css. You might have to introduce little javascript to detect the backward scroll and pause the animation
@usernameusernameusername12
@usernameusernameusername12 25 күн бұрын
@@Snippets_Code oh ok, thx! Great video 🙂
@alihamdane
@alihamdane 21 күн бұрын
لماذ لما تستخدم animation timelinr scroll instead of view
@Snippets_Code
@Snippets_Code 21 күн бұрын
Scroll means the animation happens when the view port is scrolled, instead of when the elements enter view port
@foysalahmedmin
@foysalahmedmin 23 күн бұрын
Alhamdulillah.
@HoyaS2
@HoyaS2 Күн бұрын
Is it possible to do scroll animation just once or is there a way like that? For example, when you scroll up, the animation doesn't work
@Snippets_Code
@Snippets_Code Күн бұрын
For that thing you might need to introduce little javascript to detect backward scroll and pause the animation, or something like that. 🙂
@HoyaS2
@HoyaS2 Күн бұрын
@Snippets_Code It can't be controlled only by CSS. Thank you.
@Snippets_Code
@Snippets_Code Күн бұрын
Currently there is now to detect the scroll direction using the css itself, so it might not be possible with just CSS
@HoyaS2
@HoyaS2 Күн бұрын
@@Snippets_Code Thank you. I'm glad you subscribed.
@AshwinSI-px5yo
@AshwinSI-px5yo 20 күн бұрын
Can you provide the full code both html and css
@Snippets_Code
@Snippets_Code 20 күн бұрын
I have mentioned the link to the code in description 🙂
@html86
@html86 23 күн бұрын
How we can add this in react and next js project
@Snippets_Code
@Snippets_Code 23 күн бұрын
Just include it as CSS of your project 🙂
@ujjwalchoudhary7219
@ujjwalchoudhary7219 2 күн бұрын
Can i get the css of the all boxes how they arrange?
@Snippets_Code
@Snippets_Code 2 күн бұрын
Link to code mentioned in description
@violonist-pl4tt
@violonist-pl4tt 24 күн бұрын
It doesnt playfor me. idk why. My site is a complete portofilo website i wanted to add animation to.
@Snippets_Code
@Snippets_Code 24 күн бұрын
These are some new advanced features in CSS, so they have limited availability, currently compatible with chrome and edge
@violonist-pl4tt
@violonist-pl4tt 24 күн бұрын
@Snippets_Code oh, actually I am using Edge. But it was late night when I was trying to code. I will try again tomorrow. Thanks for the easy tuttorial
@talhasifat15
@talhasifat15 11 күн бұрын
Hi, Does it work next. I try doing it, and it works once, and then it's the 2nd day I am trying it but it's not working. I tried doing it with HTML/CSS only then did it work. does anyone have an idea of why it not working with Next?
@JaskaranSingh-le4tm
@JaskaranSingh-le4tm 8 күн бұрын
the animation-time and view both are new properties. So these have limited browser compatibility. For ex- These are not supported by FireFox and Safari.
@BhaktiTone
@BhaktiTone 18 күн бұрын
Hum na to pagal hain, aur na hamara dimag kharab hai.
@user-kw1uw5we1e
@user-kw1uw5we1e 27 күн бұрын
it doesn't work with tailwindcss reat.tsx app why ?
@Snippets_Code
@Snippets_Code 27 күн бұрын
It will work, with tailwind css, but as these are new features in CSS, just check the compatibility of the browser 🙂
@satwikpanda2469
@satwikpanda2469 25 күн бұрын
I am facing the same issue were you able to solve it?
@l.sureshkumar-lsk550
@l.sureshkumar-lsk550 23 күн бұрын
Share the code pls
@Snippets_Code
@Snippets_Code 23 күн бұрын
Sure I will mention the link in description
@phat80
@phat80 23 күн бұрын
It’s useless as it won’t work in safari and firefox!
@Snippets_Code
@Snippets_Code 23 күн бұрын
Currently these features are supported in chrome and edge, might be added to safari and firefox later 🙂
@Param3021
@Param3021 21 күн бұрын
It's useful if you use the right browser.
@JakeSavageOpinion
@JakeSavageOpinion 21 күн бұрын
​@Param3021 I wish you all the best telling your users that
@sesil2459
@sesil2459 23 күн бұрын
Well, animation-timeline has not really good browsers support...
@Snippets_Code
@Snippets_Code 23 күн бұрын
Yeah, currently it is compatible with chrome and edge
@phat80
@phat80 23 күн бұрын
@@Snippets_Codeif it’s not supported at least by Safari you should consider it does not exist.
@user-ip1rx2vs6j
@user-ip1rx2vs6j 3 күн бұрын
Safari does not support this way of scroll-based animation
@znkdev
@znkdev 24 күн бұрын
3 lines? you sure you want to make this clickbait?
@Snippets_Code
@Snippets_Code 24 күн бұрын
Nope, Not a clickbait, these are some new features in CSS which you can explore 🙂
@znkdev
@znkdev 24 күн бұрын
@@Snippets_Code I found it nice, and liked the video, but it is not in 3 lines!
@user-om1te4qo7k
@user-om1te4qo7k 24 күн бұрын
​@@Snippets_Code well if you didn't do as thumbnail said ,it's clickbait new feature or not
@ktldon
@ktldon 24 күн бұрын
​@@znkdevif you exclude the animation css, it is indeed 3 lines of code. Still pretty simple code anyway
@xDmtm
@xDmtm 24 күн бұрын
It's 3 lines! animation: ... animation-timeline: ... animation-range: ...
@YasirJabri
@YasirJabri 24 күн бұрын
We definitely need a css library similar to animate.css (or it's js support library wow.js) open source
@jamworthy14
@jamworthy14 11 күн бұрын
ME who just Started WEb development 😮😭
@amanchoudhary7414
@amanchoudhary7414 10 күн бұрын
So what.....? Are u going to panic in this ?
@jamworthy14
@jamworthy14 10 күн бұрын
@@amanchoudhary7414 i feel overwhelmed by this. bro
@darzhaneduardovich2712
@darzhaneduardovich2712 4 күн бұрын
@@jamworthy14 nah, you should be happy
@DaMu24
@DaMu24 18 күн бұрын
3 lines? more like 13 lines. Also doesn't work in Firefox, so nice try...
@Snippets_Code
@Snippets_Code 18 күн бұрын
Actually I meant that you can make any type of animation happen when scrolled by including those 3 CSS lines only, and I didn't include the CSS of the blocks, text, basic body styling in video, if those were mentioned, it would have been more than 13 lines also 🙂 Not mentioning the support for the advanced CSS feature is a mistake, I will make sure to mention that when required in future videos.
@diegocamacho6060
@diegocamacho6060 16 күн бұрын
@@Snippets_Code 🤗🤗
@3litepker
@3litepker 20 күн бұрын
If it’s not supported on the main browsers then it’s really silly to even entertain this. Until it’s supported it’s trash and has no use in production. 99% of use cases will require all of the main web browsers
@Snippets_Code
@Snippets_Code 20 күн бұрын
It is a new feature in CSS, supported in chrome and edge and also fun to use 🙂
@heartbreaker7021
@heartbreaker7021 3 күн бұрын
diskliked for click bait
@knowname5354
@knowname5354 3 күн бұрын
Unsupported for production app. Dislike
3D WEBSITE with THREEJS and GSAP
1:55
Washington maina
Рет қаралды 27 М.
This Should Have Been In CSS Years Ago
1:57
Dev Dive In
Рет қаралды 33 М.
СНЕЖКИ ЛЕТОМ?? #shorts
00:30
Паша Осадчий
Рет қаралды 8 МЛН
A flexbox trick to improve text wrapping
5:02
Kevin Powell
Рет қаралды 179 М.
Subtle, yet Beautiful Scroll Animations
5:04
Beyond Fireship
Рет қаралды 1,6 МЛН
Responsive Flexbox Layout in 2 Minutes
2:41
SolarDev
Рет қаралды 20 М.
I Tested Every FREE Drawing App
22:15
viyaura
Рет қаралды 144 М.
KIA - 6 лет вне закона! // Проверил. Купил. Попал.
40:03
Crazy CSS Using By Master CSS
6:46
Lun Dev
Рет қаралды 60 М.
How to Make a Loading Animation with HTML and CSS
8:56
NextGenCoder
Рет қаралды 189
Complete git and Github course in Hindi
2:54:56
Chai aur Code
Рет қаралды 86 М.
Animated Background using only CSS
6:44
Ecem Gokdogan
Рет қаралды 148