opencode-browser-tool-insta.../scripts/fixture_scroll_long.html

109 lines
2.8 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Scroll Fixture Long Page</title>
<style>
:root {
color-scheme: light;
}
body {
margin: 0;
font-family: "Courier New", Courier, monospace;
background: linear-gradient(180deg, #f8f9fb 0%, #e9eef7 100%);
}
.topbar {
position: sticky;
top: 0;
z-index: 20;
padding: 10px 14px;
background: #1f2a44;
color: #ffffff;
font-size: 14px;
}
.grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
gap: 16px;
padding: 16px;
}
.card {
min-height: 220px;
border-radius: 12px;
background: #ffffff;
border: 1px solid #d7deea;
box-shadow: 0 6px 18px rgba(31, 42, 68, 0.12);
padding: 14px;
}
.section {
margin: 24px 16px;
padding: 16px;
border-radius: 12px;
background: #ffffff;
border: 1px solid #d7deea;
}
.scroll-box {
height: 240px;
overflow: auto;
border: 1px solid #9aa7bf;
border-radius: 8px;
padding: 8px;
background: #f4f7fc;
}
.line {
padding: 8px 4px;
border-bottom: 1px dashed #bcc8dc;
}
.tail {
height: 1200px;
margin: 16px;
border-radius: 12px;
background: repeating-linear-gradient(
45deg,
#dce6f6,
#dce6f6 16px,
#edf3fd 16px,
#edf3fd 32px
);
}
</style>
</head>
<body>
<div class="topbar">scrollY: <strong id="scroll-y">0</strong></div>
<div class="grid" id="cards"></div>
<section class="section">
<h2>Scrollable container</h2>
<div class="scroll-box" id="scroll-box"></div>
</section>
<div class="tail"></div>
<script>
const cards = document.getElementById("cards")
for (let i = 1; i <= 18; i += 1) {
const card = document.createElement("article")
card.className = "card"
card.innerHTML = `<h3>Card ${i}</h3><p>Long page fixture content block to force vertical scroll.</p>`
cards.appendChild(card)
}
const box = document.getElementById("scroll-box")
for (let i = 1; i <= 60; i += 1) {
const row = document.createElement("div")
row.className = "line"
row.textContent = `Container row ${i}`
box.appendChild(row)
}
const value = document.getElementById("scroll-y")
const update = () => {
value.textContent = String(Math.round(window.scrollY))
}
update()
window.addEventListener("scroll", update, { passive: true })
</script>
</body>
</html>