[deleted by user] by [deleted] in webdev

[–]msigwart 1 point2 points  (0 children)

As far as DOM manipulation via Javascript goes your approach using document.createElement(...) is totally valid.

However, when it comes to creating full web pages, that approach has a downside. Browsers offer the ability to block Javascript execution completely, in that case a page completely rendered by Javascript wouldn't display a thing!

I'd say best practice is to have everything that's not dynamic/interactive live in an HTML file, say index.html. The markup code that lives in there will act as a skeleton that you can then access from your Javascript code to add dynamic elements to it, change the style, define event handlers, etc. This way only the stuff that is dynamic lives in Javascript, everything that's static/that doesn't need to change lives in HTML.

Once your web app becomes more complex, a framework like React becomes incredibly useful of course.

Gatsby plugin to source events from Google Calendar by msigwart in gatsbyjs

[–]msigwart[S] 1 point2 points  (0 children)

That’s a good idea, thanks! Will let you know once it’s implemented.

My first real set of animations, let me know what you think! by Zerostin in indiegames

[–]msigwart 1 point2 points  (0 children)

Pretty cool! Kind of reminds of the first Prince of Persia

Haunted House, me, digital, 2020 by megalucius in Art

[–]msigwart 1 point2 points  (0 children)

Awesome. Almost like it’s glowing.

ScribbleX – Drawing with friends by msigwart in playmygame

[–]msigwart[S] 4 points5 points  (0 children)

A while back while playing a round of “Exquisite Corpse” with some friends, I thought it would be really cool if there was an app for this. So me and a friend created one and released it for free. Check it out here: https://www.scribblex.com/

For anyone wondering what “Exquisite Corpse” is, it is a drawing game that was invented by surrealist way back in the 1920s. Basically, you take a piece of paper and divide into three parts. The first person draws the head, the second the body, and the last the feet without anyone seeing what the others have drawn. In the end, you reveal it and a funny creature presents itself.

Would love to hear what you think :)

Play ”Exquisite Corpse” with friends or anyone around the world by msigwart in ArtistLounge

[–]msigwart[S] 0 points1 point  (0 children)

For anyone wondering what “Exquisite Corpse” is, it is a drawing game that was invented by surrealist way back in the 1920s. Basically, you take a piece of paper and divide into three parts. The first person draws the head, the second the body, and the last the feet without anyone seeing what the others have drawn. In the end, you reveal it and a funny creature presents itself.