feat(backend): add database versioning
This commit is contained in:
@@ -3,6 +3,7 @@ Interactive CLI interface for NimbusFlow.
|
||||
"""
|
||||
|
||||
import sys
|
||||
import time
|
||||
from pathlib import Path
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
@@ -35,6 +36,13 @@ class Colors:
|
||||
ERROR = '\033[1m\033[91m' # Bold Red
|
||||
WARNING = '\033[1m\033[93m' # Bold Yellow
|
||||
INPUT_BOX = '\033[90m' # Grey
|
||||
|
||||
# Gold shimmer colors
|
||||
GOLD_DARK = '\033[38;5;130m' # Dark gold
|
||||
GOLD_MEDIUM = '\033[38;5;178m' # Medium gold
|
||||
GOLD_BRIGHT = '\033[38;5;220m' # Bright gold
|
||||
GOLD_SHINE = '\033[1m\033[38;5;226m' # Bright shining gold
|
||||
GOLD_WHITE = '\033[1m\033[97m' # Bright white for peak shine
|
||||
|
||||
|
||||
def create_input_box(prompt: str, width: int = 60) -> str:
|
||||
@@ -61,27 +69,77 @@ def clear_screen():
|
||||
print("\033[2J\033[H")
|
||||
|
||||
|
||||
def get_shimmer_color(position: int, shimmer_center: int, shimmer_width: int = 8) -> str:
|
||||
"""Get the appropriate shimmer color based on distance from shimmer center."""
|
||||
distance = abs(position - shimmer_center)
|
||||
|
||||
if distance == 0:
|
||||
return Colors.GOLD_WHITE
|
||||
elif distance == 1:
|
||||
return Colors.GOLD_SHINE
|
||||
elif distance <= 3:
|
||||
return Colors.GOLD_BRIGHT
|
||||
elif distance <= 5:
|
||||
return Colors.GOLD_MEDIUM
|
||||
elif distance <= shimmer_width:
|
||||
return Colors.GOLD_DARK
|
||||
else:
|
||||
return Colors.GOLD_DARK
|
||||
|
||||
|
||||
def animate_nimbusflow_text() -> None:
|
||||
"""Animate the NimbusFlow ASCII text and frame with a gold shimmer effect."""
|
||||
# Complete welcome screen lines including borders
|
||||
welcome_lines = [
|
||||
"╔════════════════════════════════════════════════════════════════════════════════════════════╗",
|
||||
"║ ║",
|
||||
"║ ███╗ ██╗██╗███╗ ███╗██████╗ ██╗ ██╗███████╗ ███████╗██╗ ██████╗ ██╗ ██╗ ║",
|
||||
"║ ████╗ ██║██║████╗ ████║██╔══██╗██║ ██║██╔════╝ ██╔════╝██║ ██╔═══██╗██║ ██║ ║",
|
||||
"║ ██╔██╗ ██║██║██╔████╔██║██████╔╝██║ ██║███████╗ █████╗ ██║ ██║ ██║██║ █╗ ██║ ║",
|
||||
"║ ██║╚██╗██║██║██║╚██╔╝██║██╔══██╗██║ ██║╚════██║ ██╔══╝ ██║ ██║ ██║██║███╗██║ ║",
|
||||
"║ ██║ ╚████║██║██║ ╚═╝ ██║██████╔╝╚██████╔╝███████║ ██║ ███████╗╚██████╔╝╚███╔███╔╝ ║",
|
||||
"║ ╚═╝ ╚═══╝╚═╝╚═╝ ╚═╝╚═════╝ ╚═════╝ ╚══════╝ ╚═╝ ╚══════╝ ╚═════╝ ╚══╝╚══╝ ║",
|
||||
"║ ║",
|
||||
"╚════════════════════════════════════════════════════════════════════════════════════════════╝"
|
||||
]
|
||||
|
||||
# Calculate max width for animation
|
||||
max_width = max(len(line) for line in welcome_lines)
|
||||
|
||||
# Animation parameters
|
||||
shimmer_width = 12
|
||||
total_steps = max_width + shimmer_width * 2
|
||||
step_delay = 0.025 # Seconds between frames (even faster animation)
|
||||
|
||||
# Animate the shimmer effect
|
||||
for step in range(total_steps):
|
||||
shimmer_center = step - shimmer_width
|
||||
|
||||
# Move cursor up to overwrite previous frame (10 lines total)
|
||||
if step > 0:
|
||||
print(f"\033[{len(welcome_lines)}A", end="")
|
||||
|
||||
for line in welcome_lines:
|
||||
for i, char in enumerate(line):
|
||||
if char.isspace():
|
||||
print(char, end="")
|
||||
else:
|
||||
color = get_shimmer_color(i, shimmer_center, shimmer_width)
|
||||
print(f"{color}{char}{Colors.RESET}", end="")
|
||||
|
||||
print() # New line after each row
|
||||
|
||||
# Add a small delay for animation
|
||||
time.sleep(step_delay)
|
||||
|
||||
|
||||
|
||||
|
||||
def display_welcome():
|
||||
"""Display welcome screen."""
|
||||
"""Display welcome screen with animated shimmer effect."""
|
||||
print("\033[2J\033[H") # Clear screen and move cursor to top
|
||||
|
||||
# NimbusFlow branding
|
||||
welcome_text = """
|
||||
╔════════════════════════════════════════════════════════════════════════════════════════════╗
|
||||
║ ║
|
||||
║ ███╗ ██╗██╗███╗ ███╗██████╗ ██╗ ██╗███████╗ ███████╗██╗ ██████╗ ██╗ ██╗ ║
|
||||
║ ████╗ ██║██║████╗ ████║██╔══██╗██║ ██║██╔════╝ ██╔════╝██║ ██╔═══██╗██║ ██║ ║
|
||||
║ ██╔██╗ ██║██║██╔████╔██║██████╔╝██║ ██║███████╗ █████╗ ██║ ██║ ██║██║ █╗ ██║ ║
|
||||
║ ██║╚██╗██║██║██║╚██╔╝██║██╔══██╗██║ ██║╚════██║ ██╔══╝ ██║ ██║ ██║██║███╗██║ ║
|
||||
║ ██║ ╚████║██║██║ ╚═╝ ██║██████╔╝╚██████╔╝███████║ ██║ ███████╗╚██████╔╝╚███╔███╔╝ ║
|
||||
║ ╚═╝ ╚═══╝╚═╝╚═╝ ╚═╝╚═════╝ ╚═════╝ ╚══════╝ ╚═╝ ╚══════╝ ╚═════╝ ╚══╝╚══╝ ║
|
||||
║ ║
|
||||
║ 🎵 Scheduling System 🎵 ║
|
||||
╚════════════════════════════════════════════════════════════════════════════════════════════╝
|
||||
"""
|
||||
print(welcome_text)
|
||||
print() # Add some top padding
|
||||
animate_nimbusflow_text()
|
||||
print()
|
||||
|
||||
|
||||
@@ -355,7 +413,7 @@ def run_interactive_mode(cli: "NimbusFlowCLI"):
|
||||
display_welcome()
|
||||
|
||||
print(f"{Colors.HEADER}Welcome to the NimbusFlow Interactive CLI{Colors.RESET}")
|
||||
print(f"{Colors.DIM}Navigate through menus to manage your choir scheduling system.{Colors.RESET}")
|
||||
print(f"{Colors.DIM}Navigate through menus to manage your scheduling system.{Colors.RESET}")
|
||||
print()
|
||||
input(f"{Colors.DIM}Press Enter to continue...{Colors.RESET}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user