human_state

package
v0.0.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2025 License: MIT Imports: 8 Imported by: 0

README

Prompt:

generate an image that represents a pretty handsome young male with hat, need full body picture, not just upper half

(using Gemini)

And then convert image to ASCII via https://www.asciiart.eu/image-to-ascii

check here: https://gemini.google.com/app/e5745497ec0d3b9e

Documentation

Index

Constants

View Source
const (
	HP_TOTAL_SCORE = 5
	HP_STATE_NAME  = "H/P State"
)

Variables

This section is empty.

Functions

func GetASCIIArt

func GetASCIIArt() string

GetASCIIArt returns the ASCII art for a male figure

func HumanStatePage

func HumanStatePage(humanState *HumanState, onKeyDown func(*dom.DOMEvent)) *dom.Node

HumanStatePage renders the complete human state page

func RenderBars

func RenderBars(hpScores int, totalScore int, focusedBarIndex int, onAdjustScore func(delta int), onUpdateFocus func(index int)) []*dom.Node

RenderBars renders all 5 hp bars as a group of DOM text nodes

Types

type HumanState

type HumanState struct {
	HpScores        int                                          // 5 bars for the single hp state
	FocusedBarIndex int                                          // Which bar is currently focused (0-4)
	OnAdjustScore   func(delta int) error                        // Callback for when score is adjusted
	Enqueue         func(action func(ctx context.Context) error) // Async task enqueue function
	LoadStateOnce   func()                                       // Load state once on first access
}

HumanState represents the state of human metrics with one hp state having 5 bars

func (*HumanState) AdjustScore

func (hs *HumanState) AdjustScore(delta int)

AdjustScore increases or decreases the focused bar's score

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL