-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
116 lines (109 loc) · 2.94 KB
/
index.html
File metadata and controls
116 lines (109 loc) · 2.94 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
<title>
Percentage Calculator
</title>
<!-- Bootstrap CSS -->
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet"/>
<!-- Custom CSS -->
</head>
<body>
<div class="container">
<h1>
Percentage Calculator
</h1>
<form id="percentageForm">
<div class="form-group">
<label for="number">
Number:
</label>
<input class="form-control" id="number" required="" type="number"/>
</div>
<div class="form-group">
<label for="percentage">
Percentage:
</label>
<input class="form-control" id="percentage" required="" type="number"/>
</div>
<button class="btn" type="submit">
Calculate
</button>
</form>
</div>
<!-- Bootstrap & jQuery JS -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js">
</script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js">
</script>
<!-- Custom JS -->
</body>
</html>
<style>
body {
font-family: Arial, sans-serif;
background: linear-gradient(to right, #ff9966, #ff5e62);
}
.container {
max-width: 500px;
margin: 0 auto;
padding: 40px;
background-color: #ffffff;
border-radius: 10px;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
animation: fade-in 1s ease-in-out;
}
h1 {
text-align: center;
color: #ffffff;
font-size: 36px;
margin-bottom: 40px;
animation: slide-in 1s ease-in-out;
}
.form-group {
margin-bottom: 20px;
}
.btn {
width: 100%;
padding: 10px;
font-size: 18px;
border-radius: 5px;
background-color: #ff5e62;
color: #ffffff;
border: none;
cursor: pointer;
transition: background-color 0.3s ease-in-out;
}
.btn:hover {
background-color: #ff3c3f;
}
@keyframes fade-in {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
@keyframes slide-in {
0% {
transform: translateY(-50px);
}
100% {
transform: translateY(0);
}
}
</style>
<script>
$(document).ready(function() {
$('#percentageForm').submit(function(e) {
e.preventDefault();
var number = parseFloat($('#number').val());
var percentage = parseFloat($('#percentage').val());
var result = (number * percentage) / 100;
alert('Result: ' + result.toFixed(2));
});
});
</script>