-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
168 lines (160 loc) · 6.5 KB
/
main.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
const menuItems = document.querySelectorAll('.nav-center .links li');
const sectionFooters = document.querySelectorAll('section, footer');
const navToggle = document.querySelector('.nav-toggle');
const links = document.querySelector('.links');
const closeMod = document.querySelector('.closeModal');
const icon = navToggle.querySelector('.fa-times');
const openIcon = navToggle.querySelector('.fa-bars');
navToggle.addEventListener('click', () => {
links.classList.toggle('show-links');
icon.classList.toggle('close-icon');
openIcon.classList.toggle('open-icon');
});
window.addEventListener('scroll', () => {
let currentSection = '';
sectionFooters.forEach((sectionFooter) => {
const sectionTop = sectionFooter.offsetTop;
if (window.pageYOffset >= (sectionTop)) {
currentSection = sectionFooter.getAttribute('id');
}
});
menuItems.forEach((menuItem) => {
menuItem.classList.remove('active');
if (menuItem.classList.contains(currentSection)) {
menuItem.classList.add('active');
}
menuItem.addEventListener('click', () => {
links.classList.toggle('show-links');
});
links.classList.remove('show-links');
icon.classList.remove('close-icon');
openIcon.classList.remove('open-icon');
});
});
const myModal = document.getElementById('myModal');
const seeProject = document.querySelectorAll('.see-details');
const Projects = [
{
id: 1,
name: 'Awesome Books',
description:
'This web app is a simple web page that allows the user to enter book details (title and author) and then stores and retrieves the information from local storage. I used HTML, CSS and ES6 to develop it.',
image: 'Images/awesome-books.PNG',
technologies: [
'html',
'css',
'JavaScript',
'github',
'ruby',
'Bootstrap',
],
Live: 'https://github.com/belaymit/Portfolio-microverse',
Source: 'https://github.com/belaymit/Portfolio-microverse',
},
{
id: 2,
name: 'Capstone Project I',
description:
'This is Microverse HTML/CSS and JS Capstone Project. I designed a conference website and added live data using JavaScript objects.',
image: 'Images/conference.PNG',
technologies: [
'html',
'css',
'JavaScript',
'github',
'ruby',
'Bootstrap',
],
Live: 'https://github.com/belaymit/Portfolio-microverse',
Source: 'https://github.com/belaymit/Portfolio-microverse',
},
{
name: 'Todo List',
description:
'This project is the most interesting of all of my projects. It is implemented using HTML, CSS and ES-6. I also used webpack and JavaScript Modules. I really learned a lot from this project.',
image: 'Images/to-do-List_up.PNG',
technologies: [
'html',
'css',
'JavaScript',
'github',
'ruby',
'Bootstrap',
],
Live: 'https://github.com/belaymit/Portfolio-microverse',
Source: 'https://github.com/belaymit/Portfolio-microverse',
},
{
name: 'Multi-Post Stories',
description:
'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essent',
image: 'Images/Snapshoot Portfolio__.png',
technologies: [
'html',
'css',
'JavaScript',
'github',
'ruby',
'Bootstrap',
],
Live: 'https://github.com/belaymit/Portfolio-microverse',
Source: 'https://github.com/belaymit/Portfolio-microverse',
},
{
name: 'Uber Navigation',
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 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 release',
image: 'Images/Snapshoot Portfolio.png',
technologies: [
'html',
'css',
'JavaScript',
'github',
'ruby',
'Bootstrap',
],
Live: 'https://github.com/belaymit/Portfolio-microverse',
Source: 'https://github.com/belaymit/Portfolio-microverse',
},
{
name: 'Uber Navigation',
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 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 release',
image: 'Images/Snapshoot Portfolio.png',
technologies: [
'html',
'css',
'JavaScript',
'github',
'ruby',
'Bootstrap',
],
Live: 'https://github.com/belaymit/Portfolio-microverse',
Source: 'https://github.com/belaymit/Portfolio-microverse',
},
];
seeProject.forEach((el) => el.addEventListener('click', (e) => {
const i = e.target.classList[0];
document.querySelector('.project-image').src = Projects[i].image;
document.querySelector('.modal-project-title').innerText = Projects[i].name;
document.querySelector('.modal-project-description').innerHTML = Projects[i].description;
document.querySelector('.button-container')
.innerHTML = ` <button onclick="${Projects[i].Live}" type="button" class="btn">see live <span><i class="fa-solid fa-arrow-up-right-from-square"></i></span></button>
<button onclick="${Projects[i].Source}" type="button" class="btn">see source <span> <i class="fa-brands fa-github"></i></button>`;
document.querySelector('.languages-used')
.innerHTML = `<li>
${Projects[i].technologies[0]}</li>
<li>${Projects[i].technologies[1]}</li>
<li> ${Projects[i].technologies[2]}</li>
<li>${Projects[i].technologies[3]}</li>
<li>${Projects[i].technologies[4]}</li>
<li>${Projects[i].technologies[5]}</li>`;
}));
function openPopUp() {
myModal.classList.add('open-popup');
}
function closePopUp() {
myModal.classList.remove('open-popup');
}
openPopUp.addEventListener('click', openPopUp);
closeMod.addEventListener('click', closePopUp);