private/Banner.ps1
|
# FR-022: startup banner, horizontally centered to terminal width, visible above both the # language screen and the main menu (not shown once and dropped). $script:OctaWordmark = @( ' ██████╗ ██████╗ ████████╗ █████╗ ', '██╔═══██╗██╔════╝ ╚══██╔══╝██╔══██╗', '██║ ██║██║ ██║ ███████║', '██║ ██║██║ ██║ ██╔══██║', '╚██████╔╝╚██████╗ ██║ ██║ ██║', ' ╚═════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝' ) function Get-OctaCenteredLine { param( [Parameter(Mandatory)][string]$Text, [Parameter(Mandatory)][int]$Width ) $padding = [Math]::Max(0, [Math]::Floor(($Width - $Text.Length) / 2)) return (' ' * $padding) + $Text } function Show-OctaBanner { [CmdletBinding()] param( [string]$Tagline = 'Windows 11 Debloat -- Local. Transparente. Open Source.' ) $width = 80 try { $width = $Host.UI.RawUI.WindowSize.Width } catch { } if ($width -lt 40 -or $width -gt 120) { $width = 80 } Write-Host '' foreach ($line in $script:OctaWordmark) { Write-Host (Get-OctaCenteredLine -Text $line -Width $width) } Write-Host '' Write-Host (Get-OctaCenteredLine -Text "🐙 $Tagline" -Width $width) Write-Host '' } |