Skip to content

Commit c742f7d

Browse files
Merge pull request #317 from silversword411/main
Add image zoom functionality when clicking an image
2 parents 17c7232 + cb42920 commit c742f7d

File tree

4 files changed

+167
-8
lines changed

4 files changed

+167
-8
lines changed

docs/ee/reporting/functions/examples.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
2. Check at least one overdue item in agent settings<br>![uptime](../images/example_uptime_setting.png)
77
3. Run report and enjoy!
88

9-
[![html report screenshot](../images/example_uptimereport.png)](../images/example_uptimereport.png)
9+
![html report screenshot](../images/example_uptimereport.png)
1010

1111
## Windows 11 Upgrade Compatible list
1212

@@ -17,18 +17,20 @@ To get a Windows 10 upgrade to Windows 11 compatibility list you'll want to:
1717
3. Import one of the `Windows 11 Compatible` Reports ![Reports](../images/example_win11_reports.png)
1818
4. Enjoy!
1919

20-
[![Win11 HTML report screenshot](../images/example_win11_compatible_reporthtml.png)](../images/example_win11_compatible_reporthtml.png)
20+
![Win11 HTML report screenshot](../images/example_win11_compatible_reporthtml.png)
2121

2222

23-
[![pdf report screenshot](../images/example_win11_compatible_reportpdf.png)](../images/example_win11_compatible_reportpdf.png)
23+
![pdf report screenshot](../images/example_win11_compatible_reportpdf.png)
2424

2525

2626
## NOC Dashboard
2727

28-
Got a TV? Load it up for the team!
28+
Got a TV? Load it up for the team!
2929

3030
Want quick searchable agent status with more data? Load it locally!
3131

32+
The `Restrict Summary` button is for only showing agents that are offline and have an overdue alert set (eg critical machines). If it's on a hands off device make sure you set the refresh every so it's reloading data regularly.
33+
3234
<div class="video-wrapper">
3335
<iframe width="400" height="225" src="https://www.youtube.com/embed/OtV2M5uYj_k" frameborder="0" allowfullscreen></iframe>
3436
</div>
@@ -39,9 +41,9 @@ Want quick searchable agent status with more data? Load it locally!
3941

4042
Search for software, sort by different columns
4143

42-
[![Software Inventory](../images/example_softwarereport.gif)](../images/example_softwarereport.gif)
44+
![Software Inventory](../images/example_softwarereport.gif)
4345

4446

4547
`Software Report - Advanced DataTables`
4648

47-
[![Software Advanced](../images/example_software_Advanced_DataTables.png)](../images/example_software_Advanced_DataTables.png)
49+
![Software Advanced](../images/example_software_Advanced_DataTables.png)

docs/js/image-zoom.js

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
document.addEventListener("DOMContentLoaded", function () {
2+
// Create modal elements
3+
const modal = document.createElement("div");
4+
modal.className = "image-modal";
5+
modal.innerHTML = `
6+
<div class="image-modal-content">
7+
<span class="image-modal-close">&times;</span>
8+
<img class="image-modal-img" src="" alt="">
9+
<div class="image-modal-caption"></div>
10+
</div>
11+
`;
12+
document.body.appendChild(modal);
13+
14+
const modalImg = modal.querySelector(".image-modal-img");
15+
const modalCaption = modal.querySelector(".image-modal-caption");
16+
const closeBtn = modal.querySelector(".image-modal-close");
17+
18+
// Add click event to all images in the content area
19+
const images = document.querySelectorAll(".md-content img");
20+
21+
images.forEach((img) => {
22+
// Add a cursor pointer to indicate clickable
23+
img.style.cursor = "pointer";
24+
25+
img.addEventListener("click", function() {
26+
modal.style.display = "flex";
27+
modalImg.src = this.src;
28+
modalImg.alt = this.alt;
29+
modalCaption.textContent = this.alt || this.title || "";
30+
31+
// Prevent body scrolling when modal is open
32+
document.body.style.overflow = "hidden";
33+
});
34+
});
35+
36+
// Close modal when clicking the X
37+
closeBtn.addEventListener("click", function() {
38+
closeModal();
39+
});
40+
41+
// Close modal when clicking anywhere in the modal (including on the image)
42+
modal.addEventListener("click", function(e) {
43+
// Close modal when clicking anywhere except the close button
44+
if (e.target !== closeBtn) {
45+
closeModal();
46+
}
47+
});
48+
49+
// Close modal with Escape key
50+
document.addEventListener("keydown", function(e) {
51+
if (e.key === "Escape" && modal.style.display === "flex") {
52+
closeModal();
53+
}
54+
});
55+
56+
function closeModal() {
57+
modal.style.display = "none";
58+
document.body.style.overflow = "auto";
59+
}
60+
});

