Skip to content

Commit

Permalink
Clearing and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
onlaj committed Nov 4, 2021
1 parent 4418f2c commit 71d3fbb
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 73 deletions.
14 changes: 7 additions & 7 deletions lib/ledsettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from lib.functions import fastColorWipe, find_between, clamp
from neopixel import Color


class LedSettings:
def __init__(self, usersettings):

Expand Down Expand Up @@ -81,9 +82,8 @@ def __init__(self, usersettings):

self.sequence_number = 0

#if self.mode == "Disabled" and self.color_mode != "disabled":
# if self.mode == "Disabled" and self.color_mode != "disabled":
# usersettings.change_setting_value("color_mode", "disabled")


def add_instance(self, menu, ledstrip):
self.menu = menu
Expand All @@ -97,7 +97,7 @@ def addcolor(self):
self.usersettings.change_setting_value("multicolor", self.multicolor)
self.usersettings.change_setting_value("multicolor_range", self.multicolor_range)

#self.menu.update_multicolor(self.multicolor)
# self.menu.update_multicolor(self.multicolor)

def deletecolor(self, key):
del self.multicolor[int(key) - 1]
Expand All @@ -106,7 +106,7 @@ def deletecolor(self, key):
self.usersettings.change_setting_value("multicolor", self.multicolor)
self.usersettings.change_setting_value("multicolor_range", self.multicolor_range)

#self.menu.update_multicolor(self.multicolor)
# self.menu.update_multicolor(self.multicolor)
self.menu.go_back()

def change_multicolor(self, choice, location, value):
Expand Down Expand Up @@ -254,7 +254,7 @@ def get_adjacent_color(self, color):
def get_adjacent_colors(self):
return str(self.adjacent_red) + ", " + str(self.adjacent_green) + ", " + str(self.adjacent_blue)

def set_sequence(self, sequence, step, direct_step = False):
def set_sequence(self, sequence, step, direct_step=False):
try:
if int(step) == 0 or direct_step == True:
if direct_step == True:
Expand All @@ -270,7 +270,7 @@ def set_sequence(self, sequence, step, direct_step = False):
self.control_number = self.sequences_tree.getElementsByTagName("sequence_" + str(self.sequence_number))[
0].getElementsByTagName("control_number")[0].firstChild.nodeValue
self.count_steps = 1
#if(direct_step == False):
# if(direct_step == False):
self.sequence_active = True
self.sequence_active_name = sequence
while True:
Expand Down Expand Up @@ -559,4 +559,4 @@ def gradient_get_colors(self, position):
blue = ((position / self.ledstrip.led_number) * (self.gradient_end["blue"] - self.gradient_start["blue"])) + \
self.gradient_start["blue"]

return [round(red), round(green), round(blue)]
return [round(red), round(green), round(blue)]
14 changes: 9 additions & 5 deletions webinterface/templates/sequences.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
<button id="next_step_button" onclick="change_setting('next_step', '0')" class="z-10 transform
shadow-xl w-full h-20 bg-gray-100 dark:bg-gray-600 font-bold rounded-lg mt-4">
<div class="absolute top-0 right-0 pt-2 flex items-center px-2 text-gray-700 dark:text-gray-200"
onclick="event.stopPropagation();this.parentElement.classList.toggle('big-button');document.getElementById('sequence_block').classList.toggle('height-80vw');">
onclick="event.stopPropagation();this.parentElement.classList.toggle('big-button');
document.getElementById('sequence_block').classList.toggle('height-80vw');">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24"
stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
Expand All @@ -54,7 +55,8 @@

<div class="flex-1 p-5 bg-gray-200 dark:bg-gray-700 shadow-xl rounded-lg">
<div id="sequence_edit"
class="w-10 flex-1 font-bold text-xl pb-2 text-gray-600 dark:text-gray-400 cursor-pointer pointer-events-auto opacity-100 animate-pulse"
class="w-10 flex-1 font-bold text-xl pb-2 text-gray-600 dark:text-gray-400 cursor-pointer
pointer-events-auto opacity-100 animate-pulse"
onclick="toggle_edit_sequence();">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24"
stroke="currentColor">
Expand Down Expand Up @@ -304,11 +306,13 @@
Save current settings to step
</label>
<button onclick="this.classList.add('hidden');
this.nextElementSibling.classList.remove('hidden')" class="w-full h-10 outline-none mb-2 bg-gray-100 dark:bg-gray-600 font-bold
this.nextElementSibling.classList.remove('hidden')"
class="w-full h-10 outline-none mb-2 bg-gray-100 dark:bg-gray-600 font-bold
h-4 py-2 px-2
rounded-2xl inline-flex items-center">
<svg xmlns="http://www.w3.org/2000/svg" class="h-8 w-full justify-items-center text-green-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
<svg xmlns="http://www.w3.org/2000/svg" class="h-8 w-full justify-items-center text-green-400"
fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"/>
</svg>
</button>
<button onclick="change_setting('save_led_settings_to_step',
Expand Down
Loading

0 comments on commit 71d3fbb

Please sign in to comment.