Compare commits
1 commit
main
...
hotfix/slo
Author | SHA1 | Date | |
---|---|---|---|
92adc6ea9b |
16
animation.py
16
animation.py
|
@ -48,9 +48,9 @@ class RandomSingle(Animation):
|
|||
by Max & Lightmoll (https://lght.ml)
|
||||
from 2022-06-08
|
||||
"""
|
||||
def __init__(self, color):
|
||||
def __init__(self, color, looptime=60):
|
||||
super().__init__()
|
||||
self.PERIOD = 4 * 30 #frames
|
||||
self.PERIOD = looptime * 30 #frames
|
||||
self.color = self._rand_color()
|
||||
self.last_colors = []
|
||||
self.frame_counter = 0
|
||||
|
@ -92,10 +92,10 @@ class TwoColor(Steady):
|
|||
by Max & Lightmoll (https://lght.ml)
|
||||
from 2022-06-08
|
||||
"""
|
||||
def __init__(self, color):
|
||||
def __init__(self, color, looptime=60):
|
||||
super().__init__(color)
|
||||
self.start_time = time()
|
||||
self.PERIOD = 0.5 #s
|
||||
self.PERIOD = looptime * 0.5 #s
|
||||
self.COL_1 = color #input color
|
||||
|
||||
self.COL_2 = (255-self.r, 255-self.g, 255-self.b) #compl. color
|
||||
|
@ -174,7 +174,7 @@ class Caramelldansen(Steady):
|
|||
|
||||
|
||||
class FadeTo(Steady):
|
||||
def __init__(self, color, t=2.0):
|
||||
def __init__(self, color, t=60.0):
|
||||
super(FadeTo, self).__init__(color)
|
||||
self.t = t
|
||||
self.start = time()
|
||||
|
@ -192,7 +192,7 @@ class FadeTo(Steady):
|
|||
|
||||
|
||||
class RotatingRainbow(Animation):
|
||||
def __init__(self, looptime=50.0):
|
||||
def __init__(self, looptime=60.0):
|
||||
super(RotatingRainbow, self).__init__()
|
||||
self.looptime = looptime
|
||||
pass
|
||||
|
@ -216,7 +216,7 @@ class RotatingRainbow(Animation):
|
|||
|
||||
|
||||
class Chase(Steady):
|
||||
def __init__(self, color, looptime=1.0):
|
||||
def __init__(self, color, looptime=60.0):
|
||||
super(Chase, self).__init__(color)
|
||||
self.looptime = looptime
|
||||
|
||||
|
@ -234,7 +234,7 @@ class Chase(Steady):
|
|||
|
||||
|
||||
class ChaseRandom(Animation):
|
||||
def __init__(self, color, looptime=1.0):
|
||||
def __init__(self, color, looptime=60.0):
|
||||
super(Chase, self).__init__(color)
|
||||
self.looptime = looptime
|
||||
|
||||
|
|
|
@ -17,10 +17,25 @@
|
|||
<input type="radio" class="js_animation" name="state" id="animation_white" value="steady"/>
|
||||
<label for="animation_white">Steady</label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="radio" class="js_animation" name="state" id="animation_chase" value="chase"/>
|
||||
<label for="animation_chase">Chase</label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="radio" class="js_animation" name="state" id="animation_rainbow" value="rainbow"/>
|
||||
<label for="animation_rainbow">Rainbow</label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="radio" class="js_animation" name="state" id="animation_randomsingle" value="randomsingle"/>
|
||||
<label for="animation_randomsingle">Random Single</label>
|
||||
<div>
|
||||
<input type="radio" class="js_animation" name="state" id="animation_twocolor" value="twocolor"/>
|
||||
<label for="animation_twocolor">Complementary</label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="radio" class="js_animation" name="state" id="animation_caramelldansen" value="caramelldansen"/>
|
||||
<label for="animation_caramelldansen">Caramelldansen</label>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset class="colors">
|
||||
<legend>Color</legend>
|
||||
|
|
Loading…
Reference in a new issue