Skip to content

Commit

Permalink
support promo messages
Browse files Browse the repository at this point in the history
  • Loading branch information
vintikzzz committed Dec 1, 2024
1 parent 7f6a38c commit 40ef87b
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 2 deletions.
32 changes: 32 additions & 0 deletions assets/src/styles/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,41 @@
opacity: 1;
}
}

@property --bg-angle {
inherits: false;
initial-value: 0deg;
syntax: "<angle>";
}

@keyframes spin {
to {
--bg-angle: 360deg;
}
}

.border-rainbow {
animation: spin 2.5s infinite linear;
background:
linear-gradient(
to bottom,
oklch(0.1 0.2 240 / 0.95),
oklch(0.1 0.2 240 / 0.95)
)
padding-box,
conic-gradient(
from var(--bg-angle) in oklch longer hue,
oklch(0.85 0.37 0) 0 0
)
border-box;
border-style: solid;
border-color: transparent;
}
}

@layer components {


.progress-alert {
@apply bg-base-200 text-accent border-accent border shadow-md py-4 rounded-box popin;

Expand Down
13 changes: 13 additions & 0 deletions services/web/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,19 @@ func NewHelper(c *cli.Context) *Helper {
}
}

func (s *Helper) TimeBetween(from string, to string) bool {
ft, err := time.Parse(time.DateTime, from)
if err != nil {
panic(err)
}
tt, err := time.Parse(time.DateTime, to)
if err != nil {
panic(err)
}
now := time.Now()
return now.After(ft) && now.Before(tt)
}

func (s *Helper) HasAds(c *claims.Data) bool {
if c == nil {
return false
Expand Down
4 changes: 3 additions & 1 deletion templates/partials/extend_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
{{ define "get_extra" }}
{{ end }}
{{ define "embed_extra" }}
{{ end }}
{{ end }}
{{ define "promo" }}
{{ end }}
3 changes: 2 additions & 1 deletion templates/views/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
<pre>{{ .Err | log | shortErr }}</pre>
<a class="closeable-close close">ok</a>
</div>
{{ end }}
{{ end }}
{{ template "promo" . }}
{{ with .Data }}
{{ if has . "Job" }}
<form class="hidden progress-alert progress-alert-block mb-10 closeable" data-async-progress-log="{{ .Job | makeJobLogURL }}" data-async-target="main">
Expand Down

0 comments on commit 40ef87b

Please sign in to comment.