* Hover divs and clickable images
This commit is contained in:
15
ts/index.ts
15
ts/index.ts
@@ -21,6 +21,7 @@ class Category {
|
||||
link.href = '#'
|
||||
link.text = this.name + 'ft. No thumbnail'
|
||||
}
|
||||
link.text = link.text[0].toUpperCase() + link.text.substring(1, link.text.length)
|
||||
|
||||
container.appendChild(link)
|
||||
|
||||
@@ -28,7 +29,7 @@ class Category {
|
||||
return container
|
||||
}
|
||||
|
||||
thumbnail_div() : HTMLImageElement {
|
||||
thumbnail_div() : HTMLAnchorElement {
|
||||
let nail = document.createElement('img')
|
||||
nail.className = 'pure-img'
|
||||
|
||||
@@ -39,8 +40,18 @@ class Category {
|
||||
nail.setAttribute('src', '/static/cantfindshit.gif')
|
||||
}
|
||||
|
||||
return nail
|
||||
let link = document.createElement('a')
|
||||
if(this.name) {
|
||||
link.href = `/category/${this.name}`
|
||||
} else {
|
||||
link.href = '#'
|
||||
}
|
||||
link.appendChild(nail)
|
||||
|
||||
return link
|
||||
}
|
||||
|
||||
|
||||
public as_div() {
|
||||
let container = document.createElement('div')
|
||||
container.className = 'video-block'
|
||||
|
||||
Reference in New Issue
Block a user