|
2 | 2 | <TabbedLayout>
|
3 | 3 | <template #preview>
|
4 | 4 | <div class="demo-container relative overflow-hidden">
|
5 |
| - <ChromaGrid /> |
| 5 | + <ChromaGrid :radius="radius" :damping="damping" :fadeOut="fadeOut" :ease="ease" /> |
6 | 6 | </div>
|
7 | 7 |
|
| 8 | + <Customize> |
| 9 | + <PreviewSlider title="Radius" v-model="radius" :min="50" :max="600" :step="10" /> |
| 10 | + |
| 11 | + <PreviewSlider title="Damping" v-model="damping" :min="0.1" :max="5" :step="0.5" /> |
| 12 | + |
| 13 | + <PreviewSlider title="Fade Out" v-model="fadeOut" :min="0" :max="2" :step="0.1" /> |
| 14 | + |
| 15 | + <PreviewSelect title="Easing Function" v-model="ease" :options="easeOptions" /> |
| 16 | + </Customize> |
| 17 | + |
8 | 18 | <PropTable :data="propData" />
|
| 19 | + |
9 | 20 | <Dependencies :dependency-list="['gsap']" />
|
10 | 21 | </template>
|
11 | 22 |
|
|
20 | 31 | </template>
|
21 | 32 |
|
22 | 33 | <script setup lang="ts">
|
| 34 | +import { ref } from 'vue'; |
23 | 35 | import CliInstallation from '../../components/code/CliInstallation.vue';
|
24 | 36 | import CodeExample from '../../components/code/CodeExample.vue';
|
25 | 37 | import Dependencies from '../../components/code/Dependencies.vue';
|
26 | 38 | import PropTable from '../../components/common/PropTable.vue';
|
27 | 39 | import TabbedLayout from '../../components/common/TabbedLayout.vue';
|
28 |
| -
|
29 |
| -import { chromaGrid } from '../../constants/code/Components/chromaGridCode'; |
30 | 40 | import ChromaGrid from '../../content/Components/ChromaGrid/ChromaGrid.vue';
|
| 41 | +import Customize from '@/components/common/Customize.vue'; |
| 42 | +import PreviewSelect from '@/components/common/PreviewSelect.vue'; |
| 43 | +import PreviewSlider from '@/components/common/PreviewSlider.vue'; |
| 44 | +import { chromaGrid } from '../../constants/code/Components/chromaGridCode'; |
| 45 | +
|
| 46 | +const radius = ref(300); |
| 47 | +const damping = ref(0.45); |
| 48 | +const fadeOut = ref(0.6); |
| 49 | +const ease = ref('power3.out'); |
| 50 | +
|
| 51 | +const easeOptions = [ |
| 52 | + { label: 'Power3 Out', value: 'power3.out' }, |
| 53 | + { label: 'Bounce Out', value: 'bounce.out' }, |
| 54 | + { label: 'Elastic Out', value: 'elastic.out(1, 0.3)' } |
| 55 | +]; |
31 | 56 |
|
32 | 57 | const propData = [
|
33 | 58 | {
|
|
0 commit comments