diff options
| author | Mhykol <mchaeldonald62@pm.me> | 2024-06-16 23:07:37 -0400 |
|---|---|---|
| committer | Mhykol <mchaeldonald62@pm.me> | 2024-06-16 23:07:37 -0400 |
| commit | 2cd055553b61909703850ff780e852c47bc0c749 (patch) | |
| tree | 034572675ea833dd2953fc1a5af9c4ffc902324c /examples/assets/js/index.js | |
| parent | 1f25435e48e603671d5d75901515f0ac08d81e39 (diff) | |
Added examples for assets
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() |
