diff --git a/resources/Environment/Component/RegularBtn/style.scss b/resources/Environment/Component/RegularBtn/style.scss index 33b1642..496b5c1 100644 --- a/resources/Environment/Component/RegularBtn/style.scss +++ b/resources/Environment/Component/RegularBtn/style.scss @@ -24,6 +24,18 @@ regular-btn { /* Floating */ &.btn-floating { + /* Fix side nav */ + margin: initial!important; + + /* i */ + i { + + /* Fix side nav */ + height: initial; + line-height: initial; + + } + /* Round */ &.btn-round { diff --git a/resources/Environment/Page/Home/index.ts b/resources/Environment/Page/Home/index.ts index adcd09b..abf7dc3 100644 --- a/resources/Environment/Page/Home/index.ts +++ b/resources/Environment/Page/Home/index.ts @@ -12,6 +12,7 @@ * Dependances */ const css = require("!!css-loader!sass-loader!./style.scss"); +import { M } from "@materializecss/materialize"; const html = require("./template.hbs"); import {Crazypage} from "crazyphp"; require("./style.scss"); @@ -71,6 +72,31 @@ export default class Home extends Crazypage { console.log("hello home"); + // Init scroll spy + this.initScrollSpy(); + + } + + /** + * Init Scroll Spy + * + * @return void + */ + private initScrollSpy = () => { + + // Get el + let els = document.querySelectorAll('.scrollspy'); + + // Check els + if(els.length) + + M.ScrollSpy.init(els, { + "activeClass": "active", + "getActiveElement": (id) => { + return 'a[href="#' + id + '"]'; + } + }); + } } diff --git a/resources/Environment/Page/Home/template.hbs b/resources/Environment/Page/Home/template.hbs index d14caf2..506d3b7 100644 --- a/resources/Environment/Page/Home/template.hbs +++ b/resources/Environment/Page/Home/template.hbs @@ -1,5 +1,5 @@ {{!-- Root --}} -