JSFiddle - React, Tailwind, and code Playground
by alrx150051
HTML
<body background="bg.png">
<button onclick="plus()" id="button">плюс</button>
<button onclick="minus()"id="button" >минус</button>
<button onclick="umno()" >умножить</button>
<button onclick="razd()" >разделить</button>
<button onclick="step() " >степень</button>
<button onclick="koren() " >квадратный корень</button>
<button onclick="sbros() " >сбросить</button>
<br>
<p align=center contenteditable="true" class="pil" id="textes">0</p>
<br>
<button onclick="kod()">закодировать <font color=red>74</font></button>
<button onclick="dok()">раскодировать <font color=#AFEEEE>47</font></button>
<br>
<br>
<p><small><small><small><small>Тут можно самому задать функцию шифровки: <a href="info.html">Подробнее</a></small></small></small></small></p>
<input size = "60" id=textextextes>
<button onclick=evalis()>Зашифровать!</button>
<br>
CSS
p {
font-size: 70pt;
color: yellow;
}
button {
color: #ADFF2F;
background: blue;
-webkit-clip-path: polygon(50% 0%, 82% 8%, 100% 32%, 100% 70%, 81% 91%, 50% 100%, 19% 93%, 0 72%, 0 32%, 20% 9%);
clip-path: polygon(50% 0%, 82% 8%, 100% 32%, 100% 70%, 81% 91%, 50% 100%, 19% 93%, 0 72%, 0 32%, 20% 9%);
width: 15%;
border: 0;
}
button:hover {
background: red;
color: yellow;
}
p.pil:hover {
color: greenyellow;
}
input {
background: black;
color:GreenYellow;
border-color: green;
}
input:hover{
border-color:GreenYellow;
}
a {
color: red;
}
a:hover {
color: blue;
}
JavaScript
var n = 0
setInterval(update,100)
function plus() {
n = +textes.textContent
let uv = +prompt("+сколько?")
n+=uv
textes.textContent = n
}
function minus() {
n = +textes.textContent
let um = +prompt("-сколько?")
n-=um
textes.textContent = n
}
function umno() {
n = +textes.textContent
let umn = +prompt("умножить на сколько?")
n*=umn
textes.textContent = n
}
function razd() {
n = +textes.textContent
let raz = +prompt("Разделить на сколько?")
n/=raz
textes.textContent = n
if (raz===0){
alert("ты всё сломал -_- нельзя делить на 0")
n/=raz
}
}
function step() {
n = +textes.textContent
let ste = prompt("какая степень?")
n**=ste
textes.textContent = n
}
function koren() {
n = +textes.textContent
n = Math.sqrt(n)
textes.textContent = n
}
function sbros() {
n=0
textes.textContent = n
}
function kod(){
n = +textes.textContent
var a = +textes.textContent
var b = a**2
var c = 1000-b
var d = c / 2
textes.textContent = d
n = +textes.textContent
}
function dok() {
n = +textes.textContent
var d = +textes.textContent
var c = d * 2
var b = 1000 - c
var a = Math.sqrt(b)
textes.textContent = a
n = +textes.textContent
}
function evalis() {
var n = +textes.textContent
eval(textextextes.value)
textes.textContent = Number.parseInt(n)
}
function update() {
n = +textes.textContent
textes.textContent = n
}