-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
197 lines (169 loc) · 4.95 KB
/
index.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
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
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Сокращатель ссылок</title>
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap" rel="stylesheet">
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Poppins', sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #f0f0f5;
color: #333;
padding: 20px;
}
.container {
text-align: center;
background-color: white;
padding: 40px;
border-radius: 16px;
box-shadow: 0px 6px 20px rgba(0, 0, 0, 0.1);
max-width: 500px;
width: 100%;
position: relative;
}
h1 {
font-size: 32px;
font-weight: 600;
margin-bottom: 30px;
color: #007BFF;
}
.input-group {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
margin-bottom: 30px;
}
input[type="url"] {
width: 100%;
padding: 12px;
font-size: 16px;
border: 2px solid #ddd;
border-radius: 8px;
outline: none;
transition: border-color 0.3s;
}
input[type="url"]:focus {
border-color: #007BFF;
}
button {
padding: 12px 25px;
margin-top: 10px;
background-color: #007BFF;
color: white;
font-weight: 600;
border: none;
border-radius: 8px;
cursor: pointer;
font-size: 16px;
transition: background-color 0.3s;
width: 100%;
}
button:hover {
background-color: #0056b3;
}
.loading {
display: none;
border: 4px solid rgba(0, 0, 0, 0.1);
border-radius: 50%;
border-top: 4px solid #007BFF;
width: 24px;
height: 24px;
animation: spin 1s linear infinite;
position: absolute;
top: 10px;
right: 10px;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
.result {
display: none;
margin-top: 20px;
opacity: 0;
transition: opacity 0.5s ease;
}
.result.show {
display: block;
opacity: 1;
}
.error {
color: red;
display: none;
margin-top: 20px;
}
.shortened-url {
background-color: #f0f0f5;
padding: 10px;
border-radius: 8px;
display: inline-block;
margin-top: 10px;
cursor: pointer;
color: #007BFF;
}
footer {
margin-top: 20px;
color: #666;
font-size: 14px;
}
a {
text-decoration: none;
color: #007BFF;
font-weight: 600;
transition: color 0.3s;
}
a:hover {
color: #0056b3;
}
/* Медиазапрос для экранов до 600px */
@media (max-width: 600px) {
.container {
padding: 20px;
}
h1 {
font-size: 24px;
}
input[type="url"], button {
width: 100%;
}
button {
margin-top: 10px;
margin-left: 0;
}
}
</style>
</head>
<body>
<div class="container">
<h1>Сократи свою ссылку</h1>
<div class="input-group" id="urlForm">
<input type="url" id="longUrl" placeholder="Вставьте ссылку сюда" required>
<button id="submit-button">Сократить</button>
<div class="loading" id="loading"></div> <!-- Спиннер -->
</div>
<div class="result" id="result">
<p>Сокращённая ссылка:</p>
<p class="shortened-url" id="shortUrl"></p>
<p class="copy-notice" id="copyNotice" style="display: none; color: green;">Скопировано в буфер обмена!</p>
</div>
<div class="error" id="error"></div>
<footer>
<p>© 2024 Сокращатель ссылок | <a href="https://github.com/gusevgrishaem1">Мой GitHub</a></p>
</footer>
</div>
<!-- Подключаем внешний скрипт -->
<script src="script.js"></script>
</body>
</html>