You've already forked img-proxy-url-generator
Initial working commit
This commit is contained in:
19
printer/log.go
Normal file
19
printer/log.go
Normal 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
19
printer/printer.go
Normal 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
56
printer/styles.go
Normal 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)
|
||||
}
|
||||
Reference in New Issue
Block a user