-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpopup.html
260 lines (260 loc) · 6.48 KB
/
popup.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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Web Content Downloader (for images)</title>
<style>
html, body {
height: 100%;
margin: 0;
padding: 0;
}
body {
width: 550px;
font-family: Arial, sans-serif;
background-color: #f0f0f0;
display: flex;
flex-direction: column;
}
.wrapper {
flex: 1 0 auto;
padding: 20px;
overflow-y: auto;
}
.card {
background-color: #e6f2ff; /* Couleur de fond bleutée légère */
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
padding: 15px;
margin-bottom: 20px;
}
h1 {
font-size: 24px;
color: #333;
margin-bottom: 20px;
text-align: center;
}
#csvFile {
display: none;
}
.file-input-label, .clear-button {
display: inline-block;
padding: 10px 15px;
color: white;
cursor: pointer;
border-radius: 4px;
margin-right: 10px;
border: none;
font-size: 14px;
}
.file-input-label {
background-color: #4CAF50;
}
.clear-button {
background-color: #f44336; /* Red color for the Clear button */
}
#previewSection {
display: none;
}
#preview {
max-height: 300px;
overflow-y: auto;
margin-top: 20px;
background-color: white; /* Assurez-vous que le fond est blanc */
}
img {
max-width: 100%;
height: auto;
margin-bottom: 10px;
border-radius: 4px;
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.pagination {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 15px;
}
.pagination button {
padding: 8px 12px;
background-color: #555;
color: white;
border: none;
cursor: pointer;
border-radius: 4px;
}
#pageInfo {
font-size: 14px;
color: #666;
}
#downloadAll {
display: block;
width: 100%;
padding: 12px;
background-color: #f44336;
color: white;
border: none;
cursor: pointer;
border-radius: 4px;
margin-top: 15px;
font-size: 16px;
}
.instructions {
background-color: #cce5ff; /* Bleu un peu plus foncé pour les instructions */
border-left: 6px solid #007bff; /* Bordure gauche bleue plus foncée */
padding: 15px;
font-size: 14px;
position: relative;
}
.hide-instructions {
position: absolute;
top: 5px;
right: 5px;
cursor: pointer;
background: none;
border: none;
font-size: 18px;
color: #666;
}
.content {
flex: 1;
}
footer {
flex-shrink: 0;
background-color: #f8f8f8;
text-align: center;
font-size: 12px;
color: #666;
border-top: 1px solid #ddd;
padding: 10px 0;
}
footer a {
text-decoration: none;
color: inherit;
}
footer a:hover {
text-decoration: underline;
}
.social-icons {
margin-top: 5px;
}
.social-icons a {
margin: 0 5px;
}
.social-icons img {
vertical-align: middle;
}
.input-section {
margin-bottom: 20px;
}
.input-toggle {
display: flex;
justify-content: space-between;
margin-bottom: 15px;
}
.input-toggle button {
flex: 1;
padding: 10px;
background-color: #ddd;
border: none;
cursor: pointer;
border-radius: 4px;
}
.input-toggle button.active {
background-color: #4CAF50;
color: white;
}
#urlTextArea {
width: 100%;
height: 120px;
margin-bottom: 15px;
border-radius: 4px;
border: 1px solid #ddd;
padding: 10px;
}
.image-container {
margin-bottom: 20px;
border: 1px solid #ddd;
padding: 10px;
border-radius: 4px;
}
.image-url {
word-break: break-all;
margin-top: 5px;
font-size: 12px;
color: #666;
}
.button-group {
display: flex;
justify-content: space-between;
}
.button-group button {
flex: 1;
margin-right: 10px;
}
.button-group button:last-child {
margin-right: 0;
}
.error-message {
color: #f44336;
background-color: #ffebee;
padding: 10px;
border-radius: 4px;
margin-bottom: 10px;
border: 1px solid #f44336;
}
</style>
</head>
<body>
<div class="wrapper">
<h1>Web Content Downloader (for images)</h1>
<div class="card instructions" id="instructionsSection">
<button class="hide-instructions" id="hideInstructions">×</button>
<p><strong>How to use this tool:</strong></p>
<ol>
<li>Select a CSV file containing URLs of websites with images (one per line).</li>
<li>Or directly paste the URLs into the text area, one per line.</li>
<li>Images will be previewed automatically.</li>
<li>Use the pagination buttons to navigate between images.</li>
<li>Click "Download All" to save all images.</li>
</ol>
</div>
<div class="card input-section">
<div class="input-toggle">
<button id="csvToggle" class="active">CSV File</button>
<button id="textToggle">Text</button>
</div>
<div id="csvInput">
<input type="file" id="csvFile" accept=".csv">
<label for="csvFile" class="file-input-label">Choose CSV File</label>
</div>
<div id="textInput" style="display:none;">
<textarea id="urlTextArea" placeholder="Paste your URLs here, one per line"></textarea>
<div class="button-group">
<button id="loadUrls" class="file-input-label">Load URLs</button>
<button id="clearUrls" class="clear-button">Clear</button>
</div>
</div>
</div>
<div class="card" id="previewSection">
<div id="preview"></div>
<div class="pagination">
<button id="prevPage" style="display:none;">Previous</button>
<span id="pageInfo"></span>
<button id="nextPage" style="display:none;">Next</button>
</div>
<button id="downloadAll">Download All</button>
</div>
</div>
<footer>
<p>© 2023 Web Content Downloader (for images). All rights reserved.</p>
<p>Developed by Guigeek973</p>
<div class="social-icons">
<a href="https://github.com/Guigeek973" target="_blank" rel="noopener noreferrer">
<img src="https://github.com/favicon.ico" alt="GitHub" width="16" height="16">
</a>
</div>
</footer>
<script src="popup.js"></script>
</body>
</html>