Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Sharkey
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dima Krasner
Sharkey
Commits
dc5b4a04
Commit
dc5b4a04
authored
2 years ago
by
syuilo
Browse files
Options
Downloads
Patches
Plain Diff
enhance(client): show fireworks when visit user who today is birthday
Resolve #9476
parent
6adc0521
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
CHANGELOG.md
+1
-0
1 addition, 0 deletions
CHANGELOG.md
packages/frontend/package.json
+1
-0
1 addition, 0 deletions
packages/frontend/package.json
packages/frontend/src/pages/user/home.vue
+34
-0
34 additions, 0 deletions
packages/frontend/src/pages/user/home.vue
yarn.lock
+8
-0
8 additions, 0 deletions
yarn.lock
with
44 additions
and
0 deletions
CHANGELOG.md
+
1
−
0
View file @
dc5b4a04
...
...
@@ -80,6 +80,7 @@ You should also include the user name that made the change.
-
Client: add user list widget @syuilo
-
Client: add heatmap of daily active users to about page @syuilo
-
Client: introduce fluent emoji @syuilo
-
Client: show fireworks when visit user who today is birthday @syuilo
-
Client: show bot warning on screen when logged in as bot account @syuilo
-
Client: improve overall performance of client @syuilo
-
Client: ui tweaks @syuilo
...
...
This diff is collapsed.
Click to expand it.
packages/frontend/package.json
+
1
−
0
View file @
dc5b4a04
...
...
@@ -20,6 +20,7 @@
"blurhash"
:
"2.0.4"
,
"broadcast-channel"
:
"4.19.1"
,
"browser-image-resizer"
:
"git+https://github.com/misskey-dev/browser-image-resizer#v2.2.1-misskey.3"
,
"canvas-confetti"
:
"^1.6.0"
,
"chart.js"
:
"4.1.1"
,
"chartjs-adapter-date-fns"
:
"3.0.0"
,
"chartjs-chart-matrix"
:
"^1.3.0"
,
...
...
This diff is collapsed.
Click to expand it.
packages/frontend/src/pages/user/home.vue
+
34
−
0
View file @
dc5b4a04
...
...
@@ -110,6 +110,7 @@
<
script
lang
=
"
ts
"
setup
>
import
{
defineAsyncComponent
,
computed
,
inject
,
onMounted
,
onUnmounted
,
watch
}
from
'
vue
'
;
import
calcAge
from
'
s-age
'
;
import
confetti
from
'
canvas-confetti
'
;
import
*
as
misskey
from
'
misskey-js
'
;
import
XUserTimeline
from
'
./index.timeline.vue
'
;
import
XNote
from
'
@/components/MkNote.vue
'
;
...
...
@@ -155,6 +156,29 @@ const age = $computed(() => {
return
calcAge
(
props
.
user
.
birthday
);
}
);
function
birthdayEffect
()
{
const
duration
=
1000
*
5
;
const
animationEnd
=
Date
.
now
()
+
duration
;
const
defaults
=
{
startVelocity
:
30
,
spread
:
360
,
ticks
:
60
,
zIndex
:
os
.
claimZIndex
(
'
high
'
)
}
;
function
randomInRange
(
min
,
max
)
{
return
Math
.
random
()
*
(
max
-
min
)
+
min
;
}
const
interval
=
setInterval
(()
=>
{
const
timeLeft
=
animationEnd
-
Date
.
now
();
if
(
timeLeft
<=
0
)
{
return
clearInterval
(
interval
);
}
const
particleCount
=
50
*
(
timeLeft
/
duration
);
// since particles fall down, start a bit higher than random
confetti
(
Object
.
assign
({
}
,
defaults
,
{
particleCount
,
origin
:
{
x
:
randomInRange
(
0.1
,
0.3
),
y
:
Math
.
random
()
-
0.2
}
}
));
confetti
(
Object
.
assign
({
}
,
defaults
,
{
particleCount
,
origin
:
{
x
:
randomInRange
(
0.7
,
0.9
),
y
:
Math
.
random
()
-
0.2
}
}
));
}
,
250
);
}
function
menu
(
ev
)
{
os
.
popupMenu
(
getUserMenu
(
props
.
user
,
router
),
ev
.
currentTarget
??
ev
.
target
);
}
...
...
@@ -180,6 +204,16 @@ function parallax() {
onMounted
(()
=>
{
window
.
requestAnimationFrame
(
parallaxLoop
);
narrow
=
rootEl
!
.
clientWidth
<
1000
;
if
(
props
.
user
.
birthday
)
{
const
m
=
new
Date
().
getMonth
()
+
1
;
const
d
=
new
Date
().
getDate
();
const
bm
=
parseInt
(
props
.
user
.
birthday
.
split
(
'
-
'
)[
1
]);
const
bd
=
parseInt
(
props
.
user
.
birthday
.
split
(
'
-
'
)[
2
]);
if
(
m
===
bm
&&
d
===
bd
)
{
birthdayEffect
();
}
}
}
);
onUnmounted
(()
=>
{
...
...
This diff is collapsed.
Click to expand it.
yarn.lock
+
8
−
0
View file @
dc5b4a04
...
...
@@ -4833,6 +4833,13 @@ __metadata:
languageName: node
linkType: hard
"canvas-confetti@npm:^1.6.0":
version: 1.6.0
resolution: "canvas-confetti@npm:1.6.0"
checksum: be19e3be736ab28aa8af7b53cba9f4146f5714edadbf4d5a7d7b1899914dc59a8ac5574260fe6b7d9995c51df5787b0b707adfbb72dbacbc61fc03f9f2b25291
languageName: node
linkType: hard
"caseless@npm:~0.12.0":
version: 0.12.0
resolution: "caseless@npm:0.12.0"
...
...
@@ -8052,6 +8059,7 @@ __metadata:
blurhash: 2.0.4
broadcast-channel: 4.19.1
browser-image-resizer: "git+https://github.com/misskey-dev/browser-image-resizer#v2.2.1-misskey.3"
canvas-confetti: ^1.6.0
chart.js: 4.1.1
chartjs-adapter-date-fns: 3.0.0
chartjs-chart-matrix: ^1.3.0
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment