commit bf14b2577f22704869b03c4a858ff3231d19f6ba
parent 527153c6c5fb806e6bcb9335e35f6fd092f8c17a
Author: n0tr1v <n0tr1v@protonmail.com>
Date: Tue, 10 Jan 2023 23:15:29 -0800
shorter tutorial time for dev
Diffstat:
3 files changed, 13 insertions(+), 19 deletions(-)
diff --git a/pkg/web/handlers/data.go b/pkg/web/handlers/data.go
@@ -361,6 +361,8 @@ type chatData struct {
CaptchaImg string
ErrGuestUsername string
ErrCaptcha string
+ TutoSecs int64
+ TutoFrames []string
}
type chatHelpData struct {
diff --git a/pkg/web/handlers/handlers.go b/pkg/web/handlers/handlers.go
@@ -2233,6 +2233,11 @@ func ChatHandler(c echo.Context) error {
func chatHandler(c echo.Context, redRoom bool) error {
authUser := c.Get("authUser").(*database.User)
var data chatData
+ data.TutoSecs = 15
+ if config.Development.IsTrue() {
+ data.TutoSecs = 2
+ }
+ data.TutoFrames = generateCssFrames(data.TutoSecs, nil, true)
data.RedRoom = redRoom
preventRefresh := utils.DoParseBool(c.QueryParam("r"))
data.TogglePms = utils.DoParseInt64(c.QueryParam("pmonly"))
diff --git a/pkg/web/public/views/pages/chat.gohtml b/pkg/web/public/views/pages/chat.gohtml
@@ -36,33 +36,20 @@
{{ if .Data.DisplayTutorial }}
#tutorial_btn_next {
visibility: hidden;
- animation: 15s 1s forwards timer_countdown_frames2;
+ animation: {{ .Data.TutoSecs }}s 1s forwards timer_countdown_frames2;
}
@keyframes timer_countdown_frames2 {
99% { visibility: hidden; }
100% { visibility: visible; }
}
#tutorial_secs:before {
- content: "15";
- animation: 15s 1s forwards timer_countdown_frames;
+ content: "{{ .Data.TutoSecs }}";
+ animation: {{ .Data.TutoSecs }}s 1s forwards timer_countdown_frames;
}
@keyframes timer_countdown_frames {
- 0% { content: "15"; }
- 6.6666666667% { content: "14"; }
- 13.3333333333% { content: "13"; }
- 20% { content: "12"; }
- 26.6666666667% { content: "11"; }
- 33.3333333333% { content: "10"; }
- 40% { content: "9"; }
- 46.6666666667% { content: "8"; }
- 53.3333333333% { content: "7"; }
- 60% { content: "6"; }
- 66.6666666667% { content: "5"; }
- 73.3333333333% { content: "4"; }
- 80% { content: "3"; }
- 86.6666666667% { content: "2"; }
- 93.3333333333% { content: "1"; }
- 100% { content: "0"; }
+ {{ range .Data.TutoFrames -}}
+ {{ . | css }}
+ {{ end -}}
}
.modal {
-moz-backdrop-filter: blur(2px);