AeThex-OS/gen_bootanim.ps1
MrPiglr b3c308b2c8 Add functional marketplace modules, bottom nav bar, root terminal, arcade games
- ModuleManager: Central tracking for installed marketplace modules
- DataAnalyzerWidget: Real-time CPU/RAM/Battery/Storage widget (unlocked by Data Analyzer module)
- BottomNavBar: Navigation bar for Projects/Chat/Marketplace/Settings
- RootShell: Real root command execution utility
- TerminalActivity: Full root shell with neofetch, sysinfo, real Linux commands
- Terminal Pro module: Adds aliases (ll, la, h), command history
- ArcadeActivity + SnakeGame: Pixel Arcade module unlocks retro games
- fade_in/fade_out animations for smooth transitions
2026-02-18 22:03:50 -07:00

102 lines
4.7 KiB
PowerShell

Add-Type -AssemblyName System.Drawing
$width = 800
$height = 1280
$bgColor = [System.Drawing.Color]::FromArgb(255, 8, 12, 21)
function Draw-Frame {
param([int]$frameNum, [string]$outputDir, [float]$textOpacity, [float]$glowOpacity, [float]$subtitleOpacity)
$bmp = New-Object System.Drawing.Bitmap($width, $height)
$g = [System.Drawing.Graphics]::FromImage($bmp)
$g.SmoothingMode = [System.Drawing.Drawing2D.SmoothingMode]::HighQuality
$g.TextRenderingHint = [System.Drawing.Text.TextRenderingHint]::AntiAliasGridFit
$g.Clear($bgColor)
if ($glowOpacity -gt 0) {
$glowAlpha2 = [Math]::Min(255, [Math]::Max(0, [int]($glowOpacity * 15)))
$glowColor2 = [System.Drawing.Color]::FromArgb($glowAlpha2, 212, 175, 55)
$glowBrush2 = New-Object System.Drawing.SolidBrush($glowColor2)
$g.FillEllipse($glowBrush2, [int](($width - 500) / 2), [int](($height - 500) / 2 - 40), 500, 500)
$glowBrush2.Dispose()
$glowAlpha = [Math]::Min(255, [Math]::Max(0, [int]($glowOpacity * 40)))
$glowColor = [System.Drawing.Color]::FromArgb($glowAlpha, 212, 175, 55)
$glowBrush = New-Object System.Drawing.SolidBrush($glowColor)
$g.FillEllipse($glowBrush, [int](($width - 300) / 2), [int](($height - 300) / 2 - 40), 300, 300)
$glowBrush.Dispose()
}
if ($textOpacity -gt 0) {
$textAlpha = [Math]::Min(255, [Math]::Max(0, [int]($textOpacity * 255)))
$textColor = [System.Drawing.Color]::FromArgb($textAlpha, 212, 175, 55)
$font = New-Object System.Drawing.Font("Segoe UI", 160, [System.Drawing.FontStyle]::Bold)
$brush = New-Object System.Drawing.SolidBrush($textColor)
$sf = New-Object System.Drawing.StringFormat
$sf.Alignment = [System.Drawing.StringAlignment]::Center
$sf.LineAlignment = [System.Drawing.StringAlignment]::Center
$rect = New-Object System.Drawing.RectangleF(0, -40, $width, $height)
$g.DrawString([string][char]0x00C6, $font, $brush, $rect, $sf)
$font.Dispose()
$brush.Dispose()
$sf.Dispose()
}
if ($subtitleOpacity -gt 0) {
$subAlpha = [Math]::Min(255, [Math]::Max(0, [int]($subtitleOpacity * 180)))
$subColor = [System.Drawing.Color]::FromArgb($subAlpha, 160, 140, 100)
$subFont = New-Object System.Drawing.Font("Segoe UI", 24, [System.Drawing.FontStyle]::Regular)
$subBrush = New-Object System.Drawing.SolidBrush($subColor)
$subSf = New-Object System.Drawing.StringFormat
$subSf.Alignment = [System.Drawing.StringAlignment]::Center
$subSf.LineAlignment = [System.Drawing.StringAlignment]::Center
$subRect = New-Object System.Drawing.RectangleF(0, 140, $width, $height)
$g.DrawString("AeThex OS", $subFont, $subBrush, $subRect, $subSf)
$subFont.Dispose()
$subBrush.Dispose()
$subSf.Dispose()
}
if ($subtitleOpacity -gt 0.3) {
$lineAlpha = [Math]::Min(255, [Math]::Max(0, [int](($subtitleOpacity - 0.3) * 80)))
$linePen = New-Object System.Drawing.Pen([System.Drawing.Color]::FromArgb($lineAlpha, 212, 175, 55), 1)
$lineY = [int]($height / 2 + 120)
$lineHalf = [int](200 * [Math]::Min(1, ($subtitleOpacity - 0.3) / 0.5))
$g.DrawLine($linePen, [int]($width/2 - $lineHalf), $lineY, [int]($width/2 + $lineHalf), $lineY)
$linePen.Dispose()
}
$g.Dispose()
$path = Join-Path $outputDir ("{0:D5}.png" -f $frameNum)
$bmp.Save($path, [System.Drawing.Imaging.ImageFormat]::Png)
$bmp.Dispose()
}
$baseDir = "C:\Users\PCOEM\AeThexOS\bootanimation"
if (Test-Path $baseDir) { Remove-Item -Recurse -Force $baseDir }
New-Item -ItemType Directory -Force "$baseDir\part0" | Out-Null
New-Item -ItemType Directory -Force "$baseDir\part1" | Out-Null
Write-Host "Generating Part 0 (fade in - 40 frames)..."
for ($i = 0; $i -lt 40; $i++) {
$t = $i / 39.0
$textOp = [Math]::Min(1.0, $t * 2.5)
$glowOp = [Math]::Max(0, [Math]::Min(1.0, ($t - 0.1) * 2.0))
$subOp = [Math]::Max(0, [Math]::Min(1.0, ($t - 0.4) * 2.5))
Draw-Frame -frameNum $i -outputDir "$baseDir\part0" -textOpacity $textOp -glowOpacity $glowOp -subtitleOpacity $subOp
if ($i % 10 -eq 0) { Write-Host " frame $i/40" }
}
Write-Host "Part 0 done."
Write-Host "Generating Part 1 (pulse loop - 30 frames)..."
for ($i = 0; $i -lt 30; $i++) {
$t = $i / 29.0
$pulse = 0.7 + 0.3 * [Math]::Sin($t * 2 * [Math]::PI)
$glowPulse = 0.5 + 0.5 * [Math]::Sin($t * 2 * [Math]::PI)
Draw-Frame -frameNum $i -outputDir "$baseDir\part1" -textOpacity $pulse -glowOpacity $glowPulse -subtitleOpacity $pulse
if ($i % 10 -eq 0) { Write-Host " frame $i/30" }
}
Write-Host "Part 1 done."
Write-Host "All 70 frames generated!"