From 7cc8cee0fdc6ff8e350e6a7813fd9a06d5c9ce9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Quentin=20Hocde=CC=81?= Date: Fri, 5 Mar 2021 09:22:43 -0500 Subject: [PATCH] Updates coding styles Scroll.js and app.js --- assets/scripts/modules/Scroll.js | 12 ++-- www/index.html | 96 ++++++++++++++++++-------------- 2 files changed, 59 insertions(+), 49 deletions(-) diff --git a/assets/scripts/modules/Scroll.js b/assets/scripts/modules/Scroll.js index 1169f0f..30f0e33 100644 --- a/assets/scripts/modules/Scroll.js +++ b/assets/scripts/modules/Scroll.js @@ -1,4 +1,4 @@ -import { module } from 'modujs'; +import { module } from 'modujs'; import LocomotiveScroll from 'locomotive-scroll'; export default class extends module { @@ -13,9 +13,9 @@ export default class extends module { smooth: true }); - this.scroll.on('call', (func,way,obj,id) => { + this.scroll.on('call', (func, way, obj, id) => { // Using modularJS - this.call(func[0],{way,obj},func[1],func[2]); + this.call(func[0], { way, obj }, func[1], func[2]); }); this.scroll.on('scroll', (args) => { @@ -25,11 +25,11 @@ export default class extends module { toggleLazy(args) { let src = this.getData('lazy', args.obj.el) - if(src.length) { - if(args.obj.el.tagName == "IMG") { + if (src.length) { + if (args.obj.el.tagName === 'IMG') { args.obj.el.src = src } else { - args.obj.el.style.backgroundImage = `url(${src})` + args.obj.el.style.backgroundImage = `url('${src}')` } this.setData('lazy', '', args.obj.el) } diff --git a/www/index.html b/www/index.html index 5182049..de058dd 100644 --- a/www/index.html +++ b/www/index.html @@ -1,20 +1,21 @@ - - - Boilerplate - - - - - - - - - - - + - + - - - -
-
-
-

Boilerplate

- -
+ + -
-
-

Hello

-
-
+ +
+
+
+ +

Boilerplate

+
+ +
-
-

Made with 🚂

-
-
+
+
+

Hello

+
+
+ +
+

Made with 🚂

+
+
- - + + + + + + - - -