-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtask.php
More file actions
217 lines (180 loc) · 5.53 KB
/
task.php
File metadata and controls
217 lines (180 loc) · 5.53 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
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
<!DOCTYPE html>
<html>
<head>
<title>Temprature CONVERSION</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://fonts.googleapis.com/css2?family=Flamenco&display=swap" rel="stylesheet">
<style>
*{
margin:0; padding: 0; box-sizing: border-box;
}
header{
background-image:linear-gradient(rgba(0, 0, 0, 0.5),rgb(0, 0, 0, 0.5)), url('images/landscape-photography-of-green-mountains-910411.jpg');
height: 100vh;
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
h1{
text-align: center; line-height: 20vh;
}
.main-div{
width: 100%; height: 80vh; display: flex; justify-content: space-around; align-items: center;
}
.left-side img{
max-width: 400px;
height: auto;
}
.right-side{
width: 400px;
height: 300px;
background-color: gray;
border-radius: 15px;
display:flex;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
}
body{
font-family: 'Flamenco', cursive;
}
.input1{
height: 40px;
width: 250px;
padding: 5px;
border-radius: 1px solid gray;
border-radius: 5px;
outline: none;
}
.selection{
width: 100%;
margin: 15px;
}
.colorchange{
animation: colorchangeArt 1s infinite;
}
@keyframes colorchangeArt {
0%{color:red;}
25%{color: yellow;}
50%{color:whie;}
100%{color:purple;}
}
.btn{
padding: 10px 18px;
border-radius: 10px;
outline: none;
border: none;
background-color: blue;
color: white;
font-size: 0.6em;
text-align: center;
}
p{
margin: 20px 0 0 0;
color: white;
}
.convt{
text-align: center;
color: white;
}
@media only screen and (max-width: 1366px){
.left-side{font-size: 280%;}
}
@media only screen and (max-width: 852px){
.right-side{font-size: 100%;}
}
@media only screen and (max-width: 680px){
.right-side{font-size: 80%;}
}
@media only screen and (max-width: 844px){
.right-side{
width: 260px;
}
}
@media only screen and (max-width: 844px){
.left-side{
font-size: 120%;
width: auto;
height: auto;
}
}
@media only screen and (max-width: 710px){
.right-side{
width: 240px;
}
}
@media only screen and (max-width: 710px){
.input1{
width: 220px;
}
}
@media only screen and (max-width: 710px){
.left-side{
margin-right: 10px;
height: auto;
}
}
@media only screen and (max-width: 690px){
.right-side{
width: 200px;
}
}
@media only screen and (max-width: 690px){
.input1{
width: 180px;
}
}
@media only screen and (max-width: 635px){
.right-side{
width: 140px;
}
}
@media only screen and (max-width: 635px){
.input1{
width: 120px;
}
}
</style>
</head>
<body>
<header>
<h1> Temprature Conversion</h1>
<div class="convt">
<h2> <span class="colorchange"> EASY TO USE AND QUICK TO ACCESS</span></h2>
</div>
<div class="main-div">
<div class="left-side">
<img src="images/—Pngtree—_blue smoke abstract_3780311.png">
</div>
<div class="right-side">
<form method="POST">
<input type="text" name="num" placeholder="enter your number" class="input1">
<div class="selection">
<label>celc</label>
<input type="radio" name="units" value="celc">
<label>farh</label>
<input type="radio" name="units" value="farh">
</div>
<input type="submit" name="submit" value="Convert Now" class="btn">
</form>
<div>
<p>
<?php
if(isset($_POST['submit'])){
$num = $_POST['num'];
$temp = $_POST['units'];
if($temp == "celc"){
$result = $num*9/5 +32;
echo "The conversion of celcius to farhenheit is:" .$result;
}else{
$result = ($num-32)*5/9;
echo "The conversion of farenheit to celcius is:" .$result;
}
}
?>
</p>
</div>
</header>
</body>
</html>