gordiensi7799 4 years ago
parent
commit
12bb08a699
2 changed files with 61 additions and 32 deletions
  1. 38 6
      index.html
  2. 23 26
      script.js

+ 38 - 6
index.html

@@ -4,9 +4,41 @@
 	<meta charset="UTF-8">
 	<meta name="viewport" content="width=device-width, initial-scale=1.0">
 	<title>Document</title>
-</head>
-<body>
-	<h1>prosto mem</h1>
-	<script type="text/javascript" src="./script.js"></script>
-</body>
-</html>
+	<html lang="en">
+	<head class="head">
+		<meta charset="UTF-8">
+		<title>Title</title>
+		<style type="text/css">
+			.c3{
+				color: #6f507d;
+				font-size: 15px;
+				font-family: monospace;
+			}
+			.c2{
+				color: #219191;
+				font-size: 25px;
+			}
+			.c1{
+				color: #915021;
+				font-size: 35px;
+				font-family: cursive;
+			}
+			#btn1 {
+				margin-left: 30px;
+				transform: rotate(90deg);
+				background-color: ##F0E68C;
+				font-size: 20px;
+				color: #00FF00;
+				transition: 0.6s;
+			}
+			#btn1:hover{
+				background-color: #DC143C;
+				color: #6A5ACD;
+				padding-top: 11px;
+			}
+		</style>
+		<body>
+			<h1>slozhno</h1>
+			<script type="text/javascript" src="./script.js"></script>
+		</body>
+		</html>

+ 23 - 26
script.js

@@ -1,32 +1,29 @@
-//task1
-function sampleFunc1 () {
-  console.log ( `${arguments.callee.name}: ${arguments[0]} | ${arguments[1]}` )
+//task 1
+let body = document.body;
+let tags = ["p","div","h1"]
+let classes =["c1","c2","c3"]
+let lennn = classes.length;
+for ( i = 0; i < tags.length; i++) {
+    tags[i]=document.createElement(tags[i])
+    tags[i].className = classes[i%lennn]
+    body.appendChild(tags[i])
+    tags[i].innerText ="love it"
 }
 
-function modificator1 ( func ) {
-  return func.bind(null, 'test', 'sample')
-}
-
-testFunc1 = modificator1( sampleFunc1 )
-
-testFunc1()
-
-
 
 //task2
-function sampleFunc () {
-    console.info (`Symbols in my code: ${arguments.callee - 0}`)
+let task= {
+    tagsArray:[
+        {name: "button", class: "btn1"},
+    ]
 }
-
-function modificator(func) {
-    func.valueOf = function () {
-        return this.toString().length;
-    };
+for(let i=0; i < task.tagsArray.length; i++) {
+    let arrItems= task.tagsArray[i]
+    arrItems.name= document.createElement(arrItems.name)
+    arrItems.name.id = arrItems.class
+    body.appendChild(arrItems.name)
+    arrItems.name.innerText="donate me"
 }
-modificator( sampleFunc )
-
-sampleFunc()
-
-
-
-//task3
+document.getElementById("btn1").addEventListener("click", function() {
+    alert("ty but ochen' malo")
+});