summaryrefslogtreecommitdiff
path: root/js/box-1.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/box-1.js')
-rw-r--r--js/box-1.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/js/box-1.js b/js/box-1.js
new file mode 100644
index 0000000..6e84c5c
--- /dev/null
+++ b/js/box-1.js
@@ -0,0 +1,19 @@
+window.addEventListener('load', () => {
+ window.Box1 = {
+ element: document.getElementById("box-1"),
+ observer: new IntersectionObserver((entries) => {
+ entries.forEach((entry) => {
+ if (entry.isIntersecting) {
+ document.getElementById("box-1").classList.add("visible");
+ document.getElementById("uni-foreground").classList.add("visible");
+ }
+ });
+ }, {
+ root: null,
+ rootMargin: "0px",
+ threshold: 0.5,
+ })
+ }
+
+ Box1.observer.observe(Box1.element);
+}); \ No newline at end of file