-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
217 lines (209 loc) · 5.51 KB
/
main.py
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
#!/usr/bin/python3
import sys
from fastapi import FastAPI
from starlette.responses import HTMLResponse
from fastapi.middleware.cors import CORSMiddleware
from models import models
from db.configuration import engine
from api import crawler
models.Base.metadata.create_all(bind=engine)
app = FastAPI(
title="Security analyzer",
description="Security analyzer Backend",
version="1.0.0",
)
origins = [
"http://localhost",
"http://localhost:8080",
]
app.add_middleware(
CORSMiddleware,
allow_origins=origins,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
app.include_router(crawler.router)
@app.get("/", response_class=HTMLResponse)
def index():
return """
<!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" />
<link
rel="shortcut icon"
type="image/icon"
href="https://www.yezz.me/assets/css/Ico/icon.png"
/>
<style>
* {
box-sizing: border-box;
}
*::before,
*::after {
box-sizing: border-box;
}
body {
display: flex;
align-items: center;
justify-content: center;
margin: 0;
min-height: 100vh;
background: #000000;
}
#container {
display: flex;
align-items: center;
justify-content: center;
width: 6.25rem;
height: 6.25rem;
}
button {
position: relative;
display: inline-block;
cursor: pointer;
outline: none;
border: 0;
vertical-align: middle;
}
button.face-button {
width: 6.25rem;
height: 6.25rem;
border-radius: 50%;
background: #fdda5f;
box-shadow: inset 2px -4px 18px #fd9744;
}
.face-container {
position: relative;
display: block;
width: 40px;
height: 20px;
margin: auto;
}
.eye {
position: absolute;
height: 0.5rem;
width: 0.5rem;
background: #2a2927;
border-radius: 50%;
-webkit-animation: eyeBlink 3200ms linear infinite;
animation: eyeBlink 3200ms linear infinite;
}
.eye.left {
left: 0;
}
.eye.right {
left: 2rem;
}
.mouth {
position: absolute;
top: 1.125rem;
left: 0.8rem;
width: 1rem;
height: 0.125rem;
background: #2a2927;
border-radius: 0;
}
.eye,
.mouth {
box-shadow: inset 1px 2px 4px #121110;
}
.face-button:hover .mouth,
.face-button:active .mouth {
left: 1rem;
width: 0.5rem;
height: 0.4rem;
border-radius: 1rem 1rem 0.125rem 0.125rem;
}
.face-button:hover .eye,
.face-button:active .eye {
height: 0.375rem;
width: 0.375rem;
box-shadow: 0 0 0 0.25rem #fff;
}
@-webkit-keyframes eyeBlink {
0%,
30%,
36%,
100% {
transform: scale(1);
}
32%,
34% {
transform: scale(1, 0);
}
}
@keyframes eyeBlink {
0%,
30%,
36%,
100% {
transform: scale(1);
}
32%,
34% {
transform: scale(1, 0);
}
}
</style>
<title>DogeAPI</title>
</head>
<body>
<div id="container">
<a href="/docs">
<button class="face-button">
<span class="face-container">
<span class="eye left"></span>
<span class="eye right"></span>
<span class="mouth"></span>
</span>
</button>
</a>
</div>
<script>
const faceButton = document.querySelector(".face-button");
const faceContainer = document.querySelector(".face-container");
const containerCoords = document.querySelector("#container");
const mouseCoords = containerCoords.getBoundingClientRect();
faceButton.addEventListener("mousemove", function (e) {
const mouseX = e.pageX - containerCoords.offsetLeft;
const mouseY = e.pageY - containerCoords.offsetTop;
TweenMax.to(faceButton, 0.3, {
x: ((mouseX - mouseCoords.width / 2) / mouseCoords.width) * 50,
y: ((mouseY - mouseCoords.height / 2) / mouseCoords.width) * 50,
ease: Power4.easeOut,
});
});
faceButton.addEventListener("mousemove", function (e) {
const mouseX = e.pageX - containerCoords.offsetLeft;
const mouseY = e.pageY - containerCoords.offsetTop;
TweenMax.to(faceContainer, 0.3, {
x: ((mouseX - mouseCoords.width / 2) / mouseCoords.width) * 25,
y: ((mouseY - mouseCoords.height / 2) / mouseCoords.width) * 25,
ease: Power4.easeOut,
});
});
faceButton.addEventListener("mouseenter", function (e) {
TweenMax.to(faceButton, 0.3, {
scale: 0.975,
});
});
faceButton.addEventListener("mouseleave", function (e) {
TweenMax.to(faceButton, 0.3, {
x: 0,
y: 0,
scale: 1,
});
TweenMax.to(faceContainer, 0.3, {
x: 0,
y: 0,
scale: 1,
});
});
</script>
</body>
</html>
"""