NeeilTimer

Size
2,836 Kb
Views
26,312

How do I make an neeiltimer?

What is a neeiltimer? How do you make a neeiltimer? This script and codes were developed by Neeilan Selvalingam on 13 September 2022, Tuesday.

NeeilTimer Previews

NeeilTimer - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>neeilTimer</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <link href='https://fonts.googleapis.com/css?family=Pacifico' rel='stylesheet' type='text/css'>
<p id="top"> <span style="color:white">Pomodoro Timer</span><br> <span style="font-size:0.5em;">by Neeilan</span>
</p>
<div class="timer"> <button id="counter" onclick="controller()"></button><br> <button id="minus" onclick="minus()">-</button> <button id="plus" onclick="plus()">+</button> <button id="sound" onclick="toggleSound()">&#x1f507;	</button>
</div> <script src="js/index.js"></script>
</body>
</html>

NeeilTimer - Script Codes CSS Codes

#top { text-align: center; color: rgb(255,201,14); font-family: Pacifico; font-size: 3em; line-height: 0.8em;
}
body { background: rgb(1, 15, 22);
}
h4 { font-family: Arial; font-size: 1.4em; color: lightgray; margin-top: 10px;
}
.timer { text-align: center; position: relative; width: 100%; margin-left: auto; margin-right: auto;
}
button { padding:5px; position: relative; color: white; background: #319470; margin: 10px; border-style: none; height: 50px; width: 50px; border-radius: 80%;
}
button:focus { outline: none;
}
button:disabled { background: rgb(4, 62, 89);
}
button:active { height: 49px;
}
#counter { display: inline; padding-top: 35px; height: 200px; width: 200px; border-radius: 80%; font-size: 1.8em; background: rgb(0, 147, 147); overflow: hidden;
}
h6 { margin-top: 0px; padding-top: 5px; font-size: 0.5em; color: rgb(0, 106, 106);
}

NeeilTimer - Script Codes JS Codes

var minutes = 25, active = false, sound = true, countdown, seconds;
var audio = new Audio('http://soundbible.com/grab.php?id=1787&type=mp3');
var tick = new Audio('http://soundbible.com/grab.php?id=2044&type=mp3');
document.getElementById("counter").innerHTML = minutes + "<br><h6 id='inner'>Start</h6>";
function controller() { if (active === false && minutes > 0) { turnRed(); active = true; disableButtons(); seconds = minutes * 60; countdown = setInterval(function() { startCountdown(); }, 1000); } //Active is true, minutes=0 else if (active === true) { audio.pause(); audio.load(); //reload audio clearInterval(countdown); active = false; turnBlue(); enableButtons(); minutes = 25; document.getElementById("counter").innerHTML = minutes + "<br><h6 id='inner'>Start</h6>"; }
}
function startCountdown() { if (seconds > 0) { if (sound) { tick.play(); } seconds--; var minsLeft = Math.floor(seconds / 60); var secsLeft = Math.floor(seconds - minsLeft * 60); document.getElementById("counter").innerHTML = pad(minsLeft) + ":" + pad(secsLeft) + "<br><h6 style='color:rgb(233,152,152)'>Reset</h6>"; } else { clearInterval(countdown); audio.play(); }
}
// .................
function pad(num) { if (num < 10) { return "" + 0 + num; } else { return num; }
}
function turnRed() { document.getElementById("counter").style.backgroundColor = "#de6868"; document.getElementById("inner").style.color = "rgb(233,152,152)";
}
function turnBlue() { document.getElementById("counter").style.backgroundColor = "rgb(0,147,147)";
}
function disableButtons() { document.getElementById("plus").disabled = true; document.getElementById("minus").disabled = true;
}
function enableButtons() { document.getElementById("plus").disabled = false; document.getElementById("minus").disabled = false;
}
function toggleSound() { if (sound === true) { sound = false; document.getElementById("sound").innerHTML = "&#x1f50a;"; document.getElementById("sound").style.backgroundColor = "rgb(127,127,127)"; } else { sound = true; document.getElementById("sound").innerHTML = "&#x1f507;"; document.getElementById("sound").style.backgroundColor = "#319470"; }
}
function plus() { minutes++; document.getElementById("counter").innerHTML = pad(minutes) + "<br><h6 id='inner'>Start</h6>";
}
function minus() { if (minutes > 1) { minutes--; } document.getElementById("counter").innerHTML = pad(minutes) + "<br><h6 id='inner'>Start</h6>";
}
NeeilTimer - Script Codes
NeeilTimer - Script Codes
Home Page Home
Developer Neeilan Selvalingam
Username neeilan
Uploaded September 13, 2022
Rating 3
Size 2,836 Kb
Views 26,312
Do you need developer help for NeeilTimer?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Neeilan Selvalingam (neeilan) Script Codes
Name
GameOfLife
Milestones
Simon Game
Fctest
NeeilCalc
MarkdownPreviewer
UTSCMap
RecipeBox
TTTnoAI
Scribe
Create amazing web content with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!