2
2
<div class =" stats-card" >
3
3
<CardBlock title =" Hiding Stats" class =" field--hiding-stats" >
4
4
<template #icon >
5
- <bxHide class =" mr-2 text-[#F19F19 ]" />
5
+ <bxHide class =" mr-2 text-[#ff7a00 ]" />
6
6
</template >
7
7
<div v-for =" (value, key) in Stats" :key =" key" class =" mb-2" >
8
8
<label class =" cursor-pointer text-gray-600" >
18
18
</CardBlock >
19
19
<CardBlock title =" Others" class =" field--others" >
20
20
<template #icon >
21
- <icRoundDashboardCustomize class =" mr-2 text-[#F19F19 ]" />
21
+ <icRoundDashboardCustomize class =" mr-2 text-[#ff7a00 ]" />
22
22
</template >
23
23
<div v-for =" (value, key) in boolFlags" :key =" key" class =" mb-2" >
24
24
<label class =" cursor-pointer text-gray-600" >
32
32
</div >
33
33
</CardBlock >
34
34
35
+ <CardBlock title =" Colors" class =" field--colors" >
36
+ <template #icon >
37
+ <icBaselineStyle class =" mr-2 text-[#ff7a00]" />
38
+ </template >
39
+ <div v-for =" (prop, key) in colors" :key =" key" class =" mb-2" >
40
+ <label class =" cursor-pointer text-gray-600 inline-flex items-center" >
41
+ <input
42
+ type =" checkbox"
43
+ class =" mr-2"
44
+ v-model =" prop.isChecked" >
45
+ <span >{{ caseConvert(key) }}</span >
46
+ <input type =" color" class =" ml-2" v-model =" prop.hex" >
47
+ </label >
48
+ </div >
49
+ </CardBlock >
50
+
35
51
<CardBlock title =" Customization" class =" field--customization" >
36
52
<template #icon >
37
- <icBaselineStyle class =" mr-2 text-[#F19F19 ]" />
53
+ <gridiconsCustomize class =" mr-2 text-[#ff7a00 ]" />
38
54
</template >
39
55
<div v-for =" (prop, key) in customization" :key =" key" class =" mb-2" >
40
56
<label class =" cursor-pointer text-gray-600 inline-flex items-center" >
43
59
class =" mr-2"
44
60
v-model =" prop.isChecked" >
45
61
<span >{{ caseConvert(key) }}</span >
46
- <input type =" color " class =" ml-2" v-model =" prop.hex " >
62
+ <input type =" text " class =" ml-2" v-model =" prop.value " >
47
63
</label >
48
64
</div >
49
65
</CardBlock >
@@ -74,10 +90,12 @@ import icBaselineStyle from '~icons/ic/baseline-style'
74
90
import bxHide from ' ~icons/bx/hide'
75
91
import icRoundDashboardCustomize from ' ~icons/ic/round-dashboard-customize'
76
92
import fluentArrowReset24Filled from ' ~icons/fluent/arrow-reset-24-filled'
93
+ import gridiconsCustomize from ' ~icons/gridicons/customize'
77
94
import { useThrottleFn } from ' @vueuse/core'
78
95
import CardBlock from ' ../cardBlock.vue'
79
96
import MdPreview from ' ../mdPreview.vue'
80
97
import ThemePreview from ' ../themePreview.vue'
98
+ import caseConvert from ' ../../utils/caseConvert'
81
99
82
100
const username = inject (' username' , ' ' ) as any
83
101
@@ -96,11 +114,32 @@ const initFlags = () => ({
96
114
hide_title: false ,
97
115
hide_rank: false ,
98
116
include_all_commits: false ,
99
- disable_animations: false
117
+ disable_animations: false ,
118
+ hide_border: false
100
119
})
101
120
const boolFlags = ref (initFlags ())
102
121
103
- const initCustomize = () => ({
122
+ const initCustomization = () => ({
123
+ cache_seconds: {
124
+ isChecked: false ,
125
+ value: 1800 ,
126
+ },
127
+ border_radius: {
128
+ isChecked: false ,
129
+ value: 0
130
+ },
131
+ line_height: {
132
+ isChecked: false ,
133
+ value: 16
134
+ },
135
+ custom_title: {
136
+ isChecked: false ,
137
+ value: ' '
138
+ }
139
+ })
140
+ const customization = ref (initCustomization ())
141
+
142
+ const initColors = () => ({
104
143
title_color: {
105
144
isChecked: false ,
106
145
hex: ' #000000'
@@ -122,7 +161,7 @@ const initCustomize = () => ({
122
161
hex: ' #000000'
123
162
}
124
163
})
125
- const customization = ref (initCustomize ())
164
+ const colors = ref (initColors ())
126
165
const selectedTheme = ref (' default' )
127
166
128
167
const allQueries = computed (() => {
@@ -141,10 +180,17 @@ const allQueries = computed(() => {
141
180
}
142
181
}
143
182
183
+ // colors
184
+ for (const [key, prop] of Object .entries (colors .value )) {
185
+ if (prop .isChecked ) {
186
+ str .push (` ${key }=${prop .hex .substr (1 )} ` )
187
+ }
188
+ }
189
+
144
190
// customization
145
191
for (const [key, prop] of Object .entries (customization .value )) {
146
192
if (prop .isChecked ) {
147
- str .push (` ${key }=${prop .hex . substr ( 1 ) } ` )
193
+ str .push (` ${key }=${prop .value } ` )
148
194
}
149
195
}
150
196
@@ -154,11 +200,6 @@ const allQueries = computed(() => {
154
200
return str .join (' &' )
155
201
})
156
202
157
- const caseConvert = (str : string ) => {
158
- const sentence = str .split (' _' )
159
- return sentence .map (word => word .charAt (0 ).toUpperCase () + word .slice (1 )).join (' ' )
160
- }
161
-
162
203
const assembledApi = computed (() => ` https://github-readme-stats.vercel.app/api?${allQueries .value } ` )
163
204
164
205
const imgSrc = ref (' https://via.placeholder.com/495x195.png?text=check+your+username' )
@@ -168,11 +209,11 @@ const handleGenerate = useThrottleFn(() => {
168
209
}, 1000 , false )
169
210
170
211
const emit = defineEmits ([' resetUserName' ])
171
- const handleReset = () => {
212
+ const handleReset = () => {
172
213
emit (' resetUserName' )
173
214
hidingStats .value = []
174
215
boolFlags .value = initFlags ()
175
- customization .value = initCustomize ()
216
+ colors .value = initColors ()
176
217
}
177
218
</script >
178
219
0 commit comments