File size: 1,453 Bytes
ef987bb | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | <!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<title>Demo 1001 Layout Gap Fixture</title>
<style>
body { margin: 0; font-family: Arial, sans-serif; }
.app { display: flex; min-height: 100vh; }
.sidebar { width: 240px; background: #111827; color: white; transition: width .2s; }
.sidebar.collapsed { width: 0; overflow: hidden; }
.content-shell { flex: 1; margin-left: 64px; transition: margin-left .2s; }
.content { padding-left: 40px; padding-top: 24px; }
</style>
</head>
<body>
<div class="app">
<aside class="sidebar" data-testid="sidebar">Sidebar</aside>
<main class="content-shell" data-testid="content-shell">
<section class="content" data-testid="main-content">
<button data-testid="collapse-sidebar">Collapse</button>
<button data-testid="show-prompt">Show prompt</button>
<input data-testid="prompt-input" hidden>
</section>
</main>
</div>
<script>
const sidebar = document.querySelector('[data-testid="sidebar"]');
document.querySelector('[data-testid="collapse-sidebar"]').addEventListener('click', () => sidebar.classList.add('collapsed'));
document.querySelector('[data-testid="show-prompt"]').addEventListener('click', () => {
sidebar.classList.remove('collapsed');
document.querySelector('[data-testid="prompt-input"]').hidden = false;
});
</script>
</body>
</html>
|