1.8 KiB
1.8 KiB
GoCal
This is a terminal-based calendar and hourly schedule viewer built using Bubble Tea and styled with Lipgloss.
Project Structure
| File | Description |
|---|---|
main.go |
Entry point of the application. Initializes the program and sets the initial model state (current year/month and cursor position). |
constants.go |
Defines global constants such as calendar grid size and cell dimensions used throughout the app. |
styles.go |
Contains all the Lipgloss style definitions for calendar cells, headers, and hourly schedule views. |
model.go |
Defines the data model struct (model) that holds the application state, and the viewMode type representing current UI mode. Also contains the Init function for Bubble Tea. |
update.go |
Implements all update logic for handling user input and updating the model state in both month and hourly views. Includes the fix to properly update cursor position when switching months. |
view.go |
Contains all rendering logic that converts the current model state into styled terminal output for both month and hourly views. |
Features
- Month view with navigable calendar grid.
- Highlighted current day.
- Cursor highlighting with keyboard navigation.
- Enter key switches to hourly schedule view for the selected day.
- Hourly view with current hour highlighted.
- Switch back to month view with ESC.
Usage
-
[a] / [d]: Navigate previous / next month.
-
Arrow keys: Move cursor around days.
-
[Enter]: Switch to hourly view for selected day.
-
[Esc]: Return to month view.
-
[q] / Ctrl+C: Quit.