From 455f78b178f63c10ac9a9354bde16b0d8f06531f Mon Sep 17 00:00:00 2001 From: Liam Swayne Date: Thu, 28 Dec 2023 23:50:48 -0500 Subject: [PATCH] Replace var declarations with let declarations (#576) * Replace var declaration with let declaration --- src/interface/desktop/loading-animation.js | 8 ++++---- src/interface/desktop/main.js | 4 ++-- src/khoj/interface/web/assets/utils.js | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/interface/desktop/loading-animation.js b/src/interface/desktop/loading-animation.js index d9bffb57..8d7b2fc0 100644 --- a/src/interface/desktop/loading-animation.js +++ b/src/interface/desktop/loading-animation.js @@ -1,4 +1,4 @@ -var $wrap = document.getElementById('loading-animation'), +let $wrap = document.getElementById('loading-animation'), canvassize = 380, @@ -29,7 +29,7 @@ mesh = new THREE.Mesh( new THREE.TubeGeometry(new (THREE.Curve.create(function() {}, function(percent) { - var x = length*Math.sin(pi2*percent), + let x = length*Math.sin(pi2*percent), y = radius*Math.cos(pi2*3*percent), z, t; @@ -63,7 +63,7 @@ group.add(ring); // fake shadow (function() { - var plain, i; + let plain, i; for (i = 0; i < 10; i++) { plain = new THREE.Mesh(new THREE.PlaneGeometry(length*2+1, radius*3, 1), new THREE.MeshBasicMaterial({color: 0xd1684e, transparent: true, opacity: 0.15})); plain.position.z = -2.5+i*0.5; @@ -94,7 +94,7 @@ function tilt(percent) { } function render() { - var progress; + let progress; animatestep = Math.max(0, Math.min(240, toend ? animatestep+1 : animatestep-4)); acceleration = easing(animatestep, 0, 1, 240); diff --git a/src/interface/desktop/main.js b/src/interface/desktop/main.js index 4325c1b2..4bb087d9 100644 --- a/src/interface/desktop/main.js +++ b/src/interface/desktop/main.js @@ -68,7 +68,7 @@ const schema = { }; let syncing = false; -var state = {} +let state = {} const store = new Store({ schema }); console.log(store); @@ -384,7 +384,7 @@ const createWindow = (tab = 'chat.html') => { firstRun = false; // Create splash screen - var splash = new BrowserWindow({width: 400, height: 400, transparent: true, frame: false, alwaysOnTop: true}); + let splash = new BrowserWindow({width: 400, height: 400, transparent: true, frame: false, alwaysOnTop: true}); splash.setOpacity(1.0); splash.setBackgroundColor('#d16b4e'); splash.loadFile('splash.html'); diff --git a/src/khoj/interface/web/assets/utils.js b/src/khoj/interface/web/assets/utils.js index 0d513146..43eca02c 100644 --- a/src/khoj/interface/web/assets/utils.js +++ b/src/khoj/interface/web/assets/utils.js @@ -1,6 +1,6 @@ // Toggle the navigation menu function toggleMenu() { - var menu = document.getElementById("khoj-nav-menu"); + let menu = document.getElementById("khoj-nav-menu"); menu.classList.toggle("show"); }