File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change 2525 @import url("@fontsource/inter/600-italic.css");
2626 @import url("@fontsource/inter/700-italic.css");
2727 </style>
28+ <style type="text/css">
29+ #header {
30+ transition: box-shadow ease 250ms;
31+ }
32+ #header.scrolled {
33+ box-shadow: 0 0 6px rgba(0, 0, 0, 0.2);
34+ }
35+ </style>
2836 </head>
2937 <body>
30- <header style="width: 100vw; margin: -32px calc((100% - 100vw) / 2) 4rem; background-color : var(--theme-foreground); color: var(--theme-background); font: 500 16px/normal var(--sans-serif);">
38+ <header id="header" style="position: sticky; z-index: 10; top: 0; margin: -32px calc((100% - 100vw) / 2) 4rem; background: var(--theme-foreground); color: var(--theme-background); font: 500 16px/normal var(--sans-serif);">
3139 <div style="display: flex; max-width: var(--max-width); padding: 1rem; margin: auto; gap: 1rem; justify-content: space-between;">
3240 <a href="/notebook-kit/" style="color: inherit; display: flex; align-items: center; gap: 0.5rem;">
3341 <svg role="img" width="24" height="24" viewBox="0 0 24 24" aria-label="Observable" fill="currentColor">
5462 <script type="module">
5563 document.querySelector("#edit-page").href += `/edit/main/docs${location.pathname.replace(/^\/notebook-kit\//, "/") + (location.pathname.endsWith("/") ? "index" : "")}.html`;
5664 </script>
65+ <script type="module">
66+ let scrolled = false;
67+ const header = document.querySelector("#header");
68+ document.addEventListener("scroll", () => {
69+ const s = scrollY > 0;
70+ if (scrolled === s) return;
71+ header.classList.toggle("scrolled", scrolled = s);
72+ });
73+ </script>
5774 <footer style="width: 100vw; margin: 2rem calc((100% - 100vw) / 2) -32px; padding-bottom: 16px; background-color: var(--theme-foreground); color: var(--theme-background); font: 12px/normal var(--sans-serif);">
5875 <div style="display: flex; flex-wrap: wrap; max-width: var(--max-width); padding: 2rem 1rem; margin: auto; gap: 2rem;">
5976 <div>
You can’t perform that action at this time.
0 commit comments