camekommd

anim

Aug 27th, 2026
8
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.42 KB | None | 0 0
  1. -- Define the title and APIs
  2. local title = "Starting CameronOS..."
  3. local apis = {
  4. "Loading API: rednet",
  5. "Loading API: orangeFS",
  6. "Loading API: quarrysound",
  7. "Loading API: sunUI"
  8. }
  9.  
  10. -- Get terminal size and calculate the middle of the screen
  11. local w, h = term.getSize()
  12. local wm, hm = w / 2, h / 2
  13.  
  14. -- Function to display the title with animation and the APIs below it
  15. parallel.waitForAny(function()
  16. -- Flashing Title Animation
  17. for _ = 1, 2 do
  18. term.setBackgroundColor(colors.red)
  19. term.setTextColor(colors.gray)
  20. term.setCursorPos(wm - (#title / 2), hm)
  21. term.clear()
  22. term.write(title)
  23. sleep(0.2)
  24.  
  25. term.setBackgroundColor(colors.green)
  26. term.setTextColor(colors.lightGray)
  27. term.setCursorPos(wm - (#title / 2), hm)
  28. term.clear()
  29. term.write(title)
  30. sleep(0.2)
  31.  
  32. term.setBackgroundColor(colors.cyan)
  33. term.setTextColor(colors.white)
  34. term.setCursorPos(wm - (#title / 2), hm)
  35. term.clear()
  36. term.write(title)
  37. sleep(0.2)
  38. end
  39.  
  40. -- Set the background and text colors
  41. term.setBackgroundColor(colors.cyan)
  42. term.setTextColor(colors.white)
  43. term.setCursorPos(wm - (#title / 2), hm)
  44. term.clear()
  45. term.write(title)
  46. sleep(1)
  47.  
  48. -- Start loading APIs beneath the title
  49. local apiStartY = hm + 2 -- Start two lines below the title
  50.  
  51. for i, api in ipairs(apis) do
  52. -- Calculate the X position for the API to align it under the title
  53. local apiX = wm - (#api / 2)
  54.  
  55. -- Flashing Effect for APIs
  56. for _ = 1, 2 do
  57. term.setBackgroundColor(colors.cyan)
  58. term.setTextColor(colors.lightGray)
  59. term.setCursorPos(apiX, apiStartY + i - 1) -- Position each API under the title
  60. term.clearLine()
  61. term.write(api)
  62. sleep(0.025)
  63.  
  64. term.setBackgroundColor(colors.cyan)
  65. term.setTextColor(colors.gray)
  66. term.setCursorPos(apiX, apiStartY + i - 1)
  67. term.clearLine()
  68. term.write(api)
  69. sleep(0.025)
  70. end
  71. end
  72. end)
  73.  
  74. sleep(2)
  75. term.setBackgroundColor(colors.black)
  76. term.setTextColor(colors.white)
  77. term.clear()
  78.  
  79. -- Optional: You can add more actions here after the animation
  80. -- Transition to terminal or other actions
  81. term.setTextColor(colors.white)
  82. term.setCursorPos(1, 1)
  83.  
Advertisement
Add Comment
Please, Sign In to add comment