crash: bleh; DONE ENOUGH
This commit is contained in:
parent
5a2b1dc37b
commit
f91401e663
1 changed files with 20 additions and 11 deletions
|
@ -7,12 +7,14 @@ scattering letters everywhr`.split("\n");
|
||||||
|
|
||||||
// i like the freezing effect, but it's probably not right here;
|
// i like the freezing effect, but it's probably not right here;
|
||||||
const explode_transform = (): [string, string] => {
|
const explode_transform = (): [string, string] => {
|
||||||
const [x, y, turns] = [
|
const [x, y_, turns] = [
|
||||||
Math.random() * 20 + 35,
|
-Math.random() * 25,
|
||||||
(Math.random() - 0.5) * 10,
|
(Math.random() - 0.5) * 10,
|
||||||
Math.random() * 10,
|
Math.random() * 10,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const y = y_ < 0 ? y_ - 35 : y_ + 35;
|
||||||
|
|
||||||
return [
|
return [
|
||||||
`translate(${x.toFixed(2)}rem, ${y.toFixed(
|
`translate(${x.toFixed(2)}rem, ${y.toFixed(
|
||||||
2
|
2
|
||||||
|
@ -38,7 +40,7 @@ const Line = ({
|
||||||
{...(() => {
|
{...(() => {
|
||||||
// we're pretending that everything is the same length (we'll see if this works)
|
// we're pretending that everything is the same length (we'll see if this works)
|
||||||
const delay_per = length_s / 160;
|
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);
|
console.log(delay_per, all_delay);
|
||||||
|
|
||||||
return [...children].map((c, i) => {
|
return [...children].map((c, i) => {
|
||||||
|
@ -46,16 +48,23 @@ const Line = ({
|
||||||
return (
|
return (
|
||||||
<span
|
<span
|
||||||
style={{
|
style={{
|
||||||
transform: trans,
|
transform: inv_trans,
|
||||||
display: "inline-block",
|
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>
|
</span>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@ -117,4 +126,4 @@ const Crash = ({
|
||||||
</div>
|
</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} />);
|
||||||
|
|
Loading…
Reference in a new issue