-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscriptProjects.js
35 lines (30 loc) · 1.26 KB
/
scriptProjects.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
// Replace the videoIds array with the video IDs of the YouTube videos you want to showcase
const videoIds = ['NJvc3ywlfaM', 'lhN3zga0bl8', '3T-F8i-0S14','VtrDtajr8Xc','_XcdxEazAjs','dAHSYJtYkes','41zfW0_Idp0','pcxAYghnZas','j7NDEB_jf_k','bemmWhzlHFU'];
// Add custom text to the corresponding video IDs
const videoTexts = [
'Legend of Catto',
'Surviving Uni',
'Digger',
'Harry Potter',
'Physics Ball',
'Ludo',
'CodeRevolution',
'Split',
'Pikachu Run',
'Tyrian'
];
videoIds.forEach((videoId, index) => {
const gridItem = document.createElement('div');
gridItem.classList.add('grid-item');
const iframe = document.createElement('iframe');
iframe.src = `https://www.youtube.com/embed/${videoId}`;
iframe.allow = 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture';
iframe.allowFullscreen = true;
// Create a paragraph element to display the custom text
const customText = document.createElement('p');
customText.textContent = videoTexts[index];
customText.style.marginTop = '0.5rem';
gridItem.appendChild(iframe);
gridItem.appendChild(customText); // Add the custom text below the video
document.querySelector('.grid-container').appendChild(gridItem);
});