Skip to content

Commit

Permalink
Playground started
Browse files Browse the repository at this point in the history
  • Loading branch information
davay42 committed Jan 23, 2023
1 parent 1faedf4 commit 3d21c96
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
27 changes: 27 additions & 0 deletions docs/.vitepress/components/avatar-playground.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<script setup>
import GunVueAvatar from './gun-vue-avatar.vue';
import { useState } from '../composables/state'
const state = useState()
</script>

<template lang='pug'>
.p-12.max-w-1200px.m-auto
h1.text-2xl.font-bold Playground
.flex.w-full.justify-between.gap-2.mt-8
.p-2.flex.flex-col.gap-2
select.p-2(v-model="state.options.draw")
option(value="circles") Circles
option(value="squares") Squares
.text-lg Draw
label.flex.gap-2
input(type="checkbox" v-model="state.options.dark")
.text-lg Dark
label.flex.gap-2
input(type="checkbox" v-model="state.options.reflect")
.text-lg Reflect
.p-2
gun-vue-avatar.rounded-full(
:pub="state.pub"
v-bind="state.options"
)
</template>
6 changes: 6 additions & 0 deletions docs/.vitepress/composables/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ export const state = reactive({
epriv: "Tr9_a9sWJbo7EI0ARB5VeptIBALFuVNkSkrRAuP8vQc",
},
pub: computed(() => state.pair.pub),
options: {
size: 200,
reflect: true,
dark: false,
draw: 'circles'
},
})

state.history = useRefHistory(toRef(state, 'pair'))
Expand Down
5 changes: 4 additions & 1 deletion docs/.vitepress/theme/Layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import DefaultTheme from 'vitepress/theme'
import { computed, onMounted } from 'vue';
import GunVueAvatar from '../components/gun-vue-avatar.vue';
import HeaderLinks from '../components/header-links.vue'
import AvatarPlayground from '../components/avatar-playground.vue'
import { useState } from '../composables/state'
const { Layout } = DefaultTheme
Expand Down Expand Up @@ -45,11 +46,13 @@ Layout
.flex(
v-for="rec in list"
:key="rec"
)
)
gun-vue-avatar.rounded-full(
:pub="rec.snapshot.pub"
:size="50"
) {{ rec.snapshot.pub }}
template(#home-features-after)
AvatarPlayground
</template>

<style scoped lang="postcss">
Expand Down

0 comments on commit 3d21c96

Please sign in to comment.