News for hackers. Stuff that matters.
Re:Anime.js – A lightweight JavaScript animation library by alin23 on Friday June 23, 2023 @06:01AM (#36444820)
One less known use case for this is creating animated UI demos, which as a dev I find harder to do using video editing software.

I used it to create the simple demo on the rcmd frontpage: https://lowtechguys.com/rcmd

This is the code, where I'm just animating elements of an SVG I previously created with Sketch: https://github.com/FuzzyIdeas/lowtechguys/blob/main/src/rcmd...

I'm also doing the same thing for the Lunar frontpage: https://lunar.fyi/

But because Lunar's demo is a lot more resource intensive, I pre-rendered it into a video, and heavily optimized it for each screen size, in H.265, WEBM and H.264.

One of the biggest hurdles in Lunar's case was how to make the video have transparent regions. With Anime.js you are able to animate individual elements, placed around static text and buttons, which you can't do with videos.

Alpha support in videos is not so good, so I had to create a full-page video (in both portrait and landscape) with the right background color, and placed it as a background layer with a low z-index.

Finding the right video compression parameters to avoid background grain was not easy.

Re:Anime.js – A lightweight JavaScript animation library by RyanHamilton on Friday June 23, 2023 @06:06AM (#36444844)
rcmd looks cool. Good work. I use Windows + Number to go to the same apps, your idea of letters is a definitive improvement.
Re:Anime.js – A lightweight JavaScript animation library by alin23 on Friday June 23, 2023 @06:12AM (#36444870)
Thanks! That's where I got rcmd's inspiration from, I was previously a Window power user and sorely missed the WinKey+number hotkey.
Re:Anime.js – A lightweight JavaScript animation library by criley2 on Friday June 23, 2023 @09:13AM (#36446384)
As a windows power user using OSX for work, does your tool allow you to cycle through open windows by repeating the button?

While I do love cmd+` for window switching in OSX, I still prefer Win+#### (repeated taps of the same number like Win+1,1,1) to cycle through my chrome windows in a known order. (So Win+1,1 always opens my second chrome window).

Also for anyone else in this situation, is there a way to click on an app in the OSX dock and have it not surface every single window all at once? 2 years of OSX and I still struggle when all 6 chrome windows are surfaced and drown out my perfectly arranged other work.

Re:Anime.js – A lightweight JavaScript animation library by alin23 on Friday June 23, 2023 @09:33AM (#36446625)
By default it doesn't do that, because window focusing needs special privileges that App Store apps don't have.

There is an addon thing that you can install by clicking on the Switcher button and scrolling all the way to the bottom to find the Install experimental window switching button.

After that is installed, a new "Cycle Windows" button will appear: https://shots.panaitiu.com/klbRwgTG

The addon will also assign the Right Option key for focusing specific windows of the focused app, by letter: https://shots.panaitiu.com/j9cgRP9C

Re:Anime.js – A lightweight JavaScript animation library by jtha on Friday June 23, 2023 @11:13AM (#36447970)
I've been using a simple home-made Autohotkey script for years (decade?) to do it more like rmcd is doing.

Here's an example for opening Chrome or switching to it if it's open. If there is more than one Chrome window open it cycles between them by minimizing the current one, then opening the next one etc.

SetTitleMatchMode, 2

#c::

IfWinExist, Google Chrome

  IfWinActive

    WinMinimize

  else

    Winactivate

  else

    run,"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
return
Re:Anime.js – A lightweight JavaScript animation library by aloer on Friday June 23, 2023 @07:38AM (#36445487)
Does rcmd expose an api to e.g. call it via shell action in BTT? I would like to keep using BTT for higher level config.

In BTT I have currently set right cmd as a second hyper key (first one being caps). I could see rcmd being useful if I can define on a per key basis if it should run or not.

PS: Great blog you have

Re:Anime.js – A lightweight JavaScript animation library by alin23 on Friday June 23, 2023 @07:58AM (#36445635)
Hey thanks!

No, rcmd does not expose any API, but you can disable/enable only specific letters from the Settings: https://shots.panaitiu.com/zz8Y2kxL

You can also change the trigger key from ⌘ Right Command to any combination of direction-aware modifiers.

Also, if you don't make use of rcmd's dynamically assigned apps and you prefer to assign a letter to a specific app, you can use BTT only for this, no need for going through rcmd.

BTT has a focus-or-open action and it's what I used before building rcmd. It can't hide or cycle apps with the same letter like rcmd does but it's good enough for some people.

Re:Anime.js – A lightweight JavaScript animation library by SebastianKra on Friday June 23, 2023 @02:22PM (#36450473)
After a bit of reluctance to give up my right CMD-key, I decided to try rcmd and it has since disappeared into my workflow like no other app since window snapping.

Unlike similar solutions, unused keys are assigned dynamically based on the first letter of the app. So I can have my main apps on 1,2,3... and the rest will change based on which apps are open.