This is a godawful, terrible, and useless to society idea.
So naturally I wanna see if it'd be possible. General user flow would be:
- User goes to my website, inputs some variant of konami code (
up, up, down, down, left, right, left, right, B, A and RETURN could do the trick
- This fetches a compressed data pack of Bad Apple video in bit-map form (since it's a bitone already)
- We get this by exploding out the mp4 frame by frame at 24 frames per second, decimating each image to the resolution desired for favicons.
- Then, for each frame, we pack it into a buffer where each bit represents a pixel, so 4 bytes (for a 16 x 16 image size, there's 256 pixels, divided by 8 bits in a byte for 32 bytes of binary data for a single frame)
- Upon reading this flat video content buffer, we process (iterate by 32 byte intervals) through it, generating an image in-memory
- We then begin calling whatever it is that updates the favicon every
1s / 24 frames = 0.041s per frame (might wanna time how long the favicon update takes). Alternatively, we could just swap the image the favicon is pointing to every 0.041s, and keep the favicon link stable (not sure if favicon is just cached though)
Open questions to address at the start here
Step 1 can be done with an event listener, step 2 just with an API call to download bad apple which can be done pretty easily. Step 3 is an unkown, and there's a question of timing in step4 where we want to know how long the favicon update took.
- "Can I update the favicon programmatically?"
This is a godawful, terrible, and useless to society idea.
So naturally I wanna see if it'd be possible. General user flow would be:
up, up, down, down, left, right, left, right, B, A and RETURNcould do the trick1s / 24 frames = 0.041s per frame(might wanna time how long the favicon update takes). Alternatively, we could just swap the image the favicon is pointing to every 0.041s, and keep the favicon link stable (not sure if favicon is just cached though)Open questions to address at the start here
Step 1 can be done with an event listener, step 2 just with an API call to download bad apple which can be done pretty easily. Step 3 is an unkown, and there's a question of timing in step4 where we want to know how long the favicon update took.