Files
remnawave-minishop/docs-site/src/pages/demo.astro
T
2026-05-28 13:10:07 +03:00

268 lines
7.0 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
const defaultDemoSrc = '/demo/runtime/app.html?screen=home&mock=tariffs';
const docsHref = '/getting-started/demo/';
---
<!doctype html>
<html lang="ru">
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, viewport-fit=cover"
/>
<meta name="robots" content="noindex, nofollow" />
<meta name="theme-color" content="#05080f" />
<title>remnawave-minishop demo</title>
<style>
:root {
color-scheme: dark;
font-family:
Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
sans-serif;
background: #05080f;
color: #f8fafc;
}
* {
box-sizing: border-box;
}
html,
body {
width: 100%;
height: 100%;
margin: 0;
}
body {
display: grid;
grid-template-rows: auto minmax(0, 1fr);
overflow: hidden;
background: #05080f;
}
.demo-topbar {
display: flex;
gap: 1rem;
align-items: center;
justify-content: space-between;
min-height: 3.25rem;
padding: max(0.7rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right))
0.7rem max(1rem, env(safe-area-inset-left));
border-bottom: 1px solid rgb(148 163 184 / 20%);
background: rgb(5 8 15 / 94%);
backdrop-filter: blur(16px);
}
.demo-topbar__toggle,
.demo-topbar__hide {
display: none;
}
.demo-topbar__panel {
display: flex;
flex: 1 1 auto;
gap: 1rem;
align-items: center;
justify-content: space-between;
min-width: 0;
}
.demo-topbar__title {
min-width: 0;
}
.demo-topbar__title strong {
display: block;
color: #00fe7a;
font-size: 0.95rem;
line-height: 1.2;
}
.demo-topbar__back {
flex: 0 0 auto;
border: 1px solid rgb(0 254 122 / 45%);
border-radius: 7px;
padding: 0.48rem 0.72rem;
color: #f8fafc;
font-size: 0.86rem;
font-weight: 650;
line-height: 1;
text-decoration: none;
}
.demo-topbar__back:hover {
border-color: #00fe7a;
color: #00fe7a;
}
.demo-topbar__actions {
display: flex;
flex: 0 0 auto;
gap: 0.5rem;
align-items: center;
}
.demo-frame {
display: block;
width: 100%;
height: 100%;
border: 0;
background: #05080f;
}
@media (max-width: 42rem) {
body {
display: block;
}
.demo-topbar {
position: fixed;
z-index: 2;
top: max(0.55rem, env(safe-area-inset-top));
right: max(0.55rem, env(safe-area-inset-right));
display: block;
min-height: 0;
padding: 0;
border: 0;
background: transparent;
backdrop-filter: none;
pointer-events: none;
}
.demo-topbar__toggle {
display: inline-grid;
min-width: 2.75rem;
height: 2.25rem;
place-items: center;
pointer-events: auto;
border: 1px solid rgb(0 254 122 / 35%);
border-radius: 999px;
padding: 0 0.7rem;
background: rgb(5 8 15 / 86%);
box-shadow: 0 12px 34px rgb(0 0 0 / 28%);
color: #f8fafc;
backdrop-filter: blur(12px);
cursor: pointer;
font: inherit;
font-size: 0.78rem;
font-weight: 700;
line-height: 1;
}
.demo-topbar:not([data-collapsed]) .demo-topbar__toggle,
.demo-topbar[data-collapsed] .demo-topbar__panel {
display: none;
}
.demo-topbar__panel {
display: flex;
gap: 0.55rem;
align-items: center;
width: min(20rem, calc(100vw - 1.1rem));
padding: 0.38rem;
pointer-events: auto;
border: 1px solid rgb(148 163 184 / 22%);
border-radius: 10px;
background: rgb(5 8 15 / 90%);
box-shadow: 0 16px 44px rgb(0 0 0 / 34%);
backdrop-filter: blur(14px);
}
.demo-topbar__title {
flex: 1 1 auto;
overflow: hidden;
}
.demo-topbar__title strong {
overflow: hidden;
font-size: 0.78rem;
text-overflow: ellipsis;
white-space: nowrap;
}
.demo-topbar__actions {
gap: 0.35rem;
}
.demo-topbar__back {
display: inline-flex;
border-color: rgb(0 254 122 / 35%);
padding: 0.42rem 0.55rem;
font-size: 0.78rem;
}
.demo-topbar__hide {
display: inline-grid;
width: 1.95rem;
height: 1.95rem;
place-items: center;
border: 1px solid rgb(148 163 184 / 26%);
border-radius: 7px;
padding: 0;
background: transparent;
color: #cbd5e1;
cursor: pointer;
font: inherit;
font-size: 1rem;
line-height: 1;
}
.demo-frame {
height: 100dvh;
}
}
</style>
</head>
<body>
<header class="demo-topbar" data-collapsed>
<button
class="demo-topbar__toggle"
type="button"
aria-controls="demo-topbar-panel"
aria-expanded="false"
>
Демо
</button>
<div class="demo-topbar__panel" id="demo-topbar-panel">
<div class="demo-topbar__title">
<strong>remnawave-minishop demo</strong>
</div>
<div class="demo-topbar__actions">
<a class="demo-topbar__back" href={docsHref}>К документации</a>
<button class="demo-topbar__hide" type="button" aria-label="Скрыть панель">
×
</button>
</div>
</div>
</header>
<iframe
id="demo-frame"
class="demo-frame"
title="remnawave-minishop static demo"
src={defaultDemoSrc}
loading="eager"
></iframe>
<script is:inline>
const frame = document.getElementById('demo-frame');
const params = new URLSearchParams(window.location.search);
if (!params.has('screen')) params.set('screen', 'home');
if (!params.has('mock')) params.set('mock', 'tariffs');
frame.src = `/demo/runtime/app.html?${params.toString()}${window.location.hash || ''}`;
const topbar = document.querySelector('.demo-topbar');
const toggle = document.querySelector('.demo-topbar__toggle');
const hide = document.querySelector('.demo-topbar__hide');
const setCollapsed = (collapsed) => {
topbar.toggleAttribute('data-collapsed', collapsed);
toggle.setAttribute('aria-expanded', String(!collapsed));
};
toggle.addEventListener('click', () => setCollapsed(false));
hide.addEventListener('click', () => setCollapsed(true));
</script>
</body>
</html>