pavlovm503 4 years ago
parent
commit
f9d9c64e8c
3 changed files with 120 additions and 0 deletions
  1. 61 0
      Pavlov_hm7/css/style.css
  2. 19 0
      Pavlov_hm7/inddex.html
  3. 40 0
      Pavlov_hm7/script/script.js

+ 61 - 0
Pavlov_hm7/css/style.css

@@ -0,0 +1,61 @@
+body{
+	background: linear-gradient(to bottom, #1e9a6a 0%,#2ad887 50%,#7ee8b5 100%) no-repeat;
+}
+.block{
+	display: flex;
+	flex-direction: column;
+	background: #C6FCE6;
+	width: 500px;
+	padding:100px 50px 50px;
+	margin:10vh auto;
+	border: solid 10px #84BBA5;
+	align-items: center;
+}
+.block input{
+	width: 75%;
+	height: 50px;
+	margin-bottom: 30px;
+	background: #98F9D2;
+	border: solid 4px #31A275;
+	font-size: 25px;
+	padding: 2.5px 10px;
+	color: #31A275;
+	text-align: center;
+}
+.block input::placeholder{
+	color: #84BBA5;
+}
+.block button{
+	width: 50%;
+	height: 40px;
+	margin-bottom: 20px;
+	background: #B3FCDE;
+	border: solid 4px #31A275;
+	font-size: 20px;
+	color: #31A275;
+	cursor: pointer;
+	text-transform: uppercase;
+	letter-spacing: 5px;
+	font-weight: 600;
+	transition: all 0.5s ease;
+}
+.block button:hover{
+	border: solid 4px #84BBA5;
+	background: #31A275;
+	color: #B3FCDE;
+}
+table{
+	border: solid 10px #84BBA5;
+	margin:20vh auto;
+	background: #C6FCE6; 
+	cursor: pointer;
+}
+td{
+	width: 40px;
+	height: 40px;
+	text-align: center;
+	color: #31A275;
+}
+tr{
+	background: #B3FCDE;	
+}

+ 19 - 0
Pavlov_hm7/inddex.html

@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="utf-8">
+    <title>Pavlov_Maik_FSA3</title>
+    <link rel="stylesheet" href="css/style.css">
+</head>
+<body>
+    <main>
+        <div class="block">
+            <input type="number" id="afooter" placeholder="first namber">
+            <input type="number" id="bfooter" placeholder="second namber">
+            <button id="calculeit">plus</button>
+            <input type="namber" readonly id="output" placeholder="resoult">
+        </div>
+    </main>
+    <script src="script/script.js"></script>
+</body>
+</html>

+ 40 - 0
Pavlov_hm7/script/script.js

@@ -0,0 +1,40 @@
+let afooter = document.querySelector("#afooter");
+let bfooter = document.querySelector("#bfooter");
+let calculeit = document.querySelector("#calculeit");
+let output = document.querySelector("#output");
+calculeit.addEventListener("click", function(){ calc });
+function calc() {
+	output.value = ((+afooter.value) + (+bfooter.value));
+};
+afooter.oninput = calc;
+bfooter.oninput = calc;
+let table = document.createElement("table");
+let src = document.querySelector("script");
+let td = document.getElementsByTagName("td");
+let tr = document.getElementsByTagName("tr");
+document.body.insertBefore(table, src);
+let namb = "";
+for (let i = 0; i < 10; i++){
+	namb += "<tr>"
+	for (let j = 0; j < 10; j++){
+		if (i == 0){namb += "<td>" + j + "</td>";}
+		else {namb += "<td>" + i * (j === 0 ? 1 : j) + "</td>";}
+	}
+	namb += "</tr>"
+}
+table.innerHTML = namb
+for (let i = 0; i < 100; i++) {
+	td[i].addEventListener("mouseover", function(){	
+		for (let x = 0; x < 10; x++){td[i].parentElement.children[x].style.backgroundColor = "#98f9d2";}
+		for (let y = 0; y < 100; y++){if (td[i].cellIndex === td[y].cellIndex) 
+			{td[y].style.backgroundColor = "#98f9d2"
+			};
+		};
+	});
+	td[i].addEventListener("mouseout", function(){
+		for (let x = 0; x < 10; x++) {td[i].parentElement.children[x].style.backgroundColor = "#b3fcde";};
+		for (let y = 0; y < 100; y++) {
+			if (td[i].cellIndex === td[y].cellIndex) {td[y].style.backgroundColor = "#b3fcde";};
+		};
+	});
+};