-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
210 lines (185 loc) · 7.47 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
198
199
200
201
202
203
204
205
206
207
208
209
210
<!DOCTYPE html>
<html>
<head>
<title>Gartic Fotos</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Adicionando o favicon -->
<link rel="icon" type="image/png" href="https://gartic.com.br/imgs/instagram/avatar.png?v=1">
<!-- Estilos CSS -->
<style>
body {
background-color: #666;
background-image: url("https://gartic.com.br/imgs/sala/pattern_preto.png");
background-repeat: repeat;
color: white;
font-family: "Arial Black", Arial, sans-serif;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
height: 100vh;
margin: 0;
}
/* Adicionando cores adicionais para o fundo da página */
body.blue { background-color: #0081FF; }
body.gray { background-color: #666; }
body.red { background-color: #D54038; }
body.orange { background-color: #FFA006; }
body.green { background-color: #388E3C; }
body.pink { background-color: #FF4081; }
label {
display: block;
margin-bottom: 10px;
font-size: 20px;
}
input[type="text"] {
width: 200px;
padding: 5px;
}
.button {
padding: 10px;
background-color: #ffbb0f;
color: #6d3e04;
border: 1px solid #e28208;
cursor: pointer;
margin-top: 10px;
font-family: "Arial Black", Arial, sans-serif;
font-size: 24px;
}
.closeButton {
display: none;
margin-top: 10px;
font-size: 18px;
cursor: pointer;
background-color: #ffbb0f;
color: #6d3e04;
border: 1px solid #e28208;
padding: 5px 10px;
font-family: "Arial Black", Arial, sans-serif;
}
.error {
color: red;
margin-top: 5px;
font-size: 16px;
}
#photosContainer {
margin-top: 20px;
text-align: center;
}
#photosContainer img {
width: 300px;
height: 300px;
transition: transform 0.3s ease;
border: 2px solid #ffbb0f;
cursor: pointer;
}
#photosContainer img:hover {
transform: scale(1.1);
}
#imageCaption {
color: white;
font-family: "Arial Black", Arial, sans-serif;
margin-top: 10px;
font-size: 20px;
}
#avatar {
display: none;
width: 300px;
height: 300px;
margin-top: 20px;
}
/* Adicionando estilos para o seletor de cor de fundo */
#backgroundColorSelector {
margin-top: 10px;
font-family: "Arial Black", Arial, sans-serif;
font-size: 18px;
}
</style>
</head>
<body class="gray">
<img src="https://gartic.com.br/imgs/v3/logoHome2x.png" alt="Logo do Gartic">
<label for="nickInput">Digite o Nick do Gartic:</label>
<br>
<input type="text" id="nickInput" placeholder="Insira o nick" onkeydown="handleKeyDown(event)">
<br>
<button class="button" onclick="showPhotos('Atual')">Veja Atual</button>
<button class="button" onclick="showPhotos('Antiga')">Veja Antiga</button>
<button class="button" onclick="showPhotos('Antiga2')">Veja Antiga 2</button>
<div class="error" id="errorMessage"></div>
<div id="photosContainer"></div>
<div id="imageCaption"></div>
<div class="closeButton" onclick="closeImage()">Fechar imagem</div>
<img id="avatar" src="" alt="Avatar">
<!-- Adicionando um seletor para a cor do fundo -->
<label for="backgroundColorSelector">Selecione a cor de fundo:</label>
<select id="backgroundColorSelector" onchange="changeBackgroundColor()">
<option value="blue">Azul</option>
<option value="gray">Cinza</option>
<option value="red">Vermelha</option>
<option value="orange">Laranja</option>
<option value="green">Verde</option>
<option value="pink">Rosa</option>
</select>
<script>
// Função para trocar a cor de fundo
function changeBackgroundColor() {
var select = document.getElementById("backgroundColorSelector");
var body = document.body;
// Altera a classe do corpo para a cor selecionada
body.className = select.value;
}
function showPhotos(type) {
var input = document.getElementById("nickInput");
var newNick = input.value;
var container = document.getElementById("photosContainer");
var caption = document.getElementById("imageCaption");
var errorMessage = document.getElementById("errorMessage");
var closeButton = document.querySelector(".closeButton");
if (newNick.trim() !== "") {
var url = "";
var fileName = newNick + "_" + type; // Defina o nome do arquivo desejado
var imgHtml = "";
if (type === 'Atual') {
url = "https://gartic.com.br/avatar.php?nick=" + encodeURIComponent(newNick);
imgHtml = "<a href='" + url + "' download='" + fileName + "'><img src='" + url + "' alt='Foto do nick'></a>";
} else if (type === 'Antiga') {
var nickInicial = newNick.substring(0, 2);
url = `https://gartic.com.br/imgs/mural/${nickInicial}/${newNick}/avatar.png?v=43`;
imgHtml = "<a href='" + url + "' download='" + fileName + "'><img src='" + url + "' alt='Avatar Antigo'></a>";
} else if (type === 'Antiga2') {
var nickInicial = newNick.substring(0, 2);
url = `https://gartic.com.br/imgs/mural/${nickInicial}/${newNick}/avatar_mini.png?v=0`;
imgHtml = "<a href='" + url + "' download='" + fileName + "'><img src='" + url + "' alt='Avatar Antigo 2'></a>";
}
container.innerHTML = imgHtml;
caption.textContent = "Clique na imagem para baixar!";
closeButton.style.display = "block";
errorMessage.textContent = "";
} else {
container.innerHTML = "";
caption.textContent = "";
closeButton.style.display = "none";
errorMessage.textContent = "Digite o nick da conta corretamente. Qualquer erro não irá mostrá-lo.";
errorMessage.style.color = "red";
}
}
function handleKeyDown(event) {
if (event.key === "Enter") {
showPhotos('Atual'); // Ou substitua pelo tipo desejado (Atual, Antiga, Antiga2)
}
}
function closeImage() {
var container = document.getElementById("photosContainer");
var caption = document.getElementById("imageCaption");
var closeButton = document.querySelector(".closeButton");
var errorMessage = document.getElementById("errorMessage");
var avatarImage = document.getElementById("avatar");
container.innerHTML = "";
caption.textContent = "";
closeButton.style.display = "none";
errorMessage.textContent = "";
avatarImage.style.display = "none";
}
</script>
</body>
</html>