Skip to content

Commit

Permalink
Добавили задачу
Browse files Browse the repository at this point in the history
  • Loading branch information
Elena Rashkovan authored and Nikita Shelomov committed Oct 11, 2018
1 parent 4cc4353 commit 2518db4
Show file tree
Hide file tree
Showing 51 changed files with 4,468 additions and 2 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_size = 4
indent_style = space
trim_trailing_whitespace = true

[*.json]
indent_size = 2

[*.md]
trim_trailing_whitespace = false
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.DS_Store
.git
.idea

*.log
*.swp

node_modules
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
registry=https://registry.npmjs.org
save-exact=true
7 changes: 7 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "stylelint-config-hrundel",
"processors": ["@mapbox/stylelint-processor-arbitrary-tags"],
"rules": {
"selector-max-id": 1
}
}
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
language: node_js
node_js:
- "10"
30 changes: 28 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,28 @@
# markup-task-2
Задача «Ацссорти»
# Задача «Ацссорти»

Перед выполнением задания внимательно прочитайте:

- [О всех этапах проверки задания](https://github.com/urfu-2018/guides/blob/master/workflow/overall.md)
- [Как отправить пулл](https://github.com/urfu-2018/guides/blob/master/workflow/pull.md)
- [Как пройти тесты](https://github.com/urfu-2018/guides/blob/master/workflow/test.md)
- Правила оформления [javascript](https://github.com/urfu-2018/guides/blob/master/codestyle/js.md), [HTML](https://github.com/urfu-2018/guides/blob/master/codestyle/html.md) и [CSS](https://github.com/urfu-2018/guides/blob/master/codestyle/css.md) кода

## Основное задание

В папке `tasks` подготовлено 20 заданий на использование различных селекторов.
Вы должны поменять только содержимое тега `<style>` так, чтобы левая половина совпала с картинкой справа, либо с условиями, которые там описаны.
Каждую задачу можно решить небольшим количеством кода, главное – подобрать правильный селектор.

## Примечание

Для быстрого перехода между задачами можно пользоваться ссылками либо стрелками на клавиатуре.

Используемые цвета:

![](https://dummyimage.com/15/ff6698.jpg?text=+)`#ff6698`
![](https://dummyimage.com/15/ffb366.jpg?text=+)`#ffb366`
![](https://dummyimage.com/15/ffff66.jpg?text=+)`#ffff66`
![](https://dummyimage.com/15/98ff66.jpg?text=+)`#98ff66`
![](https://dummyimage.com/15/6698ff.jpg?text=+)`#6698ff`

<img src="https://user-images.githubusercontent.com/11533472/46813130-8af30580-cd8f-11e8-82b1-39b7a7def8b5.png">
180 changes: 180 additions & 0 deletions global.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
body
{
font: 15px Helvetica, Arial;
margin: 0;
padding: 20px;
}

code
{
background-color: #eee;
border-radius: 2px;
padding: 0 4px;
}

.global-heading
{
margin: 0 0 20px;
}

.global-results
{
font-size: 0;
}

.global-result
{
display: inline-block;
width: 450px;
height: 450px;
font-size: 1rem;
border-radius: 10px;
border: 2px solid #eee;
margin: 0 10px 0 0;
vertical-align: top;
padding: 10px;
}

.global-nav
{
margin: 40px 0 0;
}

.global-prev
{
margin: 0 10px 0 0;
}

.global-prev:before
{
content: '← ';
}

.global-next:after
{
content: ' →';
}

.global-scope
{
display: flex;
flex-wrap: wrap;

width: 250px;
}

.global-scope a
{
text-decoration: none;
}

.global-scope_4,
.global-scope_5,
.global-scope_15
{
display: block;
}

.global-scope_16 div
{
background-color: #fff;
}

.global-scope_16 div.c2.c3.c4.c5.c6
{
background-color: #fff;
}

.global-scope_4 article
{
padding: 10px 0;
}

.global-scope_4 hr
{
margin: 0;
}

.global-scope_10
{
width: 100%;
}

.global-scope_12,
.global-scope_13,
.global-scope_18
{
width: 330px;
}

.global-scope_18 div
{
background-color: #ff6698;
}

.global-scope_17
{
width: 400px;
}

.global-scope input
{
outline: none;
margin: 10px;
}

.global-scope a
{
width: 100%;
margin: 10px;
}

.global-scope ul
{
list-style-type: none;
padding: 0;
}

.global-scope button
{
margin: 10px;
}

.global-scope > div > img
{
width: 100px;
height: 100px;
}

.global-scope > div,
.global-scope > aside
{
display: inline-flex;
flex-wrap: wrap;
justify-content: space-around;
align-items: center;
width: 100px;
height: 100px;
margin: 5px;
border-radius: 10px;
box-shadow: 0 0 0 1px #eee;
box-sizing: border-box;
overflow: hidden;
}

.global-scope > div > div,
.global-scope > aside > div,
.global-scope > div > aside,
.global-scope > aside > aside
{
display: inline-block;
vertical-align: top;
text-align: center;
line-height: 30px;
width: 30px;
height: 30px;
margin: 5px;
border-radius: 5px;
box-shadow: 0 0 0 1px #eee;
box-sizing: border-box;
}
35 changes: 35 additions & 0 deletions global.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
(function (window, document) {
var n = window.location.href.match(/(\d+)\.html/)[1];

var count = 20;
var next = +n + 1;
var prev = +n - 1;

document.querySelector('.global-heading').innerHTML = 'Задача №' + n;

var prevHref = (next > count ? 1 : next) + '.html';
var nextHref = (prev < 1 ? count : prev) + '.html';

document.querySelector('.global-next').href = prevHref;
document.querySelector('.global-prev').href = nextHref;

document.querySelector('.global-scope').classList.add('global-scope_' + n);

var goal = document.querySelector('.global-goal');

goal.src = '../goals/' + n + '.png';
goal.alt = 'Цель ' + n;

window.addEventListener('keydown', function (event) {
switch (event.keyCode) {
case 37:
window.location.href = nextHref;

break;
case 39:
window.location.href = prevHref;

break;
}
});
})(window, document);
Binary file added goals/1.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 goals/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 goals/11.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 goals/12.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 goals/13.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 goals/14.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 goals/15.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 goals/16.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 goals/17.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 goals/18.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 goals/19.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 goals/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 goals/20.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 goals/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 goals/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 goals/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 goals/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 goals/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 goals/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 goals/9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<title>Задача «Ацссорти»</title>
</head>
<body>
<h2>Задача «Ацссорти»</h2>
<ul>
<li><a href="./tasks/1.html">Задание #1</a></li>
<li><a href="./tasks/2.html">Задание #2</a></li>
<li><a href="./tasks/3.html">Задание #3</a></li>
<li><a href="./tasks/4.html">Задание #4</a></li>
<li><a href="./tasks/5.html">Задание #5</a></li>
<li><a href="./tasks/6.html">Задание #6</a></li>
<li><a href="./tasks/7.html">Задание #7</a></li>
<li><a href="./tasks/8.html">Задание #8</a></li>
<li><a href="./tasks/9.html">Задание #9</a></li>
<li><a href="./tasks/10.html">Задание #10</a></li>
<li><a href="./tasks/11.html">Задание #11</a></li>
<li><a href="./tasks/12.html">Задание #12</a></li>
<li><a href="./tasks/13.html">Задание #13</a></li>
<li><a href="./tasks/14.html">Задание #14</a></li>
<li><a href="./tasks/15.html">Задание #15</a></li>
<li><a href="./tasks/16.html">Задание #16</a></li>
<li><a href="./tasks/17.html">Задание #17</a></li>
<li><a href="./tasks/18.html">Задание #18</a></li>
<li><a href="./tasks/19.html">Задание #19</a></li>
<li><a href="./tasks/20.html">Задание #20</a></li>
</ul>
</body>
</html>
Loading

0 comments on commit 2518db4

Please sign in to comment.