I added a couple of features this time and polished a few:
- Resizing windows is now possible. It’s controlled by two invisible divs on top of the bottom and right edges of the window, and works similarly to the drag function, but it only tracks the change in position of one axis and changes the width/height css attributes of the window accordingly. The resizing is also clamped so that the windows can’t be too small.
- Dragging and resizing windows are smoother thanks to setting pointer-events on the iframes to “none” when dragging, so that you won’t stop dragging when your cursor accidentally moves into them.
- I fixed that header thing last time by first making the function wait for the iframe to load before continuing, then using querySelector for the title. For the pages that I get security errors on, the page link is a fallback (the or operator is SO useful). As an added bonus, it automatically returns “Error” when there’s an https error that I can’t really figure out yet.
- There’s a right click context menu now. At the moment, it just opens a dialog to open another file, but it will expand as I add more features. It suppresses the regular context menu with event.preventDefault, which is a pretty neat function.
- The aforementioned file opener was added. It’s a bit goofy now, but it works and even handles errors when you leave the field blank.
After adding a file explorer, I should be ready to add content and actually put it online (the github pages is still set to my old website to keep it clean)
Log in to leave a comment