Counter up animation | Javascript

  Рет қаралды 20,548

Web Dev Made Easy

Web Dev Made Easy

Күн бұрын

Пікірлер: 45
@natan-cwb9131
@natan-cwb9131 2 жыл бұрын
Muito bão Robson!!! Pelo sotaque vc é dos nosso...UHAuHAhAU!!!
@DevMadeEasy
@DevMadeEasy 2 жыл бұрын
Obrigado amigo! Bem vindo a nossa comunidade & happy coding!
@djordjek3916
@djordjek3916 3 жыл бұрын
Really well-explained video. Easy. Thank you for the tutorial!
@DevMadeEasy
@DevMadeEasy 3 жыл бұрын
Glad you enjoyed it!
@DevMadeEasy
@DevMadeEasy 4 жыл бұрын
If you find this video helpful, give it a like as this would help it reach even more people! Also, subscribe if you haven't ! Thank you! 🙏 👉 Source Code Available Here: 🌱devmadeeasy.gumroad.com/l/counterupanimation
@foxynight1688
@foxynight1688 2 жыл бұрын
Thank you for the tutorial!
@DevMadeEasy
@DevMadeEasy 2 жыл бұрын
Glad it was helpful!
@samarpal7088
@samarpal7088 Жыл бұрын
Very nice class sir thanks
@DevMadeEasy
@DevMadeEasy Жыл бұрын
All the best
@abdurahman6838
@abdurahman6838 2 жыл бұрын
Barakallah bro
@DevMadeEasy
@DevMadeEasy 2 жыл бұрын
Thanks! Happy Coding my friend!
@jalalbmnf
@jalalbmnf 4 жыл бұрын
Great job!!!👍👍👍
@DevMadeEasy
@DevMadeEasy 4 жыл бұрын
Thank you! Cheers!
@NganNguyen-ww1ez
@NganNguyen-ww1ez 2 жыл бұрын
Thank you very much
@DevMadeEasy
@DevMadeEasy 2 жыл бұрын
Any time
@ceejayviii
@ceejayviii 2 жыл бұрын
Thank You!
@DevMadeEasy
@DevMadeEasy 2 жыл бұрын
You're welcome! I'm very glad you liked it my friend! Welcome to the Community and Happy Coding!
@ankitchauhan8682
@ankitchauhan8682 2 жыл бұрын
great thanks
@DevMadeEasy
@DevMadeEasy 2 жыл бұрын
Welcome 😊
@RyanCavalcanti
@RyanCavalcanti Жыл бұрын
Obrigado! Poderia me tirar uma dúvida? Gostaria de saber como faço para só executar a função desse contador quando o usuário descer até a posição da tela do site onde se encontra a função. Porque assim que o usuário entra, a função já é ativada e ele não consegue visualizar essa função sendo executada.
@flamengoreactskill
@flamengoreactskill 3 жыл бұрын
great job
@DevMadeEasy
@DevMadeEasy 3 жыл бұрын
Hey DEV, I'm glad you liked it, welcome to the Tribe...
@WilliamSeeley-ho6ju
@WilliamSeeley-ho6ju 3 жыл бұрын
Would this work on a web extension?
@camilogarcia1325
@camilogarcia1325 2 жыл бұрын
If + does not works for you to convert to number the string, use parseInt(counter.innerText); instead
@DevMadeEasy
@DevMadeEasy 2 жыл бұрын
Thanks for you feedback Camigo. Welcome to our DEV Tribe....
@camilogarcia1325
@camilogarcia1325 2 жыл бұрын
@@DevMadeEasy THanks to you to make this tutorials, hope you upload more, is awesome
@mobilehospitalpg3608
@mobilehospitalpg3608 3 жыл бұрын
great
@DevMadeEasy
@DevMadeEasy 3 жыл бұрын
Hello DEV, I'm glad you like it... There is more coming this week... Happy Coding!!!
@tee_blaqk
@tee_blaqk 2 жыл бұрын
Hello, thank you sir 💯💯👌 Please what if I want to add one to the value to make it ..1501, every time it counts up, so it'll be 1501, 1502... Would appreciate a response, asap, thank you
@DevMadeEasy
@DevMadeEasy 2 жыл бұрын
Yes, you can
@PrefnaVagheni
@PrefnaVagheni 5 ай бұрын
Thank you for this amazing tutorial. Surely I learned something today. Please I got a question though, why to choose 250 as dividend? someone please to help me understand that logic. Cause it was the only way(number) to get the exact number in the data-target. So I'll appreciate if someone can break the logic down for me. Thanks.
@DevMadeEasy
@DevMadeEasy 5 ай бұрын
Hello Dev, I am glad you liked... Welcome to the DevTribe...
@professionalman9449
@professionalman9449 7 ай бұрын
tanks ❤
@DevMadeEasy
@DevMadeEasy 7 ай бұрын
You're welcome 😊
@user713.
@user713. 4 жыл бұрын
how to make the animation activate when scrolling to the block?
@DevMadeEasy
@DevMadeEasy 4 жыл бұрын
Yes, this is a great idea, I was going to do it, but the video would be too long.. Feel free to do so if you want you can show us the results here in the comments. Anyway, good studies!
@yuvantbesre1297
@yuvantbesre1297 3 жыл бұрын
@@DevMadeEasy He is not telling you anything. He is actually asking you that how would we animate on scroll. As a matter of fact, I do too. I don't want to use JQuery or any other plugin for such a small thing. SO please tell us.
@djordjek3916
@djordjek3916 3 жыл бұрын
@@yuvantbesre1297 I did it using vanilla JavaScript intersection observer. Here is the code for simple example: *HTML* Hello All 1500 KZbin followers 3000 Twitter followers 1000 Facebook followers *CSS* * { margin: 0; padding: 0; box-sizing: border-box; } .sc-1 { min-height: 100vh; display: flex; justify-content: center; align-items: center; background-color: orange; } .sc-2 { min-height: 40vh; display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; align-items: center; padding:30px; } .counter-container { text-align: center; background-color: white; padding: 20px; box-shadow: 0 0 20px -10px rgba(0, 0, 0, 0.3); } i { font-size: 40px; } .fa-youtube { color: #FF0D00; } .fa-twitter { color: #1EA1F2; } .fa-facebook-f { color: #1877F2; } .counter { font-size: 50px; margin: 30px 0; } @media (max-width: 650px) { .sc-2 { grid-template-columns: 1fr; } } *JavaScript* const counters = document.querySelectorAll('.counter'); const section2 = document.querySelector('.sc-2'); const countingCounters = function (entries, observer) { entries.forEach(entry => { if (entry.isIntersecting && entry.intersectionRatio >= 0.2) { counters.forEach(counter => { counter.innerText = '0'; const updateCounter = function () { const target = +counter.getAttribute('data-target'); const c = +counter.innerText; const increment = target / 350; if (c < target) { counter.innerText = `${Math.ceil(c + increment)}`; setTimeout(updateCounter, 5); } else { counter.innerText = target; } } updateCounter(); }); observer.unobserve(section2); } }); }; const options = { root: null, threshold: 0.2 }; const observer = new IntersectionObserver(countingCounters, options); observer.observe(section2);
@lovelymuffins21
@lovelymuffins21 2 жыл бұрын
@@djordjek3916 thank you very much
@sviatoslavoleksiienko8523
@sviatoslavoleksiienko8523 2 жыл бұрын
Have the same question :)
@typicalyorkshirebloke
@typicalyorkshirebloke 2 жыл бұрын
Is it possible to have the numbers going up at different speeds inside of one set of code instead of repeating the exact same code over multiple times with different speeds?
@marcin1352
@marcin1352 2 жыл бұрын
in div add data-speed="500" (500 is example) then add to script const speed = +counter.getAttribute("data-speed"); and update const increment value to target / speed;
@gmkhussain
@gmkhussain 4 жыл бұрын
Great Man ❤️🔥 What a co-incidence on my channel #NewSeries 😂
@DevMadeEasy
@DevMadeEasy 4 жыл бұрын
I'm glad you like it!
🦶🏼Multi Step Form With Progress | HTML CSS & JavaScript
36:35
Web Dev Made Easy
Рет қаралды 15 М.
Build a Step Progress Bar | JavaScript
29:29
Web Dev Made Easy
Рет қаралды 28 М.
She made herself an ear of corn from his marmalade candies🌽🌽🌽
00:38
Valja & Maxim Family
Рет қаралды 18 МЛН
小丑女COCO的审判。#天使 #小丑 #超人不会飞
00:53
超人不会飞
Рет қаралды 16 МЛН
5 JavaScript Concepts You HAVE TO KNOW
9:38
James Q Quick
Рет қаралды 1,4 МЛН
Animate On Scroll With Just 3 LINES Of CSS (No Libraries Needed)
2:51
Learn Intersection Observer In 15 Minutes
15:32
Web Dev Simplified
Рет қаралды 345 М.
Countdown Timer | JavaScript
20:00
Web Dev Made Easy
Рет қаралды 43 М.
7 Amazing CLI Tools You Need To Try
18:10
Josean Martinez
Рет қаралды 406 М.
How To Create A Search Bar In JavaScript
14:28
Web Dev Simplified
Рет қаралды 425 М.