diff --git a/.gitignore b/.gitignore index 496ee2ca..2608ec26 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -.DS_Store \ No newline at end of file +.DS_Store +.vscode \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index fc73658c..a0ca1ab6 100644 --- a/docs/index.html +++ b/docs/index.html @@ -9,7 +9,7 @@ - +

Vocabulary

@@ -1019,7 +1019,8 @@

Name

--> - +Back to Top + diff --git a/specimen/contexts/blog-index.html b/specimen/contexts/blog-index.html index 514d54cb..eb128c75 100644 --- a/specimen/contexts/blog-index.html +++ b/specimen/contexts/blog-index.html @@ -16,7 +16,7 @@ Skip to content - +

@@ -578,7 +578,8 @@

Support Our Work

- + Back to Top + diff --git a/specimen/contexts/blog-post.html b/specimen/contexts/blog-post.html index dccb5d3a..81878384 100644 --- a/specimen/contexts/blog-post.html +++ b/specimen/contexts/blog-post.html @@ -16,7 +16,7 @@ Skip to content - +

@@ -334,7 +334,8 @@

Support Our Work

- + Back to Top + diff --git a/specimen/contexts/default-page.html b/specimen/contexts/default-page.html index 123139c3..3510794a 100644 --- a/specimen/contexts/default-page.html +++ b/specimen/contexts/default-page.html @@ -16,7 +16,7 @@ Skip to content - +

@@ -265,7 +265,8 @@

Support Our Work

- + Back to Top + diff --git a/specimen/contexts/home-index.html b/specimen/contexts/home-index.html index 627192d6..e231bd81 100644 --- a/specimen/contexts/home-index.html +++ b/specimen/contexts/home-index.html @@ -16,7 +16,7 @@ Skip to content - +

@@ -440,7 +440,8 @@

Support Our Work

- + Back to Top + diff --git a/specimen/contexts/license-page.html b/specimen/contexts/license-page.html index 519a047e..10b65ea8 100644 --- a/specimen/contexts/license-page.html +++ b/specimen/contexts/license-page.html @@ -16,7 +16,7 @@ Skip to content - +

@@ -169,7 +169,8 @@

Support Our Work

- + Back to Top + diff --git a/specimen/contexts/person-page.html b/specimen/contexts/person-page.html index ad9510e7..de7614b7 100644 --- a/specimen/contexts/person-page.html +++ b/specimen/contexts/person-page.html @@ -16,7 +16,7 @@ Skip to content - +

@@ -263,7 +263,8 @@

Support Our Work

- + Back to Top + diff --git a/specimen/contexts/program-index.html b/specimen/contexts/program-index.html index cbfcd3a6..0e337567 100644 --- a/specimen/contexts/program-index.html +++ b/specimen/contexts/program-index.html @@ -16,7 +16,7 @@ Skip to content - +

@@ -268,7 +268,8 @@

Support Our Work

- + Back to Top + diff --git a/specimen/contexts/program-page.html b/specimen/contexts/program-page.html index 4c596fc0..3776ca87 100644 --- a/specimen/contexts/program-page.html +++ b/specimen/contexts/program-page.html @@ -16,7 +16,7 @@ Skip to content - +

@@ -247,7 +247,8 @@

Support Our Work

- + Back to Top + diff --git a/specimen/contexts/search-index.html b/specimen/contexts/search-index.html index ab5a1494..c49caa16 100644 --- a/specimen/contexts/search-index.html +++ b/specimen/contexts/search-index.html @@ -16,7 +16,7 @@ Skip to content - +

@@ -286,7 +286,8 @@

Support Our Work

- + Back to Top + diff --git a/specimen/contexts/team-index.html b/specimen/contexts/team-index.html index 1d895485..fadca4c4 100644 --- a/specimen/contexts/team-index.html +++ b/specimen/contexts/team-index.html @@ -16,7 +16,7 @@ Skip to content - +

@@ -221,7 +221,8 @@

Support Our Work

- + Back to Top + diff --git a/specimen/contexts/walkthrough-page.html b/specimen/contexts/walkthrough-page.html index f3dd379d..767b55fe 100644 --- a/specimen/contexts/walkthrough-page.html +++ b/specimen/contexts/walkthrough-page.html @@ -16,7 +16,7 @@ Skip to content - +

@@ -177,7 +177,8 @@

Support Our Work

- + Back to Top + diff --git a/specimen/style.css b/specimen/style.css index 2231bd96..dea8e0e6 100644 --- a/specimen/style.css +++ b/specimen/style.css @@ -1,2 +1,36 @@ @import '../src/css/vocabulary.css' layer(vocabulary); @import '../specimen/tests/grid-test.css' layer(vocabulary); + +:root { + scroll-behavior: smooth; +} + +.scroll-to-top { + position: fixed; + bottom: 20px; + right: 20px; + background-color: #007bff; + color: white; + text-decoration: none; + padding: 10px 15px; + border-radius: 5px; + transition: opacity 0.3s, visibility 0.3s; + z-index: 1000; +} + +.scroll-to-top:focus { + outline: 2px solid #05b5da; +} +.show { + opacity: 1; + visibility: visible; +} +.hide { + opacity: 0; + visibility: hidden; +} +@media (max-width: 600px) { + .scroll-to-top { + display: none; + } +} diff --git a/src/js/scroll.js b/src/js/scroll.js new file mode 100644 index 00000000..13b27543 --- /dev/null +++ b/src/js/scroll.js @@ -0,0 +1,16 @@ +document.addEventListener('DOMContentLoaded', function () { + const scrollThreshold = 1000; + const scrollToTopButton = document.querySelector('.scroll-to-top'); + + const scrollToTop = () => { + if (window.scrollY > scrollThreshold) { + scrollToTopButton.classList.add('show'); + scrollToTopButton.classList.remove('hide'); + } else { + scrollToTopButton.classList.remove('show'); + scrollToTopButton.classList.add('hide'); + } + }; + + window.addEventListener('scroll', scrollToTop); +});