Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions docs/stylesheets/extra.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
.sg-github-star {
position: fixed;
top: 0.64rem;
right: 5.25rem;
z-index: 5;
height: 1.5rem;
align-items: center;
display: inline-flex;
height: 2.4rem;
line-height: 1;
margin: 0 0.35rem 0 0.55rem;
visibility: hidden;
}

.sg-github-star--ready {
visibility: visible;
}

.sg-github-star iframe {
display: block;
}

@media screen and (max-width: 76.1875em) {
@media screen and (max-width: 44.9375em) {
.sg-github-star {
display: none;
}
Expand Down
23 changes: 21 additions & 2 deletions overrides/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

{% block extrahead %}
{{ super() }}
<script async defer src="https://buttons.github.io/buttons.js"></script>
{% endblock %}

{% block header %}
{{ super() }}
<div class="sg-github-star">
<div class="sg-github-star" data-md-component="sg-github-star">
<a
class="github-button"
href="https://github.com/aitechnav/Sentinel_Guard"
Expand All @@ -19,4 +18,24 @@
aria-label="Star aitechnav/Sentinel_Guard on GitHub"
>Star</a>
</div>
<script>
(function () {
function placeSentinelGuardStar() {
var star = document.querySelector('[data-md-component="sg-github-star"]');
var palette = document.querySelector('.md-header__option');
if (!star || !palette || !palette.parentNode) return;
if (star.nextElementSibling !== palette) {
palette.parentNode.insertBefore(star, palette);
}
star.classList.add('sg-github-star--ready');
}

if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', placeSentinelGuardStar);
} else {
placeSentinelGuardStar();
}
})();
</script>
<script async defer src="https://buttons.github.io/buttons.js"></script>
{% endblock %}
Loading