]> git.openstreetmap.org Git - nominatim-ui.git/blob - src/components/Header.svelte
last update -x ago-, spinner for loading indicator (#83)
[nominatim-ui.git] / src / components / Header.svelte
1 <script>
2   import PageLink from './PageLink.svelte';
3   import ReverseLink from './ReverseLink.svelte';
4   import LastUpdated from './LastUpdated.svelte';
5
6   import { page } from '../lib/stores.js';
7
8   $: view = $page.tab;
9 </script>
10
11 <style>
12   .navbar-brand :global(a:hover) {
13     text-decoration: none;
14   }
15
16   .navbar-brand h1 {
17     display: inline;
18     font-size: 1.2em;
19     color: #333;
20   }
21
22   .navbar-brand img {
23     display: inline-block;
24     margin-right: 5px;
25     margin-top: -5px;
26   }
27
28   .dropdown-menu { /* need to be above map markers */
29     z-index: 1005;
30   }
31
32   .search-section {
33     padding: 1em 30px;
34     background-color: #f5f5f5;
35     border-top: 2px solid #ddd;
36     border-bottom: 2px solid #ddd;
37   }
38 </style>
39
40 <header class="container-fluid">
41   <nav class="navbar navbar-expand-lg navbar-light">
42     <div class="navbar-brand">
43       <PageLink page="search">
44         <img alt="logo" src="images/osm_logo.120px.png" width="30" height="30"/>
45         <h1>Nominatim</h1>
46       </PageLink>
47     </div>
48     <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
49       <span class="navbar-toggler-icon"></span>
50     </button>
51     <div class="collapse navbar-collapse" id="navbarSupportedContent">
52       <ul class="navbar-nav mr-auto">
53         <li class="nav-item {view === 'search' ? 'active' : ''}">
54           <PageLink page="search" extra_classes="nav-link ">Search</PageLink>
55         </li>
56         <li class="nav-item {view === 'reverse' ? 'active' : ''}">
57           <ReverseLink extra_classes="nav-link ">Reverse</ReverseLink>
58         </li>
59         <li class="nav-item {view === 'details' ? 'active' : ''}">
60           <PageLink page="details" extra_classes="nav-link ">Search By ID</PageLink>
61         </li>
62       </ul>
63       <ul class="navbar-nav">
64         <li class="nav-item dropdown">
65           <a class="nav-link dropdown-toggle" href="#open-about-dropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
66             About &amp; Help
67           </a>
68           <div class="dropdown-menu dropdown-menu-right">
69             <a class="dropdown-item" href="https://nominatim.org/release-docs/develop/api/Overview/" target="_blank">API Reference</a>
70             <a class="dropdown-item" href="https://nominatim.org/release-docs/develop/api/Faq/" target="_blank">FAQ</a>
71             <a class="dropdown-item" href="https://help.openstreetmap.org/tags/nominatim/">OpenStreetMap Help</a>
72             <a class="dropdown-item" href="https://github.com/osm-search/Nominatim">Nominatim on Github</a>
73             <a class="dropdown-item" href="https://github.com/osm-search/nominatim-ui">This frontend on Github</a>
74             <div class="dropdown-divider"></div>
75             <a class="dropdown-item" href="#report-issue" data-toggle="modal" data-target="#report-modal">Report problem with results</a>
76           </div>
77         </li>
78       </ul>
79     </div>
80   </nav>
81 </header>
82 <section class="search-section">
83   <slot/>
84 </section>
85 <LastUpdated/>