Skip to content

Commit cb04fe3

Browse files
author
guldus98
committed
html, css and js
1 parent c6cd3ae commit cb04fe3

File tree

3 files changed

+125
-0
lines changed

3 files changed

+125
-0
lines changed
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
@import url('https://fonts.googleapis.com/css?family=Fjalla+One');
2+
body {
3+
padding: 0;
4+
margin: 0;
5+
font-family: 'Fjalla One', sans-serif;
6+
}
7+
.container{
8+
position: absolute;
9+
top: 30%;
10+
left: 50%;
11+
transform: translate(-50%,-50%);
12+
text-align: center;
13+
display: flex;
14+
flex-direction: column;
15+
}
16+
#text, button{
17+
width: 200px;
18+
text-align: center;
19+
margin: 0 auto;
20+
}
21+
#text {
22+
border: 2px solid rgba(0, 0, 0, 0.5);
23+
border-radius: 20px 20px 0px 0px;
24+
outline: none;
25+
padding: 5px;
26+
font-size: 20px;
27+
font-family: 'Fjalla One', sans-serif;
28+
color: rgba(0, 0, 0, 0.6);
29+
}
30+
button {
31+
border: none;
32+
border-radius: 0px 0px 20px 20px;
33+
outline: none;
34+
padding: 7px;
35+
width: 214px;
36+
background: rgba(0, 0, 0, 0.5);
37+
font-family: 'Fjalla One', sans-serif;
38+
color: #eee;
39+
font-size: 20px;
40+
transition: .5s;
41+
cursor: pointer;
42+
}
43+
button:hover{
44+
background: #262626;
45+
}
46+
.boxes {
47+
position: absolute;
48+
top: 210px;
49+
margin-top: 20px;
50+
width: 500px;
51+
height: auto;
52+
left: -125px;
53+
}
54+
.box {
55+
position: relative;
56+
float: left;
57+
padding: 5px 10px;
58+
color: rgba(0, 0, 0, 0.6);
59+
border: 2px solid rgba(0, 0, 0, 0.5);
60+
margin: 5px;
61+
font-size: 20px;
62+
cursor: pointer;
63+
transition: .5s;
64+
}
65+
h2 {
66+
font-size: 50px;
67+
color: rgba(0, 0, 0, 0.8);
68+
}
69+
.box:hover{
70+
transform: scale(1.3);
71+
background: #262626;
72+
color: #eee;
73+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<!DOCTYPE html>
2+
3+
<html>
4+
<head>
5+
<meta charset="utf-8" />
6+
<title>page</title>
7+
<link rel="stylesheet" type="text/css" href="Array.from Animation.css">
8+
<meta name="viewport" content="width=device-width, initial-scale=1">
9+
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.2/css/all.css">
10+
</head>
11+
<body>
12+
13+
14+
<div class="container">
15+
<h2>Array.from</h2>
16+
<input type="text" id="text" placeholder="text...."/>
17+
<button onclick="myFunction()">CLICK</button>
18+
<div class="boxes"></div>
19+
</div>
20+
21+
<script>
22+
23+
24+
25+
function myFunction() {
26+
let text = document.getElementById("text").value;
27+
let boxes = document.querySelector(".boxes");
28+
let list = Array.from(text);
29+
30+
list.forEach(function (x) {
31+
let box = document.createElement("div");
32+
box.setAttribute("class", "box");
33+
let txt = document.createTextNode(x);
34+
box.appendChild(txt)
35+
document.querySelector(".boxes").appendChild(box);
36+
})
37+
38+
for (let i = 0; i < 3; i++) {
39+
let line = document.createElement("br");
40+
41+
boxes.appendChild(line);
42+
}
43+
}
44+
45+
46+
</script>
47+
48+
49+
50+
51+
</body>
52+
</html>
19 KB
Loading

0 commit comments

Comments
 (0)