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

Д\з 6 - Belousov #7

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea
196 changes: 196 additions & 0 deletions css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
.clearfix:before, .clearfix:after
{
content: "";
display: table;
}

.clearfix:after
{
clear: both;
}

.clearfix
{
*zoom: 1;
}

.pseudo-link
{
border-bottom: 1px dotted;
color: #0d44a0;
cursor: pointer;
}

.pseudo-link.active
{
color: #f00;
}

.pseudo-link:hover
{
color: #f00;
}

.switcher
{
margin: 0 0 20px;
}

.images
{

}

.image
{
background: #EBEBEB;
float: left;
position: relative;
margin: 0 0 10px 10px;
}

.image:hover .image__info,
.image_selected .image__info
{
display: block;
}

.image:hover .image__img,
.image_selected .image__img
{
z-index: 2;
position: relative;
}

.image_first
{
margin-left: 0;
}

.image_selected .image__title,
.image_selected .image__author {
display: none;
}

.image__img-wrapper
{
height: 150px;
overflow: hidden;
}

.image__img
{
display: block;
}

.image__info
{
text-align: left;
position: absolute;
top: 0;
left: 0;
right: 0;
margin: -8px -8px 0;
padding: 158px 8px 8px;
display: none;
background-color: #2B2B2B;
z-index: 1;
}

.image__title
{
color: #FFF;
}

.image__author
{
color: #FFF;
}

.preview
{
background: #252424;
display: none;
margin: 0 0 10px 0;
Copy link

Choose a reason for hiding this comment

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

;-)

Copy link
Author

Choose a reason for hiding this comment

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

🎯 в яблочко

padding: 20px;
position: relative;
clear: both;
}

.preview__img
{
margin: 0 auto;
}

.preview__arrow
{
color: #FFF;
cursor: pointer;
font: 40px/45px Arial;
height: 50px;
position: absolute;
bottom: 0;
top: 0;
margin: auto 0;
text-align: center;
width: 50px;
}

.preview__arrow_disabled
{
display: none;
}

.preview__arrow:hover
{
color: #A3A3A3;
}

.preview__arrow_prev
{
left: 15px;
}

.preview__arrow_next
{
right: 15px;
}

.preview__close
{
color: #FFF;
cursor: pointer;
font: 40px/50px Arial;
height: 50px;
margin: auto 0;
Copy link

Choose a reason for hiding this comment

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

margin, наверное, здесь не нужен?

Copy link
Author

Choose a reason for hiding this comment

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

Да, здесь не нужен. Неудачный копипаст со стрелочки :)

position: absolute;
right: 5px;
text-align: center;
top: 5px;
width: 50px;
}

.preview__close:hover
{
color: #A3A3A3;
}

.images-more
{
border: 1px dashed #0D44A0;
padding: 5px;
text-align: center;
cursor: pointer;
}

.images-more:hover
{
border: 1px dashed #F00;
}

.images-more_disabled,
.images-more_disabled:hover
{
border: 1px dashed #A3A3A3;
cursor: default;
}
44 changes: 44 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8">
<link rel="stylesheet" href="css/style.css"/>
<script data-main="js/main.js" src="//cdnjs.cloudflare.com/ajax/libs/require.js/2.1.9/require.min.js"></script>
</head>
<body>

<h1>Работа с API, верстка и анимации</h1>

<div class="switcher">
<span id="switch-top" class="pseudo-link active">Популярные</span> /
<span id="switch-day" class="pseudo-link">фото дня</span> /
<span id="switch-interesting" class="pseudo-link">Новые интересные фотографии</span>
</div>

<div class="images clearfix" id="images"></div>
<div class="images-more" id="images-more">Больше изображений</div>

<script id="image-template" type="text/x-handlebars-template">
<div class="image">
<div class="image__img-wrapper">
<img class="image__img" src="{{ image.img.M.href }}" alt="{{ image.title }}"/>
</div>

<div class="image__info">
<div class="image__title">{{ image.title }}</div>
<div class="image__author">{{ image.authors.0.name }}</div>
</div>
</div>
</script>

<div id="preview" class="preview">
<div class="preview__arrow preview__arrow_prev">&larr;</div>
<div class="preview__arrow preview__arrow_next">&rarr;</div>
<div class="preview__close">×</div>
<div class="preview__img">
<img src="" alt=""/>
</div>
</div>
</body>
</html>
Loading