1
0
mirror of https://github.com/nolanlawson/pinafore synced 2024-12-13 10:48:19 +01:00
Pinafore-Web-Client-Frontend/routes/_components/compose/ComposeButton.html
Nolan Lawson 42be854521
upgrade to svelte 2.0 (#251)
* upgrade to svelte 2.0

* update svelte-loader to 2.9.0
2018-05-01 17:05:36 -07:00

74 lines
1.7 KiB
HTML

<div class="compose-box-button-halo">
<button class="primary compose-box-button"
{disabled}
aria-label={sticky ? 'Compose' : 'Toot!'}
on:click>
<span class={$postingStatus || sticky ? 'hidden' : ''}>
Toot!
</span>
<div class="compose-box-button-spinner"
aria-hidden="true">
<svg class="compose-box-button-svg {$postingStatus ? 'spin' : 'hidden'}">
<use xlink:href="#fa-spinner" />
</svg>
</div>
<div class="compose-box-button-compose {sticky ? '' : 'hidden'}"
aria-hidden="true">
<svg class="compose-box-button-svg">
<use xlink:href="#fa-pencil" />
</svg>
</div>
</button>
</div>
<style>
.compose-box-button-halo {
border-radius: 2px;
margin: 5px 15px 15px 5px;
background: var(--compose-button-halo);
pointer-events: auto;
}
.compose-box-button {
grid-area: button;
justify-self: right;
text-transform: uppercase;
position: relative;
margin: 5px;
pointer-events: auto;
}
.compose-box-button-spinner, .compose-box-button-compose {
position: absolute;
display: flex;
justify-content: center;
align-items: center;
z-index: 10;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
.compose-box-button-svg {
width: 24px;
height: 24px;
fill: var(--button-primary-text);
}
@media (max-width: 767px) {
.compose-box-button-halo {
margin: 5px;
}
.compose-box-button {
margin: 5px;
}
}
</style>
<script>
import { store } from '../../_store/store'
export default {
store: () => store,
computed: {
disabled: ({ $postingStatus, overLimit }) => $postingStatus || overLimit
}
}
</script>