Skip to content

Commit

Permalink
feat: update template
Browse files Browse the repository at this point in the history
  • Loading branch information
shaobeichen committed Oct 17, 2024
1 parent e6a82f1 commit b2e9367
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
12 changes: 7 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ import (
)

const (
progressBarWidth = 71
progressBarWidth = 50
progressFullChar = "█"
progressEmptyChar = "░"
dotChar = " • "
progressColor1 = "#B14FFF"
progressColor2 = "#00FFA3"
progressMaxValue = 1
)

// General stuff for styling the view
Expand All @@ -27,7 +29,7 @@ var (
mainStyle = lipgloss.NewStyle().MarginLeft(2)

// Gradient colors we'll use for the progress bar
ramp = makeRampStyles("#B14FFF", "#00FFA3", progressBarWidth)
ramp = makeRampStyles(progressColor1, progressColor2, progressBarWidth)
)

type model struct {
Expand Down Expand Up @@ -84,8 +86,8 @@ func updateChosen(msg tea.Msg, m model) (tea.Model, tea.Cmd) {
if !m.Loaded {
m.Frames++
m.Progress = ease.Linear(float64(m.Frames) / float64(100))
if m.Progress >= 1 {
m.Progress = 1
if m.Progress >= progressMaxValue {
m.Progress = progressMaxValue
m.Loaded = true
return m, nil
}
Expand Down
10 changes: 10 additions & 0 deletions scripts/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

# 执行第一个命令
go run . 0.46

# 等待2秒
sleep 2

# 执行第二个命令
go run . 1

0 comments on commit b2e9367

Please sign in to comment.