From b813dfa4c45706e4c5e190181cdbbd1d06bbaa4d Mon Sep 17 00:00:00 2001 From: MaxRobinsonTheGreat Date: Sat, 18 Dec 2021 10:34:19 -0600 Subject: [PATCH] max fps and active tab css --- dist/css/style.css | 4 ++++ dist/index.html | 2 +- src/Controllers/ControlPanel.js | 9 +++++++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/dist/css/style.css b/dist/css/style.css index a0624dc..1178ec3 100644 --- a/dist/css/style.css +++ b/dist/css/style.css @@ -134,6 +134,10 @@ button:active{ background-color: #81d2c7; color: black; } +.open-tab { + background-color: #66a39b; + color: black; +} .tab { grid-template-columns: repeat(2, 1fr); diff --git a/dist/index.html b/dist/index.html index 5585f26..d5a5c9a 100644 --- a/dist/index.html +++ b/dist/index.html @@ -59,7 +59,7 @@
-

About

+

About

Editor

Simulation Controls

Stats

diff --git a/src/Controllers/ControlPanel.js b/src/Controllers/ControlPanel.js index fcbe8b3..a7369a5 100644 --- a/src/Controllers/ControlPanel.js +++ b/src/Controllers/ControlPanel.js @@ -114,11 +114,14 @@ class ControlPanel { defineEngineSpeedControls(){ this.slider = document.getElementById("slider"); this.slider.oninput = function() { - this.fps = this.slider.value + const max_fps = 300; + this.fps = this.slider.value; + if (this.fps>=max_fps) this.fps = 1000; if (this.engine.running) { this.changeEngineSpeed(this.fps); } - $('#fps').text("Target FPS: "+this.fps); + let text = this.fps >= max_fps ? 'MAX' : this.fps; + $('#fps').text("Target FPS: "+text); }.bind(this); $('.pause-button').click(function() { $('.pause-button').find("i").toggleClass("fa fa-pause"); @@ -177,6 +180,8 @@ class ControlPanel { $('.tab').css('display', 'none'); var tab = '#'+this.id+'.tab'; $(tab).css('display', 'grid'); + $('.tabnav-item').removeClass('open-tab') + $('#'+this.id+'.tabnav-item').addClass('open-tab'); self.engine.organism_editor.is_active = (this.id == 'editor'); self.stats_panel.stopAutoRender(); if (this.id === 'stats') {