Skip to content

Commit

Permalink
remove smooth scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
HEIGE-PCloud committed Apr 6, 2021
1 parent fe1d58a commit a394d42
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 19 deletions.
7 changes: 7 additions & 0 deletions assets/css/_core/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ html {
font-size: $global-font-size;
line-height: $global-line-height;
width:100%;
scroll-behavior: auto;
}

@media screen and (prefers-reduced-motion: reduce) {
html {
scroll-behavior: auto;
}
}

/* scrollbar, only support webkit */
Expand Down
2 changes: 1 addition & 1 deletion assets/data/cdn/jsdelivr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ libFiles:
# animate.css@3.7.2 https://github.com/daneden/animate.css
animateCSS: animate.css/animate.min.css
# smooth-scroll@16.1.3 https://github.com/cferdinandi/smooth-scroll
smoothScrollJS: smooth-scroll/dist/smooth-scroll.min.js
# smoothScrollJS: smooth-scroll/dist/smooth-scroll.min.js
# autocomplete.js@0.37.1 https://github.com/algolia/autocomplete.js
autocompleteJS: autocomplete.js/dist/autocomplete.min.js
# lunr.js@2.3.8 https://lunrjs.com/
Expand Down
4 changes: 0 additions & 4 deletions assets/data/polyfill.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ theme:
- Promise
- fetch
- Element.prototype.after
smooth-scroll:
- Element.prototype.closest
- requestAnimationFrame
- CustomEvent
algoliasearch:
- Promise
- Object.entries
Expand Down
5 changes: 4 additions & 1 deletion assets/js/theme.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/js/theme.min.js.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion assets/lib/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ normalize.css@8.0.1 https://github.com/necolas/normalize.css
fontawesome-free@5.15.3 https://fontawesome.com/
simple-icons@4.18.0 https://github.com/simple-icons/simple-icons
animate.css@4.1.1 https://github.com/daneden/animate.css
smooth-scroll@16.1.3 https://github.com/cferdinandi/smooth-scroll
autocomplete.js@0.37.1 https://github.com/algolia/autocomplete.js
lunr.js@2.3.8 https://lunrjs.com/
algoliasearch@4.2.0 https://github.com/algolia/algoliasearch-client-javascript
Expand Down
2 changes: 0 additions & 2 deletions assets/lib/smooth-scroll/smooth-scroll.min.js

This file was deleted.

4 changes: 0 additions & 4 deletions layouts/partials/assets.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
{{- $fingerprint := .Scratch.Get "fingerprint" -}}
{{- $config := (.Scratch.Get "this").config -}}

{{- /* Smooth Scroll */ -}}
{{- $source := $cdn.smoothScrollJS | default "lib/smooth-scroll/smooth-scroll.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}

{{- /* Search */ -}}
{{- if .Site.Params.search | and .Site.Params.search.enable -}}
{{- $search := .Site.Params.search -}}
Expand Down
5 changes: 0 additions & 5 deletions src/js/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -624,10 +624,6 @@ class Theme {
}
}

initSmoothScroll() {
if (SmoothScroll) new SmoothScroll('[href^="#"]', { speed: 300, speedAsDuration: true, header: '#header-desktop' });
}

initCookieconsent() {
if (this.config.cookieconsent) cookieconsent.initialise(this.config.cookieconsent);
}
Expand Down Expand Up @@ -710,7 +706,6 @@ class Theme {
this.initHighlight();
this.initTable();
this.initHeaderLink();
this.initSmoothScroll();
this.initMath();
this.initMermaid();
this.initEcharts();
Expand Down

0 comments on commit a394d42

Please sign in to comment.