Remove space reservation in sidebar for anime info
This commit is contained in:
parent
5e552f2541
commit
5e583819d3
@ -1,6 +1,6 @@
|
|||||||
component AudioPlayer
|
component AudioPlayer
|
||||||
#audio-player
|
#audio-player
|
||||||
#audio-player-anime-info
|
#audio-player-anime-info.hidden
|
||||||
a#audio-player-anime-link.ajax(href="", title="")
|
a#audio-player-anime-link.ajax(href="", title="")
|
||||||
img#audio-player-anime-image.lazy.hidden(data-src="", data-webp="true", alt="Anime cover")
|
img#audio-player-anime-image.lazy.hidden(data-src="", data-webp="true", alt="Anime cover")
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
default-transition
|
default-transition
|
||||||
justify-content center
|
justify-content center
|
||||||
position relative
|
position relative
|
||||||
margin 0.8rem 0
|
margin-bottom 0.8rem
|
||||||
flex-shrink 0
|
flex-shrink 0
|
||||||
|
|
||||||
#audio-player-anime-info
|
#audio-player-anime-info
|
||||||
@ -11,6 +11,7 @@
|
|||||||
justify-content center
|
justify-content center
|
||||||
align-items center
|
align-items center
|
||||||
width 100%
|
width 100%
|
||||||
|
margin-top 0.8rem
|
||||||
|
|
||||||
#audio-player-anime-link
|
#audio-player-anime-link
|
||||||
width 142px
|
width 142px
|
||||||
|
@ -35,10 +35,6 @@ component Sidebar(user *arn.User)
|
|||||||
|
|
||||||
//- if arn.IsDevelopment()
|
//- if arn.IsDevelopment()
|
||||||
//- SidebarButton("Groups", "/groups", "users")
|
//- SidebarButton("Groups", "/groups", "users")
|
||||||
|
|
||||||
if user != nil && (user.Role == "editor" || user.Role == "admin")
|
|
||||||
SidebarButton("Editor", "/editor", "pencil")
|
|
||||||
SidebarButton("Log", "/log", "list")
|
|
||||||
|
|
||||||
//- Disabled:
|
//- Disabled:
|
||||||
//- SidebarButton("Dash", "/dashboard", "tachometer")
|
//- SidebarButton("Dash", "/dashboard", "tachometer")
|
||||||
@ -59,8 +55,12 @@ component Sidebar(user *arn.User)
|
|||||||
Icon("search")
|
Icon("search")
|
||||||
FuzzySearch
|
FuzzySearch
|
||||||
|
|
||||||
if user != nil && user.Role == "admin"
|
if user != nil && (user.Role == "editor" || user.Role == "admin")
|
||||||
SidebarButton("Admin", "/admin", "wrench")
|
SidebarButton("Log", "/log", "list")
|
||||||
|
SidebarButton("Editor", "/editor", "pencil")
|
||||||
|
|
||||||
|
//- if user != nil && user.Role == "admin"
|
||||||
|
//- SidebarButton("Admin", "/admin", "wrench")
|
||||||
|
|
||||||
a.sidebar-link.action(href="#", data-action="toggleTheme", data-trigger="click")
|
a.sidebar-link.action(href="#", data-action="toggleTheme", data-trigger="click")
|
||||||
.sidebar-button
|
.sidebar-button
|
||||||
|
@ -11,6 +11,7 @@ var audioPlayer = document.getElementById("audio-player")
|
|||||||
var audioPlayerPlay = document.getElementById("audio-player-play")
|
var audioPlayerPlay = document.getElementById("audio-player-play")
|
||||||
var audioPlayerPause = document.getElementById("audio-player-pause")
|
var audioPlayerPause = document.getElementById("audio-player-pause")
|
||||||
var trackLink = document.getElementById("audio-player-track-title") as HTMLLinkElement
|
var trackLink = document.getElementById("audio-player-track-title") as HTMLLinkElement
|
||||||
|
var animeInfo = document.getElementById("audio-player-anime-info") as HTMLElement
|
||||||
var animeLink = document.getElementById("audio-player-anime-link") as HTMLLinkElement
|
var animeLink = document.getElementById("audio-player-anime-link") as HTMLLinkElement
|
||||||
var animeImage = document.getElementById("audio-player-anime-image") as HTMLImageElement
|
var animeImage = document.getElementById("audio-player-anime-image") as HTMLImageElement
|
||||||
|
|
||||||
@ -86,6 +87,7 @@ function playAudioFile(arn: AnimeNotifier, trackId: string, trackUrl: string) {
|
|||||||
|
|
||||||
// Set anime info
|
// Set anime info
|
||||||
if(animeId !== "") {
|
if(animeId !== "") {
|
||||||
|
animeInfo.classList.remove("hidden")
|
||||||
let animeResponse = await fetch("/api/anime/" + animeId)
|
let animeResponse = await fetch("/api/anime/" + animeId)
|
||||||
let anime = await animeResponse.json()
|
let anime = await animeResponse.json()
|
||||||
animeLink.title = anime.title.canonical
|
animeLink.title = anime.title.canonical
|
||||||
@ -129,6 +131,7 @@ export function stopAudio(arn: AnimeNotifier) {
|
|||||||
|
|
||||||
// Hide anime info
|
// Hide anime info
|
||||||
animeLink.href = ""
|
animeLink.href = ""
|
||||||
|
animeInfo.classList.add("hidden")
|
||||||
animeImage.classList.add("hidden")
|
animeImage.classList.add("hidden")
|
||||||
|
|
||||||
if(gainNode) {
|
if(gainNode) {
|
||||||
|
Loading…
Reference in New Issue
Block a user