From 02f3164af3a25e208b4c4dd67c6efc3ef4cb1400 Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Thu, 7 Sep 2023 17:50:35 +0200 Subject: [PATCH] docs: improve landing grid performances --- docs/components/home/HomeTetris.vue | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/components/home/HomeTetris.vue b/docs/components/home/HomeTetris.vue index e5c25594..10332c24 100644 --- a/docs/components/home/HomeTetris.vue +++ b/docs/components/home/HomeTetris.vue @@ -8,13 +8,19 @@ >
-
+
+
+
-
+
@@ -28,13 +34,8 @@ const grid = ref([]) const rows = ref(0) const cols = ref(0) -const colors = useAppConfig()?.ui.colors const { width, height } = useElementSize(el) -function getRandomColor () { - return colors[Math.floor(Math.random() * (colors.length - 1))] -} - function createGrid () { grid.value = [] @@ -44,10 +45,9 @@ function createGrid () { } function createNewCell () { - const color = getRandomColor() const x = Math.floor(Math.random() * cols.value) - grid.value[0][x] = color + grid.value[0][x] = true } function moveCellsDown () {