Skip to content

Commit 2a03ae5

Browse files
committed
Added scroll to top by changing the page
1 parent 776cddc commit 2a03ae5

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

‎src/assets/scss/app.scss‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
font-family: manrope, sans-serif;
88
}
99

10+
html {
11+
scroll-behavior: smooth;
12+
}
13+
1014
#page {
1115
max-width: 1200px;
1216
padding: 0px 20px;
@@ -21,6 +25,16 @@
2125
#markdown-contents {
2226
font-size: 21px;
2327

28+
code {
29+
background: #00000011;
30+
border-radius: 5px;
31+
padding: 0px 4px;
32+
}
33+
34+
code pre {
35+
font-size: 16px;
36+
}
37+
2438
h1, h2, h3 {
2539
border-bottom: 1.3px #CCC solid;
2640
padding-bottom: 10px;

‎src/router/index.js‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ const router = new VueRouter({
4848
routes
4949
})
5050

51+
router.afterEach(()=>{
52+
window.scrollTo(0, 0)
53+
})
54+
5155
router.beforeEach((to, from, next)=>{
5256
document.title = (to.meta.title || "404") + " | JavaWebStack"
5357
next()

0 commit comments

Comments
 (0)