diff --git a/Calculators/Days-Until-Deadline-Calculator/index.html b/Calculators/Days-Until-Deadline-Calculator/index.html new file mode 100644 index 000000000..1a403fe06 --- /dev/null +++ b/Calculators/Days-Until-Deadline-Calculator/index.html @@ -0,0 +1,20 @@ + + + + + + Days Until Deadline Calculator + + + +
+

Days Until Deadline Calculator

+ + +

+ +

+
+ + + diff --git a/Calculators/Days-Until-Deadline-Calculator/script.js b/Calculators/Days-Until-Deadline-Calculator/script.js new file mode 100644 index 000000000..8331edf76 --- /dev/null +++ b/Calculators/Days-Until-Deadline-Calculator/script.js @@ -0,0 +1,15 @@ +function calculateDays() { + const deadlineInput = document.getElementById('deadline').value; + if (deadlineInput) { + const deadlineDate = new Date(deadlineInput); + const currentDate = new Date(); + + const timeDifference = deadlineDate - currentDate; + const daysRemaining = Math.ceil(timeDifference / (1000 * 60 * 60 * 24)); + + document.getElementById('result').innerText = + daysRemaining >= 0 ? `${daysRemaining} days remaining` : `The date has passed.`; + } else { + document.getElementById('result').innerText = 'Please select a date.'; + } +} diff --git a/Calculators/Days-Until-Deadline-Calculator/style.css b/Calculators/Days-Until-Deadline-Calculator/style.css new file mode 100644 index 000000000..37151b7f8 --- /dev/null +++ b/Calculators/Days-Until-Deadline-Calculator/style.css @@ -0,0 +1,55 @@ +body { + font-family: Arial, sans-serif; + background: linear-gradient(to right, #6a11cb, #2575fc); + display: flex; + justify-content: center; + align-items: center; + height: 100vh; + margin: 0; +} + +.container { + background-color: rgba(255, 255, 255, 0.8); /* Semi-transparent white background */ + padding: 20px; + border-radius: 8px; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); + text-align: center; + color: black; + background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"%3E%3Cg fill="none" stroke="%23999" stroke-width="1"%3E%3Cpath d="M0 50 L50 0 L100 50 L50 100 Z"/%3E%3Cpath d="M50 0 L50 100"/%3E%3Cpath d="M0 50 L100 50"/%3E%3C/g%3E%3C/svg%3E'); + background-size: 40px 40px; + background-repeat: repeat; +} + +h1 { + margin-bottom: 20px; +} + +label { + font-size: 18px; +} + +input[type="date"] { + padding: 10px; + margin: 10px 0; + font-size: 16px; +} + +button { + padding: 10px 20px; + font-size: 16px; + background-color: #007bff; + color: white; + border: none; + border-radius: 5px; + cursor: pointer; +} + +button:hover { + background-color: #0056b3; +} + +#result { + margin-top: 20px; + font-size: 20px; + font-weight: bold; +} diff --git a/index.html b/index.html index aab0626e6..188e52a02 100644 --- a/index.html +++ b/index.html @@ -622,6 +622,20 @@

Calculates the day for the specified date.

+
+
+

Days Until Deadline Calculator

+

Calculate the Number of Days Remaining Until a Selected Date.

+ +
+

Definite Integral Calculator