-
Notifications
You must be signed in to change notification settings - Fork 280
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
Lesson 3 tasks #902
Open
nadyakol
wants to merge
6
commits into
d-okhrimenko:master
Choose a base branch
from
nadyakol:lesson-3
base: master
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
Lesson 3 tasks #902
Changes from all commits
Commits
Show all changes
6 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
Binary file not shown.
This file contains 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,3 @@ | ||
.DS_Store | ||
.DS_Store | ||
HomeWorkAnswers/.DS_Store |
Binary file not shown.
This file contains 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,19 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Display current date</title> | ||
</head> | ||
<body> | ||
<p id="output">New date</p> | ||
<button id="btn">Click me!</button> | ||
<script> | ||
document.querySelector("#btn").onclick = function () { | ||
let output = document.querySelector("#output"); | ||
output.innerHTML = new Date(); | ||
output.style.color = "red"; | ||
}; | ||
</script> | ||
</body> | ||
</html> |
This file contains 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" /> | ||
<title>Say hello</title> | ||
</head> | ||
<body> | ||
<p id="output">Текст привітання</p> | ||
<button id="btn">Скажи привіт</button> | ||
<script> | ||
document.querySelector("#btn").onclick = function () { | ||
let name = "Надія"; | ||
let output = document.querySelector("#output"); | ||
output.innerHTML = `Привіт, ${name}!`; | ||
output.style.color = "blue"; | ||
}; | ||
</script> | ||
</body> | ||
</html> |
This file contains 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,23 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Document</title> | ||
</head> | ||
<body> | ||
<script> | ||
let input = prompt("Введіть число:"); | ||
number = Number(input); | ||
if (isNaN(number)) { | ||
alert("Введене значення не є числом. Спробуйте ще раз."); | ||
} else { | ||
if (number % 2 === 0) { | ||
alert("Число " + number + " є парним."); | ||
} else { | ||
alert("Число " + number + " є непарним."); | ||
} | ||
} | ||
</script> | ||
</body> | ||
</html> |
This file contains 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,31 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Document</title> | ||
</head> | ||
<body> | ||
<script> | ||
let currentDate = new Date(); | ||
let dayOfWeek = currentDate.getDay(); | ||
let dayName; | ||
if (dayOfWeek === 0) { | ||
dayName = "Сьогодні неділя"; | ||
} else if (dayOfWeek === 1) { | ||
dayName = "Сьогодні понеділок"; | ||
} else if (dayOfWeek === 2) { | ||
dayName = "Сьогодні вівторок"; | ||
} else if (dayOfWeek === 3) { | ||
dayName = "Сьогодні середа"; | ||
} else if (dayOfWeek === 4) { | ||
dayName = "Сьогодні четвер"; | ||
} else if (dayOfWeek === 5) { | ||
dayName = "Сьогодні п'ятниця"; | ||
} else if (dayOfWeek === 6) { | ||
dayName = "Сьогодні субота"; | ||
} | ||
alert(dayName); | ||
</script> | ||
</body> | ||
</html> |
This file contains 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,23 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Document</title> | ||
</head> | ||
<body> | ||
<script> | ||
let input = prompt("Введіть рік:"); | ||
year = Number(input); | ||
if (isNaN(year) && year >= 0) { | ||
alert("Введене значення не є роком. Спробуйте ще раз."); | ||
} else { | ||
if ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0) { | ||
alert(year + " є високосним роком."); | ||
} else { | ||
alert(year + " не є високосним роком."); | ||
} | ||
} | ||
</script> | ||
</body> | ||
</html> |
Binary file not shown.
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.
Це простіше через switch зробити або взагалі без умовної конструкції через масив з назвами днів тижня
dayName = names[dayOfWeek]