From 89bf7bd6a7435614a570b74c558d47d81f6c298c Mon Sep 17 00:00:00 2001 From: Kieran Farr Date: Thu, 6 Jul 2023 12:58:00 -0700 Subject: [PATCH] lint fix --- src/index.js | 20 ++++++++++---------- src/json-utils.js | 14 +++++++------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/index.js b/src/index.js index de4198c52..8339c10ee 100644 --- a/src/index.js +++ b/src/index.js @@ -368,17 +368,17 @@ AFRAME.registerComponent('street-environment', { const sky = this.sky; const light1 = this.light1; const light2 = this.light2; - + if (this.data.preset === 'night') { - light1.setAttribute('light', 'intensity', 0.5 ); - light2.setAttribute('light', 'intensity', 0.15 ); + light1.setAttribute('light', 'intensity', 0.5); + light2.setAttribute('light', 'intensity', 0.15); sky.setAttribute('color', '#444'); sky.setAttribute('src', '#sky-night'); sky.setAttribute('rotation', '0 0 0'); } else { // day // TODO: create a parent with children - light1.setAttribute('light', 'intensity', 2 ); - light2.setAttribute('light', 'intensity', 0.6 ); + light1.setAttribute('light', 'intensity', 2); + light2.setAttribute('light', 'intensity', 0.6); sky.setAttribute('color', '#FFF'); sky.setAttribute('src', '#sky'); sky.setAttribute('rotation', '0 255 0'); @@ -386,26 +386,26 @@ AFRAME.registerComponent('street-environment', { }, init: function () { const el = this.el; - + this.light1 = document.createElement('a-entity'); const light1 = this.light1; light1.setAttribute('id', 'env-light1'); - light1.setAttribute('light', { type: 'ambient', color: '#FFF'}); + light1.setAttribute('light', { type: 'ambient', color: '#FFF' }); el.appendChild(light1); this.light2 = document.createElement('a-entity'); const light2 = this.light2; light2.setAttribute('id', 'env-light2'); light2.setAttribute('position', { x: 0.5, y: 1, z: -1 }); - light2.setAttribute('light', { type: 'directional', color: '#FFF'}); + light2.setAttribute('light', { type: 'directional', color: '#FFF' }); el.appendChild(light2); this.sky = document.createElement('a-sky'); const sky = this.sky; sky.setAttribute('id', 'env-sky'); - el.appendChild(sky); + el.appendChild(sky); }, - update: function (oldData) { + update: function (oldData) { this.setEnvOption(); } }); diff --git a/src/json-utils.js b/src/json-utils.js index f4c1a7c0e..af45e94f4 100644 --- a/src/json-utils.js +++ b/src/json-utils.js @@ -44,7 +44,7 @@ function getElementData (entity) { function getAttributes (entity) { const elemObj = {}; - elemObj['element'] = entity.tagName.toLowerCase(); + elemObj['element'] = entity.tagName.toLowerCase(); if (entity.id) { elemObj['id'] = entity.id; @@ -58,7 +58,7 @@ function getAttributes (entity) { } if (entity.getAttribute('data-layer-name')) { elemObj['data-layer-name'] = entity.getAttribute('data-layer-name'); - } + } const entityComponents = entity.components; if (entityComponents) { @@ -282,7 +282,7 @@ function getModifiedProperty (entity, componentName) { return diff; } -function createEntities (entitiesData, parentEl) { +function createEntities (entitiesData, parentEl) { const sceneElement = document.querySelector('a-scene'); const removeEntities = ['environment', 'layers-2d']; for (const entityData of entitiesData) { @@ -333,7 +333,7 @@ function createEntityFromObj (entityData, parentEl) { // define a primitive in advance to apply other primitive-specific geometry properties entity.setAttribute('geometry', 'primitive', entityData['primitive']); } - + if (entityData.id) { entity.setAttribute('id', entityData.id); } @@ -341,7 +341,7 @@ function createEntityFromObj (entityData, parentEl) { if (entityData.class) { entity.classList.add(...entityData.class); } - + if (entityData['data-layer-name']) { entity.setAttribute('data-layer-name', entityData['data-layer-name']); } @@ -364,5 +364,5 @@ function createEntityFromObj (entityData, parentEl) { for (const childEntityData of entityData.children) { createEntityFromObj(childEntityData, entity); } - } -} + } +}