-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.template.html
126 lines (110 loc) · 2.47 KB
/
index.template.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title>CodePen - Word Length Calculator</title>
</head>
<body>
<!-- partial:index.partial.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Poppins">
<title>Word Length Calculator</title>
</head>
<style>
html {
font-family: 'Brush Script MT', cursive;
}
body{
text-align: center;
background-color: #CFD8DC;
color: #fff;
font-size: 16px;
}
#btn{
background-color: #B0BEC5;
border: 0;
color: #263238;
padding: 0px 15;
cursor: pointer;
margin-top: 35px;
text-align: center;
font-weight: 800;
border-radius: 5px;
}
#btn:hover {
background-color: #37474F;
border: 0;
color: #fff;
padding: 5px 21px;
cursor: pointer;
margin-top: 35px;
text-align: center;
font-weight: 800;
border-radius: 5px;
}
#output {
list-style: none;
text-align: center;
line-height: 35px;
color: #546E7A;
font-weight: 550;
margin: 40px auto;
font-size: 30px;
}
#str{
width: 470px;
height: 30px;
margin: 10px;
background-color: #ECEFF1;
border-radius: 5px;
}
h1 {
color: #263238;
margin:50px auto;
font-size: 50px;
font-weight: 900;
}
#count {
color: #B71C1C;
}
img {
margin-right: 150px;
float: right;
}
span {
color: #B71C1C;
}
h6 {
color: #90A4AE;
}
h6:hover {
color: #455A64;
}
</style>
<body>
<h6>Power by: Meow.Nalini98</h6>
<h1>Enter/Paste your text below</h1>
<input type="text" id="str">
<div id="output"></div><br>
<button id="btn"><h2>Calculator</h2></button><br><br>
<img src="https://3.bp.blogspot.com/-ApGaPred2AY/XHnYZMauQ-I/AAAAAABEfo8/cQtFa2VX4v8aTNJoiCNIKx-jPtNeYlZlQCLcBGAs/s1600/AW3594167_00.gif" style="width: 200px"/>
<script>
const button = document.getElementById('btn');
button.addEventListener('click', function() {
let word = document.getElementById('str').value;
let count = word.length;
let outputDiv = document.getElementById('output');
outputDiv.innerHTML = `Your text length is: <span>${count}</span>`
})
</script>
</body>
</html>
<!-- partial -->
</body>
</html>