Skip to content

Commit

Permalink
refactor(60%): playground
Browse files Browse the repository at this point in the history
  • Loading branch information
sheepbox8646 committed Jun 24, 2024
1 parent b3f6b44 commit 40bc1c2
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 5 deletions.
1 change: 1 addition & 0 deletions playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"play:preview": "vite preview"
},
"dependencies": {
"@vueuse/core": "^10.11.0",
"ace": "^1.3.0",
"class-variance-authority": "^0.7.0",
"clipboard-copy": "^4.0.1",
Expand Down
5 changes: 4 additions & 1 deletion playground/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ const codes
// Newcar Playground will help you to do this work.
export default function (nc, app) {
const scene = nc.createScene(
new nc.Circle(100)
new nc.Circle(200, {
x: 800,
y: 450
})
.animate(nc.create().withAttr({ duration: 1 }))
)
app.checkout(scene)
Expand Down
13 changes: 9 additions & 4 deletions playground/src/components/SettingDash.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { defineProps, ref } from 'vue'
import {
Dialog,
DialogClose,
DialogContent,
DialogTrigger,
} from './ui/dialog'
Expand All @@ -17,10 +18,12 @@ const props = defineProps<{
const skia = ref<string>(props.skia)
const width = ref<string>(props.width.toString())
const height = ref<string>(props.height.toString())
const dialog = ref<HTMLElement>()
</script>

<template>
<Dialog>
<Dialog ref="dialog">
<DialogTrigger as-child>
<slot />
</DialogTrigger>
Expand All @@ -37,9 +40,11 @@ const height = ref<string>(props.height.toString())
</div>
</div>
<div class="text-center">
<Button @click="props.action(skia, Number(width), Number(height))">
Submit
</Button>
<DialogClose as-child>
<Button @click="props.action(skia, Number(width), Number(height)); dialog.removeAttribute('open')">
Submit
</Button>
</DialogClose>
</div>
</DialogContent>
</Dialog>
Expand Down
1 change: 1 addition & 0 deletions playground/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ export default defineConfig({
alias: {
'@': path.resolve(__dirname, './src'),
},
dedupe: ['vue'],
},
})
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 40bc1c2

Please sign in to comment.