update(docs): Add windicss

* remove unused files
This commit is contained in:
Braks
2022-04-04 21:42:48 +02:00
parent e97d9a1dc9
commit 36e3299681
24 changed files with 966 additions and 441 deletions
@@ -0,0 +1,12 @@
<script lang="ts" setup>
import { Handle, Position } from '@braks/vue-flow'
const emit = defineEmits(['next'])
</script>
<template>
<div class="px-4 py-2 bg-white shadow-lg rounded-md border-2 border-solid border-black">
<slot />
<Handle id="a" type="source" :position="Position.Bottom" />
<Handle id="b" type="source" :position="Position.Right" />
</div>
</template>
@@ -0,0 +1,44 @@
<script lang="ts" setup>
import { Handle, NodeProps, Position } from '@braks/vue-flow'
interface RGBNodeProps extends NodeProps {
data: {
color: 'r' | 'g' | 'b'
}
amount: {
red: number
green: number
blue: number
}
}
const props = defineProps<RGBNodeProps>()
const emit = defineEmits(['change'])
let color = 'red'
switch (props.data?.color) {
case 'r':
color = 'red'
break
case 'g':
color = 'green'
break
case 'b':
color = 'blue'
break
}
const onChange = (e: any) => emit('change', { color, val: e.target.value })
</script>
<template>
<div class="px-4 py-2 bg-white rounded-md border-2 border-solid border-black text-left transform scale-75 lg:scale-100">
<div class="text-md" :style="{ color }">{{ `${color} Amount`.toUpperCase() }}</div>
<input
v-model="props.amount[color]"
class="slider nodrag"
:style="{ '--color': color }"
type="range"
min="0"
max="255"
@input="onChange"
/>
<Handle type="source" :position="Position.Right" :style="{ backgroundColor: color }" />
</div>
</template>
@@ -0,0 +1,24 @@
<script lang="ts" setup>
import { Handle, NodeProps, Position } from '@braks/vue-flow'
interface RBGOutputNodeProps extends NodeProps {
rgb: string
}
const props = defineProps<RBGOutputNodeProps>()
const emit = defineEmits(['next'])
const next = () => emit('next')
</script>
<template>
<div :style="{ backgroundColor: props.rgb }" class="rgb-output-node" @click="next">
<div class="text-md uppercase">{{ props.rgb }}</div>
Click me to continue.
<Handle type="target" :position="Position.Left" />
</div>
</template>
<style>
.rgb-output-node {
padding: 9px;
border-radius: 25px;
text-align: left;
color: white;
}
</style>