Initial working commit

This commit is contained in:
2024-04-23 08:52:59 -04:00
commit ee948f23c0
11 changed files with 625 additions and 0 deletions

19
printer/log.go Normal file
View File

@@ -0,0 +1,19 @@
package printer
import "fmt"
func (p *Printer) LogSuccess(message string) {
fmt.Println(p.getSuccess().Render("✅ " + message))
}
func (p *Printer) LogWarning(message string) {
fmt.Println(p.getWarning().Render("‼️ WARNING: " + message))
}
func (p *Printer) LogInfo(message string) {
fmt.Println(p.getInfo().Render(" " + message))
}
func (p *Printer) LogError(message string) {
fmt.Println(p.getError().Render("❌ ERROR: " + message))
}

19
printer/printer.go Normal file
View File

@@ -0,0 +1,19 @@
package printer
import (
"fmt"
)
var Version = "0.0.0"
type Printer struct {
}
func NewPrinter() *Printer {
return &Printer{}
}
func (p *Printer) PrintTitle() {
fmt.Println(p.getBright().Render(fmt.Sprintf("RSA File Encryption Tool %s", Version)))
fmt.Println()
}

56
printer/styles.go Normal file
View File

@@ -0,0 +1,56 @@
package printer
import (
"github.com/charmbracelet/lipgloss"
)
func (*Printer) getBright() lipgloss.Style {
return lipgloss.NewStyle().
Bold(true).
Foreground(lipgloss.Color("#EDEEEDFF")).
Background(lipgloss.Color("#424E46FF")).
MarginTop(1).
PaddingLeft(3).
PaddingRight(3)
}
func (*Printer) getSuccess() lipgloss.Style {
return lipgloss.NewStyle().
Bold(true).
Foreground(lipgloss.Color("#00FF00")).
MarginTop(1).
MarginBottom(2).
PaddingLeft(2).
Width(120)
}
func (*Printer) getError() lipgloss.Style {
return lipgloss.NewStyle().
Bold(true).
Foreground(lipgloss.Color("#FF0000")).
PaddingLeft(2).
MarginTop(1).
MarginBottom(2).
Width(120)
}
func (*Printer) getWarning() lipgloss.Style {
return lipgloss.NewStyle().
Bold(true).
Foreground(lipgloss.Color("#000")).
Background(lipgloss.Color("#aeff00")).
PaddingLeft(2).
Width(120).
MarginTop(1).
PaddingTop(1).
PaddingBottom(1)
}
func (*Printer) getInfo() lipgloss.Style {
return lipgloss.NewStyle().
Foreground(lipgloss.Color("#4E82B7FF")).
PaddingLeft(2).
Width(120).
PaddingTop(1).
PaddingBottom(1)
}