@varlet/cli 1.27.7-alpha.1651056904329 → 1.27.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,193 @@
1
+ .home-page {
2
+ position: relative;
3
+ width: 100vw;
4
+ height: 100vh;
5
+ box-sizing: border-box;
6
+ min-width: 1200px;
7
+ background: var(--site-config-color-home-page-background);
8
+ overflow: hidden;
9
+ display: flex;
10
+ align-items: center;
11
+ }
12
+
13
+ @keyframes fade-in {
14
+ 0% {
15
+ opacity: 0;
16
+ transform: translateX(-100%);
17
+ }
18
+
19
+
20
+ to {
21
+ opacity: 1;
22
+ transform: translateX(0%);
23
+ }
24
+ }
25
+
26
+ @keyframes slash-1 {
27
+ from {
28
+ transform: rotate(90deg);
29
+ ;
30
+ }
31
+
32
+ to {
33
+ transform: rotate(10deg);
34
+ }
35
+ }
36
+
37
+ @keyframes slash-2 {
38
+ from {
39
+ transform: rotate(90deg);
40
+ ;
41
+ }
42
+
43
+ to {
44
+ transform: rotate(20deg);
45
+ }
46
+ }
47
+
48
+ @keyframes slash-3 {
49
+ from {
50
+ transform: rotate(90deg);
51
+ ;
52
+ }
53
+
54
+ to {
55
+ transform: rotate(30deg);
56
+ }
57
+ }
58
+
59
+ @keyframes slash-4 {
60
+ from {
61
+ transform: rotate(90deg);
62
+ ;
63
+ }
64
+
65
+ to {
66
+ transform: rotate(40deg);
67
+ }
68
+ }
69
+
70
+ @keyframes slash-5 {
71
+ from {
72
+ transform: rotate(90deg);
73
+ ;
74
+ }
75
+
76
+ to {
77
+ transform: rotate(50deg);
78
+ }
79
+ }
80
+
81
+ .slash-box {
82
+ position: absolute;
83
+ width: 30px;
84
+ bottom: -70%;
85
+ top: -130%;
86
+ right: 52%;
87
+ transform-origin: bottom right;
88
+ transition: box-shadow 0.5s;
89
+ box-shadow: -20px 0 20px var(--site-config-color-home-page-slash);
90
+ }
91
+
92
+ .box-1 {
93
+ animation: slash-1 .75s forwards;
94
+ }
95
+
96
+ .box-2 {
97
+ animation: slash-2 .75s forwards;
98
+ }
99
+
100
+ .box-3 {
101
+ animation: slash-3 .75s forwards;
102
+ }
103
+
104
+ .box-4 {
105
+ animation: slash-4 .75s forwards;
106
+ }
107
+
108
+ .box-5 {
109
+ animation: slash-5 .75s forwards;
110
+ }
111
+
112
+ .profile-container {
113
+ height: 100vh;
114
+ padding-left: 10vw;
115
+ display: flex;
116
+ justify-content: center;
117
+ align-items: center;
118
+
119
+ .container-box {
120
+ width: 35vw;
121
+ min-width: 500px;
122
+
123
+ .description-container {
124
+ display: flex;
125
+ margin-bottom: 35px;
126
+ }
127
+
128
+ .logo-container {
129
+ margin-right: 20px;
130
+ }
131
+
132
+ .button-group {
133
+ display: flex;
134
+ margin-top: 25px;
135
+ align-items: center;
136
+ }
137
+
138
+ .block-button-content {
139
+ display: flex;
140
+ align-items: center;
141
+ }
142
+
143
+ .common-button {
144
+ height: 52px;
145
+ font-size: 18px;
146
+ transition: all .25s;
147
+ animation: fade-in .75s forwards;
148
+ }
149
+
150
+ .extra-button {
151
+ flex-shrink: 0;
152
+ background-color: var(--site-config-color-home-page-extra-button-background);
153
+ }
154
+
155
+ .github-button {
156
+ background-color: var(--site-config-color-home-page-github-button-background);
157
+ color: #fff;
158
+ }
159
+
160
+ .primary-button {
161
+ background-color: var(--site-config-color-home-page-primary-button-background);
162
+ }
163
+
164
+ .margin-left {
165
+ margin-left: 10px;
166
+ }
167
+
168
+ .base-title {
169
+ font-size: 84px;
170
+ line-height: 72px;
171
+ font-weight: 500;
172
+ margin-top: 8px;
173
+ animation: fade-in .75s forwards;
174
+ }
175
+
176
+ .base-description {
177
+ font-size: 16px;
178
+ line-height: 28px;
179
+ padding-left: 4px;
180
+ font-weight: 500;
181
+ margin-bottom: 45px;
182
+ letter-spacing: 1px;
183
+ animation: fade-in .75s forwards;
184
+ }
185
+
186
+ .logo {
187
+ width: 90px;
188
+ height: 90px;
189
+ flex-shrink: 0;
190
+ margin-right: 25px;
191
+ }
192
+ }
193
+ }
@@ -0,0 +1,125 @@
1
+ <script setup lang="ts">
2
+ import AnimationBox from '../../components/AnimationBox.vue'
3
+ import config from '@config'
4
+ import VarSiteButton from '../../../components/button'
5
+ import VarSiteIcon from '../../../components/icon'
6
+ import { get } from 'lodash-es'
7
+ import { ref, watch } from 'vue'
8
+ import { useRoute, useRouter } from 'vue-router'
9
+ import { getBrowserThemes, setThemes } from '../../../utils'
10
+ import { getPCLocationInfo, watchThemes } from '@varlet/cli/site/utils'
11
+ import en_US from './locale/en-US'
12
+ import zh_CN from './locale/zh-CN'
13
+ import type { Ref } from 'vue'
14
+
15
+ const route = useRoute()
16
+ const router = useRouter()
17
+ const packs = {
18
+ 'zh-CN': zh_CN,
19
+ 'en-US': en_US
20
+ } as any
21
+
22
+ const github = get(config, 'pc.header.github')
23
+ const themesKey = get(config, 'themesKey')
24
+ const currentThemes = ref(getBrowserThemes(themesKey))
25
+ const darkMode: Ref<boolean> = ref(get(config, 'pc.header.darkMode'))
26
+ const title: Ref<string> = ref(get(config, 'title'))
27
+ const languages: Ref<Record<string, string>> = ref(get(config, 'pc.header.i18n'))
28
+ const pack: Ref<Record<string, string>> = ref({})
29
+
30
+ const goGithub = () => {
31
+ window.open(github)
32
+ }
33
+
34
+ const getStar = () => {
35
+ const { language: lang } = getPCLocationInfo()
36
+ router.push(`/${lang}/home`)
37
+ }
38
+
39
+ const getThemesMessage = () => ({ action: 'themesChange', from: 'pc', data: currentThemes.value })
40
+
41
+ const setCurrentThemes = (themes: 'themes' | 'darkThemes') => {
42
+ currentThemes.value = themes
43
+ setThemes(config, currentThemes.value)
44
+ window.localStorage.setItem(themesKey, currentThemes.value)
45
+ }
46
+
47
+ const toggleTheme = () => {
48
+ setCurrentThemes(currentThemes.value === 'darkThemes' ? 'themes' : 'darkThemes')
49
+ window.postMessage(getThemesMessage(), '*')
50
+ ; (document.getElementById('mobile') as HTMLIFrameElement)?.contentWindow!.postMessage(getThemesMessage(), '*')
51
+ }
52
+
53
+ const setLocale = () => {
54
+ const { language: lang } = getPCLocationInfo()
55
+ if (!lang) return
56
+
57
+ pack.value = packs[lang]
58
+ document.title = get(config, 'pc.title')[lang] as string
59
+ }
60
+
61
+ const toggleLanguages = () => {
62
+ const { language: lang } = getPCLocationInfo()
63
+
64
+ const { menuName } = getPCLocationInfo()
65
+ const replaceStr = `/${lang === 'zh-CN' ? 'en-US' : 'zh-CN'}/${menuName}`
66
+ router.replace(replaceStr)
67
+ }
68
+
69
+ setThemes(config, currentThemes.value)
70
+
71
+ window.postMessage(getThemesMessage(), '*')
72
+
73
+ watchThemes((themes, from) => {
74
+ from === 'mobile' && setCurrentThemes(themes)
75
+ })
76
+
77
+ watch(() => route.path, setLocale, { immediate: true })
78
+ </script>
79
+
80
+ <template>
81
+ <div class="home-page">
82
+ <div class="slash-box box-1"></div>
83
+ <div class="slash-box box-2"></div>
84
+ <div class="slash-box box-3"></div>
85
+ <div class="slash-box box-4"></div>
86
+ <div class="slash-box box-5"></div>
87
+ <div class="profile-container">
88
+ <div class="container-box">
89
+ <div class="description-container">
90
+ <animation-box class="logo" />
91
+ <div class="base-title">{{ title }}</div>
92
+ </div>
93
+ <div class="base-description">{{ pack.description }}</div>
94
+
95
+ <div class="button-group">
96
+ <var-site-button class="common-button github-button" block @click="goGithub">
97
+ <div class="block-button-content">
98
+ <span>GITHUB</span>
99
+ <var-site-icon style="margin-left: 10px;" name="github" size="24px" />
100
+ </div>
101
+ </var-site-button>
102
+ <var-site-button class="common-button extra-button margin-left" text v-if="darkMode" @click="toggleTheme">
103
+ <var-site-icon size="24px" :name="currentThemes === 'themes' ? 'white-balance-sunny' : 'weather-night'" />
104
+ </var-site-button>
105
+ </div>
106
+
107
+ <div class="button-group">
108
+ <var-site-button type="primary" class="common-button primary-button" block @click="getStar">
109
+ <div class="block-button-content">
110
+ <span>{{ pack.started }}</span>
111
+ <var-site-icon style="margin-left: 10px; transform: rotate(-90deg)" name="arrow-down" size="24px" />
112
+ </div>
113
+ </var-site-button>
114
+ <var-site-button class="common-button extra-button margin-left" text v-if="languages" @click="toggleLanguages">
115
+ <var-site-icon name="translate" size="24px" />
116
+ </var-site-button>
117
+ </div>
118
+ </div>
119
+ </div>
120
+ </div>
121
+ </template>
122
+
123
+ <style lang="less" scoped>
124
+ @import "./index";
125
+ </style>
@@ -0,0 +1,5 @@
1
+ export default {
2
+ started: 'GET STARTED',
3
+ description: 'Varlet is a Material design mobile component library developed based on Vue3, developed and maintained by partners in the community. ' +
4
+ 'Support Typescript, import on demand, dark mode, theme customization, internationalization, and provide VSCode plugin to ensure a good development experience',
5
+ }
@@ -0,0 +1,5 @@
1
+ export default {
2
+ started: '起步',
3
+ description: 'Varlet 是一个基于 Vue3 开发的 Material 风格移动端组件库,' +
4
+ '全面拥抱 Vue3 生态,由社区团队维护。支持 Typescript、按需引入、暗黑模式、主题定制、国际化,并提供 VSCode 插件保障良好的开发体验',
5
+ }
@@ -19,7 +19,7 @@ module.exports = {
19
19
  useMobile: false,
20
20
  pc: {
21
21
  menu: [],
22
- redirect: '/home',
22
+ redirect: '/index',
23
23
  title: {
24
24
  'zh-CN': '面向 Vue3 的 Material 风格移动端组件库',
25
25
  'en-US': 'Material design mobile components built for Vue3',
@@ -59,6 +59,11 @@ module.exports = {
59
59
  },
60
60
  themes: {
61
61
  'color-body': '#fff',
62
+ 'color-home-page-background': '#fff',
63
+ 'color-home-page-slash': '#ccc',
64
+ 'color-home-page-primary-button-background': '#3a7afe',
65
+ 'color-home-page-extra-button-background': '#f5f5f5',
66
+ 'color-home-page-github-button-background': '#212121',
62
67
  'color-bar': '#fff',
63
68
  'color-sub-bar': '#f5f5f5',
64
69
  'color-text': '#555',
@@ -70,7 +75,7 @@ module.exports = {
70
75
  'color-link': '#00c48f',
71
76
  'color-type': '#00c48f',
72
77
  'color-progress': '#1d92e9',
73
- 'color-progress-track': '#fff',
78
+ 'color-progress-track': 'transparent',
74
79
  'color-side-bar': '#3a7afe',
75
80
  'color-side-bar-active-background': '#3a7afe1a',
76
81
  'color-app-bar': '#3a7afe',
@@ -78,6 +83,7 @@ module.exports = {
78
83
  'color-mobile-cell-hover': '#3a7afe',
79
84
  'color-pc-language-active': '#3a7afe',
80
85
  'color-pc-language-active-background': '#edf5ff',
86
+ 'color-pc-github-active-background': '#212121',
81
87
  'color-mobile-language-active': '#3a7afe',
82
88
  'color-mobile-language-active-background': '#edf5ff',
83
89
  'color-hl-background': '#fafafa',
@@ -95,6 +101,11 @@ module.exports = {
95
101
  },
96
102
  darkThemes: {
97
103
  'color-body': '#121212',
104
+ 'color-home-page-background': 'linear-gradient(to right, #1e1e1e, #272727)',
105
+ 'color-home-page-slash': '#111',
106
+ 'color-home-page-primary-button-background': '#4a7afe',
107
+ 'color-home-page-extra-button-background': '#303030',
108
+ 'color-home-page-github-button-background': '#303030',
98
109
  'color-bar': '#1e1e1e',
99
110
  'color-sub-bar': '#272727',
100
111
  'color-text': '#fff',
@@ -106,7 +117,7 @@ module.exports = {
106
117
  'color-link': '#A8FFC4',
107
118
  'color-type': '#A8FFC4',
108
119
  'color-progress': '#5580f8',
109
- 'color-progress-track': '#202020',
120
+ 'color-progress-track': 'transparent',
110
121
  'color-side-bar': '#4a7afe',
111
122
  'color-side-bar-active-background': '#4a7afe1a',
112
123
  'color-app-bar': '#272727',
@@ -114,6 +125,7 @@ module.exports = {
114
125
  'color-mobile-cell-hover': '#4a7afe',
115
126
  'color-pc-language-active': '#4a7afe',
116
127
  'color-pc-language-active-background': '#4a7afe20',
128
+ 'color-pc-github-active-background': '#303030',
117
129
  'color-mobile-language-active': '#4a7afe',
118
130
  'color-mobile-language-active-background': '#4a7afe20',
119
131
  'color-hl-background': '#272727',