Active-CSS / active-css

The epic event-driven browser language for UI with functionality in one-liner CSS. Over 100 incredible CSS commands for DOM manipulation, ajax, reactive variables, single-page application routing, and lots more. Could CSS be the JavaScript framework of the future?
https://activecss.org
Other
42 stars 7 forks source link

New fullscreen action command #221

Closed bob2517 closed 2 years ago

bob2517 commented 2 years ago

The existing commands aren't complete enough and don't work in all scenarios, so I've written a new action command which will be on the branch shortly to replace the existing two action commands. I'll leave the other one for the moment and mark it as deprecated.

Syntax will be:

fullscreen: [selector|document|window|body|exit] [hide|show|auto];

The syntax covers setting and exiting fullscreen for both the document and elements, and includes the navigationUI option where applicable. It covers setting fullscreen on a target selector other than self, so it's the most flexible.

bob2517 commented 2 years ago

fullscreen: [selector|document|window|body|close] [hide|show|auto];

bob2517 commented 2 years ago

fullscreen: [selector|body|close] [hide|show|auto];

Changing so that only body can be used to go page fullscreen. It's too confusing otherwise. The HTML node gets sent when entering fullscreen, and that's where it gets confusing in MDN with documentElement. It's like, wha? I'm just going to make any fullscreen pageness to be the body, as that's the part that gets displayed. The stuff above in the DOM is implied, as it is when an element goes fullscreen. There's no need to get weird about it, so it is now, with corresponding events (for page fullscreen. It's the same events, etc. for element fullscreen):

fullscreen: body;

body:fullscreenEnter {}

fullscreen: close;

body:fullscreenExit {}
bob2517 commented 2 years ago

This is all now working offline. You lose preventDefault, etc. on the event, but there's not much you can do when the browser fullscreenchange event is fired anyway. Will commit in a sec.