-
Notifications
You must be signed in to change notification settings - Fork 1
/
script.js
75 lines (57 loc) · 1.68 KB
/
script.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
const projectsElement = document.querySelector('.projects');
const projects = [
'3d-card',
'accordion',
'auto-type',
'boiling-dots',
'card-slider',
'code',
'color-picker',
'custom-scroll',
'dot-container',
'draggable-card',
'input-slider',
'multiselect',
'onboarding',
'paging',
'progress-navigation',
'random-switches',
'ripple-cursor',
'segmented-control',
'show-on-scroll',
'side-menu',
'sticky',
'suggest',
'textarea-highlight',
'toast',
'todo-local-storage',
'validation',
'video-player',
'week',
'zoom'
];
const formatProjectName = (name) => name.split('-').map(word => word[0].toUpperCase() + word.slice(1)).join(' ');
projects.forEach(project => {
const li = document.createElement('li');
const linkView = document.createElement('a');
const info = document.createElement('div');
const img = document.createElement('img');
const p = document.createElement('p');
const linkGithub = document.createElement('a');
const i = document.createElement('i');
linkView.href = `/${project}/dist/index.html`;
linkView.target = '_blank';
li.classList.add('project');
info.classList.add('info');
linkGithub.classList.add('icon');
i.classList.add('fab', 'fa-github');
p.innerText = formatProjectName(project);
img.src = `/${project}/design/${project}.gif`;
linkGithub.href = `https://github.com/maurodesouza/frontloops-challenge-elements/tree/master/${project}/dist`;
linkGithub.target = '_blank';
linkGithub.append(i);
info.append(p, linkGithub);
linkView.append(img, info);
li.append(linkView);
projectsElement.append(li);
})