dog

Only here to post about CD-ROMs

I want!!
⬅️ this mark
🍷white
and Taste 🦆11
require

 

 

(Avatar by @texture, CD-ROM Journal button by @candiedreptile)


CD-ROM Journal
cdrom.ca/

blackle
@blackle

Firstly, succumb to the knowledge that SVG files can have javascript embedded in them. Here is an example of some SVG art I made with a color-picker built into it.

Secondly, a fun fact: In SVG, a block of javascript code can live inside a tag alongside vector graphics. This means if you copy that group to another SVG document (e.g. in inkscape) the script will come along too.

So consider: an alternate history where SVG won over HTML. One where someone wrote some javascript that dynamically resizes the SVG viewbox depending on display resolution, and implements a grid-based layout system. I'm 50% sure this is possible, someone would just have to implement it.

So given paragraph 1, 2, and 3 together: I'm imagining that you could distribute scripts for SVG web pages as fancy vector graphics with the javascript inside its group tag. So if you were to load one of these alternate universe web pages into a graphics editor, you'd be able to see all the libraries it uses arranged in a neat row just outside the canvas extents. a screenshot from inkscape showing a hypothetical SVG-based webpage open for editing. above the actual canvas, out of view when the svg is loaded, are a series of library logos. the first is "svggrid.js" which has a pink logo, then the mit licensed "libforms2" which is a blue hexagon, then "printer" whose logo is a printer. then the twitter logo with a badge saying "svgjs." next is a clock that says "v2.9a" on it, then an emblem with a big question mark saying "superquery", and the last two logos are a generic script file icon. Anyway, I just think that would be neat

this post is adapted from an old masto thread of mine


dog
@dog

I wish I could find it now, because there was a guy who used to barge into any discussion about CSS to let you know you could make whole websites in SVG, no CSS or HTML needed. His personal site he linked as an example was garish and only looked right in a single web browser window size, but I can't argue that it worked


You must log in to comment.

in reply to @blackle's post:

.1) wow having javascript in an svg is really cool actually?? 2) i'm able to open svgs in my browser, so isn't it still possible to make svg web pages? or is there something i'm missing, i'm not a super technical person lol

I've been doing a bit of SVG shenanigans at work lately and the biggest problem with it is it can't dynamically resize things around flowing text. Best solution I've found is to embed some HTML, measure it with JS, then resize elements around it. Slightly janky as you get a kind of "flash of unlayouted document" but works ok. Doing that for a whole page would likely be a nightmare but also kind fun. These days I think canvas would work better, but in the universe where SVG won I'm sure they solved the layout issue nicely enough.

i wrote a website in SVG a few years ago. it was a dumb idea and a general pain in the ass but it was funny

also i wonder if you could get a JS framework to output a single SVG

I've made SVG pages for absolute lunatic clients whose stuff wasn't really practical in HTML before, but surely the whole point is no grid system

Mobile breaks of the kind people now expect are a lost cause tho (the workspace will resize to fit the screen but afaik everything can only be absolutely positioned in that space, if you want a big wide layout and a tiny vertical one you're basically making two separate copies of the page and letting css/js determine which to display after loading)

in reply to @dog's post: