Skip to content
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

Лебедев Никита #33

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 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 images/cat1.jpeg
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 images/cat10.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 images/cat2.jpeg
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 images/cat3.jpeg
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 images/cat4.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 images/cat5.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 images/cat6.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 images/cat7.jpeg
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 images/cat8.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 images/cat9.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
150 changes: 150 additions & 0 deletions index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
.card
{
width: 350px;
display: inline-block;
vertical-align: top;
margin-right: 12px;
margin-bottom: 10px;
Copy link

Choose a reason for hiding this comment

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

Можно записать кратко, но не обязательно


Copy link

Choose a reason for hiding this comment

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

А вот от пустых строчек лучше избавиться

font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.card:hover
{
box-shadow: 1px 4px 8px 0 rgba(0,0,0,.3), 0 6px 20px 0 rgba(0,0,0,.29);
transition: all 400ms ease-out;
Copy link

Choose a reason for hiding this comment

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

👍

}

.card-list
{
width: 100%;
min-width: 360px;
text-align: justify;
}

.info,
.description
{
font-size: 16px;
text-align: left;
padding: 5px;
padding-top: 0;
}

.link
{
font-size: 1.5em;
display: block;
Copy link
Contributor

Choose a reason for hiding this comment

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

Делать ссылки блочными плохо, потому что появляются пустые места, которые при этом являются ссылками


Copy link

Choose a reason for hiding this comment

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

:(

overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}

.link:hover
{
text-shadow: 1px 1px 5px rgba(0, 0, 238, .5);
}

.category
{
font-size: .8em;
color: #000;
}

.category a
{
color: inherit;
opacity: .7;
}

.category a:hover
{
opacity: 1;
}

.goodness
{
font-size: 1.5em;
}

.current-price
{
color: #a52a2a;
font-size: 1.5em;
margin-right: 4px;
Copy link

Choose a reason for hiding this comment

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

Магические 4 пикселя :)

}

.previous-price
{
color: #919192;
font-size: 1.1em;
text-decoration: line-through;
}

.photo
{
display: block;
Copy link

Choose a reason for hiding this comment

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

Зачем?

filter: grayscale(.4) brightness(.8);
Copy link

Choose a reason for hiding this comment

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

Очень здорово 👍

}

.photo:hover
{
filter: grayscale(0) brightness(1);
transition: all 400ms ease-out;
}

.fake-checkbox
{
display: none;
}

.fake-checkbox:checked ~ .card
{
display: block;
width: 100%;

Copy link

Choose a reason for hiding this comment

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

:(

text-align: left;
}

.fake-checkbox:checked ~ .card > .photo,
.fake-checkbox:checked ~ .card > .info,
.fake-checkbox:checked ~ .card > .description
{
display: inline-block;
vertical-align: top;
}

.fake-checkbox:checked ~ .card > .photo
{
width: 19%;
}

.fake-checkbox:checked ~ .card > .info
{
width: 29%;
}

.fake-checkbox:checked ~ .card > .description
{
width: 49%;
}

.fake-button
{
display: block;
padding: 2px 6px;
margin: 10px 0;
width: 250px;
text-align: center;

Copy link

Choose a reason for hiding this comment

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

:(

-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;

Copy link

Choose a reason for hiding this comment

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

:(

-webkit-appearance: button;
-moz-appearance: button;
/* edge fallback */
background: #ddd;
}
195 changes: 195 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,203 @@
<!DOCTYPE html>
<html lang="ru">

<head>
<title>Мяндекс.Муррркет</title>
<meta charset="utf-8">
<link rel="stylesheet" href="index.css">
</head>

<body>
<label class="fake-button" for="view-switcher">Переключить режим отображения</label>
<main class="card-list">
<input class="fake-checkbox" type="checkbox" name="view-switcher" id="view-switcher">
<div class="card">
<img class="photo" src="images/cat1.jpeg" alt="Мурзик">
<div class="info">
<a class="link" href="cat-1">Мурзик</a>
<div class="category">
<a href="category-1">Мальчики</a> - <a href="category-2">Короткошерстные</a>
</div>
<div class="goodness">
<span>★</span><span>★</span><span>★</span><span>★</span><span>☆</span>
</div>
<div class="price">
<span class="current-price">1000₽</span>
</div>
</div>
<div class="description">Ленивый домашний кот, 4 месяца, приучен к лотку.
Питается сухим кормом.</div>
</div>
<!--
Copy link
Contributor

Choose a reason for hiding this comment

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

В чём сакральных смысл этих пустых комментариев?

Copy link
Author

@nest-aka-swan nest-aka-swan Nov 11, 2016

Choose a reason for hiding this comment

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

Они нужны, чтобы не было промежутков между inline-block элементами
(они просто сломались при форматировании)

-->
<div class="card">
<img class="photo" src="images/cat2.jpeg" alt="Дуся">
<div class="info">
<a class="link" href="cat-2">Дуся</a>
<div class="category">
<a href="category-1">Девочки</a> - <a href="category-2">Короткошерстные</a>
</div>
<div class="goodness">
<span>★</span><span>★</span><span>★</span><span>☆</span><span>☆</span>
</div>
<div class="price">
<span class="current-price">1200₽</span><span class="previous-price">1400₽</span>
</div>
</div>
<div class="description">Привередливая кошечка, 6 месяцев, приучена к лотку и когтеточке.</div>
</div>
<!--
-->
<div class="card">
<img class="photo" src="images/cat3.jpeg" alt="Китти">
<div class="info">
<a class="link" href="cat-3">Китти</a>
<div class="category">
<a href="category-1">Девочки</a> - <a href="category-2">Короткошерстные</a>
</div>
<div class="goodness">
<span>★</span><span>★</span><span>★</span><span>★</span><span>★</span>
</div>
<div class="price">
<span class="current-price">1300₽</span><span class="previous-price">1800₽</span>
</div>
</div>
<div class="description">Веселая киса, очень жизнерадостная, 5 месяцев.
Подойдет для ловли мышей.</div>
</div>
<!--
-->
<div class="card">
<img class="photo" src="images/cat4.jpg" alt="Масяня">
<div class="info">
<a class="link" href="cat-4">Масяня</a>
<div class="category">
<a href="category-1">Девочки</a> - <a href="category-2">Длинношерстные</a>
</div>
<div class="goodness">
<span>★</span><span>★</span><span>★</span><span>★</span><span>★</span>
</div>
<div class="price">
<span class="current-price">2100₽</span>
</div>
</div>
<div class="description">Молодая кошечка, привита, 2 месяца. От титулованных родителей.</div>
</div>
<!--
-->
<div class="card">
<img class="photo" src="images/cat5.jpg" alt="Барон">
<div class="info">
<a class="link" href="cat-5">Барон</a>
<div class="category">
<a href="category-1">Мальчики</a> - <a href="category-2">Короткошерстные</a>
</div>
<div class="goodness">
<span>★</span><span>★</span><span>★</span><span>★</span><span>☆</span>
</div>
<div class="price">
<span class="current-price">2300₽</span>
</div>
</div>
<div class="description">Воспитанный домашний кот, 4 месяца. Дрессированный (знает команды "место"
и "лежать").</div>
</div>
<!--
-->
<div class="card">
<img class="photo" src="images/cat6.jpg" alt="Буся">
<div class="info">
<a class="link" href="cat-6">Буся</a>
<div class="category">
<a href="category-1">Девочки</a> - <a href="category-2">Короткошерстные</a>
</div>
<div class="goodness">
<span>★</span><span>★</span><span>★</span><span>★</span><span>☆</span>
</div>
<div class="price">
<span class="current-price">1500₽</span><span class="previous-price">1700₽</span>
</div>
</div>
<div class="description">Привита, приучена к лотку и когтеточке, 2 месяца. Любит полакомиться
рыбой и огурцами.</div>
</div>
<!--
-->
<div class="card">
<img class="photo" src="images/cat7.jpeg" alt="Марсик">
<div class="info">
<a class="link" href="cat-7">Марсик</a>
<div class="category">
<a href="category-1">Мальчики</a> - <a href="category-2">Длинношерстные</a>
</div>
<div class="goodness">
<span>★</span><span>★</span><span>★</span><span>★</span><span>★</span>
</div>
<div class="price">
<span class="current-price">1800₽</span><span class="previous-price">2000₽</span>
</div>
</div>
<div class="description">Жизнерадостный котенок, 2 месяца. Породистый, от титулованных
родителей.</div>
</div>
<!--
-->
<div class="card">
<img class="photo" src="images/cat8.jpg" alt="Пусик">
<div class="info">
<a class="link" href="cat-8">Пусик</a>
<div class="category">
<a href="category-1">Мальчики</a> - <a href="category-2">Короткошерстные</a>
</div>
<div class="goodness">
<span>★</span><span>★</span><span>★</span><span>☆</span><span>☆</span>
</div>
<div class="price">
<span class="current-price">1000₽</span>
</div>
</div>
<div class="description">Своенравный котенок, кушает только вискас, 3 месяца. Приучен к
когтеточке.</div>
</div>
<!--
-->
<div class="card">
<img class="photo" src="images/cat9.jpeg" alt="Лизун">
<div class="info">
<a class="link" href="cat-9">Лизун</a>
<div class="category">
<a href="category-1">Мальчики</a> - <a href="category-2">Короткошерстные</a>
</div>
<div class="goodness">
<span>★</span><span>★</span><span>★</span><span>★</span><span>★</span>
</div>
<div class="price">
<span class="current-price">1500₽</span>
</div>
</div>
<div class="description">Дружелюбный кот, 4 месяца. Любит общаться с детьми и играть с другими
котиками.</div>
</div>
<!--
-->
<div class="card">
<img class="photo" src="images/cat10.jpg" alt="Малыш">
<div class="info">
<a class="link" href="cat-10">Малыш</a>
<div class="category">
<a href="category-1">Мальчики</a> - <a href="category-2">Короткошерстные</a>
</div>
<div class="goodness">
<span>★</span><span>★</span><span>★</span><span>☆</span><span>☆</span>
</div>
<div class="price">
<span class="current-price">800₽</span><span class="previous-price">900₽</span>
</div>
</div>
<div class="description">Дворовый котенок ищет хозяев! Прошел подготовку в приемнике, привит.
Аккуратный и чистоплотный, 5 месяцев.</div>
</div>
</main>
</body>

</html>