From 0e909333d60f7d3cd3073854d29148add717320f Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Sat, 30 Sep 2023 14:14:47 +0200 Subject: [PATCH] add option to enable/disable animation for day and room name --- tile.js | 20 ++++++++++++++++++++ tile.lua | 16 ++++++++++++++-- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/tile.js b/tile.js index b8f215a..9484471 100644 --- a/tile.js +++ b/tile.js @@ -70,6 +70,13 @@ var config = { +
+ + Fade in and out +
@@ -99,12 +113,18 @@ var config = { mode: ChildTile.config_value('mode', 'all_talks'), color: ChildTile.config_value('color', '#ffffff'), font_size: ChildTile.config_value('font_size', 70, parseInt), + all_speakers: ChildTile.config_value('all_speakers', true), + next_abstract: ChildTile.config_value('next_abstract', false), next_track_text: ChildTile.config_value('next_track_text', false), + room_align: ChildTile.config_value('room_align', 'left'), + room_animate: ChildTile.config_value('room_animate', true), + day_align: ChildTile.config_value('day_align', 'left'), day_template: ChildTile.config_value('day_template', 'Day %d'), + day_animate: ChildTile.config_value('day_animate', false), } } diff --git a/tile.lua b/tile.lua index 9703dab..fce73ad 100644 --- a/tile.lua +++ b/tile.lua @@ -337,7 +337,9 @@ end local function view_room(starts, ends, config, x1, y1, x2, y2) local font_size = config.font_size or 70 local align = config.room_align or "left" + local animate = config.room_animate local default_color = {helper.parse_rgb(config.color or "#ffffff")} + local r,g,b = helper.parse_rgb(config.color or "#ffffff") local a = anims.Area(x2 - x1, y2 - y1) @@ -358,7 +360,11 @@ local function view_room(starts, ends, config, x1, y1, x2, y2) text(x, 0, current_room, font_size, rgba(default_color,1)) for now in api.frame_between(starts, ends) do - a.draw(now, x1, y1, x2, y2) + if animate then + a.draw(now, x1, y1, x2, y2) + else + font:write(x1+x, y1, line, font_size, r,g,b,1) + end end end @@ -366,7 +372,9 @@ local function view_day(starts, ends, config, x1, y1, x2, y2) local font_size = config.font_size or 70 local align = config.day_align or "left" local template = config.day_template or "Day %d" + local animate = config.day_animate local default_color = {helper.parse_rgb(config.color or "#ffffff")} + local r,g,b = helper.parse_rgb(config.color or "#ffffff") local a = anims.Area(x2 - x1, y2 - y1) @@ -388,7 +396,11 @@ local function view_day(starts, ends, config, x1, y1, x2, y2) text(x, 0, line, font_size, rgba(default_color,1)) for now in api.frame_between(starts, ends) do - a.draw(now, x1, y1, x2, y2) + if animate then + a.draw(now, x1, y1, x2, y2) + else + font:write(x1+x, y1, line, font_size, r,g,b,1) + end end end