8776ab2b26
Add custom app icon SVG source and generate platform-specific icon assets for iOS, Android, desktop, and web (favicon) at all required resolutions.
50 lines
1.5 KiB
HTML
50 lines
1.5 KiB
HTML
<!doctype html>
|
|
<html lang="en" class="no-select">
|
|
<head>
|
|
<script>
|
|
if (window.__TAURI_INTERNALS__) {
|
|
function allowsSelection(el) {
|
|
let cur = el
|
|
while (cur) {
|
|
if (
|
|
cur.tagName === "INPUT" ||
|
|
cur.tagName === "TEXTAREA" ||
|
|
cur.hasAttribute("data-selectable")
|
|
)
|
|
return true
|
|
cur = cur.parentElement
|
|
}
|
|
return false
|
|
}
|
|
|
|
document.addEventListener("selectstart", (e) => {
|
|
if (!allowsSelection(e.target)) e.preventDefault()
|
|
})
|
|
|
|
document.addEventListener("selectionchange", () => {
|
|
const sel = window.getSelection()
|
|
if (!sel || sel.isCollapsed) return
|
|
const node = sel.anchorNode
|
|
if (!node) return
|
|
const el = node.nodeType === 3 ? node.parentElement : node
|
|
if (el && !allowsSelection(el)) {
|
|
sel.removeAllRanges()
|
|
}
|
|
})
|
|
} else {
|
|
document.documentElement.classList.remove("no-select")
|
|
}
|
|
</script>
|
|
<meta charset="UTF-8" />
|
|
<link rel="icon" type="image/svg+xml" href="/app-icon.svg" />
|
|
<link rel="icon" type="image/png" href="/favicon.png" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
|
|
<title>书目管理系统</title>
|
|
</head>
|
|
|
|
<body>
|
|
<div id="root"></div>
|
|
<script type="module" src="/src/main.tsx"></script>
|
|
</body>
|
|
</html>
|