refactor
This commit is contained in:
parent
9606014617
commit
7764a7c118
|
|
@ -11,7 +11,7 @@ import { PropertyValues } from '@lit/reactive-element';
|
||||||
* Previous CPU-based implementation: github.com/folk-canvas/folk-canvas/commit/fdd7fb9d84d93ad665875cad25783c232fd17bcc
|
* Previous CPU-based implementation: github.com/folk-canvas/folk-canvas/commit/fdd7fb9d84d93ad665875cad25783c232fd17bcc
|
||||||
*/
|
*/
|
||||||
export class FolkDistanceField extends FolkBaseSet {
|
export class FolkDistanceField extends FolkBaseSet {
|
||||||
static tagName = 'folk-distance-field';
|
static override tagName = 'folk-distance-field';
|
||||||
|
|
||||||
private textures: WebGLTexture[] = [];
|
private textures: WebGLTexture[] = [];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ declare global {
|
||||||
}
|
}
|
||||||
|
|
||||||
export class FolkHull extends FolkBaseSet {
|
export class FolkHull extends FolkBaseSet {
|
||||||
static tagName = 'folk-hull';
|
static override tagName = 'folk-hull';
|
||||||
|
|
||||||
static styles = [
|
static styles = [
|
||||||
FolkBaseSet.styles,
|
FolkBaseSet.styles,
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,13 @@
|
||||||
|
import { FolkElement } from './common/folk-element';
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
interface HTMLElementTagNameMap {
|
interface HTMLElementTagNameMap {
|
||||||
'folk-metronome': FolkMetronome;
|
'folk-metronome': FolkMetronome;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class FolkMetronome extends HTMLElement {
|
export class FolkMetronome extends FolkElement {
|
||||||
static tagName = 'folk-metronome';
|
static override tagName = 'folk-metronome';
|
||||||
|
|
||||||
static define() {
|
|
||||||
if (customElements.get(this.tagName)) return;
|
|
||||||
customElements.define(this.tagName, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ declare global {
|
||||||
}
|
}
|
||||||
|
|
||||||
export class FolkCluster extends FolkHull {
|
export class FolkCluster extends FolkHull {
|
||||||
static tagName = 'folk-cluster';
|
static override tagName = 'folk-cluster';
|
||||||
|
|
||||||
static #config = new Map<ElementConstructor, ElementConfig>();
|
static #config = new Map<ElementConstructor, ElementConfig>();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ declare global {
|
||||||
}
|
}
|
||||||
|
|
||||||
export class FolkSpace extends FolkElement {
|
export class FolkSpace extends FolkElement {
|
||||||
static tagName = 'folk-space';
|
static override tagName = 'folk-space';
|
||||||
|
|
||||||
static styles = css`
|
static styles = css`
|
||||||
:host {
|
:host {
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ declare global {
|
||||||
}
|
}
|
||||||
|
|
||||||
export class FolkTimer extends FolkElement {
|
export class FolkTimer extends FolkElement {
|
||||||
static tagName = 'folk-timer';
|
static override tagName = 'folk-timer';
|
||||||
|
|
||||||
#timeMs = 0;
|
#timeMs = 0;
|
||||||
#timeoutId = -1;
|
#timeoutId = -1;
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import { verticesToPolygon } from './common/utils.js';
|
||||||
import type { Point } from './common/types.js';
|
import type { Point } from './common/types.js';
|
||||||
import { PropertyValues } from '@lit/reactive-element';
|
import { PropertyValues } from '@lit/reactive-element';
|
||||||
export class FolkXanadu extends FolkBaseConnection {
|
export class FolkXanadu extends FolkBaseConnection {
|
||||||
static tagName = 'folk-xanadu';
|
static override tagName = 'folk-xanadu';
|
||||||
|
|
||||||
override update(changedProperties: PropertyValues<this>) {
|
override update(changedProperties: PropertyValues<this>) {
|
||||||
super.update(changedProperties);
|
super.update(changedProperties);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue