refactor(gallery): rewrite gallery (#79)

closes https://github.com/CaiJimmy/hugo-theme-stack/issues/70
This commit is contained in:
Jimmy Cai
2020-12-22 19:35:37 +01:00
committed by GitHub
parent 54571f036b
commit 31c42bcfe7
5 changed files with 109 additions and 301 deletions
+4 -4
View File
@@ -5,8 +5,7 @@
* @website: https://jimmycai.com
* @link: https://github.com/CaiJimmy/hugo-theme-stack
*/
import { createGallery } from "ts/gallery"
import StackGallery from "ts/gallery";
import { getColor } from 'ts/color';
import menu from 'ts/menu';
import createElement from 'ts/createElement';
@@ -18,8 +17,9 @@ let Stack = {
*/
menu();
if (document.querySelector('.article-content')) {
createGallery('.article-content');
const articleContent = document.querySelector('.article-content') as HTMLElement;
if (articleContent) {
new StackGallery(articleContent);
}
/**