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 --}} -
+
{{!-- Left Navigation Rail --}}
@@ -8,17 +8,17 @@ @@ -32,110 +32,131 @@
{{!-- Body --}} -
+
-
+
- {{!-- Title --}} -
-

Crazy PHP

-
- - {{!-- Components --}} -
-

Components

-
+
- {{!-- Regular Btn --}} -
-

Regular Btn

-
+ {{!-- Title --}} +
+

Crazy PHP

+
- {{!-- Regular Btn | Floating --}} -
+ {{!-- Components --}} +
+

Components

+
+ {{!-- Regular Btn --}}
-
Btn Floating Round
+

Regular Btn

-
+ {{!-- Regular Btn | Floating --}} +
- +
+
Btn Floating Round
+
- +
- + - + -
+ -
+ - {{!-- Regular Btn | Floating --}} -
+
-
-
Btn Floating Box
-
+
-
+ {{!-- Regular Btn | Floating --}} +
- +
+
Btn Floating Box
+
- +
- + - + -
+ -
+ - {{!-- Regular Btn | Floating --}} -
+
- {{!-- Regular Btn | Extended --}} -
-
Btn Extended Box
-
+ -
+ {{!-- Regular Btn | Floating --}} +
- + {{!-- Regular Btn | Extended --}} +
+
Btn Extended Box
+
- +
- - - + -
+ -
+ + + - {{!-- Regular Btn | Floating --}} -
+
- {{!-- Regular Btn | Extended --}} -
-
Btn Extended Round
-
+ -
+ {{!-- Regular Btn | Floating --}} +
- + {{!-- Regular Btn | Extended --}} +
+
Btn Extended Round
+
- +
- - - + -
+ + + + + + +
- + + +
+ + {{!-- Scroll spy --}} +