Import existing code

Move the <template> to a template.html partial.
Bring the JS to the assets directory.
This commit is contained in:
Eryn Wells 2024-07-28 09:35:30 -07:00
parent 42b4de6b4c
commit 7c88822645
2 changed files with 537 additions and 0 deletions

View file

@ -0,0 +1,60 @@
<template id="command-bar-template">
<div class="command-bar">
<div class="command-bar__container">
<div class="command-bar__status">
<span class="command-bar__buffer">1:commandbar</span>
<span class="command-bar__ruler"></span>
<span class="command-bar__scrollposition"></span>
</div>
<input class="command-bar__input" name="command-bar__command">
</div>
</div>
<style>
.command-bar {
--secondary: #aaa;
position: fixed;
bottom: -8vh;
width: calc(100% - 18px);
transition: bottom 250ms ease-in-out;
font-family: monospace;
line-height: 1.2;
&[presented] {
bottom: 0vh;
}
.command-bar__container {
background-color: white;
border: 1px solid var(--secondary);
}
.command-bar__status {
background-color: var(--secondary);
color: white;
display: grid;
grid-template-columns: 3fr 1fr 1fr;
margin: 0;
padding: 0;
width: 100%;
.command-bar__scrollposition {
justify-self: flex-end;
}
}
.command-bar__input {
border: none;
display: block;
font-family: monospace;
font-size: 18px;
margin: 0;
outline: none;
outline-offset: 0;
padding: 0;
width: 100%;
}
}
</style>
</template>