mirror of
https://github.com/tw93/Mole.git
synced 2026-02-16 23:24:11 +00:00
Christmas eggs
This commit is contained in:
BIN
bin/status-go
BIN
bin/status-go
Binary file not shown.
@@ -5,6 +5,7 @@ import (
|
|||||||
"sort"
|
"sort"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/charmbracelet/lipgloss"
|
"github.com/charmbracelet/lipgloss"
|
||||||
)
|
)
|
||||||
@@ -16,6 +17,7 @@ var (
|
|||||||
dangerStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#FF6B6B")).Bold(true)
|
dangerStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#FF6B6B")).Bold(true)
|
||||||
okStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#87D787"))
|
okStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#87D787"))
|
||||||
lineStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#5A5A5A"))
|
lineStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#5A5A5A"))
|
||||||
|
hatStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#FF0000"))
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -30,6 +32,14 @@ const (
|
|||||||
iconProcs = "▶"
|
iconProcs = "▶"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Check if it's Christmas season (Dec 10-31)
|
||||||
|
func isChristmasSeason() bool {
|
||||||
|
now := time.Now()
|
||||||
|
month := now.Month()
|
||||||
|
day := now.Day()
|
||||||
|
return month == time.December && day >= 10 && day <= 31
|
||||||
|
}
|
||||||
|
|
||||||
// Mole body frames (legs animate)
|
// Mole body frames (legs animate)
|
||||||
var moleBody = [][]string{
|
var moleBody = [][]string{
|
||||||
{
|
{
|
||||||
@@ -58,10 +68,55 @@ var moleBody = [][]string{
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Mole body frames with Christmas hat
|
||||||
|
var moleBodyWithHat = [][]string{
|
||||||
|
{
|
||||||
|
` *`,
|
||||||
|
` /o\`,
|
||||||
|
` {/\_/\}`,
|
||||||
|
` ___/ o o \`,
|
||||||
|
` /___ =-= /`,
|
||||||
|
` \____)-m-m)`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
` *`,
|
||||||
|
` /o\`,
|
||||||
|
` {/\_/\}`,
|
||||||
|
` ___/ o o \`,
|
||||||
|
` /___ =-= /`,
|
||||||
|
` \____)mm__)`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
` *`,
|
||||||
|
` /o\`,
|
||||||
|
` {/\_/\}`,
|
||||||
|
` ___/ · · \`,
|
||||||
|
` /___ =-= /`,
|
||||||
|
` \___)-m__m)`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
` *`,
|
||||||
|
` /o\`,
|
||||||
|
` {/\_/\}`,
|
||||||
|
` ___/ o o \`,
|
||||||
|
` /___ =-= /`,
|
||||||
|
` \____)-mm-)`,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
// Generate frames with horizontal movement
|
// Generate frames with horizontal movement
|
||||||
func getMoleFrame(animFrame int, termWidth int) string {
|
func getMoleFrame(animFrame int, termWidth int) string {
|
||||||
bodyIdx := animFrame % len(moleBody)
|
var body []string
|
||||||
body := moleBody[bodyIdx]
|
var bodyIdx int
|
||||||
|
isChristmas := isChristmasSeason()
|
||||||
|
|
||||||
|
if isChristmas {
|
||||||
|
bodyIdx = animFrame % len(moleBodyWithHat)
|
||||||
|
body = moleBodyWithHat[bodyIdx]
|
||||||
|
} else {
|
||||||
|
bodyIdx = animFrame % len(moleBody)
|
||||||
|
body = moleBody[bodyIdx]
|
||||||
|
}
|
||||||
|
|
||||||
// Calculate mole width (approximate)
|
// Calculate mole width (approximate)
|
||||||
moleWidth := 15
|
moleWidth := 15
|
||||||
@@ -83,9 +138,22 @@ func getMoleFrame(animFrame int, termWidth int) string {
|
|||||||
|
|
||||||
padding := strings.Repeat(" ", pos)
|
padding := strings.Repeat(" ", pos)
|
||||||
var lines []string
|
var lines []string
|
||||||
for _, line := range body {
|
|
||||||
lines = append(lines, padding+line)
|
if isChristmas {
|
||||||
|
// Render with red hat on first 3 lines
|
||||||
|
for i, line := range body {
|
||||||
|
if i < 3 {
|
||||||
|
lines = append(lines, padding+hatStyle.Render(line))
|
||||||
|
} else {
|
||||||
|
lines = append(lines, padding+line)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for _, line := range body {
|
||||||
|
lines = append(lines, padding+line)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return strings.Join(lines, "\n")
|
return strings.Join(lines, "\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -53,6 +53,21 @@ readonly MOLE_CRASH_REPORT_AGE_DAYS=7 # Crash report retention
|
|||||||
readonly MOLE_SAVED_STATE_AGE_DAYS=7 # App saved state retention
|
readonly MOLE_SAVED_STATE_AGE_DAYS=7 # App saved state retention
|
||||||
readonly MOLE_TM_BACKUP_SAFE_HOURS=48 # Time Machine failed backup safety window
|
readonly MOLE_TM_BACKUP_SAFE_HOURS=48 # Time Machine failed backup safety window
|
||||||
|
|
||||||
|
# ============================================================================
|
||||||
|
# Seasonal Functions
|
||||||
|
# ============================================================================
|
||||||
|
is_christmas_season() {
|
||||||
|
local month day
|
||||||
|
month=$(date +%-m)
|
||||||
|
day=$(date +%-d)
|
||||||
|
|
||||||
|
# December 10 to December 31
|
||||||
|
if [[ $month -eq 12 && $day -ge 10 && $day -le 31 ]]; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
# ============================================================================
|
# ============================================================================
|
||||||
# Whitelist Configuration
|
# Whitelist Configuration
|
||||||
# ============================================================================
|
# ============================================================================
|
||||||
|
|||||||
60
mole
60
mole
@@ -22,7 +22,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|||||||
source "$SCRIPT_DIR/lib/core/common.sh"
|
source "$SCRIPT_DIR/lib/core/common.sh"
|
||||||
|
|
||||||
# Version info
|
# Version info
|
||||||
VERSION="1.12.1"
|
VERSION="1.12.3"
|
||||||
MOLE_TAGLINE="can dig deep to clean your Mac."
|
MOLE_TAGLINE="can dig deep to clean your Mac."
|
||||||
|
|
||||||
# Check if Touch ID is already configured
|
# Check if Touch ID is already configured
|
||||||
@@ -114,9 +114,25 @@ animate_mole_intro() {
|
|||||||
hide_cursor
|
hide_cursor
|
||||||
|
|
||||||
local -a mole_lines=()
|
local -a mole_lines=()
|
||||||
while IFS= read -r line; do
|
|
||||||
mole_lines+=("$line")
|
if is_christmas_season; then
|
||||||
done << 'EOF'
|
while IFS= read -r line; do
|
||||||
|
mole_lines+=("$line")
|
||||||
|
done << 'EOF'
|
||||||
|
*
|
||||||
|
/o\
|
||||||
|
{/\_/\}
|
||||||
|
____/ o o \
|
||||||
|
/~____ =o= /
|
||||||
|
(______)__m_m)
|
||||||
|
/ \
|
||||||
|
__/ /\ \__
|
||||||
|
/__/ \__\_
|
||||||
|
EOF
|
||||||
|
else
|
||||||
|
while IFS= read -r line; do
|
||||||
|
mole_lines+=("$line")
|
||||||
|
done << 'EOF'
|
||||||
/\_/\
|
/\_/\
|
||||||
____/ o o \
|
____/ o o \
|
||||||
/~____ =o= /
|
/~____ =o= /
|
||||||
@@ -125,19 +141,37 @@ animate_mole_intro() {
|
|||||||
__/ /\ \__
|
__/ /\ \__
|
||||||
/__/ \__\_
|
/__/ \__\_
|
||||||
EOF
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
local idx
|
local idx
|
||||||
local body_cutoff=4
|
local hat_color="${RED}"
|
||||||
|
local body_cutoff
|
||||||
local body_color="${PURPLE}"
|
local body_color="${PURPLE}"
|
||||||
local ground_color="${GREEN}"
|
local ground_color="${GREEN}"
|
||||||
for idx in "${!mole_lines[@]}"; do
|
|
||||||
if ((idx < body_cutoff)); then
|
if is_christmas_season; then
|
||||||
printf "%s\n" "${body_color}${mole_lines[$idx]}${NC}"
|
body_cutoff=6
|
||||||
else
|
for idx in "${!mole_lines[@]}"; do
|
||||||
printf "%s\n" "${ground_color}${mole_lines[$idx]}${NC}"
|
if ((idx < 3)); then
|
||||||
fi
|
printf "%s\n" "${hat_color}${mole_lines[$idx]}${NC}"
|
||||||
sleep 0.1
|
elif ((idx < body_cutoff)); then
|
||||||
done
|
printf "%s\n" "${body_color}${mole_lines[$idx]}${NC}"
|
||||||
|
else
|
||||||
|
printf "%s\n" "${ground_color}${mole_lines[$idx]}${NC}"
|
||||||
|
fi
|
||||||
|
sleep 0.1
|
||||||
|
done
|
||||||
|
else
|
||||||
|
body_cutoff=4
|
||||||
|
for idx in "${!mole_lines[@]}"; do
|
||||||
|
if ((idx < body_cutoff)); then
|
||||||
|
printf "%s\n" "${body_color}${mole_lines[$idx]}${NC}"
|
||||||
|
else
|
||||||
|
printf "%s\n" "${ground_color}${mole_lines[$idx]}${NC}"
|
||||||
|
fi
|
||||||
|
sleep 0.1
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
printf '\n'
|
printf '\n'
|
||||||
sleep 0.5
|
sleep 0.5
|
||||||
|
|||||||
Reference in New Issue
Block a user