-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
168 lines (154 loc) · 6.08 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
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
/* eslint-disable max-len */
const store = [
{
id: 1,
name: 'Dashboard App.',
img: 'image/dashboard.JPG',
companyName: 'MicroLap',
job: 'Lead Developer',
year: 2024,
description: 'I developed a React Admin. Dashboard application you ever seen. Pages and Apps are Working Perfectly. This Beautiful website is still under Construction',
tags: ['Syncfusion', 'Reactjs', 'javaScript'],
seeLive: 'https://micro-app.netlify.app/',
},
{
id: 2,
name: 'Restaurant-App',
img: 'image/restoApp.png',
companyName: 'FOOD FOR ALL',
job: 'Front End Dev',
year: 2023,
description: 'This website App displays meals information from Sea food. It also allows users to submit their comments and likes for their favorite dish. All data is preserved thanks to the external MealsDB API, and involvement API.',
tags: ['html', 'api', 'JS', 'Webpack'],
seeLive: 'https://olipliche.github.io/JS-Capstone/dist/',
},
{
id: 3,
name: 'MARKET EXCHANGE',
img: 'image/exchange.JPG',
companyName: 'Exchange App',
job: 'Full Stack Dev',
year: 2023,
description: 'This App is an online exchange rate where users can see the actual market value. Kindly refresh the page when you open this beautiful App because it is deployed in Netlify, It runs slowly.',
tags: ['react', 'redux', 'api', 'JS', 'html5', 'css3'],
seeLive: 'https://paka-metrics-webapp.netlify.app/',
},
{
id: 5,
name: 'Math magicians app',
img: 'image/calc.png',
companyName: 'CANOPY',
job: 'Lead Developer',
year: 2021,
description: 'I developed a React application called the Math magicians app and UI of the calculator. This calculator app works at 100%. ',
tags: ['React', 'Reactjs', 'javaScript'],
seeLive: 'https://paka-math-magicians.netlify.app/',
},
{
id: 6,
name: 'AMAKI AGENCY',
img: 'image/amarky.JPG',
companyName: 'AMAKI',
job: 'Full Stack Dev',
year: 2023,
description: 'Amaki Agency Healthcare provides high quality homecare, also known as domiciliary care and support to clients living in their own homes.',
tags: ['html5', 'React', 'css3', 'javaScript'],
seeLive: 'https://amaky-ag.netlify.app/',
},
{
id: 4,
name: 'Multi-Post Stories',
img: 'image/Snapshoot_Portfolio(3).svg',
companyName: 'FACEBOOK',
job: 'Full Stack Dev',
year: 2015,
description: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it 1960s with the releaLorem Ipsum is simply dummy text of the printing.',
tags: ['html', 'Ruby on rails', 'css', 'javaScript'],
seeLive: 'https://raw.githack.com/OLIPLICHE/My-Portfolio/mobileJs/index.html',
},
];
const boxes = document.querySelector('.boxes');
store.forEach((item) => {
boxes.innerHTML += `<li class="card-work">
<a data-index-number=${item.id} class="portfolio-img" href="#">
<img src=${item.img} alt="tonic" />
</a>
<div class="right-content">
<div class="title">
<h2>${item.name}</h2>
</div>
<div class="info">
<span>${item.companyName}</span>
<span><img src="Counter.png" alt="counter" /></span>
<span>${item.job}</span>
<span><img src="Counter.png" alt="counter" /></span>
<span>${item.year}</span>
</div>
<div class="detail">
<p>
${item.description}
</p>
</div>
<ul class="languages">
${(function technoUsed() {
return item.tags.map((technology) => `<li><a href="#">${technology}</a></li>`).join('');
}())}
</ul>
<div class="see-project">
<a class="btn" data-index-number=${item.id} href="">See Project</a>
</div>
</div>
</li> `;
});
const cardPopupWindow = document.querySelector('.card-popup-window');
const seeProjectBtn = document.querySelectorAll('.see-project .btn');
const seeProjectImg = document.querySelectorAll('.card-work .portfolio-img');
const closedWind = document.querySelector('.card-popup-window .popup-main-container .main-container .close');
seeProjectImg.forEach((btn) => {
btn.addEventListener('click', (e) => {
e.preventDefault();
});
});
[seeProjectBtn].forEach((item) => {
item.forEach((link) => {
link.addEventListener('click', (e) => {
e.preventDefault();
cardPopupWindow.classList.add('open-pop-up');
const filteredCard = store.filter((card) => card.id === Number(link.dataset.indexNumber));
const title = document.querySelector('.card-popup-window .popup-main-container .main-container .title h2');
const info = document.querySelectorAll('.card-popup-window .main-container .info span');
const img = document.querySelector('.card-popup-window .main-container .portfolio-img img');
const detail = document.querySelector('.card-popup-window .main-container .detail p');
const techno = document.querySelector('#lang');
const links = document.querySelectorAll('.card-popup-window .main-container .links a');
title.innerHTML = filteredCard[0].name;
img.src = filteredCard[0].img;
detail.innerHTML = filteredCard[0].description;
for (let i = 0; i < Array.from(info).length; i += 1) {
if (i === 0) {
info[i].innerHTML = filteredCard[0].companyName;
} else if (i === 2) {
info[i].innerHTML = filteredCard[0].job;
} else if (i === 4) {
info[i].innerHTML = filteredCard[0].year;
}
}
const technologiesChild = [...techno.childNodes];
technologiesChild.forEach((child, index) => {
techno.removeChild(technologiesChild[index]);
});
filteredCard[0].tags.forEach((item) => {
const techItem = document.createElement('li');
const techLink = document.createElement('a');
techLink.href = '#';
techLink.innerText = item;
techItem.appendChild(techLink);
techno.appendChild(techItem);
});
links[0].href = filteredCard[0].seeLive;
});
});
});
closedWind.addEventListener('click', () => {
cardPopupWindow.classList.remove('open-pop-up');
});