Facepunch / sbox-issues

176 stars 12 forks source link

Add sound-in / sound-out to @keyframes #5465

Open DoctorWhoFR opened 5 months ago

DoctorWhoFR commented 5 months ago

For?

S&Box

What can't you do?

I was playing with keyframes animation in s&box, and i just saw that sound-in/out dont work with keyframes animations.

I can understand i think the base point that keyframes animated are time based, and so the sound will be executed many time, but because you add control, can you make it play only one time at specific time.

@keyframes text-animation {
    0% {
        opacity: 0;
        sound-in: error;
    }

    49% {
        opacity: 1;
        sound-in: error;
    }

    59% {
        opacity: 0;
        sound-in: error;
    }

    60% {
        opacity: 1;
        sound-in: error;
    }

    99% {
        opacity: 0;
        sound-in: error;
    }

    100% {
        opacity: 1;
        sound-in: error;
    }
}

How would you like it to work?

Playing one time a sound at the specified percentage in keyframe animation.

What have you tried?

To make a neon effect (that work great because opacity work ^^)

But i want to add sound !

Additional context

No response

DoctorWhoFR commented 5 months ago

https://github.com/Facepunch/sbox-issues/assets/26010905/90f51998-7e3b-4991-a583-ca7d1e37f933