JSFiddle - React, Tailwind, and code Playground
by ZiEnTenIn
HTML
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="description" content="Описание">
<meta name="keywords" content="Ключевые слова">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="white">
<link rel="stylesheet" href="reset.css" type="text/css">
<link rel="stylesheet" href="style.css" type="text/css">
<title>ClickerGame||Hello</title>
</head>
<body>
<div class="l-menu">
<div class="resourses">
<button class="get-res">Добыть ресурсы</button>
<br/>
<br/>
<div class="res">Всего ресурсов:</div>
</div>
</div>
<div class="r-menu"></div>
<script src="script.js"></script>
</body>
</html>
CSS
html {
min-height: 100%;
width: 100%;
overflow: visible;
overflow-x: hidden;
font-family: 'Cuprum', sans-serif;
}
body {
margin: 0;
min-height: 100%;
width: 100%;
position: relative;
}
.l-menu {
position: relative;
width: 30%;
height: 100%;
display: inline-flex;
float: left;
top: 0;
left: 0;
bottom: 0;
border-right-style: solid;
border-width: 1px;
border-color: black;
justify-content: center;
align-items: center
}
.resourses {
position: relative;
width: 80%;
height: 55%;
display: block;
background-color: none;
}
.get-res {
position: relative;
width: 90%;
height: 20%;
display: block;
}
.res {
position: relative;
width: 85%;
height: 35%;
display: block;
}
.resourses p {
width: auto;
height: auto;
}
.r-menu {
position: relative;
width: 70%;
height: 100%;
display: inline-flex;
float: right;
top: 0;
right: 0;
bottom: 0;
border-left-style: solid;
border-width: 1px;
border-color: black;
}
JavaScript
var res = 0;
btn = document.querySelectorAll(".get-res");
btn.addEventListener('click', function() {
res = res + 1;
alert(res);
});