News for hackers. Stuff that matters.
Re:CSS in GitHub Readmes by boomskats on Tuesday December 08, 2020 @02:49PM (#25350406)
If anyone's interested, I'm particularly proud of my SVG animations in this readme:

https://github.com/boemska/create-sas-app

Re:CSS in GitHub Readmes by felixfbecker on Tuesday December 08, 2020 @03:52PM (#25351191)
If you're interested in adding SVGs that look like truthful screenshots, I wrote a Chrome/Firefox extension that can take screenshots of webpages in SVG: https://github.com/felixfbecker/svg-screenshots

It can't screen record an animation though, but it could be a baseline for hand-animating the elements. Accepting PRs for screen recording functionality :D

Re:CSS in GitHub Readmes by chaorace on Tuesday December 08, 2020 @04:09PM (#25351378)
Similar: emacs can take SVG screenshots of itself:

https://gist.githubusercontent.com/alphapapa/65b0b9d4b3f5534...

Re:CSS in GitHub Readmes by globuous on Tuesday December 08, 2020 @06:00PM (#25352729)
That's insane ^^
Re:CSS in GitHub Readmes by fergie on Wednesday December 09, 2020 @03:40AM (#25356587)
Seems to depend on Cairo, which is AKAIK only available in X11 environments. Does anybody know how to get this working on OSX?
Re:CSS in GitHub Readmes by fkistner on Wednesday December 09, 2020 @07:12AM (#25357760)
macOS has APIs to get a vector PDF snapshot from any view/window [1]. If emacs ends up drawing using platform APIs such as CoreText it should be possible to get a screenshot that way.

[1]: https://developer.apple.com/documentation/appkit/nswindow/14...

Re:CSS in GitHub Readmes by tomashubelbauer on Wednesday December 09, 2020 @01:30AM (#25355920)
Looks like we have a similar hobby!

https://github.com/TomasHubelbauer/SVG-Screencast

This is for screen recordings. SVG animations as the OP I play around with, too:

https://github.com/TomasHubelbauer/SVG-3D

:)

Re:CSS in GitHub Readmes by felixfbecker on Wednesday December 09, 2020 @06:37AM (#25357587)
Oh that's cool! Did you ever think about recreating the DOM in SVG elements in animating those with CSS, instead of using raster images? It would potentially be possible with MutationObserver, and optionally "copying" any CSS animations in the source DOM. Will likely not be perfect but could still be a good trade-off for a little demo animation of e.g. how to fill out a certain form instead of using a GIF or video.
Re:CSS in GitHub Readmes by tomashubelbauer on Wednesday December 09, 2020 @06:58AM (#25357695)
I'm building this to use to record Electron window recordings - I ultimately want to use this to automatically build animated SVGs showcasing features of VS Code extensions as a part of their CI so the showcased can be coded using VS Code API and the animations in the extension readme just fall out of that. So no DOM in this case. But I am thinking of ways to optimize this. I know this will be used for screen recordings and that gives me some flexibility in what assumptions I can make in the optimization pipeline. At the moment I plan on trying to come up with an algorithm to detect scrolling/jumping regions (like in the demo where the whole line height grows once the first emoji is typed on a given line) and animate their scrolling and cropping using CSS animations instead of image patches. But I think what you describe is definitely something to explore and I might take that up next if I figure a use case for it as it sounds really interesting and fun!
Re:CSS in GitHub Readmes by unicornporn on Wednesday December 09, 2020 @07:17AM (#25357781)
I can't find it on addons.mozilla.org. According to Mozilla[1] I can only use unsigned addons with ESR, Nightly and the Developer Edition of Firefox (which I don't use). I've tried setting xpinstall.signatures.required to false in about:config. It's not helping.

[1] https://support.mozilla.org/en-US/kb/add-on-signing-in-firef...

Re:CSS in GitHub Readmes by felixfbecker on Wednesday December 09, 2020 @04:03PM (#25364951)
It's linked from the README: https://addons.mozilla.org/en-US/firefox/addon/svg-screensho... No need to add an unsigned extension :)
Re:CSS in GitHub Readmes by unicornporn on Saturday December 12, 2020 @05:06PM (#25402207)
Oh! I looked for it, I promise!
Re:CSS in GitHub Readmes by CharlesW on Tuesday December 08, 2020 @04:08PM (#25351373)
Whoa, if this does what I hope it does I'll be ecstatic! Thank you!

(Here's the Chrome extension link for anyone who's interested: https://chrome.google.com/webstore/detail/svg-screenshot/nfa...)

Re:CSS in GitHub Readmes by wjdp on Wednesday December 09, 2020 @08:26AM (#25358199)
Sounds cool but no examples in the README so (lazy) potential users have no idea whether it's worth looking into.

Source: I am lazy.

Re:CSS in GitHub Readmes by felixfbecker on Wednesday December 09, 2020 @04:01PM (#25364903)
The only reason I didn't have examples was because I am lazy. Your argument about laziness convinced me, so I added some: https://github.com/felixfbecker/svg-screenshots#examples
Re:CSS in GitHub Readmes by wjdp on Wednesday December 09, 2020 @04:50PM (#25365720)
Haha, rock on! (Looks great btw)
Re:CSS in GitHub Readmes by mstade on Wednesday December 09, 2020 @01:11AM (#25355842)
This is great, thank you!

I'd love a tool like this for generating animated SVG clips of a web page, it'd help immensely when creating walkthroughs. Video recordings do work, but it's a mess working with different encodings to make it look ok. Not to mention, with SVG such walkthroughs could actually be made interactive...

Re:CSS in GitHub Readmes by eins1234 on Tuesday December 08, 2020 @04:48PM (#25351825)
This is really cool!

Would be super helpful to have some example screenshots linked in the readme though, to help set expectations.

Re:CSS in GitHub Readmes by felixfbecker on Tuesday December 08, 2020 @05:52PM (#25352641)
Here are some examples produced by the tests of the underlying library, including HN, GitHub and the Google homepage: https://github.com/felixfbecker/dom-to-svg/suites/1630896833...

The tests take a PNG screenshot of the webpage, then a PNG screenshot of the created SVG and pixelmatch the two. The difference must be below 0.5% for tests to pass.

Re:CSS in GitHub Readmes by Assossa on Tuesday December 08, 2020 @09:39PM (#25354672)
404's for me
Re:CSS in GitHub Readmes by felixfbecker on Wednesday December 09, 2020 @06:39AM (#25357595)
Ah, looks like GitHub actions don't allow public access to artifacts: https://github.community/t/public-read-access-to-actions-art...

In that case - just install the extension and try it out? :)

Re:CSS in GitHub Readmes by felixfbecker on Wednesday December 09, 2020 @04:02PM (#25364908)
Re:CSS in GitHub Readmes by lukevi on Wednesday December 09, 2020 @09:21AM (#25358707)
I recognize your name from some of the VS Code extensions that I use and just want to say thank you!
Re:CSS in GitHub Readmes by greggman3 on Tuesday December 08, 2020 @10:03PM (#25354837)
crashed on the first page I tried it on
Re:CSS in GitHub Readmes by felixfbecker on Friday December 11, 2020 @04:48AM (#25383972)
Could you file a bug here and include the URL you tried it on? https://github.com/felixfbecker/dom-to-svg/issues/new
Re:CSS in GitHub Readmes by conceptualspace on Tuesday December 08, 2020 @03:07PM (#25350650)
ah i could have used this. my readme is a simulation of a github profile ;)

https://github.com/conceptualspace

Re:CSS in GitHub Readmes by ggerganov on Tuesday December 08, 2020 @03:28PM (#25350894)
Cool idea, although with the new Dark mode on Github enabled it was very easy to see what is going on :)
Re:CSS in GitHub Readmes by tomwojcik on Tuesday December 08, 2020 @03:25PM (#25350854)
Freezes mobile GH app on Android.
Re:CSS in GitHub Readmes by mstade on Wednesday December 09, 2020 @01:08AM (#25355824)
This pleases me more than it should! Cool stuff! :o)
Re:CSS in GitHub Readmes by mstade on Wednesday December 09, 2020 @01:05AM (#25355813)
Hi! Just wanted to say this is an excellent readme, and your Boemska website is equally great. Very impressive – kudos to you and keep up the great work!
Re:CSS in GitHub Readmes by boomskats on Wednesday December 09, 2020 @07:19AM (#25357793)
Thank you for your kind words. That's made my day :)
Re:CSS in GitHub Readmes by notretarded on Tuesday December 08, 2020 @03:27PM (#25350876)
Awfully laggy on slow machines.
Re:CSS in GitHub Readmes by boomskats on Tuesday December 08, 2020 @05:11PM (#25352102)
That's the termtosvg animation ruining it for all the others. I'm actually going to replace it with a gif. The UI anims are really smooth.
Re:CSS in GitHub Readmes by jrib on Tuesday December 08, 2020 @02:59PM (#25350533)
what did you use to create them?
Re:CSS in GitHub Readmes by arusahni on Tuesday December 08, 2020 @03:08PM (#25350656)
Based on the SVG markup, termtosvg [1].

1: https://github.com/nbedos/termtosvg