stas.vladlenko 1 year ago
parent
commit
615c72e4c8
4 changed files with 121 additions and 0 deletions
  1. 23 0
      HW#1/ blueBelt.html
  2. 73 0
      HW#1/blueBelt.css
  3. 14 0
      HW#1/blueBelt.js
  4. 11 0
      HW#1/hm1.js

+ 23 - 0
HW#1/ blueBelt.html

@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <link rel="stylesheet" href="blueBelt.css">
+    <title>Form</title>
+</head>
+<body>
+    <div class="container">
+        <div class="form">
+            <input type="text" id="login" placeholder="login">
+            <input type="password" id="password" placeholder="password">
+            <button id="check">log in</button>
+        </div>
+    
+        <div id="successBox"><h1>Success!</h1></div>
+        <div id="failureBox"><h1>Failure!</h1></div>
+    </div>
+
+    <script src="blueBelt.js"></script>
+</body>
+</html>

+ 73 - 0
HW#1/blueBelt.css

@@ -0,0 +1,73 @@
+body{
+    width: 100%;
+    font-size: 12px;
+    font-family: Arial, Helvetica, sans-serif;
+}
+
+.container{
+    width: 100%;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    flex-direction: column;
+}
+
+.form{
+    display: flex;
+    justify-content: center;
+    flex-direction: column;
+    align-items: center;
+    margin-top: 25px;
+    margin-bottom: 25px;
+    width: 300px;
+    height: 200px;
+    background-color:#EEEFF1;
+    border: 1px solid coral;
+
+}
+
+input{
+    outline: none;
+    border: none;
+    margin-bottom: 20px;
+}
+
+button{
+    outline: none;
+    border: none;
+    border: 2px solid white;
+    cursor: pointer;
+    width: 100px;
+    height: 25px;
+    background-color: coral;
+    color: white;
+}
+
+
+#successBox{
+    width: 300px;
+    height: 125px;
+    background-color: chartreuse;
+    display: none;
+    margin: 0 auto;
+}
+
+#failureBox{
+    width: 300px;
+    height: 125px;
+    background-color: red;
+    display: none;
+    margin: 0 auto;
+}
+
+#successBox h1{
+    text-align: center;
+    font-size: 48px;
+    color: white;
+}
+
+#failureBox h1{
+    text-align: center;
+    font-size: 48px;
+    color: white;
+}

+ 14 - 0
HW#1/blueBelt.js

@@ -0,0 +1,14 @@
+document.getElementById('check').onclick = function(){
+    let login = document.getElementById('login').value;
+    let password = document.getElementById('password').value;
+    let successBox = document.getElementById('successBox');
+    successBox.style.display='none'
+    let failureBox = document.getElementById('failureBox');
+    failureBox.style.display='none'
+
+
+    if (login == 'admin' && password == 'qwerty')
+    successBox.style.display='block'
+    else
+    failureBox.style.display='block'
+}

+ 11 - 0
HW#1/hm1.js

@@ -0,0 +1,11 @@
+// Конвертер значений с px в em
+// 16 px = 1 em = 100%
+var pixel = 16; 
+var em;
+
+do{
+    confirm ('Вы желаете перевести Ваше значение px в em ?')
+    var userPixel = prompt("Введите значение в px");
+    em = ((userPixel*100)/16)/100;
+    alert(em + " em" + " Ваш результат");
+}while(em !== null)