-
Notifications
You must be signed in to change notification settings - Fork 0
/
age.html
141 lines (124 loc) · 4.47 KB
/
age.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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="stylesheets/age.css">
<link href="https://fonts.googleapis.com/css2?family=Baloo+Tammudu+2:wght@400;600&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>
<nav>
<a href="index.html"><img src="img/logo2.png" alt=""></a>
<div class="navlinks" id="navlink">
<i class="fa fa-times" onclick="hidemenu()"></i>
<ul>
<li><a href="index.html">HOME</a></li>
<li><a href="content.html">EXPLORE</a></li>
<li><a href="age.html">AGE CALCULATOR</a></li>
<li><a href="weight.html">WEIGHT CALCULATOR</a></li>
<li><a href="contact.html">CONTACT US</a></li>
<li><a href="about.html">ABOUT US</a></li>
</ul>
</div>
<i class="fa fa-bars" onclick="showmenu()"></i>
</nav>
<div class="container">
<div class="box pbox">
<div class="boximg" >
<img src="img/cearth.png" alt="" srcset="">
</div>
<div >
<span class="enter">Enter Your Age:</span>
<br>
<input type="number" name="eyears" id="eyears">
<br>
<button onclick="button()">Try It</button>
</div>
</div>
<div class="box">
<div class="boximg">
<img src="img/cmercury.png" alt="" srcset="">
</div>
<div class="boxmatter" id="mercury">
0.00 Mercury Years
</div>
</div>
<div class="box">
<div class="boximg" >
<img src="img/cvenus.png" alt="" srcset="">
</div>
<div class="boxmatter" id="venus">
0.00 Venus Years
</div>
</div>
<div class="box">
<div class="boximg">
<img src="img/cmars.png" alt="" srcset="">
</div>
<div class="boxmatter" id="mars">
0.00 Mars Years
</div>
</div>
<div class="box">
<div class="boximg">
<img src="img/cjupiter.png" alt="" srcset="">
</div>
<div class="boxmatter" id="jupiter">
0.00 Jupiter Years
</div>
</div>
<div class="box">
<div class="boximg">
<img src="img/csaturn.png" alt="" srcset="">
</div>
<div class="boxmatter" id="saturn">
0.00 Saturn Years
</div>
</div>
<div class="box">
<div class="boximg">
<img src="img/curanus.png" alt="" srcset="">
</div>
<div class="boxmatter" id="uranus">
0.00 Uranus Years
</div>
</div>
<div class="box">
<div class="boximg">
<img src="img/cneptune.png" alt="" srcset="">
</div>
<div class="boxmatter" id="neptune">
0.00 Neptune Years
</div>
</div>
</div>
</body>
<script>
var navlink = document.getElementById("navlink");
function showmenu() {
navlink.style.right = "0";
navlink.style.display = "flex";
}
function hidemenu() {
navlink.style.right = "-200px";
navlink.style.display = "none";
location.reload();
}
</script>
<script>
function button() {
var x = document.getElementById("eyears").value;
console.log(x);
document.getElementById("mercury").innerHTML = Math.round(x * 0.2) + " Mercury Years";
document.getElementById("venus").innerHTML = Math.round(x * 0.6) + " Venus Years";
document.getElementById("mars").innerHTML =Math.round( x * 2) + " Mars Years";
document.getElementById("jupiter").innerHTML = Math.round(x * 12) + " Jupiter Years";
document.getElementById("saturn").innerHTML = Math.round(x * 29) + " Saturn Years";
document.getElementById("uranus").innerHTML = Math.round(x * 84) + " Uranus Years";
document.getElementById("neptune").innerHTML =Math.round( x * 165) + " Neptune Years";
}
</script>
</html>