Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
m0_69021787
基于vue的头像自动生成器
提交
11412141
基
基于vue的头像自动生成器
项目概览
m0_69021787
/
基于vue的头像自动生成器
与 Fork 源项目一致
Fork自
虎纹鲨鱼 / avatar
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
基
基于vue的头像自动生成器
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
11412141
编写于
10月 19, 2021
作者:
L
LeoKu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: add analytics
上级
0f472800
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
47 addition
and
17 deletion
+47
-17
jest.config.js
jest.config.js
+1
-1
public/tencent14464934467995274316.txt
public/tencent14464934467995274316.txt
+0
-1
src/App.vue
src/App.vue
+27
-7
src/env.d.ts
src/env.d.ts
+1
-1
src/layouts/Header.vue
src/layouts/Header.vue
+9
-1
src/utils/ga.ts
src/utils/ga.ts
+9
-6
未找到文件。
jest.config.js
浏览文件 @
11412141
...
@@ -10,7 +10,7 @@ module.exports = {
...
@@ -10,7 +10,7 @@ module.exports = {
clearMocks
:
true
,
clearMocks
:
true
,
collectCoverage
:
tru
e
,
collectCoverage
:
fals
e
,
coverageDirectory
:
'
coverage
'
,
coverageDirectory
:
'
coverage
'
,
...
...
public/tencent14464934467995274316.txt
已删除
100644 → 0
浏览文件 @
0f472800
235605460366578863
\ No newline at end of file
src/App.vue
浏览文件 @
11412141
...
@@ -91,7 +91,7 @@ import {
...
@@ -91,7 +91,7 @@ import {
NOT_COMPATIBLE_AGENTS
,
NOT_COMPATIBLE_AGENTS
,
TRIGGER_PROBABILITY
,
TRIGGER_PROBABILITY
,
}
from
'
@/utils/constant
'
}
from
'
@/utils/constant
'
import
{
record
Click
}
from
'
@/utils/ga
'
import
{
record
Event
}
from
'
@/utils/ga
'
import
Confetti
from
'
./components/Confetti.vue
'
import
Confetti
from
'
./components/Confetti.vue
'
...
@@ -117,6 +117,10 @@ function handleGenerate() {
...
@@ -117,6 +117,10 @@ function handleGenerate() {
const
randomOption
=
getRandomAvatarOption
(
avatarOption
.
value
)
const
randomOption
=
getRandomAvatarOption
(
avatarOption
.
value
)
setAvatarOption
(
randomOption
)
setAvatarOption
(
randomOption
)
}
}
recordEvent
(
'
click_randomize
'
,
{
event_category
:
'
click
'
,
}
)
}
}
const
downloadModalVisible
=
ref
(
false
)
const
downloadModalVisible
=
ref
(
false
)
...
@@ -150,6 +154,10 @@ async function handleDownload() {
...
@@ -150,6 +154,10 @@ async function handleDownload() {
trigger
.
click
()
trigger
.
click
()
}
}
}
}
recordEvent
(
'
click_download
'
,
{
event_category
:
'
click
'
,
}
)
}
finally
{
}
finally
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
downloading
.
value
=
false
downloading
.
value
=
false
...
@@ -164,21 +172,33 @@ function handleAction(actionType: ActionType) {
...
@@ -164,21 +172,33 @@ function handleAction(actionType: ActionType) {
switch
(
actionType
)
{
switch
(
actionType
)
{
case
ActionType
.
Undo
:
case
ActionType
.
Undo
:
store
.
commit
(
UNDO
)
store
.
commit
(
UNDO
)
recordEvent
(
'
action_undo
'
,
{
event_category
:
'
action
'
,
event_label
:
'
Undo
'
,
}
)
break
break
case
ActionType
.
Redo
:
case
ActionType
.
Redo
:
store
.
commit
(
REDO
)
store
.
commit
(
REDO
)
recordEvent
(
'
action_redo
'
,
{
event_category
:
'
action
'
,
event_label
:
'
Redo
'
,
}
)
break
break
case
ActionType
.
Flip
:
case
ActionType
.
Flip
:
flipped
.
value
=
!
flipped
.
value
flipped
.
value
=
!
flipped
.
value
recordEvent
(
'
action_flip_avatar
'
,
{
event_category
:
'
action
'
,
event_label
:
'
Flip Avatar
'
,
}
)
break
break
case
ActionType
.
Code
:
case
ActionType
.
Code
:
codeVisible
.
value
=
!
codeVisible
.
value
codeVisible
.
value
=
!
codeVisible
.
value
record
Click
(
{
record
Event
(
'
action_view_code
'
,
{
event_category
:
'
code
'
,
event_category
:
'
action
'
,
event_label
:
'
view c
ode
'
,
event_label
:
'
View Avatar Option C
ode
'
,
}
)
}
)
break
break
}
}
...
@@ -267,7 +287,7 @@ function handleAction(actionType: ActionType) {
...
@@ -267,7 +287,7 @@ function handleAction(actionType: ActionType) {
height
:
100
%
;
height
:
100
%
;
overflow
:
hidden
;
overflow
:
hidden
;
@
mixin
gradient
-
block
(
$color
)
{
@
mixin
gradient
-
style
(
$color
)
{
position
:
absolute
;
position
:
absolute
;
width
:
100
vh
;
width
:
100
vh
;
height
:
100
vh
;
height
:
100
vh
;
...
@@ -284,14 +304,14 @@ function handleAction(actionType: ActionType) {
...
@@ -284,14 +304,14 @@ function handleAction(actionType: ActionType) {
}
}
.
gradient
-
top
{
.
gradient
-
top
{
@
include
gradient
-
block
(
$color
-
secondary
);
@
include
gradient
-
style
(
$color
-
secondary
);
top
:
-
50
%
;
top
:
-
50
%
;
right
:
-
20
%
;
right
:
-
20
%
;
}
}
.
gradient
-
bottom
{
.
gradient
-
bottom
{
@
include
gradient
-
block
(
$color
-
accent
);
@
include
gradient
-
style
(
$color
-
accent
);
bottom
:
-
50
%
;
bottom
:
-
50
%
;
left
:
-
20
%
;
left
:
-
20
%
;
...
...
src/env.d.ts
浏览文件 @
11412141
...
@@ -9,5 +9,5 @@ declare module '*.vue' {
...
@@ -9,5 +9,5 @@ declare module '*.vue' {
interface
Window
{
interface
Window
{
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
gtag
:
any
gtag
:
(...
params
:
any
[])
=>
void
}
}
src/layouts/Header.vue
浏览文件 @
11412141
...
@@ -10,7 +10,14 @@
...
@@ -10,7 +10,14 @@
target=
"_blank"
target=
"_blank"
rel=
"nofollow noopener noreferrer"
rel=
"nofollow noopener noreferrer"
>
>
<button
class=
"github-button"
>
<button
class=
"github-button"
@
click=
"
recordEvent('click_github',
{
event_category: 'click',
})
"
>
<img
:src=
"IconGitHub"
alt=
"GitHub"
/>
<img
:src=
"IconGitHub"
alt=
"GitHub"
/>
<span
class=
"text"
>
GitHub
</span>
<span
class=
"text"
>
GitHub
</span>
</button>
</button>
...
@@ -22,6 +29,7 @@
...
@@ -22,6 +29,7 @@
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
IconGitHub
from
'
@/assets/icons/icon-github.svg
'
import
IconGitHub
from
'
@/assets/icons/icon-github.svg
'
import
Logo
from
'
@/components/Logo.vue
'
import
Logo
from
'
@/components/Logo.vue
'
import
{
recordEvent
}
from
'
@/utils/ga
'
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
...
...
src/utils/ga.ts
浏览文件 @
11412141
export
function
recordClick
(
params
:
{
export
function
recordEvent
(
action
:
string
,
params
:
{
event_category
:
string
event_category
:
string
event_label
?:
string
event_label
?:
string
value
?:
number
value
?:
number
})
{
}
window
?.
gtag
(
'
event
'
,
'
Click
'
,
params
)
)
{
window
?.
gtag
(
'
event
'
,
action
,
params
)
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录