Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
AnnaKharatova committed Apr 9, 2024
0 parents commit 765751c
Show file tree
Hide file tree
Showing 16 changed files with 199 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Проект: Тестовое задание.

- Тестовое задание компании "PushKeen". Проект написан на чистом html, css и vanilla JavaScript(использование React.js было не целесообразным).
- Верстка адаптивная, кроссбраузерная, соответствует макету при ширине экрана 1980*1080.
- Используется методология БЭМ и файловая структура BEM-nested.
- На странице есть элемент анимированный при помощи CSS.
Empty file added nojekyll.txt
Empty file.
31 changes: 31 additions & 0 deletions src/blocks/floating-element/floating-element.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
@keyframes moveElement {
0% {
left: 10%;
top: 20%;
}

50% {
left: 60%;
top: 62%;
}

100% {
left: 10%;
top: 20%;
}
}

.floating-element {
position: absolute;
top: 57%;
left: 50%;
width: 45%;
height: 20%;
background-color: #7075F1;
border-radius: 210px;
-webkit-transform: translate(-10%, -20%) rotate(30deg);
-ms-transform: translate(-10%, -20%) rotate(30deg);
transform: translate(-10%, -20%) rotate(30deg);
-webkit-animation: moveElement 10s infinite;
animation: moveElement 10s infinite;
}
12 changes: 12 additions & 0 deletions src/blocks/posts/__container/posts__container.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.posts__container {
position: relative;
padding: 0;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
justify-content: center;
flex-wrap: wrap;
gap: 60px;
list-style: none;
background-repeat: no-repeat;
}
5 changes: 5 additions & 0 deletions src/blocks/posts/__item/_clicked/posts__item_clicked.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.posts__item_clicked {
-webkit-box-shadow: 0 0 40px rgb(235, 12, 12);
box-shadow: 0 0 40px rgb(235, 12, 12);
z-index: 3;
}
35 changes: 35 additions & 0 deletions src/blocks/posts/__item/posts__item.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
.posts__item {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
position: relative;
padding: 13px 24px;
z-index: 2;
width: 339px;
min-height: 234px;
background-color: inherit;
border-radius: 25px;
-webkit-transition: background-color .3s ease-in-out;
transition: background-color .3s ease-in-out;
-webkit-box-shadow: 0 0 40px rgba(51, 51, 51, 0.5);
box-shadow: 0 0 40px rgba(51, 51, 51, 0.5);
-webkit-backdrop-filter: blur(20px);
backdrop-filter: blur(20px);
text-shadow: none;
}

.posts__item:hover {
background-color: white;
-webkit-transform: scale(1.01);
transform: scale(1.01);
-webkit-box-shadow: 0 0 40px rgba(51, 51, 51, 0.5),
0px 4px 4px 0px rgba(51, 51, 51, 0.04);
box-shadow: 0 0 40px rgba(51, 51, 51, 0.5),
0px 4px 4px 0px rgba(51, 51, 51, 0.04);
-webkit-backdrop-filter: none;
backdrop-filter: none;
}

.posts__item:hover .posts__text {
text-shadow: .5px 3px #ACACAC;
}
6 changes: 6 additions & 0 deletions src/blocks/posts/__text/posts__text.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.posts__text {
font-family: 'Inter', sans-serif;
font-weight: 400;
margin-bottom: 0;
font-size: 12px;
}
11 changes: 11 additions & 0 deletions src/blocks/posts/__title/posts__title.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.posts__title {
font-family: 'Inter', sans-serif;
font-weight: 400;
font-size: 32px;
margin: 0;
padding: 0 8px 0 2px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
overflow-wrap: break-word;
}
9 changes: 9 additions & 0 deletions src/blocks/posts/posts.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.posts {
max-width: 1980px;
min-width: 400px;
padding: 125px 50px;
background-color: #D4D4D4;
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
overflow-x: hidden;
}
18 changes: 18 additions & 0 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PushKeen test</title>
<link rel="stylesheet" href="./pages/index.css">
</style>
</head>

<body class="posts">
<ul class="posts__container" id="container"></ul>
<div class="floating-element" id="floating"></div>
<script type="module" src="./pages/index.js"></script>
</body>

</html>
9 changes: 9 additions & 0 deletions src/pages/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@import url(../vendor/fonts.css);

@import url(../blocks/posts/posts.css);
@import url(../blocks/posts/__container/posts__container.css);
@import url(../blocks/posts/__item/posts__item.css);
@import url(../blocks/posts/__item/_clicked/posts__item_clicked.css);
@import url(../blocks/posts/__title/posts__title.css);
@import url(../blocks/posts/__text/posts__text.css);
@import url(../blocks/floating-element/floating-element.css);
35 changes: 35 additions & 0 deletions src/pages/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { postsArray } from '../scripts/constants.js'

const container = document.getElementById('container');

postsArray.forEach((item, index) => {
const element = document.createElement('li');
element.classList.add('posts__item');

const title = document.createElement('h2');
title.classList.add('posts__title');
title.textContent = item.title;

const text = document.createElement('p');
text.classList.add('posts__text');
text.textContent = item.text;

element.appendChild(title);
element.appendChild(text);

container.appendChild(element);
});

const elements = document.querySelectorAll(".posts__item");

document.addEventListener('click', function () {
const floating = document.getElementById('floating')
floating.classList.add('floating-element__clicked');
});

elements.forEach(el => {
el.addEventListener('click', function () {
el.classList.add('posts__item_clicked');
});
})

14 changes: 14 additions & 0 deletions src/scripts/constants.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions src/vendor/fonts.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@font-face {
font-family: 'Inter';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url(../vendor/fonts/Inter-Regular.woff2) format("woff2"),
url(../vendor/fonts/Inter-Regular.woff) format("woff");
}
Binary file added src/vendor/fonts/Inter-Regular.woff
Binary file not shown.
Binary file added src/vendor/fonts/Inter-Regular.woff2
Binary file not shown.

0 comments on commit 765751c

Please sign in to comment.