mirror of
https://github.com/unmojang/drasl.git
synced 2025-08-03 10:56:06 -04:00
Merge pull request #133 from evan-goode/evan-goode/noscript-skin-view
noscript skin viewer fallback
This commit is contained in:
commit
0282b27fc5
@ -238,6 +238,20 @@ pre {
|
|||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.texture-preview {
|
||||||
|
width: 256px;
|
||||||
|
image-rendering: pixelated;
|
||||||
|
}
|
||||||
|
|
||||||
|
.small-texture-preview {
|
||||||
|
width: 64px;
|
||||||
|
image-rendering: pixelated;
|
||||||
|
}
|
||||||
|
|
||||||
|
.noscript-hidden {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
.list-profile-picture {
|
.list-profile-picture {
|
||||||
--list-profile-picture-size: 24px;
|
--list-profile-picture-size: 24px;
|
||||||
width: var(--list-profile-picture-size);
|
width: var(--list-profile-picture-size);
|
||||||
|
@ -27,6 +27,10 @@
|
|||||||
<script type="module">
|
<script type="module">
|
||||||
import { background } from "{{.App.FrontEndURL}}/web/public/bundle.js";
|
import { background } from "{{.App.FrontEndURL}}/web/public/bundle.js";
|
||||||
background(document.querySelector("#background"));
|
background(document.querySelector("#background"));
|
||||||
|
|
||||||
|
for (const el of document.querySelectorAll(".noscript-hidden")) {
|
||||||
|
el.classList.remove("noscript-hidden");
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</body>
|
</body>
|
||||||
|
@ -19,8 +19,14 @@
|
|||||||
<h6 style="text-align: center;">{{ .Player.UUID }}<br />{{ .PlayerID }}</h6>
|
<h6 style="text-align: center;">{{ .Player.UUID }}<br />{{ .PlayerID }}</h6>
|
||||||
{{/* prettier-ignore-end */}}
|
{{/* prettier-ignore-end */}}
|
||||||
{{ if .SkinURL }}
|
{{ if .SkinURL }}
|
||||||
<div id="skin-container" style="height: 300px;">
|
<div id="skin-container" style="min-height: 300px;">
|
||||||
<canvas id="skin-canvas"></canvas>
|
<noscript>
|
||||||
|
<img class="texture-preview" src="{{ .SkinURL }}">
|
||||||
|
{{ if .CapeURL }}
|
||||||
|
<img class="texture-preview" src="{{ .CapeURL }}">
|
||||||
|
{{ end }}
|
||||||
|
</noscript>
|
||||||
|
<canvas id="skin-canvas" class="noscript-hidden"></canvas>
|
||||||
</div>
|
</div>
|
||||||
{{ else }}
|
{{ else }}
|
||||||
No skin yet.
|
No skin yet.
|
||||||
@ -45,6 +51,12 @@
|
|||||||
{{ end }}
|
{{ end }}
|
||||||
{{ if or .App.Config.AllowSkins .User.IsAdmin }}
|
{{ if or .App.Config.AllowSkins .User.IsAdmin }}
|
||||||
<h4>Skin</h4>
|
<h4>Skin</h4>
|
||||||
|
{{ if .SkinURL }}
|
||||||
|
<p>
|
||||||
|
<span style="vertical-align: top">Current skin: </span>
|
||||||
|
<img class="small-texture-preview" src="{{ .SkinURL }}">
|
||||||
|
</p>
|
||||||
|
{{ end }}
|
||||||
<p>
|
<p>
|
||||||
<label for="skin-file">Upload a skin</label><br />
|
<label for="skin-file">Upload a skin</label><br />
|
||||||
<input type="file" name="skinFile" id="skin-file" />
|
<input type="file" name="skinFile" id="skin-file" />
|
||||||
@ -89,6 +101,12 @@
|
|||||||
{{ end }}
|
{{ end }}
|
||||||
{{ if or .App.Config.AllowCapes .User.IsAdmin }}
|
{{ if or .App.Config.AllowCapes .User.IsAdmin }}
|
||||||
<h4>Cape</h4>
|
<h4>Cape</h4>
|
||||||
|
{{ if .CapeURL }}
|
||||||
|
<p>
|
||||||
|
<span style="vertical-align: top">Current cape: </span>
|
||||||
|
<img class="small-texture-preview" src="{{ .CapeURL }}">
|
||||||
|
</p>
|
||||||
|
{{ end }}
|
||||||
<p>
|
<p>
|
||||||
<label for="cape-file">Upload a cape</label><br />
|
<label for="cape-file">Upload a cape</label><br />
|
||||||
<input type="file" name="capeFile" id="cape-file" />
|
<input type="file" name="capeFile" id="cape-file" />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user