changed a bunch of shit not going to elaborate

This commit is contained in:
Laptop
2024-09-17 17:11:03 +03:00
parent 7b9ccb81bd
commit d3bf719dba
10 changed files with 87 additions and 37 deletions

View File

@@ -8,17 +8,21 @@ templ Base(title string, content templ.Component, head templ.Component) {
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="stylesheet" href="/global.css"/>
if title != "" {
<title>{ title } • Soundcloak</title>
<title>{ title } • soundcloak</title>
} else {
<title>Soundcloak</title>
<title>soundcloak</title>
}
if head != nil {
@head
}
</head>
<body>
<a href="/" id="sc"><h1>Soundcloak</h1></a>
<a href="/" id="sc"><h1>soundcloak</h1></a>
@content
</body>
</html>
}
css ViewTransition(name string) {
view-transition-name: { templ.SafeCSSProperty(name) };
}

View File

@@ -7,7 +7,7 @@ import (
"strings"
)
templ SearchPlaylists(p *sc.Paginated[sc.Playlist]) {
templ SearchPlaylists(p *sc.Paginated[*sc.Playlist]) {
<span>Found { strconv.FormatInt(p.Total, 10) } playlists</span>
<br/>
<br/>

View File

@@ -7,18 +7,14 @@ import (
"strings"
)
templ SearchTracks(p *sc.Paginated[sc.Track]) {
templ SearchTracks(p *sc.Paginated[*sc.Track]) {
<span>Found { strconv.FormatInt(p.Total, 10) } tracks</span>
<br/>
<br/>
for _, track := range p.Collection {
<a class="listing" href={ templ.URL("/" + track.Author.Permalink + "/" + track.Permalink) }>
<a class="listing" href={ templ.URL("/" + track.Author.Permalink + "/" + track.Permalink) }>
if track.Artwork != "" {
@templ.Raw("<img src='")
{ track.Artwork }
@templ.Raw("' style='view-transition-name:")
{ "track-" + strconv.FormatInt(track.ID, 10) }
@templ.Raw("'>")
<img src={ track.Artwork } class={ViewTransition("t" + track.ID)}>
} else {
<img src="/placeholder.jpg"/>
}

View File

@@ -7,7 +7,7 @@ import (
"strings"
)
templ SearchUsers(p *sc.Paginated[sc.User]) {
templ SearchUsers(p *sc.Paginated[*sc.User]) {
<span>Found { strconv.FormatInt(p.Total, 10) } users</span>
<br/>
<br/>

View File

@@ -17,11 +17,7 @@ templ TrackEmbed(t sc.Track) {
templ Track(t sc.Track, stream string) {
if t.Artwork != "" {
@templ.Raw("<img src='")
{ t.Artwork }
@templ.Raw("' style='view-transition-name:")
{ "track-" + strconv.FormatInt(t.ID, 10) }
@templ.Raw("'>")
<img src={t.Artwork} class={ViewTransition("t" + t.ID)}>
}
<h1>{ t.Title }</h1>
<audio id="track" data-stream={ stream } controls></audio>