Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions topnav/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/node_modules/
html-dump.html
3 changes: 3 additions & 0 deletions topnav/assets/img/ia-hamburger.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions topnav/assets/img/ia-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions topnav/assets/img/ia-search.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions topnav/assets/img/ia-user.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 8 additions & 5 deletions topnav/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@
<html>
<head>
<meta charset="utf-8">
<script type="module" src="/topnav-element.js"></script>
<script type="module" src="topnav-element.js"></script>
<title>topnav-element</title>
<style>
body {
margin: 0px;
}
</style>
</head>

<body>
<div class="vertical-section-container centered">
<h3>Topnav element</h3>
<topnav-element></topnav-element>
</div>
<topnav-element></topnav-element>
</body>
</html>
2 changes: 1 addition & 1 deletion topnav/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"devDependencies": {
"@polymer/iron-demo-helpers": "^3.1.0",
"@polymer/test-fixture": "^4.0.2",
"@webcomponents/webcomponentsjs": "^2.0.0",
"@webcomponents/webcomponentsjs": "^2.0.0"
}
}
1 change: 1 addition & 0 deletions topnav/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

60 changes: 57 additions & 3 deletions topnav/topnav-element.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,66 @@
import { LitElement, html } from 'lit-element';
import { LitElement, html, css } from 'lit-element'

// Extend the LitElement base class
class TopnavElement extends LitElement {

render() {
return html`
<p>Is gonna be built here!</p>
<!--https://a11y-style-guide.com/style-guide/section-navigation.html give 8px padding-->
<nav class="navbar">
<div class="main-menu">
<button><img src="assets/img/ia-hamburger.svg" alt="Main menu"></button>
</div>
<div class="logo">
<a href="#"><img src="assets/img/ia-logo.svg" alt="Home"></a>
</div>
<div class="right">
<button><img src="assets/img/ia-search.svg" alt="Search"></button>
<button><img src="assets/img/ia-user.svg" alt="User menu"></button>
</div>
</nav>
`;
}

static get styles() {
return css`
.navbar {
display: flex;
flex-direction: row;
margin: 0px;
height: 50px;
padding: 0 10px;
background: #000;
padding: 0;
list-style: none;
align-items: center;
}
.navbar button {
background: none;
color: inherit;
border: none;
padding: 10px;
font: inherit;
cursor: pointer;
}
.main-menu {
display: flex;
flex: 1;
justify-content: flex-start;
align-items: center;
}
.logo {
display: flex;
flex: 1;
justify-content: center;
align-items: center;
}
.right {
display: flex;
flex: 1;
justify-content: flex-end;
align-items: center;
}
`;
}
}

customElements.define('topnav-element', TopnavElement);