From eb086135300ad51f29d3c60e8c7a9c426eb93f4c Mon Sep 17 00:00:00 2001 From: sanjayk03-dev Date: Mon, 14 Oct 2024 11:50:25 +0530 Subject: [PATCH] rotary button style --- src/js/app.js | 5 +++++ src/pug/index.pug | 5 ++--- src/stylus/style.styl | 16 ++++++++++++++++ 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/js/app.js b/src/js/app.js index a513d2d..6add4dd 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -236,6 +236,11 @@ module.exports = new Vue({ return msgs; }, + + is_rotary_active: function() { + if(this.config.motors[2]['axis'] == 'Y') return false; + return true; + }, }, ready: function() { diff --git a/src/pug/index.pug b/src/pug/index.pug index 253db33..4246d94 100644 --- a/src/pug/index.pug +++ b/src/pug/index.pug @@ -89,9 +89,8 @@ html(lang="en") v-if="80 <= state.rpi_temp", title="Raspberry Pi temperature too high.") - .rotary - button(@click="toggle_rotary") - img(src="/images/rotary.svg", alt="rotary") + button.rotary(:class="is_rotary_active && 'active'", @click="toggle_rotary") + img(src="/images/rotary.svg", alt="rotary") .whitespace diff --git a/src/stylus/style.styl b/src/stylus/style.styl index 8b58fe8..b345a7d 100644 --- a/src/stylus/style.styl +++ b/src/stylus/style.styl @@ -1028,6 +1028,22 @@ tt.save font-size 90% line-height 1.5 white-space pre-line + + .rotary + border none + background transparent + cursor pointer + width 100px + height 100px + border-radius 100px + margin 20px 20px 0 0 + display flex + justify-content center + align-items center + + &.active + border 1px solid #54ed54 + fill #ccffcb .modal-mask position fixed