-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cec2574
commit 1c04222
Showing
5 changed files
with
4,875 additions
and
4,011 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<script setup lang="ts"> | ||
import { LeaferApp } from 'leafer-vue' | ||
import { ref } from 'vue' | ||
const rotation = ref(0) | ||
function animate() { | ||
rotation.value += 1 | ||
requestAnimationFrame(animate) | ||
} | ||
animate() | ||
const fill = ref('#32cd79') | ||
function changeColor() { | ||
fill.value = `#${Math.floor(Math.random() * 0xFFFFFF).toString(16)}` | ||
} | ||
</script> | ||
|
||
<template> | ||
<LeaferApp :width="650" :height="340"> | ||
<Leafer @tap="changeColor"> | ||
<template | ||
v-for="row in 33" | ||
:key="row" | ||
> | ||
<Rect | ||
v-for="col in 17" | ||
:key="col" | ||
:rotation="rotation" | ||
:x="(row - 1) * 20" :y="(col - 1) * 20" | ||
:width="15" :height="15" | ||
:fill="fill" | ||
:draggable="true" | ||
@tap="changeColor" | ||
/> | ||
</template> | ||
</Leafer> | ||
</LeaferApp> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.