docs/stylesheets/extra.css

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,4 +151,100 @@
151151
height: 40px;
152152
text-align: center;
153153
font-size: 14px;
154+
}
155+
156+
/* Image zoom modal styles */
157+
.image-modal {
158+
display: none;
159+
position: fixed;
160+
z-index: 9999;
161+
left: 0;
162+
top: 0;
163+
width: 100%;
164+
height: 100%;
165+
background-color: rgba(0, 0, 0, 0.9);
166+
backdrop-filter: blur(5px);
167+
align-items: center;
168+
justify-content: center;
169+
}
170+
171+
.image-modal-content {
172+
position: relative;
173+
width: 90%;
174+
max-width: 100vw;
175+
max-height: 90vh;
176+
display: flex;
177+
flex-direction: column;
178+
align-items: center;
179+
justify-content: center;
180+
}
181+
182+
.image-modal-img {
183+
width: 100%;
184+
height: auto;
185+
max-height: 80vh;
186+
max-width: 100%;
187+
object-fit: contain;
188+
border-radius: 5px;
189+
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
190+
}
191+
192+
.image-modal-close {
193+
position: absolute;
194+
top: -40px;
195+
right: 0;
196+
color: white;
197+
font-size: 35px;
198+
font-weight: bold;
199+
cursor: pointer;
200+
background: rgba(0, 0, 0, 0.5);
201+
border-radius: 50%;
202+
width: 40px;
203+
height: 40px;
204+
display: flex;
205+
align-items: center;
206+
justify-content: center;
207+
transition: background-color 0.3s ease;
208+
}
209+
210+
.image-modal-close:hover,
211+
.image-modal-close:focus {
212+
background: rgba(255, 255, 255, 0.2);
213+
text-decoration: none;
214+
}
215+
216+
.image-modal-caption {
217+
margin: 15px 0;
218+
text-align: center;
219+
color: white;
220+
font-size: 16px;
221+
background: rgba(0, 0, 0, 0.7);
222+
padding: 10px;
223+
border-radius: 5px;
224+
}
225+
226+
/* Add cursor pointer to images to indicate they're clickable */
227+
.md-content img {
228+
cursor: pointer;
229+
}
230+
231+
/* Responsive adjustments */
232+
@media (max-width: 768px) {
233+
.image-modal-content {
234+
width: 95%;
235+
max-height: 85%;
236+
}
237+
238+
.image-modal-close {
239+
top: -35px;
240+
font-size: 30px;
241+
width: 35px;
242+
height: 35px;
243+
}
244+
245+
.image-modal-caption {
246+
font-size: 14px;
247+
margin: 10px 0;
248+
padding: 8px;
249+
}
154250
}

mkdocs.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,9 @@ theme:
126126
extra_css:
127127
- stylesheets/extra.css
128128
- stylesheets/neoteroi-mkdocs.css
129-
# extra_javascript:
130-
# - js/copy-to-clipboard.js
129+
extra_javascript:
130+
- js/image-zoom.js
131+
- js/copy-to-clipboard.js
131132
extra:
132133
social:
133134
- icon: fontawesome/brands/github

0 commit comments

Comments
 (0)