Add Zukitchi widget with animated terminal pet and update README for new features
This commit is contained in:
79
widgets/zukitchi/assets.go
Normal file
79
widgets/zukitchi/assets.go
Normal file
@@ -0,0 +1,79 @@
|
||||
package zukitchi
|
||||
|
||||
import "strings"
|
||||
|
||||
func Sleep(position int) []string {
|
||||
return compileFrames(position, sleep0, sleep1)
|
||||
}
|
||||
|
||||
func compileFrames(position int, idle ...string) []string {
|
||||
var result = make([]string, len(idle))
|
||||
for i, frame := range idle {
|
||||
result[i] = cutFirstAndListLineAndMove(frame, position)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
func cutFirstAndListLineAndMove(frame string, position int) string {
|
||||
position = position + 17
|
||||
if position < 0 {
|
||||
position = 0
|
||||
}
|
||||
if position > 35 {
|
||||
position = 35
|
||||
}
|
||||
lines := strings.Split(frame, "\n")
|
||||
result := make([]string, 0, len(lines))
|
||||
for _, line := range lines {
|
||||
result = append(result, strings.Repeat(" ", position)+line)
|
||||
}
|
||||
return strings.Join(result[1:len(result)-1], "\n")
|
||||
}
|
||||
|
||||
//<editor-fold desc="Sprites">
|
||||
|
||||
// j
|
||||
// k ▄
|
||||
// i ▀
|
||||
// l █
|
||||
|
||||
const sleep0 = `
|
||||
▄▄▄ ▄▄▄
|
||||
█ █ █ █
|
||||
▀▄▄▄████▄▄ ▄▄███▄▄▄▀
|
||||
██▀ ▀▀▄▄▄▄▄▄▄▄███ ▀█▀
|
||||
██ ▄ ███▄ ▄████▄ ▄▀
|
||||
██▀▀█▀▀████▀▀█▀▀██▄
|
||||
█▀▀█████▄███████▄▄█▄▄
|
||||
▄▄▀▀▀▀█▀▀ █ ▀▀▀▄
|
||||
█ █ █ █
|
||||
█ ▄▀▀▀▄▄▄▄█████▀▀▀▀▀█████▄ █
|
||||
█ █▄▄▄▄█▀▀▀▀▀▀██████ ▀▀▀█ █
|
||||
█ ██████ ██████ █ █
|
||||
█ █▀▀▀▀███████ ███▄▄█ █
|
||||
█ ▀▄▄▄▄███▀▀▀▀▀▀▀▀▀▀██████ █
|
||||
█ ▀▀▀▀▀ █
|
||||
█ ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ █
|
||||
▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀
|
||||
`
|
||||
const sleep1 = `
|
||||
▄▄▄ ▄▄▄
|
||||
█ █ █ █
|
||||
▀▄▄▄█████▀▄▄ ▄▄▄▀████▄▄▄▀
|
||||
██▄ ███▀▀▀████▀ █▀
|
||||
██▄█▄████▄██████▄█
|
||||
███████████████████
|
||||
▄█▄▀ ▀▀█▄▄
|
||||
▄▄▀▀ █ █ ▀▀▀▀▄
|
||||
█ ▄█▄▄▄▄█████▀▀▀▀▀███▄ █
|
||||
█ ▄▀ ▄█▀▀▀▀▀▀██████ ▀██▄ █
|
||||
█ █▄████ ██████ ██ █ █
|
||||
█ ███▀▀███████ ██▄▀▀█ █
|
||||
█ █▀ ▄██▀▀▀▀▀▀▀▀▀▀▄███ █ █
|
||||
█ ▀▄▄▀ ▀███ █
|
||||
█ ▄▄▄▄▄▄▄▄▄▄▄▄▄ ▀ █
|
||||
█ ▄▄▀▀▀ ▀ █ █ ▀ ▀▀▄▄ █
|
||||
▀▀▀ ▀▀▀▀
|
||||
`
|
||||
|
||||
//</editor-fold>
|
||||
1
widgets/zukitchi/main.go
Normal file
1
widgets/zukitchi/main.go
Normal file
@@ -0,0 +1 @@
|
||||
package zukitchi
|
||||
Reference in New Issue
Block a user