swampthang Posted June 30, 2022 Share Posted June 30, 2022 (edited) I needed a simple countdown timer class and have seen a few posts here over the last few years, including the awesome timer animation by Greensock here - See the Pen qBjGZaE by GreenSock (@GreenSock) on CodePen But I just needed something simple and reusable. This community has been so good to me over the years and I've not been the most contributive member. I created this class yesterday and wanted to share it in case anyone needs this kind of thing. It could use some refactoring so it's probably a tad bloated but it's a good starter class. You can pass the total number of seconds you want the timer to run, the container into which you want the timer to appear, a start callback and an end callback. I did use a few Bootstrap css classes so if you don't want to use that, just style the css as you like. I also used a google font for the timer text. I hope this helps anyone in need of a simple timer. Thanks again for all the help over the years. See the Pen 07b7c57c6c2eaa6dd326924261682109 by swampthang (@swampthang) on CodePen Edited June 30, 2022 by swampthang forgot to mention the google font 2 1 Link to comment Share on other sites More sharing options...
GreenSock Posted June 30, 2022 Share Posted June 30, 2022 Thanks for sharing!🙂 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now