Skip to content

Commit 7c15f0f

Browse files
committed
populate with actual API data for mockup imgs
1 parent 3f4df31 commit 7c15f0f

File tree

5 files changed

+42
-5
lines changed

5 files changed

+42
-5
lines changed

frontend/dist/scripts/app.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,9 +525,25 @@ function loadProjectRequirements(data) {
525525

526526
let li = document.createElement('li');
527527
li.classList.add('disabled');
528-
li.textContent = 'There are no mockups for this project 😢';
528+
li.textContent = 'There are no mockups for this project.';
529529
mockupIconContainer.append(li)
530530
}
531+
532+
let mockupIcons = document.querySelectorAll('li.mockup-type');
533+
const gallery = document.getElementById('galleryContainer');
534+
mockupIcons.forEach((icon, index) => {
535+
icon.setAttribute('data-mockup-index', index);
536+
537+
icon.addEventListener('click', e => {
538+
gallery.innerHTML = '';
539+
let currentIndex = e.target.getAttribute('data-mockup-index');
540+
let currentMock = projectFileData.currentMocks[currentIndex];
541+
let img = document.createElement('img');
542+
img.src = currentMock;
543+
gallery.appendChild(img);
544+
})
545+
});
546+
531547

532548

533549
}

frontend/dist/styles/app.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/src/scripts/app.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,9 +525,25 @@ function loadProjectRequirements(data) {
525525

526526
let li = document.createElement('li');
527527
li.classList.add('disabled');
528-
li.textContent = 'There are no mockups for this project 😢';
528+
li.textContent = 'There are no mockups for this project.';
529529
mockupIconContainer.append(li)
530530
}
531+
532+
let mockupIcons = document.querySelectorAll('li.mockup-type');
533+
const gallery = document.getElementById('galleryContainer');
534+
mockupIcons.forEach((icon, index) => {
535+
icon.setAttribute('data-mockup-index', index);
536+
537+
icon.addEventListener('click', e => {
538+
gallery.innerHTML = '';
539+
let currentIndex = e.target.getAttribute('data-mockup-index');
540+
let currentMock = projectFileData.currentMocks[currentIndex];
541+
let img = document.createElement('img');
542+
img.src = currentMock;
543+
gallery.appendChild(img);
544+
})
545+
});
546+
531547

532548

533549
}

frontend/src/styles/components/utility-panel/_project-files.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
transition: transform 0.2s;
1616
&.disabled {
1717
pointer-events: none;
18+
font-size: 0.8rem;
19+
}
20+
span,
21+
i {
22+
pointer-events: none;
1823
}
1924
span {
2025
font-size: 0.8rem;

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,8 @@ <h1 data-project-name></h1>
204204
<i class="fa-solid fa-angle-left" data-prev-image></i>
205205
<i class="fa-solid fa-angle-right" data-next-image></i>
206206
</div>
207-
<div class="gallery-container">
208-
<img src="https://images.unsplash.com/photo-1531297484001-80022131f5a1?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=3820&q=80" alt="">
207+
<div class="gallery-container" id="galleryContainer">
208+
<!-- dynamic -->
209209
</div>
210210
</div>
211211

0 commit comments

Comments
 (0)