diff options
| author | Tulir Asokan <tulir@maunium.net> | 2020-09-10 16:12:09 +0300 |
|---|---|---|
| committer | Tulir Asokan <tulir@maunium.net> | 2020-09-10 16:12:09 +0300 |
| commit | 81caaa2ebed066f80939b04f565b307ec0dd2d61 (patch) | |
| tree | 3eba458d6ae76741862d0d04c1a6f918dd6da74e /web/spinner.js | |
| parent | bdf4222c6178e438e93775a3593d3fc7027d3471 (diff) | |
Split web things into subdirectories
Diffstat (limited to 'web/spinner.js')
| -rw-r--r-- | web/spinner.js | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/web/spinner.js b/web/spinner.js deleted file mode 100644 index 6462cde..0000000 --- a/web/spinner.js +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) 2020 Tulir Asokan -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -import { html } from "https://unpkg.com/htm/preact/index.mjs?module" - -export const Spinner = ({ size = 40, noCenter = false, noMargin = false, green = false }) => { - let margin = 0 - if (!isNaN(+size)) { - size = +size - margin = noMargin ? 0 : `${Math.round(size / 6)}px` - size = `${size}px` - } - const noInnerMargin = !noCenter || !margin - const comp = html` - <div style="width: ${size}; height: ${size}; margin: ${noInnerMargin ? 0 : margin} 0;" - class="sk-chase ${green && "green"}"> - <div class="sk-chase-dot" /> - <div class="sk-chase-dot" /> - <div class="sk-chase-dot" /> - <div class="sk-chase-dot" /> - <div class="sk-chase-dot" /> - <div class="sk-chase-dot" /> - </div> - ` - if (!noCenter) { - return html`<div style="margin: ${margin} 0;" class="sk-center-wrapper">${comp}</div>` - } - return comp -} |
