We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
image-rendering: auto
1 parent e40bcd1 commit cf02bb8Copy full SHA for cf02bb8
static/preview-image.js
@@ -0,0 +1,15 @@
1
+function resize() {
2
+ if (
3
+ body.clientWidth * window.devicePixelRatio < img.naturalWidth
4
+ || body.clientHeight * window.devicePixelRatio < img.naturalHeight
5
+ ) {
6
+ body.style.imageRendering = 'auto';
7
+ } else {
8
+ body.removeAttribute('style');
9
+ }
10
+}
11
+
12
+let body = document.body;
13
+let img = document.getElementsByTagName('img')[0];
14
15
+(new ResizeObserver(resize)).observe(body);
templates/preview-image.html
@@ -25,6 +25,7 @@
25
width: 100%;
26
}
27
</style>
28
+ <script src=/static/preview-image.js type=module defer></script>
29
</head>
30
<body>
31
<img src=/content/{{self.inscription_id}}></img>
0 commit comments