crash: bleh; DONE ENOUGH

This commit is contained in:
mehbark 2023-12-02 23:38:16 -05:00
parent 5a2b1dc37b
commit f91401e663

View file

@ -7,12 +7,14 @@ scattering letters everywhr`.split("\n");
// i like the freezing effect, but it's probably not right here;
const explode_transform = (): [string, string] => {
const [x, y, turns] = [
Math.random() * 20 + 35,
const [x, y_, turns] = [
-Math.random() * 25,
(Math.random() - 0.5) * 10,
Math.random() * 10,
];
const y = y_ < 0 ? y_ - 35 : y_ + 35;
return [
`translate(${x.toFixed(2)}rem, ${y.toFixed(
2
@ -38,7 +40,7 @@ const Line = ({
{...(() => {
// we're pretending that everything is the same length (we'll see if this works)
const delay_per = length_s / 160;
const all_delay = (length_s * (1 - width_ratio)) / 3 - 0.2;
const all_delay = (length_s * (1 - width_ratio)) / 3;
console.log(delay_per, all_delay);
return [...children].map((c, i) => {
@ -46,16 +48,23 @@ const Line = ({
return (
<span
style={{
transform: trans,
transform: inv_trans,
display: "inline-block",
animation: `spin 0.5s ${(
delay_per * (children.length - i) +
delay_s +
all_delay
).toFixed(2)}s linear both`,
}}
>
{c}
<span
style={{
transform: trans,
display: "inline-block",
animation: `spin 0.75s ${(
delay_per * (children.length - i) +
delay_s +
all_delay
).toFixed(2)}s linear forwards`,
}}
>
{c}
</span>
</span>
);
});
@ -117,4 +126,4 @@ const Crash = ({
</div>
);
render_and_copy(<Crash vehicle="🛻" msg={msg} length_s={3} delay_s={1} />);
render_and_copy(<Crash vehicle="🛻" msg={msg} length_s={1} delay_s={5} />);