Lucky manta ray
This commit is contained in:
@@ -131,17 +131,16 @@ var bigColonBlink = []string{
|
||||
}
|
||||
|
||||
// RenderBigClock renders the current time as massive ASCII block digits.
|
||||
// Format: HH:MM:SS in 24h. The colon blinks on a 500ms cycle (offset from
|
||||
// the second boundary so it doesn't flip in sync with the digits).
|
||||
func RenderBigClock(t time.Time) string {
|
||||
// Format: HH:MM:SS in 24h. blinkOnMs/blinkOffMs control the colon blink cycle.
|
||||
func RenderBigClock(t time.Time, blinkOnMs, blinkOffMs int) string {
|
||||
h := t.Hour()
|
||||
m := t.Minute()
|
||||
s := t.Second()
|
||||
|
||||
timeStr := fmt.Sprintf("%02d:%02d:%02d", h, m, s)
|
||||
|
||||
// 1500ms cycle: visible for 1000ms, hidden for 500ms.
|
||||
colonVisible := t.UnixMilli() % 1500 < 1000
|
||||
cycle := int64(blinkOnMs + blinkOffMs)
|
||||
colonVisible := t.UnixMilli()%cycle < int64(blinkOnMs)
|
||||
|
||||
var lines [7]string
|
||||
for i := range lines {
|
||||
|
||||
Reference in New Issue
Block a user