Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Transition Effect with CRT Scanlines
- local function transitionToCRT(colorSequence, delay)
- local _, height = term.getSize() -- Get terminal width and height
- for _, color in ipairs(colorSequence) do
- term.setBackgroundColor(color)
- term.clear()
- -- Simulating CRT scanlines (by alternating row colors)
- for y = 1, height do
- term.setCursorPos(1, y)
- if y % 2 == 0 then
- -- Dark row for scanline effect
- term.write(" ")
- else
- -- Normal row
- term.write(" ")
- end
- end
- sleep(delay)
- end
- end
- -- Intro Transition: Fade to Black with CRT Effect
- local function introTransition()
- local colorsToFade = {
- colors.white, colors.lightGray, colors.gray, colors.black
- }
- transitionToCRT(colorsToFade, 0.1)
- end
- -- Outro Transition: Fade to White with CRT Effect
- local function outroTransition()
- local colorsToFade = {
- colors.black, colors.gray, colors.lightGray, colors.white
- }
- transitionToCRT(colorsToFade, 0.1)
- end
- -- Main Program
- introTransition() -- Smooth transition to blank screen with CRT effect
- os.pullEvent("key") -- Wait for any key press
- outroTransition() -- Smooth transition to white with CRT effect
- sleep(0.1) -- Wait an additional 0.1 seconds after the outro transition
- shell.run("/disk/os/lock") -- Run the lock program
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement