Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Helper function to perform smooth color transitions
- local function smoothTransition(colorSequence, delay)
- for _, color in ipairs(colorSequence) do
- term.setBackgroundColor(color)
- term.clear()
- sleep(delay)
- end
- end
- -- Intro Transition: Fade from white to black
- local function introTransition()
- local fadeColors = {
- colors.white, colors.lightGray, colors.gray, colors.darkGray, colors.black
- }
- smoothTransition(fadeColors, 0.1)
- end
- -- Outro Transition: Fade from black to white
- local function outroTransition()
- local fadeColors = {
- colors.black, colors.darkGray, colors.gray, colors.lightGray, colors.white
- }
- smoothTransition(fadeColors, 0.1)
- end
- -- Additional effect: Slight flicker before locking screen
- local function flickerEffect()
- for _ = 1, 3 do
- term.setBackgroundColor(colors.white)
- term.clear()
- sleep(0.05) -- Flicker effect speed
- term.setBackgroundColor(colors.black)
- term.clear()
- sleep(0.05)
- end
- end
- -- Main Program Execution
- introTransition() -- Fade from white to black
- os.pullEvent("key") -- Wait for any key press
- outroTransition() -- Fade back from black to white
- sleep(0.1) -- Optional buffer after outro transition
- flickerEffect() -- Add flicker effect before locking
- shell.run("/disk/os/lock") -- Lock the system
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement