change font to be more terminal esque
This commit is contained in:
parent
ada0eadd0a
commit
8e7f2f6ab9
6 changed files with 83 additions and 25 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
/bin
|
Binary file not shown.
BIN
datafont.ttf
Normal file
BIN
datafont.ttf
Normal file
Binary file not shown.
62
main.go
62
main.go
|
@ -15,16 +15,23 @@ import (
|
|||
"fyne.io/fyne/v2/app"
|
||||
"fyne.io/fyne/v2/canvas"
|
||||
"fyne.io/fyne/v2/container"
|
||||
"fyne.io/fyne/v2/theme"
|
||||
"fyne.io/fyne/v2/widget"
|
||||
)
|
||||
|
||||
// Embed resources
|
||||
//
|
||||
//go:embed blessing.txt
|
||||
var blessingBytes []byte
|
||||
|
||||
//go:embed chant.mp3
|
||||
var chantBytes []byte
|
||||
|
||||
//go:embed icon.ico
|
||||
var iconBytes []byte
|
||||
|
||||
//go:embed datafont.ttf
|
||||
var dataFont []byte
|
||||
|
||||
func playChant() {
|
||||
streamer, format, err := mp3.Decode(io.NopCloser(bytes.NewReader(chantBytes)))
|
||||
if err != nil {
|
||||
|
@ -41,41 +48,46 @@ func main() {
|
|||
go playChant()
|
||||
|
||||
a := app.NewWithID("com.omnissiah.blessing")
|
||||
a.Settings().SetTheme(theme.DarkTheme())
|
||||
w := a.NewWindow("🔧 Rite of Activation")
|
||||
|
||||
// Lock resolution
|
||||
const windowWidth = 400
|
||||
const windowHeight = 800
|
||||
// Apply custom font theme
|
||||
fontRes := fyne.NewStaticResource("datafont.ttf", dataFont)
|
||||
a.Settings().SetTheme(&customTheme{font: fontRes})
|
||||
|
||||
w := a.NewWindow("COGITATOR-LINK::RITE-SEQUENCE-ENGAGE")
|
||||
iconRes := fyne.NewStaticResource("icon.ico", iconBytes)
|
||||
w.SetIcon(iconRes)
|
||||
|
||||
const windowWidth = 480
|
||||
const windowHeight = 780
|
||||
w.Resize(fyne.NewSize(windowWidth, windowHeight))
|
||||
w.SetFixedSize(true)
|
||||
|
||||
// Background
|
||||
bg := canvas.NewRectangle(color.RGBA{R: 10, G: 10, B: 10, A: 255})
|
||||
bg.Resize(fyne.NewSize(windowWidth, windowHeight))
|
||||
// Background black
|
||||
bg := canvas.NewRectangle(color.RGBA{R: 5, G: 5, B: 5, A: 255})
|
||||
|
||||
// Header and footer
|
||||
header := canvas.NewText("+++ ACTIVATE RITE +++", color.RGBA{R: 200, G: 40, B: 40, A: 255})
|
||||
header.TextSize = 20
|
||||
// Header
|
||||
header := canvas.NewText("+++ INITIATE COGITATOR RITE +++", color.RGBA{R: 100, G: 255, B: 100, A: 255})
|
||||
header.TextSize = 18
|
||||
header.Alignment = fyne.TextAlignCenter
|
||||
header.TextStyle = fyne.TextStyle{Bold: true}
|
||||
footer := canvas.NewText("<< OMNISSIAH WATCHES >>", color.RGBA{R: 255, G: 200, B: 200, A: 255})
|
||||
footer.TextSize = 16
|
||||
footer.Alignment = fyne.TextAlignCenter
|
||||
footer.TextStyle = fyne.TextStyle{Italic: true}
|
||||
header.TextStyle = fyne.TextStyle{Monospace: true, Bold: true}
|
||||
|
||||
// Center blessing
|
||||
label := widget.NewLabel(blessing)
|
||||
label.Alignment = fyne.TextAlignCenter
|
||||
// Footer
|
||||
footer := canvas.NewText("<< SYSTEM: BLESSED BY THE OMNISSIAH >>", color.RGBA{R: 255, G: 100, B: 100, A: 255})
|
||||
footer.TextSize = 14
|
||||
footer.Alignment = fyne.TextAlignCenter
|
||||
footer.TextStyle = fyne.TextStyle{Italic: true, Monospace: true}
|
||||
|
||||
// Terminal-style blessing
|
||||
label := widget.NewLabelWithStyle(blessing, fyne.TextAlignCenter, fyne.TextStyle{Monospace: true})
|
||||
label.Wrapping = fyne.TextWrapWord
|
||||
|
||||
// Scroll container
|
||||
scroll := container.NewScroll(label)
|
||||
scroll.SetMinSize(fyne.NewSize(420, 760))
|
||||
scroll.SetMinSize(fyne.NewSize(windowWidth-20, windowHeight-140))
|
||||
|
||||
// Use Border layout to keep footer anchored
|
||||
mainContent := container.NewBorder(header, footer, nil, nil, scroll)
|
||||
// Build layout
|
||||
content := container.NewBorder(header, footer, nil, nil, scroll)
|
||||
w.SetContent(container.NewMax(bg, content))
|
||||
|
||||
// Final layout with background
|
||||
w.SetContent(container.NewMax(bg, mainContent))
|
||||
w.ShowAndRun()
|
||||
}
|
||||
|
|
10
makefile
Normal file
10
makefile
Normal file
|
@ -0,0 +1,10 @@
|
|||
default: build compress
|
||||
|
||||
build:
|
||||
@echo "Building the project..."
|
||||
-mkdir -p ./bin
|
||||
go build -ldflags="-H windowsgui -s -w" -o ./bin/OmnissiahBlessing.exe
|
||||
|
||||
compress:
|
||||
@echo "Compressing the executable..."
|
||||
upx --best --lzma ./bin/OmnissiahBlessing.exe
|
35
theme.go
Normal file
35
theme.go
Normal file
|
@ -0,0 +1,35 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"image/color"
|
||||
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/theme"
|
||||
)
|
||||
|
||||
type customTheme struct {
|
||||
font fyne.Resource
|
||||
}
|
||||
|
||||
func (c *customTheme) Font(style fyne.TextStyle) fyne.Resource {
|
||||
return c.font
|
||||
}
|
||||
|
||||
func (c *customTheme) Color(name fyne.ThemeColorName, variant fyne.ThemeVariant) color.Color {
|
||||
return theme.DefaultTheme().Color(name, variant)
|
||||
}
|
||||
|
||||
func (c *customTheme) Size(name fyne.ThemeSizeName) float32 {
|
||||
switch name {
|
||||
case theme.SizeNameText:
|
||||
return 22 // Default is 14; bump it up
|
||||
case theme.SizeNameHeadingText:
|
||||
return 24
|
||||
default:
|
||||
return theme.DefaultTheme().Size(name)
|
||||
}
|
||||
}
|
||||
|
||||
func (c *customTheme) Icon(name fyne.ThemeIconName) fyne.Resource {
|
||||
return theme.DefaultTheme().Icon(name)
|
||||
}
|
Loading…
Reference in a new issue