generated from CodeYourFuture/Module-Template
-
-
Notifications
You must be signed in to change notification settings - Fork 94
Maryna Romanova - Sprint-3 #450
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
MarynaRomashca
wants to merge
3
commits into
CodeYourFuture:main
Choose a base branch
from
MarynaRomashca:Sprint-3
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,57 @@ | ||
function setAlarm() {} | ||
const textArea = document.querySelector("#alarmSet"); | ||
const timeRemaining = document.querySelector("#timeValue"); | ||
const startButton = document.querySelector("#set"); | ||
let isAudioPlay = false; | ||
let intervalId = null; | ||
|
||
textArea.addEventListener('input', function () { | ||
const value = textArea.value; | ||
timeRemaining.innerHTML = value; | ||
}); | ||
|
||
function setAlarm() { | ||
let firstReminder = +timeRemaining.innerHTML * 1000; | ||
|
||
if (intervalId) { | ||
clearInterval(intervalId); | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is fistRemaider a typo? if not just ignore There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I fixes my typo. |
||
intervalId = setInterval(() => { | ||
firstReminder -= 100; | ||
|
||
if (firstReminder <= 0) { | ||
clearInterval(intervalId); | ||
intervalId = null; | ||
timeRemaining.innerHTML = 0; | ||
if (!isAudioPlay) { | ||
playAlarm(); | ||
isAudioPlay = true; | ||
} | ||
} else { | ||
|
||
timeRemaining.innerHTML = (firstReminder / 1000).toFixed(1); | ||
} | ||
}, 100); | ||
} | ||
|
||
function pauseAlarm() { | ||
audio.pause(); | ||
audio.currentTime = 0; | ||
isAudioPlay = false; | ||
|
||
if (intervalId) { | ||
clearInterval(intervalId); | ||
intervalId = null; | ||
} | ||
} | ||
|
||
// DO NOT EDIT BELOW HERE | ||
|
||
var audio = new Audio("alarmsound.mp3"); | ||
|
||
function setup() { | ||
document.getElementById("set").addEventListener("click", () => { | ||
console.log("1") | ||
setAlarm(); | ||
}); | ||
|
||
|
@@ -18,8 +64,8 @@ function playAlarm() { | |
audio.play(); | ||
} | ||
|
||
function pauseAlarm() { | ||
audio.pause(); | ||
} | ||
// function pauseAlarm() { | ||
// audio.pause(); | ||
// } | ||
|
||
window.onload = setup; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<link rel="stylesheet" href="style.css" /> | ||
<title>Title here</title> | ||
</head> | ||
<body> | ||
<div class="centre"> | ||
<h1 id="timeRemaining">Time Remaining:</h1> <h1 id="timeValue"> 00:00</h1> | ||
<label for="alarmSet">Set time to:</label> | ||
<input id="alarmSet" type="number" /> | ||
|
||
<button id="set" type="button">Set Alarm</button> | ||
<button id="stop" type="button">Stop Alarm</button> | ||
</div> | ||
<script src="test.js"></script> | ||
</body> | ||
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// const endDate = new Date("2025-03-12T03:25:00") | ||
|
||
// console.log (endDate) | ||
// function countDoun (){ | ||
// let now = new Date() | ||
// console.log (now) | ||
// if (now.getTime() < endDate.getTime()){ | ||
// //loop | ||
// setInterval(() => { | ||
// now = new Date() | ||
// let timeRemide = endDate - now | ||
|
||
// console.log (new Date (timeRemide)) | ||
// console.log (new Date(now.getTime() + timeRemide * 24 * 60 * 60 * 1000)) | ||
// console.log (new Date(daysRemaining * 24 * 60 * 60 * 1000)); | ||
// }, 1000); | ||
|
||
// } | ||
// else { | ||
// console.log("finish") | ||
// } | ||
// } | ||
// countDoun () | ||
|
||
|
||
// //new Date(now.getTime() + daysRemaining * 24 * 60 * 60 * 1000); | ||
|
||
|
||
// //new Date(daysRemaining * 24 * 60 * 60 * 1000); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
require("@testing-library/jest-dom"); | ||
|
||
|
||
|
||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,55 @@ | ||
/** Write your CSS in here **/ | ||
body { | ||
background-color:bisque; | ||
} | ||
|
||
#div-in { | ||
background-color: white; | ||
border-radius: 20px; | ||
padding: 30px; | ||
box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2); | ||
width: 600px; | ||
height: 200px; | ||
text-align: center; | ||
|
||
justify-content: center; | ||
margin-left: 30%; | ||
margin-top:10%; | ||
|
||
} | ||
|
||
|
||
|
||
#quote { | ||
font-size: 1.5em; | ||
font-style: italic; | ||
margin-bottom: 15px; | ||
color: #333; | ||
} | ||
|
||
#author { | ||
font-size: 1.1em; | ||
font-weight: bold; | ||
color: #555; | ||
} | ||
|
||
#new-quote { | ||
position: fixed; | ||
bottom: 40%; | ||
left: 50%; | ||
|
||
margin-bottom: 20px; | ||
padding: 12px 24px; | ||
background-color:orange; | ||
color: white; | ||
border: none; | ||
border-radius: 12px; | ||
cursor: pointer; | ||
transition: background-color 0.3s ease; | ||
} | ||
|
||
#new-quote:hover { | ||
background-color: red; | ||
} | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,22 @@ | ||
/** Write your CSS in here **/ | ||
#box-cat { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: 90vh; | ||
} | ||
|
||
|
||
#carousel-img { | ||
|
||
height: 600px; | ||
width: 900px; | ||
|
||
} | ||
|
||
#button { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: 40px; | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not working in my Browser. There areas to be reviewed specifically line 26. I advise breaking this down into multiple pull requests. Also look strengthening your process for handling inputs and checking out the clear interval function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line 26 of test.js to be precise
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All is fixed