diff options
Diffstat (limited to 'examples/assets/js/index.js')
| -rw-r--r-- | examples/assets/js/index.js | 22 |
1 files changed, 22 insertions, 0 deletions
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() |
