Version - 1 - 1-38

This commit is contained in:
2023-11-29 22:29:18 +01:00
commit 2b81a65227
396 changed files with 19689 additions and 0 deletions

25
Version - 7/index.html Normal file
View File

@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>HTML</title>
<!-- HTML -->
<!-- Custom Styles -->
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id="button1">
<img src = 'https://i.postimg.cc/rdcChfG6/Notpressed.png' id="red">
<img src = "https://i.postimg.cc/rdJG75gD/Pressed.png" id="green">
</div>
<script src="main.js"></script>
<p id="clicks"></p>
</body>
</html>

45
Version - 7/main.js Normal file
View File

@@ -0,0 +1,45 @@
window.onload = function(){
start();
}
var count = 0;
function start(){
if (localStorage.getItem('count')==undefined) {count=0;}else{count = localStorage.getItem('count');}
document.getElementById('clicks').innerHTML=count;
var red = document.getElementById('red');
var green = document.getElementById('green');
var button = document.getElementById('button1');
if (/Android|iPhone/i.test(navigator.userAgent)) {
button.ontouchstart = function(){
count++;
localStorage.setItem('count',count);
document.getElementById('clicks').innerHTML=count;
red.style.visibility='hidden';
green.style.visibility='visible';
}
button.ontouchend = function(){
red.style.visibility='visible';
green.style.visibility='hidden';
}
}else{
button.onmousedown = function(){
console.log('click');
count++;
localStorage.setItem('count',count);
document.getElementById('clicks').innerHTML=count;
red.style.visibility='hidden';
green.style.visibility='visible';
}
button.onmouseup = function(){
red.style.visibility='visible';
green.style.visibility='hidden'
}
}
function reset(){
localStorage.removeItem('count');
start();
}
}

23
Version - 7/style.css Normal file
View File

@@ -0,0 +1,23 @@
body {
font-size: 15pt;
user-select: none;
}
#red{
position: absolute;
width: 300px;
height: 300px;
}
#green{
position: absolute;
width: 300px;
height: 300px;
visibility: hidden;
}
#button1{
position: absolute;
top: 50%;
left: 50%;
margin: -150px 0 0 -150px;
}