diff --git a/playground/src/main/resources/css/ProgressBar.css b/playground/src/main/resources/css/ProgressBar.css new file mode 100644 --- /dev/null +++ b/playground/src/main/resources/css/ProgressBar.css @@ -0,0 +1,39 @@ +.progress-bar * { + transition: all 0.5s; +} + +.progress-bar { + + transition: all 0.5s; + height: 1em; + line-height: 0; + font-size: 10px; + white-space: nowrap; +} + +.progress-track { + background-color: #888; + height: 0.2em; + box-shadow: 0 0 0.5em 0 #0004; + width: 70%; + display: inline-block; + vertical-align: middle; +} + +.progress-indicator { + width: 30%; + background-color: #0ae; + height: 100%; + display: inline-block; + vertical-align: middle; + box-shadow: 0 0.6em 1em -0.4em #000; +} + +.progress-bar:hover .progress-indicator { + box-shadow: 0 1em 2em -0.4em #000; +} + +.progress-bar:hover .progress-track { + background-color: #0ae; + box-shadow: 0 0 0.5em 0 #0ae; +} \ No newline at end of file diff --git a/playground/src/main/ts/MainWidget.tsx b/playground/src/main/ts/MainWidget.tsx --- a/playground/src/main/ts/MainWidget.tsx +++ b/playground/src/main/ts/MainWidget.tsx @@ -1,12 +1,21 @@ import { djbase, djclass } from "@implab/djx/declare"; import { DjxWidgetBase } from "@implab/djx/tsx/DjxWidgetBase"; import { createElement } from "@implab/djx/tsx"; +import ProgressBar from "./ProgressBar"; + +const ref = (target: W, name: K) => (v: W[K]) => target.set(name, v); @djclass export default class MainWidget extends djbase(DjxWidgetBase) { + + titleNode?: HTMLHeadingElement; + + progressBar?: ProgressBar; + render() { return
-

Hi!

+

Hi!

+
; } } diff --git a/playground/src/main/ts/ProgressBar.tsx b/playground/src/main/ts/ProgressBar.tsx new file mode 100644 --- /dev/null +++ b/playground/src/main/ts/ProgressBar.tsx @@ -0,0 +1,19 @@ +import { djbase, djclass } from "@implab/djx/declare"; +import { createElement } from "@implab/djx/tsx"; +import { DjxWidgetBase } from "@implab/djx/tsx/DjxWidgetBase"; +import "@implab/djx/css!./css/ProgressBar.css"; + +@djclass +export default class ProgressBar extends djbase(DjxWidgetBase) { + + constructor(opts?: Partial & ThisType, refNode?: Node | string) { + super(opts, refNode); + } + render() { + return
+
+
+
; + } + +} \ No newline at end of file