Skip to content

Commit

Permalink
chore(lib): Remove smooth-scroll
Browse files Browse the repository at this point in the history
Replace it with scroll-behavior,
See deprecation notice cferdinandi/smooth-scroll@41237da

Signed-off-by: Khusika Dhamar Gusti <[email protected]>
  • Loading branch information
Khusika Dhamar Gusti committed May 11, 2021
1 parent 490e00b commit 42c726d
Show file tree
Hide file tree
Showing 17 changed files with 11 additions and 32 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ I hope you will LoveIt ❤️!
* **Custom style** shortcode
* **Custom script** shortcode
* **Animated typing** supported by [TypeIt](https://typeitjs.com/)
* **Dynamic scroll** supported by [Smooth Scroll](https://github.com/cferdinandi/smooth-scroll)
* **Cookie consent banner** supported by [cookieconsent](https://github.com/osano/cookieconsent)
* ...

Expand Down Expand Up @@ -160,7 +159,6 @@ Thanks to the authors of following resources included in the theme:
* [Font Awesome](https://fontawesome.com/)
* [Simple Icons](https://github.com/simple-icons/simple-icons)
* [Animate.css](https://daneden.github.io/animate.css/)
* [Smooth Scroll](https://github.com/cferdinandi/smooth-scroll)
* [autocomplete.js](https://github.com/algolia/autocomplete.js)
* [Lunr.js](https://lunrjs.com/)
* [algoliasearch](https://github.com/algolia/algoliasearch-client-javascript)
Expand Down
2 changes: 0 additions & 2 deletions README.zh-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@
* 支持**自定义样式**的 shortcode
* 支持**自定义脚本**的 shortcode
* 支持基于 [TypeIt](https://typeitjs.com/)**打字动画** shortcode
* 支持基于 [Smooth Scroll](https://github.com/cferdinandi/smooth-scroll)**滚动动画**
* 支持基于 [cookieconsent](https://github.com/osano/cookieconsent)**Cookie 许可横幅**
* ...

Expand Down Expand Up @@ -155,7 +154,6 @@ LoveIt 主题中用到了以下项目,感谢它们的作者:
* [Font Awesome](https://fontawesome.com/)
* [Simple Icons](https://github.com/simple-icons/simple-icons)
* [Animate.css](https://daneden.github.io/animate.css/)
* [Smooth Scroll](https://github.com/cferdinandi/smooth-scroll)
* [autocomplete.js](https://github.com/algolia/autocomplete.js)
* [Lunr.js](https://lunrjs.com/)
* [algoliasearch](https://github.com/algolia/algoliasearch-client-javascript)
Expand Down
1 change: 1 addition & 0 deletions assets/css/_core/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ html {
font-size: $global-font-size;
line-height: $global-line-height;
width:100%;
scroll-behavior: smooth;
}

/* scrollbar, only support webkit */
Expand Down
6 changes: 6 additions & 0 deletions assets/css/_core/_media.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
@media screen and (prefers-reduced-motion: reduce) {
html {
scroll-behavior: auto;
}
}

@media only screen and (max-width: 2560px) {
.page {
width: 80%;
Expand Down
2 changes: 0 additions & 2 deletions assets/data/cdn/jsdelivr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ libFiles:
fontawesomeFreeCSS: '@fortawesome/[email protected]/css/all.min.css'
# [email protected] https://github.com/animate-css/animate.css
animateCSS: [email protected]/animate.min.css
# [email protected] https://github.com/cferdinandi/smooth-scroll
smoothScrollJS: [email protected]/dist/smooth-scroll.min.js
# [email protected] https://github.com/algolia/autocomplete.js
autocompleteJS: [email protected]/dist/autocomplete.min.js
# [email protected] 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
2 changes: 1 addition & 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.

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

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
@@ -1,7 +1,6 @@
[email protected] https://fontawesome.com/
[email protected] https://github.com/simple-icons/simple-icons
[email protected] https://github.com/animate-css/animate.css
[email protected] https://github.com/cferdinandi/smooth-scroll
[email protected] https://github.com/algolia/autocomplete.js
[email protected] https://lunrjs.com/
[email protected] 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.

2 changes: 0 additions & 2 deletions exampleSite/content/about/index.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ math:
* :(fas fa-align-left fa-fw): **Custom style** shortcode
* :(fab fa-js-square fa-fw): **Custom script** shortcode
* :(fas fa-i-cursor fa-fw): **Animated typing** supported by [TypeIt](https://typeitjs.com/)
* :(fas fa-arrow-down fa-fw): **Dynamic scroll** supported by [Smooth Scroll](https://github.com/cferdinandi/smooth-scroll)
* :(fas fa-cookie-bite fa-fw): **Cookie consent banner** supported by [cookieconsent](https://github.com/osano/cookieconsent)
* ...

Expand All @@ -95,7 +94,6 @@ Thanks to the authors of following resources included in the theme:
* [Font Awesome](https://fontawesome.com/)
* [Simple Icons](https://github.com/simple-icons/simple-icons)
* [Animate.css](https://daneden.github.io/animate.css/)
* [Smooth Scroll](https://github.com/cferdinandi/smooth-scroll)
* [autocomplete.js](https://github.com/algolia/autocomplete.js)
* [Lunr.js](https://lunrjs.com/)
* [algoliasearch](https://github.com/algolia/algoliasearch-client-javascript)
Expand Down
2 changes: 0 additions & 2 deletions exampleSite/content/about/index.fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ Welcome to take the time to propose a translation by [:(fas fa-code-branch fa-fw
* :(fas fa-align-left fa-fw): **Custom style** shortcode
* :(fab fa-js-square fa-fw): **Custom script** shortcode
* :(fas fa-i-cursor fa-fw): **Animated typing** supported by [TypeIt](https://typeitjs.com/)
* :(fas fa-arrow-down fa-fw): **Dynamic scroll** supported by [Smooth Scroll](https://github.com/cferdinandi/smooth-scroll)
* :(fas fa-cookie-bite fa-fw): **Cookie consent banner** supported by [cookieconsent](https://github.com/osano/cookieconsent)
* ...

Expand All @@ -100,7 +99,6 @@ Thanks to the authors of following resources included in the theme:
* [Font Awesome](https://fontawesome.com/)
* [Simple Icons](https://github.com/simple-icons/simple-icons)
* [Animate.css](https://daneden.github.io/animate.css/)
* [Smooth Scroll](https://github.com/cferdinandi/smooth-scroll)
* [autocomplete.js](https://github.com/algolia/autocomplete.js)
* [Lunr.js](https://lunrjs.com/)
* [algoliasearch](https://github.com/algolia/algoliasearch-client-javascript)
Expand Down
2 changes: 0 additions & 2 deletions exampleSite/content/about/index.zh-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ math:
* :(fas fa-align-left fa-fw): 支持**自定义样式**的 shortcode
* :(fab fa-js-square fa-fw): 支持**自定义脚本**的 shortcode
* :(fas fa-i-cursor fa-fw): 支持基于 [TypeIt](https://typeitjs.com/)**打字动画** shortcode
* :(fas fa-arrow-down fa-fw): 支持基于 [Smooth Scroll](https://github.com/cferdinandi/smooth-scroll)**滚动动画**
* :(fas fa-cookie-bite fa-fw): 支持基于 [cookieconsent](https://github.com/osano/cookieconsent)**Cookie 许可横幅**
* ...

Expand All @@ -95,7 +94,6 @@ LoveIt 主题中用到了以下项目,感谢它们的作者:
* [Font Awesome](https://fontawesome.com/)
* [Simple Icons](https://github.com/simple-icons/simple-icons)
* [Animate.css](https://daneden.github.io/animate.css/)
* [Smooth Scroll](https://github.com/cferdinandi/smooth-scroll)
* [autocomplete.js](https://github.com/algolia/autocomplete.js)
* [Lunr.js](https://lunrjs.com/)
* [algoliasearch](https://github.com/algolia/algoliasearch-client-javascript)
Expand Down
4 changes: 0 additions & 4 deletions layouts/partials/assets.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@
{{- $style := dict "Source" $source "Fingerprint" $fingerprint -}}
{{- partial "plugin/style.html" $style -}}

{{- /* 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

Large diffs are not rendered by default.

5 changes: 0 additions & 5 deletions src/js/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -637,10 +637,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 @@ -723,7 +719,6 @@ class Theme {
this.initHighlight();
this.initTable();
this.initHeaderLink();
this.initSmoothScroll();
this.initMath();
this.initMermaid();
this.initEcharts();
Expand Down

0 comments on commit 42c726d

Please sign in to comment.