-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathmain.py
More file actions
80 lines (67 loc) · 2.46 KB
/
main.py
File metadata and controls
80 lines (67 loc) · 2.46 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
import re
from flask import Flask, request
import os
app = Flask(__name__)
@app.route('/')
def index():
return '''
<html>
<!--<span>House of Metazord</span>-->
<body>
<center><img src="https://i.ibb.co/DQzNLqR/Metazord-Logo.png" alt="Metazord-Logo" border="0" width="300" height="252"></cemter>
<style>
body {background-color: #ffffff;}
input[type=text] {width: 300px; padding: 12px 20px; margin: 8px 0; display: inline-block; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box;}
input[type=submit] {width: 100px; background-color: #f79204; color: white; padding: 14px 20px; margin: 8px 0; border: none; border-radius: 4px; cursor: pointer; font-color: black;}
input[type=submit]:hover {background-color: #45a049;}
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&display=swap');
span {
font-family: 'Bebas Neue', cursive;
font-size: 3em;
position: absolute;
top: 8%;
left: 48%;
transform: translate(-50%,-50%);
background-image: linear-gradient(gold, gold);
background-size: 100% 10px;
background-repeat: no-repeat;
background-position: 100% 0%;
transition: background-size .7s, background-position .5s ease-in-out;
}
span:hover {
background-size: 100% 100%;
background-position: 0% 100%;
transition: background-position .7s, background-size .5s ease-in-out;
}
</style>
<center>
<!--<br><br><br><br><br><br><br><br><br><br>-->
<form method="post">
<input type="text" name="name" class="testcasefield">
<input type="submit" class="testcasebutton" value="Submit">
</form>
</center>
</body>
</html>
'''
@app.route('/', methods=['POST'])
def say_hello():
name = request.form['name']
if re.fullmatch(r'^[a-zA-Z0-9]+$', name):
return '''
<html>
<body>
<p class="testcaseoutput">Valid_Login</p>
</body>
</html>
'''
else:
return '''
<html>
<body>
<p class="testcaseoutput">Invalid_Login</p>
</body>
</html>
'''
if __name__ == "__main__":
app.run(host= os.getenv('IP',"0.0.0.0"), port=int(os.getenv('PORT',5005)))