diff --git a/src/components/SampleLayout.module.css b/src/components/SampleLayout.module.css index f63833e7..25d38a16 100644 --- a/src/components/SampleLayout.module.css +++ b/src/components/SampleLayout.module.css @@ -10,7 +10,9 @@ max-width: 600px; } - +nav.sourceFileNav { + position: relative; +} nav.sourceFileNav ul { box-sizing: border-box; @@ -27,6 +29,41 @@ nav.sourceFileNav li { transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); } +nav.sourceFileNav::before { + content: ''; + position: absolute; + display: flex; + flex-direction: column; + justify-content: center; + align-items: flex-start; + width: 30px; + height: 37px; + top: 15px; + left: 0px; + pointer-events: none; +} + +nav.sourceFileNav[data-left=true]::before { + background: linear-gradient(90deg, rgba(0, 0, 0, 0.35), transparent); +} + +nav.sourceFileNav::after { + content: ''; + position: absolute; + display: flex; + justify-content: center; + align-items: center; + width: 30px; + height: 37px; + top: 15px; + right: 0px; + pointer-events: none; +} + +nav.sourceFileNav[data-right=true]::after { + background: linear-gradient(270deg, rgba(0, 0, 0, 0.35), transparent); +} + nav.sourceFileNav div.sourceFileScrollContainer { white-space: nowrap; overflow-x: auto; diff --git a/src/components/SampleLayout.tsx b/src/components/SampleLayout.tsx index 8b8875ea..db39d5e4 100644 --- a/src/components/SampleLayout.tsx +++ b/src/components/SampleLayout.tsx @@ -77,6 +77,7 @@ const SampleLayout: React.FunctionComponent< }> > = (props) => { const canvasRef = useRef(null); + const navRef = useRef(null); const sources = useMemo( () => props.sources.map(({ name, contents }) => { @@ -228,8 +229,25 @@ const SampleLayout: React.FunctionComponent<
-