User avatar
⬡-49016 neobot_box_cat_ears @49016@catgirl.cloud
1y
hey fedi can MFM periodically show & hide an element forever?

as in cycling through each of these lines
a
 b
  c
   d



edit: yep!
abcd
2
0
0
0
User avatar
snail on head @nellePoint@limbo.town
1y
@49016 like fade?
1
0
1
0

User avatar
⬡-49016 neobot_box_cat_ears @49016@catgirl.cloud
1y
@nellePoint well, that just fades it in and out, it wants to completely show/hide them
1
0
0
0
User avatar
snail on head @nellePoint@limbo.town
1y
@49016 its possible to set the fade speed and the speed in which it switches between the two i believe

so one could probably make something akin to that

i cant remember if the two are differentiated or not
1
0
1
0
User avatar
snail on head @nellePoint@limbo.town
1y
2
0
1
0
User avatar
⬡-49016 neobot_box_cat_ears @49016@catgirl.cloud
1y
mfm @nellePoint @mia fade.delay just sets the css animation-delay like this: test
0
0
1
0
User avatar
mia @mia@void.rehab
1y
mfm @nellePoint @49016
make an offset rotated node to make it start offscreen, then use a spin to spin it back onscreen, and then use a counterspin to make it stay in place
like this <--- example

then you can add another offset spin with a delay to make it go away, and maybe even a counterspin if you're feeling fancy
like this <--- example

use both to make it appear and disappear
like this <--- example

(show/hide cw to reset animation)
2
0
1
0
User avatar
mia @mia@void.rehab
1y
mfm @nellePoint @49016 you can do fades with slow speeds to make something disappear, but i don't believe that's portable outside of firefish derivatives
like this <--- example
1
0
1
0
User avatar
⬡-49016 neobot_box_cat_ears @49016@catgirl.cloud
1y
mfm @mia @nellePoint works on mastodon at least lol
0
0
1
0
User avatar
⬡-49016 neobot_box_cat_ears @49016@catgirl.cloud
1y
mfm @mia @nellePoint mm it thought of doing so but that doesn't loop (or, well, loops only N times for N characters of code which does Not scale)

this was a lot easier back on cohost lol
1
0
1
0
User avatar
mia @mia@void.rehab
1y
@49016 @nellePoint there is no way to loop disappearing/appearing. all the mfm effects are continuous
1
0
1
0
User avatar
⬡-49016 neobot_box_cat_ears @49016@catgirl.cloud
1y
@mia @nellePoint actually there is

abcd
1
0
1
0
User avatar
mia @mia@void.rehab
1y
@49016 @nellePoint ah yeah, there's jump, surprised it's sticky for so long
1
0
1
0
User avatar
⬡-49016 neobot_box_cat_ears @49016@catgirl.cloud
1y
@mia @nellePoint thats the neat part: it isnt sticky at all. it goes 0 -> 16 -> 0 -> 8 -> 0

but, the funny thing is, [0, 16, 0, 8, 0] + [0, 8, 0, 16, 0] * -2 is [0, 0, 0, 24, 0] and that can be (ab)used by stacking jumps and scales like this:
let normalJump = ({speed, delay = 0, pixels = 24}) => pipe (
    scale ({y: pixels / 24}),
    jump ({speed, delay}),
    scale ({y: -2}),
    jump ({speed, delay: delay + 0.5 * speed}),
    unscale ({y: (pixels / 24) * -2}),
)

let blink = ({speed, delay = 0, hideSpeed = 1}) => pipe(
    mfmLit`crop`,
    normalJump ({speed, delay, pixels: 24 * 5 ** hideSpeed}),
)

console.log(
    blink({speed: 4, delay: 0 - .5}) (blink({speed: 2, delay: 0})("a")) +
    blink({speed: 4, delay: 0 + .5}) (blink({speed: 2, delay: 1})("b")) +
    blink({speed: 4, delay: 2 - .5}) (blink({speed: 2, delay: 0})("c")) +
    blink({speed: 4, delay: 2 + .5}) (blink({speed: 2, delay: 1})("d"))
)
1
0
1
0
User avatar
⬡-49016 neobot_box_cat_ears @49016@catgirl.cloud
1y
@mia @nellePoint (also feel free to point out if there is a better way to do any of this since atm a 4 state loop needs 48+ mfm functions. this one has no idea what the fuck it is doing, it wrote its first mfm a few hours ago lol)
1
0
1
0
User avatar
mia @mia@void.rehab
1y
@49016 @nellePoint jump is the only looping linear movement that doesn't involve other stuff (like bounce). you might be able to do it with offset spins though. just gotta find a linkage to do what you want
1
0
1
0
User avatar
⬡-49016 neobot_box_cat_ears @49016@catgirl.cloud
1y
@mia @nellePoint mm even the best fourier transform will not get a perfectly still state inbetween; there would probably be some visible wobble

oh well. 48 fns it is lol
1
0
2
0
User avatar
mia @mia@void.rehab
1y
@49016 @nellePoint
well you could alternate it
1
0
1
0
User avatar
⬡-49016 neobot_box_cat_ears @49016@catgirl.cloud
1y
@mia @nellePoint ooo good point. thats a lot less MFM too lol
0
0
2
0