src/web:
filter:
add Files functions to build `predicate.File` and `queryMap`
files api and no script page:
use `predicate.File` and `filter.Files` to query file
web:
scripts:
load:
add `fetchPriority = "high"` to gallery thumbnail images
add `alt = "spoiler"` for gallery sensitive image mask
process pages:
add document title status
fix preview image will mask original image when img tag has not src attribute in safari
add `go convert` button for upscayl page
styles/process pages:
fix `user-select: none`
templates/process pages:
add `title` tags
add `go convert` button for upscayl page
74 lines
2.8 KiB
Cheetah
74 lines
2.8 KiB
Cheetah
{{ define "convert" }}
|
|
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta property="og:site_name" content="trpic">
|
|
<meta name="file"
|
|
id="{{ .File.ID }}"
|
|
thumbed="{{ .File.Thumbed }}"
|
|
source_url="{{ .File.SourceURL }}"
|
|
raw_ext="{{ .File.RawExt }}"
|
|
ext="{{ .File.Ext }}"
|
|
size_str="{{ .File.SizeStr }}"
|
|
width="{{ .File.Width }}"
|
|
height="{{ .File.Height }}"
|
|
aspect_ratio="{{ .File.AspectRatio }}"
|
|
elongation_ratio="{{ .File.ElongationRatio }}"
|
|
>
|
|
{{ "base" | .RenderStyle }}
|
|
{{ "convert" | .RenderStyle }}
|
|
{{ "base" | .RenderScript }}
|
|
{{ "convert" | .RenderScript }}
|
|
<title>convert - trpic</title>
|
|
</head>
|
|
<body>
|
|
<noscript>
|
|
<p>当前未启用 JavaScript</p>
|
|
<p>您无法在不使用 JavaScript 的情况下访问可视化压缩页面</p>
|
|
</noscript>
|
|
<div id="preview">
|
|
<div id="preview-header">
|
|
<div id="convert-action">
|
|
<select id="quality-selector">
|
|
<option id="q100" value="100">100%</option>
|
|
<option id="q95" value="95">95%</option>
|
|
<option id="q90" value="90" selected>90%</option>
|
|
<option id="q85" value="85">85%</option>
|
|
<option id="q80" value="80">80%</option>
|
|
<option id="q75" value="75">75%</option>
|
|
<option id="q70" value="70">70%</option>
|
|
<option id="q65" value="65">65%</option>
|
|
<option id="q60" value="60">60%</option>
|
|
<option id="q55" value="55">55%</option>
|
|
<option id="q50" value="50">50%</option>
|
|
<option id="q45" value="45">45%</option>
|
|
<option id="q40" value="40">40%</option>
|
|
<option id="q35" value="35">35%</option>
|
|
</select>
|
|
<button id="convert-button">convert</button>
|
|
<button id="save-button">save</button>
|
|
</div>
|
|
<div id="preview-info">
|
|
<button id="background-button">black</button>
|
|
<button id="pixelated-button">pixelated</button>
|
|
<button id="reset-button">reset</button>
|
|
<select id="image-selector">
|
|
{{ if .RawSizeStr }}<option value="orignal">original - {{ .RawSizeStr }}</option>{{ end }}
|
|
{{ range $name, $size := .ModelAndSize }}<option value="{{ $name }}">{{ $name }} - {{ $size }}</option>{{ end }}
|
|
</select>
|
|
<p id="dimensions">{{ .File.Width }}*{{ .File.Height }}px</p>
|
|
</div>
|
|
</div>
|
|
<div id="preview-view">
|
|
<div id="image-wrapper">
|
|
<img id="preview-img">
|
|
<img id="original-img" style="z-index: -1">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|
|
{{ end }}
|