-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscripts.js
386 lines (373 loc) · 14.6 KB
/
scripts.js
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
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
document.addEventListener('DOMContentLoaded', function() {
const tools = [
{
name: 'OCR App 2.0',
description: {
pl: 'Zaawansowane narzędzie do rozpoznawania tekstu ze zdjęć',
en: 'Advanced tool for text recognition from images'
},
link: 'https://jacob22092.github.io/OCR-App-2.0/',
new: true,
image: 'photos/ocr-app-2.0.jpg',
price: 'Free',
category: {
name: {
pl: 'Konwerter',
en: 'Converter'
},
color: 'category-converter'
}
},
{
name: 'OCR App',
description: {
pl: 'Podstawowe narzędzie do rozpoznawania tekstu ze zdjęć',
en: 'Basic tool for text recognition from images'
},
link: 'https://jacob22092.github.io/OCR-App/',
new: false,
image: 'photos/ocr-app.jpg',
price: 'Free',
category: {
name: {
pl: 'Konwerter',
en: 'Converter'
},
color: 'category-converter'
}
},
{
name: 'GoodTape',
description: {
pl: 'Narzędzie do transkrypcji i edycji wideo',
en: 'Tool for transcription and video editing'
},
link: 'https://goodtape.io/',
new: false,
image: 'photos/goodtape.jpg',
price: 'Free Plan',
category: {
name: {
pl: 'Audio',
en: 'Audio'
},
color: 'category-audio'
}
},
{
name: 'PhotoRoom',
description: {
pl: 'Narzędzie do usuwania tła z obrazów',
en: 'Tool for removing background from images'
},
link: 'https://www.photoroom.com/tools/background-remover',
new: false,
image: 'photos/photoroom.jpg',
price: 'Free',
category: {
name: {
pl: 'Grafika',
en: 'Graphics'
},
color: 'category-graphics'
}
},
{
name: 'Photopea',
description: {
pl: 'Alternatywa dla popularnego programu Photoshop',
en: 'Alternative to the popular Photoshop program'
},
link: 'https://www.photopea.com/',
new: false,
image: 'photos/photopea.jpg',
price: 'Free',
category: {
name: {
pl: 'Grafika',
en: 'Graphics'
},
color: 'category-graphics'
}
},
{
name: 'Canva',
description: {
pl: 'Narzędzie do projektowania grafiki',
en: 'Tool for graphic design'
},
link: 'https://www.canva.com/',
new: false,
image: 'photos/canva.jpg',
price: 'Free',
category: {
name: {
pl: 'Grafika',
en: 'Graphics'
},
color: 'category-graphics'
}
},
{
name: 'LibreOffice',
description: {
pl: 'Bezpłatny pakiet biurowy kompatybilny z Microsoft Office, oferujący edytor tekstu, arkusze kalkulacyjne i prezentacje.',
en: 'Free office suite compatible with Microsoft Office, offering a word processor, spreadsheets, and presentations.'
},
link: 'https://www.libreoffice.org/',
new: false,
image: 'photos/libreoffice.jpg',
price: 'Free',
category: {
name: {
pl: 'Edytor',
en: 'Editor'
},
color: 'category-editor'
}
},
{
name: 'Overleaf',
description: {
pl: 'Edytor LaTeX online do tworzenia dokumentów akademickich, umożliwiający współpracę w czasie rzeczywistym.',
en: 'Online LaTeX editor for creating academic documents, enabling real-time collaboration.'
},
link: 'https://www.overleaf.com/',
new: false,
image: 'photos/overleaf.jpg',
price: 'Free',
category: {
name: {
pl: 'Edytor',
en: 'Editor'
},
color: 'category-editor'
}
},
{
name: 'Notion',
description: {
pl: 'Darmowe narzędzie do notatek, planowania i zarządzania projektami z różnorodnymi bazami danych i kalendarzami.',
en: 'Free tool for note-taking, planning, and project management with various databases and calendars.'
},
link: 'https://www.notion.so/',
new: false,
image: 'photos/notion.jpg',
price: 'Free',
category: {
name: {
pl: 'Edytor',
en: 'Editor'
},
color: 'category-editor'
}
},
{
name: 'Trello',
description: {
pl: 'Darmowe narzędzie do zarządzania projektami i organizacji zadań oparte na tablicach kanban.',
en: 'Free tool for project management and task organization based on kanban boards.'
},
link: 'https://trello.com/',
new: false,
image: 'photos/trello.jpg',
price: 'Free Plan',
category: {
name: {
pl: 'Planer',
en: 'Planner'
},
color: 'category-planner'
}
},
{
name: 'Anki',
description: {
pl: 'Program do nauki za pomocą fiszek z synchronizacją na różnych urządzeniach, wykorzystujący powtarzanie przestrzenne.',
en: 'Program for learning with flashcards synchronized across different devices, utilizing spaced repetition.'
},
link: 'https://apps.ankiweb.net/',
new: false,
image: 'photos/anki.jpg',
price: 'Free',
category: {
name: {
pl: 'Nauka',
en: 'Study'
},
color: 'category-study'
}
},
{
name: 'Forest Free',
description: {
pl: 'Aplikacja pomagająca w koncentracji poprzez sadzenie wirtualnych drzew podczas pracy.',
en: 'App helping with focus by planting virtual trees during work.'
},
link: 'https://www.forestapp.cc/',
new: false,
image: 'photos/forest.jpg',
price: 'Free',
category: {
name: {
pl: 'Skupienie',
en: 'Focus'
},
color: 'category-focus'
}
},
{
name: 'Habitica',
description: {
pl: 'Aplikacja do zarządzania zadaniami i nawykami w formie gry RPG, motywująca do realizacji celów.',
en: 'App for task and habit management in the form of an RPG game, motivating to achieve goals.'
},
link: 'https://habitica.com/',
new: false,
image: 'photos/habitica.jpg',
price: 'Free',
category: {
name: {
pl: 'Skupienie',
en: 'Focus'
},
color: 'category-focus'
}
},
{
name: 'Audacity',
description: {
pl: 'Bezpłatne narzędzie do nagrywania i edycji dźwięku, popularne wśród podcasterów i muzyków.',
en: 'Free tool for recording and editing sound, popular among podcasters and musicians.'
},
link: 'https://www.audacityteam.org/',
new: false,
image: 'photos/audacity.jpg',
price: 'Free',
category: {
name: {
pl: 'Audio',
en: 'Audio'
},
color: 'category-audio'
}
}
];
const translations = {
pl: {
pageTitle: "StudyTools - Narzędzia dla Studentów",
headerTitle: "StudyTools",
headerDescription: "Twoje ulubione narzędzia do nauki w jednym miejscu",
toolsListTitle: "Lista Narzędzi",
tableHeaderName: "Nazwa",
tableHeaderDescription: "Opis",
tableHeaderAction: "Akcja",
freeInfo: {
free: "Narzędzie jest darmowe",
freePlan: "Narzędzie ma darmowy plan"
},
suggestTitle: "Proponuj Narzędzia",
suggestDescription: "Razem możemy zbudować wielką listę wspaniałych narzędzi, które pomogą nam wszystkim w nauce i pracy. Jeśli masz sugestię dotyczącą narzędzia, które moglibyśmy dodać, kliknij przycisk poniżej i wypełnij formularz Google.",
suggestButton: "Zaproponuj Narzędzie"
},
en: {
pageTitle: "StudyTools - Tools for Students",
headerTitle: "StudyTools",
headerDescription: "Your favorite study tools in one place",
toolsListTitle: "Tool List",
tableHeaderName: "Name",
tableHeaderDescription: "Description",
tableHeaderAction: "Action",
freeInfo: {
free: "This tool is free",
freePlan: "This tool has a free plan"
},
suggestTitle: "Suggest Tools",
suggestDescription: "Together we can build a great list of amazing tools to help us all in our studies and work. If you have a suggestion for a tool we could add, click the button below and fill out the Google form.",
suggestButton: "Suggest a Tool"
}
};
function setLanguage(language) {
document.title = translations[language].pageTitle;
document.getElementById('header-title').textContent = translations[language].headerTitle;
document.getElementById('header-description').textContent = translations[language].headerDescription;
document.getElementById('tools-title').textContent = translations[language].toolsListTitle;
document.getElementById('suggest-title').textContent = translations[language].suggestTitle;
document.getElementById('suggest-description').textContent = translations[language].suggestDescription;
document.getElementById('suggest-button').textContent = translations[language].suggestButton;
tools.forEach(tool => {
tool.translatedDescription = tool.description[language];
tool.translatedCategoryName = tool.category.name[language];
tool.translatedFreeInfo = tool.price === 'Free' ? translations[language].freeInfo.free : translations[language].freeInfo.freePlan;
});
}
const userLang = navigator.language || navigator.userLanguage;
const language = userLang.startsWith('pl') ? 'pl' : 'en';
setLanguage(language);
const toolsList = document.getElementById('tools');
const modal = document.getElementById('toolModal');
const modalTitle = document.getElementById('modalTitle');
const modalImage = document.getElementById('modalImage');
const modalDescription = document.getElementById('modalDescription');
const modalCategory = document.getElementById('modalCategory');
const modalFreeInfo = document.getElementById('modalFreeInfo');
const closeModal = document.getElementsByClassName('close')[0];
function displayTools(toolsToShow) {
toolsList.innerHTML = '';
toolsToShow.forEach(tool => {
const listItem = document.createElement('div');
const visitButton = `<a href="${tool.link}" target="_blank"><button class="visit-btn"><i class="fas fa-external-link-alt"></i> Visit</button></a>`;
const newIcon = tool.new ? '<i class="fas fa-star new-icon"></i>' : '';
listItem.className = tool.new ? 'tool-card new-tool ' + tool.category.color : 'tool-card ' + tool.category.color;
listItem.innerHTML = `
<img src="${tool.image}" alt="${tool.name}">
<div class="tool-card-content">
<h3>${newIcon}${tool.name}</h3>
<p>${tool.translatedDescription}</p>
${visitButton}
</div>`;
listItem.addEventListener('click', () => {
modalTitle.textContent = tool.name;
modalImage.src = tool.image;
modalDescription.textContent = tool.translatedDescription;
modalCategory.textContent = tool.translatedCategoryName;
modalCategory.className = `badge category-badge ${tool.category.color}`;
modalFreeInfo.textContent = tool.translatedFreeInfo;
modal.style.display = 'block';
});
toolsList.appendChild(listItem);
});
}
displayTools(tools);
closeModal.onclick = function() {
modal.style.display = 'none';
}
window.onclick = function(event) {
if (event.target == modal) {
modal.style.display = 'none';
}
}
// Filtruj narzędzia według kategorii
const categoryButtons = document.querySelectorAll('.category-button');
categoryButtons.forEach(button => {
button.addEventListener('click', () => {
const category = button.getAttribute('data-category');
if (category === 'all') {
displayTools(tools);
} else {
const filteredTools = tools.filter(tool => tool.category.color === category);
displayTools(filteredTools);
}
});
});
// Cookie Consent
const cookieConsent = document.getElementById('cookieConsent');
const acceptCookies = document.getElementById('acceptCookies');
if (!localStorage.getItem('cookiesAccepted')) {
cookieConsent.style.display = 'block';
}
acceptCookies.onclick = () => {
localStorage.setItem('cookiesAccepted', 'true');
cookieConsent.style.display = 'none';
}
});