Skip to content

Commit 10e7d44

Browse files
authored
make images clickable and show in lightbox (gematik#28)
* Added lightbox support for images * added lightbox functionality via css
1 parent b805a12 commit 10e7d44

File tree

4 files changed

+50
-2
lines changed

4 files changed

+50
-2
lines changed

_layouts/default.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,6 @@ <h1><a href="{{ "/" | absolute_url }}">{{ site.title | default: site.github.repo
4444
</footer>
4545
</div>
4646
<script id="usercentrics-cmp" src="https://app.usercentrics.eu/browser-ui/latest/loader.js" data-settings-id="_NKfSQXhq" async></script>
47-
<script src="{{ "/assets/js/scale.fix.js" | relative_url }}" type="text/plain" cookie-consent="strictly-necessary"></script>
47+
<script src="{{ site.baseurl }}/assets/js/scale.fix.js" type="text/plain" cookie-consent="strictly-necessary"></script>
4848
</body>
4949
</html>

_layouts/post.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ <h1>{{ page.title }}</h1>
1919
</p> -->
2020

2121
{{content}}
22-
22+
<script src="path/to/lightbox.js"></script>

_posts/2022-11-04-validating-fhir-resources-is-easy.markdown

+7
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,16 @@ java -jar validator_cli.jar c:\temp\patient.xml -version 3.0 -ig hl7.fhir.us.cor
2222
Another option is to use the [Simplifier validation service](https://simplifier.net/validate) (free registration required):
2323

2424
<p align="center">
25+
<a href="#img1">
2526
<img src="{{ site.baseurl }}/assets/img/221104-validating-fhir/simplifier-1.png" alt="Simplifier validation service"/>
27+
</a>
2628
</p>
2729

30+
<!-- lightbox container hidden with CSS -->
31+
<a href="#" class="lightbox" id="img1">
32+
<span style="background-image: url('{{ site.baseurl }}/assets/img/221104-validating-fhir/simplifier-1.png')"></span>
33+
</a>
34+
2835
The output contains found issues, categorized into errors, warnings, and notices:
2936

3037
<p align="center">

assets/css/style.scss

+41
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,44 @@
22
---
33

44
@import "jekyll-theme-minimal";
5+
6+
img {
7+
max-height: 50vh;
8+
}
9+
10+
/** LIGHTBOX MARKUP **/
11+
.lightbox {
12+
/* Default to hidden */
13+
display: none;
14+
15+
/* Overlay entire screen */
16+
position: fixed;
17+
z-index: 999;
18+
top: 0;
19+
left: 0;
20+
right: 0;
21+
bottom: 0;
22+
23+
/* A bit of padding around image */
24+
padding: 1em;
25+
26+
/* Translucent background */
27+
background: rgba(0, 0, 0, 0.8);
28+
}
29+
30+
/* Unhide the lightbox when it's the target */
31+
.lightbox:target {
32+
display: block;
33+
}
34+
35+
.lightbox span {
36+
/* Full width and height */
37+
display: block;
38+
width: 100%;
39+
height: 100%;
40+
41+
/* Size and position background image */
42+
background-position: center;
43+
background-repeat: no-repeat;
44+
background-size: contain;
45+
}

0 commit comments

Comments
 (0)