-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into 03-lection1/03-index
- Loading branch information
Showing
25 changed files
with
195 additions
and
25 deletions.
There are no files selected for viewing
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
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
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
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,9 @@ | ||
# Avatar | ||
|
||
Аватарка - неотъемлимая часть любого сайта, где есть профиль пользователя.<br> | ||
Этот компонент выглядит несложно, но надо обратить внимание на то, что пользователи загружают картинки в разных размерах, с разным соотношением сторон, а на странице эта картинка не должна сжиматься, или наоборот, оставлять пустое пространство в контейнере.<br> | ||
Еще одно требование - возможность сохранить аватарку через пкм. | ||
Не забудьте про атрибут `alt` :) | ||
|
||
## object-fit | ||
Возможно, вам будет полезно свойство `object-fit`, которое определяет как содержимое тегов `img` или `video` должно заполнять контейнер относительно его высоты и ширины. |
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,11 @@ | ||
.avatar { | ||
width: 102px; | ||
height: 102px; | ||
} | ||
|
||
.avatar__img { | ||
width: 100%; | ||
height: 100%; | ||
object-fit: cover; | ||
border-radius: 50%; | ||
} |
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,22 @@ | ||
<!DOCTYPE html> | ||
<!-- Страница с аватаром --> | ||
<html lang="ru"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Avatar</title> | ||
|
||
<link rel="stylesheet" href="../../assets/css/main.css"> | ||
<link rel="stylesheet" href="./avatar.css"> | ||
</head> | ||
|
||
<body> | ||
<div class="container"> | ||
<div class="avatar"> | ||
<img class="avatar__img" src="../../assets/images/avatar.jpg" alt="userpic photo"> | ||
</div> | ||
</div> | ||
</body> | ||
|
||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,7 @@ | ||
const expect = require('chai').expect; | ||
|
||
describe('lection4/avatar', () => { | ||
it('Аватарка', () => { | ||
expect(1).to.equal(1); | ||
}); | ||
}); |
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,7 @@ | ||
# background-image | ||
|
||
В директории `public` лежат картинки в нескольких разрешениях.<br> | ||
Нужно вставить картинку на фон страницы так, чтобы не грузились картинки избыточного размера.<br> | ||
|
||
Воспользоваться нужно способом вставки картинки через `background-image` и медиа-запросы. | ||
|
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,26 @@ | ||
.background { | ||
width: 100%; | ||
height: 400px; | ||
background-image: url(./public/forest_400.jpg); | ||
background-repeat: no-repeat; | ||
background-position: center; | ||
background-size: cover; | ||
} | ||
|
||
@media screen and (min-width: 768px) { | ||
.background { | ||
background-image: url(./public/forest_768.jpg); | ||
} | ||
} | ||
|
||
@media screen and (min-width: 1024px) { | ||
.background { | ||
background-image: url(./public/forest_1024.jpg); | ||
} | ||
} | ||
|
||
@media screen and (min-width: 2560px) { | ||
.background { | ||
background-image: url(./public/forest_2560.jpg); | ||
} | ||
} |
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,13 @@ | ||
<!DOCTYPE html> | ||
<html lang="ru"> | ||
<head> | ||
<link rel="stylesheet" href="../../assets/css/main.css"> | ||
<link rel="stylesheet" href="./background-image.css"> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<div class="background"> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,7 @@ | ||
const expect = require('chai').expect; | ||
|
||
describe('lection4/background-image', () => { | ||
it('Фон', () => { | ||
expect(1).to.equal(1); | ||
}); | ||
}); |
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,5 @@ | ||
# srcset | ||
|
||
В директории `public` лежат картинки в нескольких разрешениях.<br> | ||
Нужно вставить на страницу квадратный блок 300x300, а в него вписать картинку так, чтобы для экранов с высокой плотностью пикселей загружалась картинка в 2 раза больше.<br> | ||
|
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,27 @@ | ||
<!DOCTYPE html> | ||
<html lang="ru"> | ||
|
||
<head> | ||
<link rel="stylesheet" href="../../assets/css/main.css"> | ||
<link rel="stylesheet" href="./srcset.css"> | ||
|
||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Srcset</title> | ||
</head> | ||
|
||
<body> | ||
<div class="image__wrapper"> | ||
<img src="./public/forest_400.jpg" alt="forest image" | ||
|
||
srcset=" | ||
./public/forest_400.jpg 400w, | ||
./public/forest_768.jpg 768w" | ||
|
||
sizes=" | ||
(max-width: 400px) 300px, | ||
(max-width: 768px) 300px"> | ||
</div> | ||
</body> | ||
|
||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,5 @@ | ||
.image__wrapper { | ||
width: 300px; | ||
height: 300px; | ||
overflow: hidden; | ||
} |
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,7 @@ | ||
const expect = require('chai').expect; | ||
|
||
describe('lection4/srcset', () => { | ||
it('Srcset', () => { | ||
expect(1).to.equal(1); | ||
}); | ||
}); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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