Initial Commit
This commit is contained in:
commit
87a522daab
22 changed files with 1555 additions and 0 deletions
34
tui/model.go
Normal file
34
tui/model.go
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
package tui
|
||||
|
||||
import (
|
||||
tea "github.com/charmbracelet/bubbletea"
|
||||
"github.com/charmbracelet/huh"
|
||||
)
|
||||
type viewMode int
|
||||
|
||||
const (
|
||||
monthView viewMode = iota
|
||||
hourlyView
|
||||
formView
|
||||
)
|
||||
|
||||
|
||||
type model struct {
|
||||
cursorRow int // which row the cursor is sitting on used for cursor highlight
|
||||
cursorCol int // which col the cursor is sitiing on used for cursor highlight
|
||||
monthIndex int // what month 1-12 that is being displayed
|
||||
year int // the current year being displayed
|
||||
startOffset int // weekday offset where day 1 starts
|
||||
daysInMonth int // a count of how many days there are in the month to account for 30,31,or 28
|
||||
|
||||
mode viewMode
|
||||
form *huh.Form
|
||||
// For hourly view
|
||||
selectedDay int // which day we are looking at in hourly view
|
||||
hourCursor int // which hour (0-23) is selected in hourly view
|
||||
}
|
||||
|
||||
|
||||
func (m model) Init() tea.Cmd {
|
||||
return nil
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue