mirror of
https://github.com/celogeek/go-comic-converter.git
synced 2025-05-25 08:12:36 +02:00
responsive style for image
This commit is contained in:
parent
8b04cbc38f
commit
3f874dc43e
@ -85,11 +85,5 @@ func (i *Image) ImgStyle(viewWidth, viewHeight int, align string) string {
|
||||
}
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"width:%dpx; height:%dpx; top:%.2f%%; %s;",
|
||||
i.Width,
|
||||
i.Height,
|
||||
marginH*100/float64(viewHeight),
|
||||
align,
|
||||
)
|
||||
return fmt.Sprintf("top:%.2f%%; %s;", marginH*100/float64(viewHeight), align)
|
||||
}
|
||||
|
@ -15,4 +15,6 @@ img {
|
||||
margin:0;
|
||||
padding:0;
|
||||
z-index:0;
|
||||
max-width:100%;
|
||||
max-height:100%;
|
||||
}
|
@ -8,8 +8,6 @@
|
||||
<meta name="viewport" content="{{ .ViewPort }}"/>
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
<img src="../{{ .ImagePath }}" alt="{{ .Title }}" style="{{ .ImageStyle }}"/>
|
||||
</div>
|
||||
<img src="../{{ .ImagePath }}" alt="{{ .Title }}" style="{{ .ImageStyle }}"/>
|
||||
</body>
|
||||
</html>
|
Loading…
x
Reference in New Issue
Block a user