A1Protocol Posted August 29 Share Posted August 29 Greetings everyone! I recently added a small number counter on my "About Me" page. Text only. Here. I was wondering if you knew how to animate the numbers? Like a flip clock or Elfsight's number counter. Thank you! Link to comment
tuanphan Posted August 30 Share Posted August 30 I think adjust current number will require a lot of code You can use a Count up Animation Plugin, like this: https://www.will-myers.com/products/p/count-up-animation use code TUAN to get 10% discount You can also find a free code on Codepen, then share link, we can convert it to Code Block, like this https://codepen.io/vn38/pen/eYZWeGr https://codepen.io/nathanlong/pen/NWLWXXx Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
A1Protocol Posted August 30 Author Share Posted August 30 1 hour ago, tuanphan said: You can also find a free code on Codepen, then share link, we can convert it to Code Block, like this https://codepen.io/vn38/pen/eYZWeGr https://codepen.io/nathanlong/pen/NWLWXXx Hey Tuan! I'm trying to avoid using a plug-in for stability purposes. I like either link's animations. Is there a way we can integrate those to my site? Thank you. Link to comment
Solution tuanphan Posted September 2 Solution Share Posted September 2 On 8/30/2024 at 9:33 AM, A1Protocol said: Hey Tuan! I'm trying to avoid using a plug-in for stability purposes. I like either link's animations. Is there a way we can integrate those to my site? Thank you. With first link, try edit page > Add a Code Block > Paste this code <nav class="level"> <div class="level-item has-text-centered"> <div> <p class="heading">Tweets</p> <p class="title js-count-up" data-value="3456"></p> </div> </div> <div class="level-item has-text-centered"> <div> <p class="heading">Following</p> <p class="title js-count-up" data-value="123"></p> </div> </div> <div class="level-item has-text-centered"> <div> <p class="heading">Followers</p> <p class="title js-count-up" data-value="450000"></p> </div> </div> <div class="level-item has-text-centered"> <div> <p class="heading">Likes</p> <p class="title js-count-up" data-value="789"></p> </div> </div> </nav> <style> .bg { background-color: #1e1f26; height: 100vh; color: #ffffff; display: flex; align-items: center; justify-content: center; } .level { background-color: #00d1b2; padding: 5rem 0; color: #ffffff; margin: 0 !important; } .title { color: inherit; width: 200px; height: 36px; } </style> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.9.0/css/bulma.min.css"/> <script src="https://cdnjs.cloudflare.com/ajax/libs/waypoints/4.0.1/noframework.waypoints.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/countup.js/2.0.7/countUp.js"></script> <script> import { CountUp } from 'https://cdnjs.cloudflare.com/ajax/libs/countup.js/2.0.7/countUp.js'; function countStart() { const $counters = document.querySelectorAll(".js-count-up"), options = { useEasing: true, useGrouping: true, separator: ",", decimal: "." }; $counters.forEach(item => { const value = item.dataset.value; const counter = new CountUp(item, value, options); counter.start(); }); } new Waypoint({ element: document.querySelector('.level'), handler: function () { countStart(); //this.destroy() //for once }, offset: '50%' }); </script> Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
A1Protocol Posted September 2 Author Share Posted September 2 Hey Tuan! Thank you for getting back to me! This just added a green tweet block with followers, tweets and likes overlapping my numbers. I understand if it's a more complex issue that requires a plug-in. I don't mind leaving my numbers as such. Link to comment
tuanphan Posted September 7 Share Posted September 7 On 9/2/2024 at 9:43 PM, A1Protocol said: Hey Tuan! Thank you for getting back to me! This just added a green tweet block with followers, tweets and likes overlapping my numbers. I understand if it's a more complex issue that requires a plug-in. I don't mind leaving my numbers as such. Can you share link to page where you added code? I will check again Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
A1Protocol Posted September 7 Author Share Posted September 7 13 hours ago, tuanphan said: Can you share link to page where you added code? I will check again Hey Tuan! I will keep my simple textual numbers count. Keeping it simple! Thank you for your assistance with this! Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment