Footer Logo click should scroll to top on home page
rileywong311 opened this issue · comments
![image](https://private-user-images.githubusercontent.com/114180322/245645820-e9373c4b-ecbb-49f1-a2aa-e4ebaf730f3a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA2Nzc2NDMsIm5iZiI6MTcyMDY3NzM0MywicGF0aCI6Ii8xMTQxODAzMjIvMjQ1NjQ1ODIwLWU5MzczYzRiLWVjYmItNDlmMS1hMmFhLWU0ZWJhZjczMGYzYS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzExJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcxMVQwNTU1NDNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1iNjZkYTE2ZTk2MTA4NWI0MTBjMjNlM2I2YzFiNzQ3NWU3MWQ1Zjg2ZGFlODc2NTUyMzk3ZjBhNjY0ZTdhZjI5JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.fiscAUR4xWwvUApJzONOtG6Th0tvG96RvmhzAdobYMM)
This is a good first issue. SCU ACM members are especially encouraged to try this out.!
Clicking this SCU ACM logo on the footer takes you back to the homepage (via the Vue.js router). However, when already on the homepage it does nothing. It would be a nice feature to scroll back up to the top of the page when this is clicked on the homepage.
Likely, this involves the <element>.ScrollTo
/ <element>.ScrollIntoView
JavaScript function (and perhaps a Vue.js component method to run this). The element
will have to be accessed somehow. I've found ways to do this through the CSS id
styling, but there might be a way to do it with Vue.js refs.
For example, I've done something like this before:
async toHome() {
await this.$router.push('/')
const element = document.getElementById("Title");
element.scrollIntoView({behavior: 'smooth'});
},