Remove transparency on images prior to loading page
This commit is contained in:
parent
0baba06ace
commit
c926a9184e
|
@ -17,7 +17,7 @@ import (
|
||||||
|
|
||||||
const (
|
const (
|
||||||
AllowedCharacters string = `^[A-z0-9.\-_]+$`
|
AllowedCharacters string = `^[A-z0-9.\-_]+$`
|
||||||
ReleaseVersion string = "8.4.0"
|
ReleaseVersion string = "8.4.1"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -50,7 +50,7 @@ func (t Format) CSS() string {
|
||||||
css.WriteString(`a{color:inherit;display:block;height:97%;width:100%;text-decoration:none;}`)
|
css.WriteString(`a{color:inherit;display:block;height:97%;width:100%;text-decoration:none;}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
css.WriteString(`img{margin:auto;display:block;max-width:97%;max-height:97%;color:transparent;`)
|
css.WriteString(`img{margin:auto;display:block;max-width:97%;max-height:97%;`)
|
||||||
css.WriteString(`object-fit:scale-down;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)`)
|
css.WriteString(`object-fit:scale-down;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)`)
|
||||||
if t.Fun {
|
if t.Fun {
|
||||||
rotate := rand.Intn(360)
|
rotate := rand.Intn(360)
|
||||||
|
@ -86,7 +86,7 @@ func (t Format) Body(rootUrl, fileUri, filePath, fileName, prefix, mime, nonce s
|
||||||
|
|
||||||
var w strings.Builder
|
var w strings.Builder
|
||||||
|
|
||||||
w.WriteString(fmt.Sprintf(`<a href="%s"><img nonce=%q id="main" src="%s" width="%d" height="%d" type="%s" alt="Roulette selected: %s"></a>`,
|
w.WriteString(fmt.Sprintf(`<a href="%s"><img nonce=%q src="%s" width="%d" height="%d" type="%s" alt="Roulette selected: %s"></a>`,
|
||||||
rootUrl,
|
rootUrl,
|
||||||
nonce,
|
nonce,
|
||||||
fileUri,
|
fileUri,
|
||||||
|
@ -95,8 +95,6 @@ func (t Format) Body(rootUrl, fileUri, filePath, fileName, prefix, mime, nonce s
|
||||||
mime,
|
mime,
|
||||||
fileName))
|
fileName))
|
||||||
|
|
||||||
w.WriteString(fmt.Sprintf(`<script nonce=%q>window.addEventListener("load", function (){ document.getElementById("main").style.color='inherit' });</script>`, nonce))
|
|
||||||
|
|
||||||
return w.String(), nil
|
return w.String(), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue