summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/assets/js/footer.js19
-rw-r--r--examples/assets/js/index.js22
-rw-r--r--examples/assets/js/loading.js16
3 files changed, 57 insertions, 0 deletions
diff --git a/examples/assets/js/footer.js b/examples/assets/js/footer.js
new file mode 100644
index 0000000..df46a42
--- /dev/null
+++ b/examples/assets/js/footer.js
@@ -0,0 +1,19 @@
+class Footer {
+ constructor() {}
+
+ Init() {this.#EventListener()}
+
+ #EventListener() {
+ const links = document.getElementsByClassName('footer-links')
+ for(let i = 0; i < links.length; i++) {links[i].addEventListener('click', () => this.#Copy(links[i].textContent))}
+ }
+ #Copy(x) {
+ navigator.clipboard.writeText(x).then(() => {
+ console.log('copied')
+ }).catch((err) => {
+ console.error(err)
+ })
+ }
+}
+
+new Footer().Init()
diff --git a/examples/assets/js/index.js b/examples/assets/js/index.js
new file mode 100644
index 0000000..32e8cf5
--- /dev/null
+++ b/examples/assets/js/index.js
@@ -0,0 +1,22 @@
+class Index {
+ constructor() {}
+
+ Init() {this.#EventListener()}
+
+ #EventListener() {
+ const about = document.getElementById('index-about')
+ const readBlogs = document.getElementsByClassName('index-readblogs')
+ const websites = {
+ helpinghands: document.getElementById('helpinghands'),
+ goodhandhauling: document.getElementById('goodhandhauling')
+ }
+
+ for (let i = 0; i < readBlogs.length; i++) readBlogs[i].addEventListener('click', () => window.location.href = '/blog')
+
+ about.addEventListener('click', () => window.location.href = '/about')
+ websites.helpinghands.addEventListener('click', () => window.location.href = 'https://helpinghandsadultcare.org/')
+ websites.goodhandhauling.addEventListener('click', () => window.location.href = 'https://goodhandhauling.com/')
+ }
+}
+
+new Index().Init()
diff --git a/examples/assets/js/loading.js b/examples/assets/js/loading.js
new file mode 100644
index 0000000..8fff0f3
--- /dev/null
+++ b/examples/assets/js/loading.js
@@ -0,0 +1,16 @@
+class Loading {
+ constructor() {
+ this.object = {
+ loadingScreen: document.getElementById('loading')
+ }
+ }
+
+ Stop() {
+ this.object.loadingScreen.style.opacity = 0;
+ this.object.loadingScreen.style.zIndex = -9999;
+ }
+ Start() {
+ this.object.loadingScreen.style.opacity = 1;
+ this.object.loadingScreen.style.zIndex = 9999;
+ }
+}