Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Site/assets/Cloudy Weather.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Site/assets/Cloudy Weather@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Site/assets/Sun.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Site/assets/Sunny Weather.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Site/assets/Weather.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Site/assets/Weather_10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Site/assets/Weather_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Site/assets/Weather_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Site/assets/Weather_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Site/assets/Weather_5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Site/assets/Weather_6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Site/assets/Weather_7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Site/assets/Weather_8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Site/assets/Weather_9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Site/assets/images.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
110 changes: 110 additions & 0 deletions Site/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Погода.</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" media="screen" href="style/main.css" />
<link rel="stylesheet" type="text/css" media="screen" href="style/5-day-weather.css" />
<script src="scripts/main.js"></script>

</head>
<body>
<header>
<nav>
<div class="navigation">
<a href="#">Сегодня</a>
<a href="#">5 дней</a>
<a href="#">История погоды</a>
</div>
<div class="information_navigtion">
<ul>
<li id="icon_info_weather"><img src="assets/Cloudy Weather.png"></li>
<li id="temp_info_weather">34°</li>
<li id="region_info_weather">Ижевск</li>
<li id="country_info_weather">Россия</li>
</ul>
</div>
</nav>
</header>
<section>
<div class="weather-menu">


<div class="slider">
<div class="header-menu">
<p>Пн, 18 Май</p>
</div>
<div class="item">
<div id="ome_section" class="block">Ночь
</br><img class="img" src="assets/Cloudy Weather.png">
<div class="temp">+10°</div>
</div>
<div id="two_section" class="block">Утро
</br><img class="img" src="assets/Weather_2.png">
<div class="temp">+5°</div>
</div>
<div id="three_section" class="block">День
</br><img class="img" src="assets/Weather_2.png">
<div class="temp">+8°</div>
</div>
<div id="four_section" class="block">Вечер
</br><img class="img" src="assets/Weather_2.png">
<div class="temp">+14°</div>
</div>
</div>
<div class="item" id="one">
<div class="header-menu" id ="one">
<p>Вт, 18 Май</p>
</div>
<div id="ome_section" class="block">Ночь
</br><img class="img" src="assets/Cloudy Weather.png">
<div class="temp">+1321°</div>
</div>
<div id="two_section" class="block">Утро
</br><img class="img" src="assets/Weather_2.png">
<div class="temp">+21315°</div>
</div>
<div id="three_section" class="block">День
</br><img class="img" src="assets/Weather_2.png">
<div class="temp">+8213123°</div>
</div>
<div id="four_section" class="block">Вечер
</br><img class="img" src="assets/Weather_2.png">
<div class="temp">+14213123°</div>
</div>
</div>
<div class="item" id="two">
<div class="header-menu" id="two">
<p>Ср, 18 Май</p>
</div>
<div id="ome_section" class="block">Ночь
</br><img class="img" src="assets/Cloudy Weather.png">
<div class="temp">+21312°</div>
</div>
<div id="two_section" class="block">Утро
</br><img class="img" src="assets/Weather_2.png">
<div class="temp">-213123°</div>
</div>
<div id="three_section" class="block">День
</br><img class="img" src="assets/Weather_2.png">
<div class="temp">+2138213123°</div>
</div>
<div id="four_section" class="block">Вечер
</br><img class="img" src="assets/Weather_2.png">
<div class="temp">+1°</div>
</div>
</div>
</div>
<div class="slider-dots">
<span class="slider-dots_item" onclick="currentSlide(1)">Понедельник</span>
<span class="slider-dots_item" onclick="currentSlide(2)">Вторник</span>
<span class="slider-dots_item" onclick="currentSlide(3)">Среда</span>
</div>
</div>
<a class="prev" onclick="minusSlide()">&#10094;</a>
<a class="next" onclick="plusSlide()">&#10095;</a>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

сделай это лучше в js файле с помощью addEventListener

</section>
</body>
</html>
41 changes: 41 additions & 0 deletions Site/scripts/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
var slideIndex = 1;
var slides = document.getElementsByClassName("item");
var dots = document.getElementsByClassName("slider-dots_item");
//showSlides(slideIndex);


function plusSlide() {
showSlides(slideIndex += 1);
}


function minusSlide() {
showSlides(slideIndex -= 1);
}

function currentSlide(n) {
showSlides(slideIndex = n);
}

function showSlides(n) {
var i;

if (n > slides.length) {
slideIndex = 1
}
if (n < 1) {
slideIndex = slides.length
}
for (i = 0; i < slides.length; i++) {
// if (slides[i].style.display === 'block') {
// }
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

удали неиспользуемый код

console.log(i);
slides[i].style.display = "none";
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

сделай проверку в if блоке на то если элемент активен и потом делай display = 'none'
не очень хорошо выполнять ненужные действия впустую

dots[i].className = dots[i].className.replace(" active", "");
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

используй методы у classList вместо работы с методами строки
можно использовать add, remove, toggle, etc.

}
// for (i = 0; i < dots.length; i++) {
// dots[i].className = dots[i].className.replace(" active", "");
// }
slides[slideIndex - 1].style.display = "block";
dots[slideIndex - 1].className += " active";
}
31 changes: 31 additions & 0 deletions Site/style/5-day-weather.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#icon_info_weather {
vertical-align: middle;
}
.weather-menu {

width: 632px;
height: 171px;
display: block;
margin-top: 90px;
margin-left: 418px;
border: 1px solid black;

}
.block {
float: left;
line-height: 50px;
font-size: 25px;
width: 150px;
margin-right: 10px;
text-align: center;

}
.weather-menu :last-child {
margin-right: 0px;
}
#ome_section .temp {
margin-top: 6px;
}
#one, #two {
display: none;
}
42 changes: 42 additions & 0 deletions Site/style/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
*{
padding: 0;
margin: 0;
}
nav {
font-size: 0px;
}
nav a {
font-size: 20px;
border-left: 0px solid #333;
border-right: 0px solid #333;
display: inline-block;
padding: 10px 15px;
text-decoration: none;
color: black;

}
nav a:hover {
box-shadow: 0 0 4px black;
color: black;
}
.navigation {
padding-left: 60px;
border: 0px solid #333;

}
.information_navigtion {
font-size: 19px;
padding-left: 60px;
border: 0px solid #333;
box-shadow: 0 0 1px black;

}
.information_navigtion li {
display: inline-block;
padding: 10px 1px;

}
.header-menu {
border-bottom: 1px solid black;
text-align: center;
}