How do some electronics with on/off or mode/off switches turn off with a CRT shutdown animation and/or closing tune?

The electronics I'm talking about have an LED screen.

Not nearly enough for anyone to even guess. What is a "CRT shutdown animation"?

Google it

The switch is just an input that runs a program which entertains you for a bit, then turns off the hardware.

Not likely I'll be doing that....

You are the one with the question; to prevent us from finding the wrong stuff, you should provide the information that was requested.

I can't remember ever seeing a Cathode Ray Tube with an animation.

Remember these forums are populated by volunteers, trying to help you.

@s355 I assume (for lack of more detailed information) that you refer to devices where, if you press the power button when they're on, they display an animation before turning off. This implies that the power button doesn't actually break the power circuit, but it is usually simply a momentary push button that sends a signal to a processor which picks it up and runs a power-down sequence. Finally the device may unlatch a relay, effectively turning part of the system off. Usually this sort of equipment remains powered at all times, at least a part of it, to allow the soft-turn-on/off to work.

The electronics I'm talking about have slide switches or toggle switches.

Perhaps if you post a specific example with some more details we can guess more accurately how it works. Otherwise contact the manufacturer and ask them how they do it.

The image or mental picture you have of what you want to do is not being well translated into words so that others may read your words and have the same image as you do. Perhaps you might want to restate your thing do?

If the switch actually breaks a connection to Vcc or whatever, there may be a large capacitor in the circuit: the processor sees the impending doom of being unpowered, and uses stored energy in the capacitor to make a "last gasp" display of some kind.

a7