-
Notifications
You must be signed in to change notification settings - Fork 0
/
popup.js
175 lines (165 loc) · 6.9 KB
/
popup.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
/* eslint-disable camelcase */
/* eslint-disable no-unused-vars */
/* eslint-disable func-names */
/* eslint-disable camelcase */
const popUpWindow = document.getElementById('pop-up-window');
const myRecentWork = document.getElementById('my-recent-work-section');
const title = document.getElementById('multipost-stories-title');
const snapshotPic = document.getElementById('pop-up-snapshot');
const PopUpParagr = document.getElementById('multipost-story-prgph');
const languages = document.getElementById('pup-up-build-with');
const seeLiveButton = document.getElementById('see-live-btn');
const seeSourceButton = document.getElementById('see-source-btn');
const closingButton = document.getElementById('button-closing-pop');
const myDataArray = [
{
title: 'Children with disabilities',
snapshotPicSrc: './assets/children.png',
prgphContent: `This is a simple website build for children with desabilities, it talks about the inequality of chances
and discrimination they mostly face`,
LanguagesBuildWith: ['html', 'css', 'SASS', 'Javascript'],
seeLiveBtn: 'https://yannickzahinda.github.io/Capstone-project/',
seeSource: 'https://yannickzahinda.github.io/Capstone-project',
},
{
title: 'TV Maze',
snapshotPicSrc: './assets/films.png',
prgphContent: `This is a movies website that allow the user to see films displayed on the screen, taking data from API`,
LanguagesBuildWith: ['html', 'CSS', 'Javascript', 'Webpack', 'API documentation'],
seeLiveBtn: 'https://yannickzahinda.github.io/Javascript-group-capstone-project/',
seeSource: 'https://github.com/YannickZahinda/My-Portfolio-design',
},
{
title: 'Leaderboard',
snapshotPicSrc: './assets/leaderboard.png',
prgphContent: `This is a simple website that allows the user to record his score and see them displaying on the
screen, the data are recorded on an API `,
LanguagesBuildWith: ['html', 'css', 'Javascript', 'Webpack', 'Api'],
seeLiveBtn: 'https://yannickzahinda.github.io/Leaderboard/',
seeSource: 'https://github.com/YannickZahinda/My-Portfolio-design',
},
{
title: 'Math Magician',
snapshotPicSrc: './assets/Math.png',
prgphContent: `Math Magician is a single page application (SPA); for maths lovers ! it's a website that allows the user to
perform basics calculation with basics operator !`,
LanguagesBuildWith: ['html', 'css', 'javascript', 'react'],
seeLiveBtn: 'https://github.com/YannickZahinda/math-magician',
seeSource: 'https://github.com/YannickZahinda/My-Portfolio-design',
},
];
// const popUpData = myDataArray[n];
function onpenWindow() {
popUpWindow.style.display = 'block';
popUpWindow.style.transition = '1s ease';
}
closingButton.addEventListener('click', () => {
popUpWindow.style.display = 'none';
});
function onpenWindowDataIncluded(i) {
const popUpData = myDataArray[i];
title.innerText = popUpData.title;
snapshotPic.src = myDataArray[i].snapshotPicSrc;
PopUpParagr.innerText = popUpData.prgphContent;
languages.innerHTML = popUpData.LanguagesBuildWith.map(
(lang) => `<li class='language-pop'>${lang}</li>`,
)
.join('');
seeLiveButton.onclick = () => {
window.location.href = myDataArray[i].seeLiveBtn;
};
seeSourceButton.onclick = () => {
window.location.href = myDataArray[i].seeSource;
};
onpenWindow();
}
myRecentWork.innerHTML = `
<div class="multipost-stories-item">
<div class="img-placeholder-container">
<img src='${myDataArray[0].snapshotPicSrc}' alt="snapshot-portfolio" class="snapshot">
</div>
<div class="multipost-stories-container">
<h6 class="multipost-stories-title">${myDataArray[0].title}</h6>
<p class="multipost-story-prgph">
${myDataArray[0].prgphContent}
</p>
<ul class="build-with pop-up-build-with">
<li class="language>css</li>
<li class="language">html</li>
<li class="language">Boostrap</li>
<li class="language">Ruby</li>
</ul>
<div class="button-container">
<button class="see-project-button" onclick="onpenWindowDataIncluded(0)" type="button">
See Project
</button>
</div>
</div>
</div>
<div class="multipost-stories-item multipost-stories-item1">
<div class="img-placeholder-container">
<img src="${myDataArray[1].snapshotPicSrc}" alt="snapshot-portfolio" class="snapshot">
</div>
<div class="multipost-stories-container">
<h6 class="multipost-stories-title">${myDataArray[1].title}</h6>
<p class="multipost-story-prgph">
${myDataArray[1].prgphContent}
</p>
<ul class="build-with pop-up-build-with">
<li class="language">css</li>
<li class="language">html</li>
<li class="language">Boostrap</li>
<li class="language">Ruby</li>
</ul>
<div class="button-container">
<button class="see-project-button" onclick="onpenWindowDataIncluded(1)" type="button">
See Project
</button>
</div>
</div>
</div>
<div class="multipost-stories-item">
<div class="img-placeholder-container">
<img src="${myDataArray[2].snapshotPicSrc}" alt="snapshot-portfolio" class="snapshot">
</div>
<div class="multipost-stories-container">
<h6 class="multipost-stories-title">${myDataArray[2].title}</h6>
<p class="multipost-story-prgph">
${myDataArray[2].prgphContent}
</p>
<ul class="build-with pop-up-build-with">
<li class="language">css</li>
<li class="language">html</li>
<li class="language">Boostrap</li>
<li class="language">Ruby</li>
</ul>
<div class="button-container">
<button class="see-project-button" onclick="onpenWindowDataIncluded(2)" type="button">
See Project
</button>
</div>
</div>
</div>
<div class="multipost-stories-item multipost-stories-item1">
<div class="img-placeholder-container">
<img src="${myDataArray[3].snapshotPicSrc}" alt="snapshot-portfolio" class="snapshot">
</div>
<div class="multipost-stories-container">
<h6 class="multipost-stories-title">${myDataArray[3].title}</h6>
<p class="multipost-story-prgph">
${myDataArray[3].prgphContent}
</p>
<ul class="build-with pop-up-build-with">
<li class="language">css</li>
<li class="language">html</li>
<li class="language">Boostrap</li>
<li class="language">Ruby</li>
</ul>
<div class="button-container">
<button class="see-project-button" type="button" onclick="onpenWindowDataIncluded(3)">
See Project
</button>
</div>
</div>
</div>
`;