|
| 1 | +<script> |
| 2 | + import { page } from '$app/stores'; |
| 3 | + import logo from '$lib/images/tc_icon_256x256.png'; |
| 4 | + import github from '$lib/images/github.svg'; |
| 5 | +</script> |
| 6 | + |
| 7 | +<header> |
| 8 | + <div class="corner"> |
| 9 | + <a href="https://projects.eclipse.org/projects/tools.tracecompass"> |
| 10 | + <img src={logo} alt="Trace Compass" /> |
| 11 | + </a> |
| 12 | + </div> |
| 13 | + |
| 14 | + <nav> |
| 15 | + <svg viewBox="0 0 2 3" aria-hidden="true"> |
| 16 | + <path d="M0,0 L1,2 C1.5,3 1.5,3 2,3 L2,0 Z" /> |
| 17 | + </svg> |
| 18 | + <ul> |
| 19 | + <li aria-current={$page.url.pathname === '/' ? 'page' : undefined}> |
| 20 | + <a href="/">Home</a> |
| 21 | + </li> |
| 22 | + <li aria-current={$page.url.pathname === '/about' ? 'page' : undefined}> |
| 23 | + <a href="/about">About</a> |
| 24 | + </li> |
| 25 | + </ul> |
| 26 | + <svg viewBox="0 0 2 3" aria-hidden="true"> |
| 27 | + <path d="M0,0 L0,3 C0.5,3 0.5,3 1,2 L2,0 Z" /> |
| 28 | + </svg> |
| 29 | + </nav> |
| 30 | + |
| 31 | + <div class="corner"> |
| 32 | + <a href="https://github.com/eclipse-cdt-cloud/theia-trace-extension"> |
| 33 | + <img src={github} alt="GitHub" /> |
| 34 | + </a> |
| 35 | + </div> |
| 36 | +</header> |
| 37 | + |
| 38 | +<style> |
| 39 | + header { |
| 40 | + display: flex; |
| 41 | + justify-content: space-between; |
| 42 | + } |
| 43 | +
|
| 44 | + .corner { |
| 45 | + width: 3em; |
| 46 | + height: 3em; |
| 47 | + } |
| 48 | +
|
| 49 | + .corner a { |
| 50 | + display: flex; |
| 51 | + align-items: center; |
| 52 | + justify-content: center; |
| 53 | + width: 100%; |
| 54 | + height: 100%; |
| 55 | + } |
| 56 | +
|
| 57 | + .corner img { |
| 58 | + width: 2em; |
| 59 | + height: 2em; |
| 60 | + object-fit: contain; |
| 61 | + } |
| 62 | +
|
| 63 | + nav { |
| 64 | + display: flex; |
| 65 | + justify-content: center; |
| 66 | + --background: rgba(255, 255, 255, 0.7); |
| 67 | + } |
| 68 | +
|
| 69 | + svg { |
| 70 | + width: 2em; |
| 71 | + height: 3em; |
| 72 | + display: block; |
| 73 | + } |
| 74 | +
|
| 75 | + path { |
| 76 | + fill: var(--background); |
| 77 | + } |
| 78 | +
|
| 79 | + ul { |
| 80 | + position: relative; |
| 81 | + padding: 0; |
| 82 | + margin: 0; |
| 83 | + height: 3em; |
| 84 | + display: flex; |
| 85 | + justify-content: center; |
| 86 | + align-items: center; |
| 87 | + list-style: none; |
| 88 | + background: var(--background); |
| 89 | + background-size: contain; |
| 90 | + } |
| 91 | +
|
| 92 | + li { |
| 93 | + position: relative; |
| 94 | + height: 100%; |
| 95 | + } |
| 96 | +
|
| 97 | + li[aria-current='page']::before { |
| 98 | + --size: 6px; |
| 99 | + content: ''; |
| 100 | + width: 0; |
| 101 | + height: 0; |
| 102 | + position: absolute; |
| 103 | + top: 0; |
| 104 | + left: calc(50% - var(--size)); |
| 105 | + border: var(--size) solid transparent; |
| 106 | + border-top: var(--size) solid var(--color-theme-1); |
| 107 | + } |
| 108 | +
|
| 109 | + nav a { |
| 110 | + display: flex; |
| 111 | + height: 100%; |
| 112 | + align-items: center; |
| 113 | + padding: 0 0.5rem; |
| 114 | + color: var(--color-text); |
| 115 | + font-weight: 700; |
| 116 | + font-size: 0.8rem; |
| 117 | + text-transform: uppercase; |
| 118 | + letter-spacing: 0.1em; |
| 119 | + text-decoration: none; |
| 120 | + transition: color 0.2s linear; |
| 121 | + } |
| 122 | +
|
| 123 | + a:hover { |
| 124 | + color: var(--color-theme-1); |
| 125 | + } |
| 126 | +</style> |
0 commit comments