Skip to content

Commit

Permalink
feat: update components styles
Browse files Browse the repository at this point in the history
  • Loading branch information
imirdzhamolov committed Apr 26, 2020
1 parent d9cea57 commit 51a1767
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 19 deletions.
18 changes: 13 additions & 5 deletions client/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ body {
left: 0;
bottom: 0;
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: center;
padding: 2vmax 1vmax;
Expand All @@ -18,19 +17,28 @@ body {
box-sizing: border-box;
}

.keypress__content {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: center;
border-radius: 0.5vmax;
background-color: rgba(0, 0, 0, 0.5);
}

.keypress__item {
padding: 1vmax;
padding: 0.5vmax;
}

.keypress__item_type_plus {
padding: 0;
}

.keypress-item {
padding: 1vmax;
padding: 0.5vmax;
font-family: Arial, -apple-system, sans-serif;
font-weight: 700;
font-size: 4vmax;
font-size: 3vmax;
line-height: 1;
text-transform: uppercase;
color: #fff;
Expand All @@ -41,7 +49,7 @@ body {
.keypress-item-plus {
font-family: Arial, -apple-system, sans-serif;
font-weight: 700;
font-size: 4vmax;
font-size: 3vmax;
line-height: 1;
color: #fff;
}
16 changes: 3 additions & 13 deletions client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,9 @@
</head>
<body>

<div id="root" class="keypress"></div>

<template id="keypress-item">
<div class="keypress__item">
<div class="keypress-item"></div>
</div>
</template>

<template id="keypress-item-plus">
<div class="keypress__item keypress__item_type_plus">
<div class="keypress-item-plus">+</div>
</div>
</template>
<div id="root" class="keypress">
<div class="keypress__content js-content"></div>
</div>

<script type="text/javascript" src="./index.js"></script>

Expand Down
3 changes: 2 additions & 1 deletion client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ function computeKeyPressed(type, keyCode) {
}

const elemRoot = document.getElementById('root');
const elemContent = elemRoot.querySelector('.js-content');

function renderKeysPressed() {
const result = [];
Expand All @@ -33,5 +34,5 @@ function renderKeysPressed() {
result.push(`<div class="keypress__item"><div class="keypress-item">${value}</div></div>`);
});

elemRoot.innerHTML = result.join(`<div class="keypress__item keypress__item_type_plus"><div class="keypress-item-plus">+</div></div>`);
elemContent.innerHTML = result.join(`<div class="keypress__item keypress__item_type_plus"><div class="keypress-item-plus">+</div></div>`);
}

0 comments on commit 51a1767

Please sign in to comment.