Skip to content

Commit

Permalink
App that shows tv static and a channel number in the top right corner (
Browse files Browse the repository at this point in the history
  • Loading branch information
Snuckey authored Sep 29, 2023
1 parent 537dc51 commit 561f9ec
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
8 changes: 8 additions & 0 deletions apps/tvstatic/manifest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
id: tv-static
name: TV Static
summary: Show static on an old TV
desc: Make your Tidbyt look like it is showing static on an old TV that is turned to Channel 3.
author: Snuckey
fileName: tv_static.star
packageName: tvstatic
59 changes: 59 additions & 0 deletions apps/tvstatic/tv_static.star
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
"""
Applet: TV Static
Summary: Show static on an old TV
Description: Make your Tidbyt look like it is showing static on an old TV that is turned to Channel 3.
Author: Snuckey
"""

load("random.star", "random")
load("render.star", "render")

STATIC_DIM = 2

def main():
return render.Root(
child = render.Stack(
children = [
render.Animation(
children = staticFrames(),
),
render.Row(
children = [
render.Text(content = "03", color = "#00ff00", font = "10x20"),
],
main_align = "end",
expanded = True,
),
],
),
)

def staticFrames():
frames = []
for _ in range(200):
frames.append(staticScreen())
return frames

def staticScreen():
static = []

for _ in range(int(32 / STATIC_DIM)):
static.append(render.Row(children = staticRow()))

return render.Column(children = static)

def staticRow():
static = []
color = ""

for _ in range(int(64 / STATIC_DIM)):
num = random.number(0, 2)

if num == 0:
color = "#000000"
else:
color = "#ffffff"

static.append(render.Box(width = STATIC_DIM, height = STATIC_DIM, color = color))

return static

0 comments on commit 561f9ec

Please sign in to comment.