48
48
</div >
49
49
</CardBlock >
50
50
51
- <CardBlock title =" Theme" class =" field--theme" >
52
- <template #icon >
53
- <mdiThemeLightDark class =" mr-2 text-[#F19F19]" />
54
- </template >
55
- <div class =" mb-2" >
56
- <label class =" cursor-pointer text-gray-600 inline-flex items-center" >
57
- <select v-model =" selectedTheme" class =" px-2 py-1" >
58
- <option v-for =" theme in themeOptions" :value =" theme" >{{ theme.name }}</option >
59
- </select >
60
- </label >
61
- </div >
62
- <figure class =" m-0 my-2" >
63
- <img
64
- :src =" getPreviewImg(selectedTheme.value)"
65
- class =" max-w-[400px] w-full"
66
- alt =" theme-preview" >
67
- </figure >
68
- <a href =" https://github.com/anuraghazra/github-readme-stats/blob/master/themes/README.md" class =" text-xs text-gray-400" target =" _blank" >
69
- <i >- theme preview (github-readme-stats/themes/README.md)</i >
70
- </a >
71
- </CardBlock >
72
-
73
- <!-- ^^^ manipulator ^^^ -->
51
+ <ThemePreview v-model:theme =" selectedTheme" category =" stats" />
74
52
75
53
<MdPreview :apiUrl =" assembledApi" />
76
54
91
69
</template >
92
70
93
71
<script lang="ts" setup>
94
- import mdiCardAccountDetailsStarOutline from ' ~icons/mdi/card-account-details-star-outline' ;
95
- import icBaselineStyle from ' ~icons/ic/baseline-style' ;
96
- import bxHide from ' ~icons/bx/hide' ;
97
- import mdiThemeLightDark from ' ~icons/mdi/theme-light-dark' ;
98
- import icRoundDashboardCustomize from ' ~icons/ic/round-dashboard-customize' ;
99
- import fluentArrowReset24Filled from ' ~icons/fluent/arrow-reset-24-filled' ;
72
+ import mdiCardAccountDetailsStarOutline from ' ~icons/mdi/card-account-details-star-outline'
73
+ import icBaselineStyle from ' ~icons/ic/baseline-style'
74
+ import bxHide from ' ~icons/bx/hide'
75
+ import icRoundDashboardCustomize from ' ~icons/ic/round-dashboard-customize'
76
+ import fluentArrowReset24Filled from ' ~icons/fluent/arrow-reset-24-filled'
100
77
import { useThrottleFn } from ' @vueuse/core'
101
- import { Themes , getPreviewImg } from ' ../../enums/themes' ;
102
- import CardBlock from ' ../cardBlock.vue' ;
78
+ import CardBlock from ' ../cardBlock.vue'
103
79
import MdPreview from ' ../mdPreview.vue'
80
+ import ThemePreview from ' ../themePreview.vue'
104
81
105
82
const username = inject (' username' , ' ' ) as any
106
83
@@ -146,12 +123,7 @@ const initCustomize = () => ({
146
123
}
147
124
})
148
125
const customization = ref (initCustomize ())
149
-
150
- const themeOptions = Object .entries (Themes ).map (([key , value ]) => ({
151
- name: key ,
152
- value
153
- }))
154
- const selectedTheme = ref (themeOptions [0 ])
126
+ const selectedTheme = ref (' default' )
155
127
156
128
const allQueries = computed (() => {
157
129
// username
@@ -177,7 +149,7 @@ const allQueries = computed(() => {
177
149
}
178
150
179
151
// theme
180
- if (selectedTheme .value . name !== ' default' ) str .push (` theme=${selectedTheme . value .value } ` )
152
+ if (selectedTheme .value !== ' default' ) str .push (` theme=${selectedTheme .value } ` )
181
153
182
154
return str .join (' &' )
183
155
})
0 commit comments