Skip to content

A javascript countdown clock or timer. That is simple to use in any project or on any website.

License

Notifications You must be signed in to change notification settings

caa-pjt/countdown-timer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JS - CountDownTimer. Creat a count down timer without dependencies!

countdown-timer

A javascript countdown clock or timer. That is simple to use in any project or on any website.

Usage

Include the (minified) JavaScript Templates script in your HTML markup:

<script src="./dist/countdownTimer.min.j"></script>

HTML code

    <div class="contdown">
        <div class="bloc" id="days"></div>
        <div class="bloc" id="hours"></div>
        <div class="bloc" id="minutes"></div>
        <div class="bloc" id="seconds"></div>
    </div>

JS code

    new ContDownTimer({
        
        options...
        
    }, callback function... )

Options

    {
        launchDate :  new Date(year, monthIndex, day, hours, minutes, seconds),
        language : "string<language>" // Avaliable en|fr default en

    }, function() {

        // This code will be called after the time is finished
    }

Valid code example

new ContDownTimer({
    launchDate :  new Date(2023, 10, 22, 0, 0),
    language : "fr"
}, () => {
        
    document.querySelector('.contdown-container').style.display = 'none'
    document.body.innerHTML = `<h1>The timer is ended !</h1>` 
})

About

A javascript countdown clock or timer. That is simple to use in any project or on any website.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published