Skip to content
Open

HW2 #14

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
122 changes: 122 additions & 0 deletions Aleksandr Zorin/css/flex.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
body {
background-image: url(../img/background.jpg);
background-position: center center;
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
font-family: 'Dosis', sans-serif;
margin: 0;
}

p {
margin: 0;
}

.weather-widget {
margin-top: 100px;
display: flex;
justify-content: center;
flex-wrap: wrap;
}

.weather-widget__location {
background-image: url(../img/city.jpg);
background-size: cover;
width: 500px;
border-radius: 10px 0px 0px 10px;
box-shadow: 0px 0px 100px 1px black;
display: flex;
flex-direction: column;
overflow: hidden;
}

.weather-widget__information {
box-sizing: border-box;
width: 500px;
padding-left: 50px;
padding-right: 50px;
background-color: #FFFFFF;
border-radius: 0px 10px 10px 0px;
box-shadow: 0px 0px 50px 1px black;
display: flex;
flex-direction: column;
}

.weather-widget__temp {
padding-top: 40px;
padding-bottom: 40px;
font-size: 100pt;
font-weight: 200;
color: #8E4140;
text-align: center;
border-bottom: 2px solid #8E4140;
}

.weather-widget__graph {
padding-top: 20px;
padding-bottom: 20px;
border-bottom: 2px solid #8E4140;
}

.weather-widget__days {
padding-top: 40px;
padding-bottom: 20px;
display: flex;
justify-content: space-around;
}

.weather-widget__weather-type {
background: rgba(46,28,37,0.89);
font-size: 60pt;
line-height: 1.5;
font-weight: 200;
text-align: center;
color: white;
}

.weather-widget__today {
background: rgba(119,25,33,0.89);
font-size: 20pt;
font-weight: 300;
text-align: center;
color: white;
padding-top: 40px;
padding-bottom: 40px;
}

.weather-widget__weather-type-logo {
box-sizing: content-box;
height: 100%;
text-align: center;
padding-top: 85px;
padding-bottom: 84px;
}

.weather-widget__day {
font-size: 16pt;
font-weight: 40;
line-height: 2;
text-align: center
}

.weather-widget__weekday-information {
text-align: center;
padding-left: 20px;
padding-right: 20px;
color: #8E4140;
}

.weather-widget__nighttime-temp {
color: black;
}

.weather-widget__day-weather-logo {
padding-left: 15px;
padding-right: 15px;
}

.weather-widget__weekday {
border-bottom: 2px solid #8E4140;
padding-top: 15px;
padding-bottom: 10px;
}
147 changes: 147 additions & 0 deletions Aleksandr Zorin/css/grid.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
body {
background-image: url(../img/background.jpg);
background-position: center center;
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
font-family: 'Dosis', sans-serif;
margin: 0;
}

p {
margin: 0;
}

.weather-widget {
margin-top: 100px;
display: grid;
display: -ms-grid;
grid-template-columns: 4fr 5fr 5fr 4fr;
grid-template-areas: ". location information .";
justify-items: stretch;
}

.weather-widget__location {
background-image: url(../img/city.jpg);
background-size: cover;
border-radius: 10px 0px 0px 10px;
box-shadow: 0px 0px 100px 1px black;
overflow: hidden;
grid-area: location;
display: grid;

}

.weather-widget__information {
box-sizing: border-box;
padding-left: 50px;
padding-right: 50px;
background-color: #FFFFFF;
border-radius: 0px 10px 10px 0px;
box-shadow: 0px 0px 50px 1px black;
grid-area: information;
}

.weather-widget__temp {
padding-top: 40px;
padding-bottom: 40px;
font-size: 100pt;
font-weight: 200;
color: #8E4140;
text-align: center;
border-bottom: 2px solid #8E4140;
}

.weather-widget__graph {
padding-top: 20px;
padding-bottom: 20px;
border-bottom: 2px solid #8E4140;
}

.weather-widget__days {
padding-top: 40px;
padding-bottom: 20px;
display: grid;
justify-items: center;
grid-template-columns: 1fr 1fr 1fr;
}

.weather-widget__weather-type {
background: rgba(46,28,37,0.89);
font-size: 60pt;
line-height: 1.5;
font-weight: 200;
text-align: center;
color: white;
}

.weather-widget__today {
background: rgba(119,25,33,0.89);
font-size: 20pt;
font-weight: 300;
text-align: center;
color: white;
padding-top: 40px;
padding-bottom: 40px;
}

.weather-widget__weather-type-logo {
box-sizing: content-box;
height: 100%;
text-align: center;
padding-top: 85px;
padding-bottom: 84px;
}

.weather-widget__day {
font-size: 16pt;
font-weight: 40;
line-height: 2;
text-align: center;
width: 100px;
}

.weather-widget__weekday-information {
width: 100px;
text-align: center;
margin: auto;
color: #8E4140;
}

