-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
- Loading branch information
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
/* | ||
* MkDocs Material theme buttons have wrong colors for the theme | ||
* setting: | ||
* | ||
* palette: | ||
* scheme: default | ||
* primary: white | ||
* | ||
* Thus the following CSS overwrites the button background- and | ||
* text-colors. | ||
*/ | ||
.md-button { | ||
color: var(--md-accent-fg-color) !important; | ||
border-color: currentColor !important; | ||
} | ||
.md-button:focus, | ||
.md-button:hover { | ||
color: var(--md-primary-fg-color) !important; | ||
background-color: var(--md-accent-fg-color) !important; | ||
border-color: var(--md-accent-fg-color) !important; | ||
} | ||
|
||
/* | ||
* The nav title has a click handler to scroll to the top | ||
*/ | ||
.md-header-nav__title { | ||
cursor: pointer; | ||
} | ||
|
||
/* | ||
* Text alignment | ||
*/ | ||
.text-center { | ||
text-align: center; | ||
} | ||
|
||
/* | ||
* Custom CSS for images | ||
*/ | ||
.hidden { | ||
visibility: hidden; | ||
opacity: 0; | ||
transition: visibility 0s linear 300ms, opacity 300ms; | ||
} | ||
.visible { | ||
visibility: visible; | ||
opacity: 1; | ||
transition: visibility 0s linear 0s, opacity 300ms; | ||
} | ||
.fullscreen-image-background { | ||
z-index: 25; | ||
background-color: rgba(10, 10, 10, 0.5); | ||
position: fixed; | ||
bottom: 0; | ||
left: 0; | ||
right: 0; | ||
top: 0; | ||
} | ||
.fullscreen-image-background img { | ||
transition: opacity 1s; | ||
cursor: zoom-out; | ||
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); | ||
z-index: 100; | ||
position: fixed; | ||
left: 0; | ||
right: 0; | ||
top: 0; | ||
bottom: 0; | ||
margin: 1rem auto; | ||
max-height: calc(100vh - 2rem); | ||
width: auto; | ||
} | ||
.zoom { | ||
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); | ||
border-radius: 0.2rem; | ||
margin: 0.5rem; | ||
width: 25%; | ||
cursor: zoom-in; | ||
} | ||
.zoom-wrapper { | ||
display: flex; | ||
flex-direction: row; | ||
align-items: center; | ||
justify-content: center; | ||
flex-wrap: wrap; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Add click event handler for images with class="zoom" | ||
*/ | ||
document.querySelectorAll('img.zoom').forEach(item => { | ||
const p = item.parentElement; | ||
if (!p.classList.contains('processed')) { | ||
p.classList.add('processed'); | ||
if (p.querySelectorAll('img.zoom').length === p.children.length) { | ||
p.classList.add('zoom-wrapper'); | ||
} | ||
} | ||
item.addEventListener('click', function () { | ||
const img = document.getElementById('fullscreen-image-img'); | ||
img.setAttribute('src', this.getAttribute('src')); | ||
img.setAttribute('alt', this.getAttribute('alt')); | ||
|
||
const div = document.getElementById('fullscreen-image'); | ||
div.classList.replace('hidden', 'visible'); | ||
}) | ||
}); | ||
|
||
var div = document.createElement('div'); | ||
div.classList.add('fullscreen-image-background', 'hidden'); | ||
div.id = 'fullscreen-image'; | ||
var img = document.createElement('img'); | ||
img.id = 'fullscreen-image-img'; | ||
div.appendChild(img); | ||
|
||
div.addEventListener('click', function () { | ||
this.classList.replace('visible', 'hidden'); | ||
}); | ||
document.body.appendChild(div); |
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.