Skip to content

Commit

Permalink
add styles
Browse files Browse the repository at this point in the history
  • Loading branch information
melvincarvalho committed May 21, 2023
1 parent e334666 commit 9f67a37
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 15 deletions.
2 changes: 1 addition & 1 deletion app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { html, render } from './js/preact.js'
import { html, render } from './js/standalone.module.js'
import Navbar from './index.js'

render(html`<${Navbar} />`, document.body)
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<html>
<head></head>
<body>
<script type="module" src="app.js"></script>
<script type="module" src="./app.js"></script>
</body>
</html>
32 changes: 28 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,35 @@
import { html } from './js/standalone.module.js'

const navbarStyle = {
overflow: 'hidden',
backgroundColor: '#333'
}

const navbarLinkStyle = {
float: 'left',
display: 'block',
color: '#f2f2f2',
textAlign: 'center',
padding: '14px 16px',
textDecoration: 'none'
}

const navbarLinkHoverStyle = {
backgroundColor: '#ddd',
color: 'black'
}

const dropdownStyle = {
float: 'left',
overflow: 'hidden'
}

const Navbar = () => {
return html`
<div class="navbar">
<a href="#home">Home</a>
<a href="#about">About</a>
<a href="#contact">Nostr</a>
<div style=${navbarStyle}>
<a href="#home" style=${navbarLinkStyle} onMouseOver=${navbarLinkHoverStyle}>Home</a>
<a href="#about" style=${navbarLinkStyle} onMouseOver=${navbarLinkHoverStyle}>About</a>
<a href="#contact" style=${navbarLinkStyle} onMouseOver=${navbarLinkHoverStyle}>Nostr</a>
</div>
`
}
Expand Down
8 changes: 0 additions & 8 deletions js/preact.js

This file was deleted.

1 change: 1 addition & 0 deletions js/standalone.module.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,7 @@
"url": "https://github.com/nostr-components/navbar/issues"
},
"homepage": "https://github.com/nostr-components/navbar#readme",
"dependencies": {}
"dependencies": {
"htm": "^3.1.1"
}
}

0 comments on commit 9f67a37

Please sign in to comment.