Advertisement
DOGGYWOOF

Untitled

Nov 21st, 2024
5
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. -- Helper function to perform smooth color transitions
  2. local function smoothTransition(colorSequence, delay)
  3. for _, color in ipairs(colorSequence) do
  4. term.setBackgroundColor(color)
  5. term.clear()
  6. sleep(delay)
  7. end
  8. end
  9.  
  10. -- Intro Transition: Fade from white to black
  11. local function introTransition()
  12. local fadeColors = {
  13. colors.white, colors.lightGray, colors.gray, colors.darkGray, colors.black
  14. }
  15. smoothTransition(fadeColors, 0.1)
  16. end
  17.  
  18. -- Outro Transition: Fade from black to white
  19. local function outroTransition()
  20. local fadeColors = {
  21. colors.black, colors.darkGray, colors.gray, colors.lightGray, colors.white
  22. }
  23. smoothTransition(fadeColors, 0.1)
  24. end
  25.  
  26. -- Additional effect: Slight flicker before locking screen
  27. local function flickerEffect()
  28. for _ = 1, 3 do
  29. term.setBackgroundColor(colors.white)
  30. term.clear()
  31. sleep(0.05) -- Flicker effect speed
  32. term.setBackgroundColor(colors.black)
  33. term.clear()
  34. sleep(0.05)
  35. end
  36. end
  37.  
  38. -- Main Program Execution
  39. introTransition() -- Fade from white to black
  40. os.pullEvent("key") -- Wait for any key press
  41. outroTransition() -- Fade back from black to white
  42. sleep(0.1) -- Optional buffer after outro transition
  43. flickerEffect() -- Add flicker effect before locking
  44. shell.run("/disk/os/lock") -- Lock the system
  45.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement