Compare commits
3 commits
b83ba3b56a
...
9975d72364
Author | SHA1 | Date | |
---|---|---|---|
9975d72364 | |||
d9c0ff232e | |||
4b0b053c83 |
29
index.html
|
@ -1,11 +1,22 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<link rel="icon" href="/static/images/home-icon.png">
|
||||
<meta name="viewport" content="width=device-width">
|
||||
|
||||
<link rel="stylesheet" href="/src/css/index.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
|
||||
<footer>
|
||||
<bottom-app-bar></bottom-app-bar>
|
||||
</footer>
|
||||
|
||||
<script src="/src/components/bottom-app-bar.js" type="module"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
77
src/components/bottom-app-bar.js
Normal file
|
@ -0,0 +1,77 @@
|
|||
const template = `
|
||||
<div>
|
||||
<img src="/static/images/home-icon.png">
|
||||
</div>
|
||||
<div>
|
||||
<img src="/static/images/routes-icon.png">
|
||||
</div>
|
||||
<div>
|
||||
<img src="/static/images/settings-icon.png">
|
||||
</div>
|
||||
`;
|
||||
const style = `
|
||||
:host {
|
||||
position: fixed;
|
||||
bottom: 20px;
|
||||
display: flex;
|
||||
height: 42px;
|
||||
width: 80%;
|
||||
border-radius: 90px;
|
||||
box-shadow: 0 0 50px #ccc;
|
||||
}
|
||||
|
||||
:host > div {
|
||||
flex: 1;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
}
|
||||
|
||||
img {
|
||||
display: block;
|
||||
height: 32px;
|
||||
width: auto;
|
||||
}
|
||||
`;
|
||||
|
||||
/**
|
||||
* Bottom app bar custom element.
|
||||
*/
|
||||
class BottomAppBar extends HTMLElement {
|
||||
#elements = {};
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
this.#createShadowDOM();
|
||||
this.#setElements();
|
||||
this.#addEventListeners();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create shadow DOM.
|
||||
*/
|
||||
#createShadowDOM() {
|
||||
this.attachShadow({mode: 'open'});
|
||||
this.shadowRoot.innerHTML = `
|
||||
<style>${style}</style>
|
||||
${template}
|
||||
`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set all shadow dom selectors.
|
||||
*/
|
||||
#setElements() {
|
||||
this.selectors = {};
|
||||
}
|
||||
|
||||
#addEventListeners() {}
|
||||
}
|
||||
|
||||
customElements.define('bottom-app-bar', BottomAppBar);
|
||||
|
||||
export default BottomAppBar;
|
||||
|
19
src/css/index.css
Normal file
|
@ -0,0 +1,19 @@
|
|||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin: 0px;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
footer {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
width: 100%;
|
||||
}
|
BIN
static/images/app-bar-logo.png
Normal file
After Width: | Height: | Size: 8.2 KiB |
BIN
static/images/arrow-up.png
Normal file
After Width: | Height: | Size: 923 B |
BIN
static/images/black-back-arrow.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
static/images/home-icon.png
Normal file
After Width: | Height: | Size: 8 KiB |
BIN
static/images/routes-icon.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
static/images/settings-icon.png
Normal file
After Width: | Height: | Size: 8.6 KiB |
BIN
static/images/splash-background.png
Normal file
After Width: | Height: | Size: 11 MiB |
BIN
static/images/splash-logo.png
Normal file
After Width: | Height: | Size: 40 KiB |
BIN
static/images/white-back-arrow.png
Normal file
After Width: | Height: | Size: 1 KiB |