.weather-widget__nighttime-temp {
color: black;
}

.weather-widget__weekday {
border-bottom: 2px solid #8E4140;
padding-top: 15px;
padding-bottom: 10px;
}

@media screen and (max-width: 1200px) {
.weather-widget {
grid-template-columns: 1fr 6fr 6fr 1fr;
grid-template-areas: ". location information .";
justify-items: stretch;
}
}

@media screen and (max-width: 900px) {
.weather-widget {
grid-template-columns: 1fr 5fr 1fr;
grid-template-rows: 1fr 1fr;
grid-template-areas: ". location ."
". information .";
justify-items: stretch;
}
}
@media screen and (max-width: 550px) {
.weather-widget {
grid-template-columns: 1fr;
grid-template-rows: 1fr 1fr;
grid-template-areas: "location"
"information";
justify-items: stretch;
}
}
}
Binary file added Aleksandr Zorin/img/background.jpg
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 Aleksandr Zorin/img/city.jpg
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 Aleksandr Zorin/img/weather/cloudy.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 Aleksandr Zorin/img/weather/sunny-big.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 Aleksandr Zorin/img/weather/sunny.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
58 changes: 58 additions & 0 deletions Aleksandr Zorin/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Tokyo</title>
<link rel="stylesheet" type="text/css" href="css/grid.css" />
<link href="https://fonts.googleapis.com/css?family=Dosis:200,300,400&display=swap" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>

<body>
<article class="weather-widget">
<div class="weather-widget__location">
<div class="weather-widget__weather-type-logo"><img src="img/weather/sunny-big.png" width="50%"></div>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@Zorin-Alex It's better to set width style in css too. You can just add class to <img> tag and use it in css file

<div class="weather-widget__weather-type">Sunny</div>
<div class="weather-widget__today">Tokyo - Wednesday, July 31</div>
</div>
<div class="weather-widget__information">
<div class="weather-widget__temp">
28 &deg;C
</div>
<div class="weather-widget__graph">
<svg width="100%"viewBox="0 0 400 150">
<line x1="20" y1="10" x2="80" y2="130" stroke="#8E4140" stroke-width = "2"/>
<line x1="80" y1="130" x2="140" y2="70" stroke="#8E4140" stroke-width = "2"/>
<line x1="140" y1="70" x2="200" y2="30" stroke="#8E4140" stroke-width = "2"/>
<line x1="200" y1="30" x2="260" y2="130" stroke="#8E4140" stroke-width = "2"/>
<line x1="260" y1="130" x2="320" y2="10" stroke="#8E4140" stroke-width = "2"/>
<line x1="320" y1="10" x2="380" y2="70" stroke="#8E4140" stroke-width = "2"/>

<circle cx="20" cy="10" r="4" stroke="#8E4140" stroke-width="3" fill ="white"/>
<circle cx="80" cy="130" r="4" stroke="#8E4140" stroke-width="3" fill ="white"/>
<circle cx="140" cy="70" r="4" stroke="#8E4140" stroke-width="3" fill ="white"/>
<circle cx="200" cy="30" r="4" stroke="#8E4140" stroke-width="3" fill ="white"/>
<circle cx="260" cy="130" r="4" stroke="#8E4140" stroke-width="3" fill ="white"/>
<circle cx="320" cy="10" r="4" stroke="#8E4140" stroke-width="3" fill ="white"/>
<circle cx="380" cy="70" r="4" stroke="#8E4140" stroke-width="3" fill ="white"/>
</svg>
</div>
<div class="weather-widget__days">
<div class="weather-widget__day">
<img class="weather-widget__day-weather-logo" src="img/weather/sunny.png" width="70%">
<div class="weather-widget__weekday-information"><p class="weather-widget__weekday">Thu</p><p class="weather-widget__daytime-temp">28 &deg;C</p><p class="weather-widget__nighttime-temp">18 &deg;C</p></div>
</div>
<div class="weather-widget__day">
<img class="weather-widget__day-weather-logo" src="img/weather/cloudy.png" width="70%">
<div class="weather-widget__weekday-information"><p class="weather-widget__weekday">Fri</p><p class="weather-widget__daytime-temp">22 &deg;C</p><p class="weather-widget__nighttime-temp">20 &deg;C</p></div>
</div>
<div class="weather-widget__day">
<img class="weather-widget__day-weather-logo" src="img/weather/cloudy.png" width="70%">
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@Zorin-Alex Same case with img and it's width for these three .weather-widget__day-weather-logo elements

<div class="weather-widget__weekday-information"><p class="weather-widget__weekday">Sat</p><p class="weather-widget__daytime-temp">30 &deg;C</p><p class="weather-widget__nighttime-temp">27 &deg;C</p></div>
</div>

</div>
</article>

</body>
</html>