Skip to content

Commit

Permalink
'format fix'
Browse files Browse the repository at this point in the history
  • Loading branch information
bintus-ux committed Nov 19, 2024
1 parent fed3dd0 commit f9efe04
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 50 deletions.
67 changes: 33 additions & 34 deletions assets/js/scrollToTop.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,34 @@
document.addEventListener("DOMContentLoaded", function () {
let scrollToTopBtn = document.getElementById("scrollToTopBtn");
let footer = document.querySelector(".td-footer");

if (!scrollToTopBtn || !footer) return;

function adjustButtonPosition() {
let footerTop = footer.getBoundingClientRect().top;
let windowHeight = window.innerHeight;

if (footerTop < windowHeight + 40) {
scrollToTopBtn.style.bottom = windowHeight - footerTop + 40 + "px";
} else {
scrollToTopBtn.style.bottom = "40px";
}
document.addEventListener('DOMContentLoaded', function () {
let scrollToTopBtn = document.getElementById('scrollToTopBtn');
let footer = document.querySelector('.td-footer');

if (!scrollToTopBtn || !footer) return;

function adjustButtonPosition() {
let footerTop = footer.getBoundingClientRect().top;
let windowHeight = window.innerHeight;

if (footerTop < windowHeight + 40) {
scrollToTopBtn.style.bottom = windowHeight - footerTop + 40 + 'px';
} else {
scrollToTopBtn.style.bottom = '40px';
}

window.onscroll = function () {
if (
document.body.scrollTop > 200 ||
document.documentElement.scrollTop > 200
) {
scrollToTopBtn.style.display = "block";
} else {
scrollToTopBtn.style.display = "none";
}

adjustButtonPosition();
};

scrollToTopBtn.onclick = function () {
window.scrollTo({ top: 0, behavior: "smooth" });
};
});
}

window.onscroll = function () {
if (
document.body.scrollTop > 200 ||
document.documentElement.scrollTop > 200
) {
scrollToTopBtn.style.display = 'block';
} else {
scrollToTopBtn.style.display = 'none';
}

adjustButtonPosition();
};

scrollToTopBtn.onclick = function () {
window.scrollTo({ top: 0, behavior: 'smooth' });
};
});
28 changes: 12 additions & 16 deletions assets/scss/_styles_project.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@
margin-top: 1rem;
margin-bottom: 1rem;

>ul {
> ul {
list-style: none;
margin: 0;
padding: 0;

>li {
> li {
display: inline;

>a {
> a {
@extend .btn;
margin: 0.25rem;

Expand All @@ -50,8 +50,7 @@

>ul>li>a

/*, > p > a*/
{
/*, > p > a*/ {
@extend .btn-lg;
@extend .btn-secondary;
}
Expand All @@ -60,7 +59,7 @@
.l-primary-buttons {
@extend .l-buttons;

>ul>li>a {
> ul > li > a {
@extend .btn-lg;
@extend .btn-primary;
}
Expand All @@ -73,8 +72,7 @@

>ul>li>a

/*, > p > a*/
{
/*, > p > a*/ {
@extend .btn-lg;
@extend .btn-primary;
padding: 20px;
Expand All @@ -89,8 +87,7 @@

>ul>li>a

/*, > p > a*/
{
/*, > p > a*/ {
@extend .btn-lg;
@extend .btn-secondary;
padding: 20px;
Expand Down Expand Up @@ -180,7 +177,7 @@
.community-contribution {
text-align: center;

&>p {
& > p {
font-size: $h3-font-size;
font-weight: $headings-font-weight;
line-height: $headings-line-height;
Expand Down Expand Up @@ -337,10 +334,9 @@ details {
// Workaround for iOS and macOS Safari 17+. For details see:
// https://github.com/open-telemetry/opentelemetry.io/issues/3538

.td-content .highlight>pre {

>.click-to-copy,
>code {
.td-content .highlight > pre {
> .click-to-copy,
> code {
overflow-y: auto;
}
}
Expand All @@ -361,4 +357,4 @@ details {
z-index: 1000;
border-radius: 50%;
position: fixed;
}
}

0 comments on commit f9efe04

Please sign in to comment.