Will it work?

This commit is contained in:
Schmelczer András 2019-12-26 16:56:27 +01:00
parent 79f7c4c16f
commit f74c86f4b1
19 changed files with 193 additions and 78 deletions

View file

@ -5,6 +5,7 @@ export const generate = (
count: number,
color?: () => string,
height?: () => number,
isAnimated?: (index) => boolean,
transform?: () => string
): html => `
<section class="background">
@ -13,8 +14,12 @@ export const generate = (
? new Array(count)
.fill(0, 0, count)
.map(
_ =>
`<div style="background-color: ${color()}; height: ${height()}px; transform: ${transform()}"></div>`
(_, i) => `
<div class="${
isAnimated(i) ? "animated" : ""
}" style="background-color: ${color()}; height: ${height()}px; transform: ${transform()}"
></div>
`
)
.join("")
: ""