UNPKG

2.4 kBPlain TextView Raw
1<template>
2 <div>
3 <span class="version">v{{ packageVersion }}</span>
4 <transition-group name="head" appear>
5 <div :key="view" class="title z-header" :class="view === 'home' ? 'home' : ''">{{ txt.title }}
6 <br>
7 <div class="subtitle">
8 <br>
9 <span>{{ txt.subtitle }}</span>
10 </div>
11 </div>
12 <div :key="view + 1" class="panel" style="display: none;"></div>
13 <div :key="view + 2" class="footer" v-if="txt.footer"><b>Tip:</b> {{ txt.footer }}</div>
14 </transition-group>
15 <z-canvas :views="$options.components"/>
16 </div>
17</template>
18
19<script>
20import pkg from '../package.json'
21import home from './demo/home.vue'
22import docs from './demo/docs.vue'
23import moon from './demo/moon.vue'
24import earth from './demo/earth.vue'
25import demo from './demo/demo.vue'
26import sun from './demo/sun.vue'
27
28export default {
29 data () {
30 return {
31 packageVersion: pkg.version
32 }
33 },
34 computed: {
35 view () {
36 return this.$zircle.getCurrentViewName().slice(0, -3)
37 },
38 txt () {
39 switch (this.view) {
40 case 'home':
41 return {
42 title: 'Welcome to Zircle\'s demo',
43 subtitle: 'Sun, Earth & Moon',
44 footer: 'click/touch on circles!'
45 }
46 case 'sun':
47 return {
48 title: 'Sun profile',
49 subtitle: 'Sun, Earth & Moon',
50 footer: ''
51 }
52 case 'earth':
53 return {
54 title: 'Earth profile',
55 subtitle: 'Sun, Earth & Moon',
56 footer: 'zoom the Moon!'
57 }
58 case 'moon':
59 return {
60 title: 'Moon profile',
61 subtitle: 'Sun, Earth & Moon',
62 footer: ''
63 }
64 case 'demo':
65 return {
66 title: '',
67 subtitle: 'Sun, Earth & Moon',
68 footer: 'zoom the Sun & the Earth!'
69 }
70 default:
71 return {
72 title: 'oops',
73 subtitle: '',
74 footer: ''
75 }
76 }
77 }
78 },
79 components: {
80 /* eslint-disable vue/no-unused-components */
81 home,
82 docs,
83 earth,
84 moon,
85 demo,
86 sun
87 },
88 mounted () {
89 this.$zircle.config({
90 debug: true,
91 style: {
92 theme: 'white'
93 }
94 })
95 this.$zircle.setView('home')
96 }
97}
98</script>
99
100<style>
101@import url("../public/index.css");
102</style>