Files
@ 5707e7b42de6
Branch filter:
Location: light9/light9/web/live/index.html
5707e7b42de6
5.3 KiB
text/html
css work on live ui
Ignore-this: e70c49ee127305aeba8efa9f65acb430
Ignore-this: e70c49ee127305aeba8efa9f65acb430
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | <!doctype html>
<html>
<head>
<title>device control</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="/style.css">
<script src="/lib/webcomponentsjs/webcomponents-lite.min.js"></script>
<link rel="import" href="/lib/polymer/polymer.html">
<link rel="import" href="/lib/paper-slider/paper-slider.html">
<link rel="import" href="/lib/iron-ajax/iron-ajax.html">
<link rel="import" href="../light9-collector-client.html">
<script src="/lib/d3/build/d3.min.js"></script>
<script src="/lib/N3.js-pull61/browser/n3-browser.js"></script>
<script src="/lib/async/dist/async.js"></script>
<script src="/lib/underscore/underscore-min.js"></script>
<link rel="import" href="../rdfdb-synced-graph.html">
<link rel="import" href="/resource-display.html">
</head>
<body>
<dom-module id="light9-live-control">
<template>
<style>
paper-slider { width: 100%; margin: -19px 0; }
</style>
<style is="custom-style">
paper-slider {
--paper-slider-knob-color: var(--paper-red-500);
--paper-slider-active-color: var(--paper-red-500);
--paper-slider-font-color: white;
--paper-slider-input: {
width: 75px;
background: black;
}
}
</style>
<template is="dom-if" if="{{deviceAttr.useSlider}}">
<paper-slider min="0"
max="{{deviceAttr.max}}"
step=".001"
editable
content-type="application/json"
immediate-value="{{immediateSlider}}"></paper-slider>
</template>
<template is="dom-if" if="{{deviceAttr.useColor}}">
<input type="color"
id="col"
on-input="onPickedColor"
value="{{pickedColor}}">
<button on-click="goWhite">white</button>
<button on-click="goBlack">black</button>
</template>
<template is="dom-if" if="{{deviceAttr.useChoice}}">
<select size$="{{deviceAttr.choiceSize}}" value="{{pickedChoice::change}}">
<option value="">None</option>
<template is="dom-repeat" items="{{deviceAttr.choices}}">
<option value="{{item.uri}}">{{item.label}}</option>
</template>
</select>
</template>
</template>
</dom-module>
<dom-module id="light9-live-device-control">
<template>
<style>
.device {
border: 2px solid #151e2d;
margin: 4px;
padding: 1px;
background: #171717; /* deviceClass gradient added later */
break-inside: avoid-column;
border-top-right-radius: 15px;
overflow: hidden;
}
.deviceAttr {
border-top: 1px solid #272727;
padding-bottom: 2px;
display: flex;
}
.deviceAttr > span {
}
.deviceAttr > light9-live-control {
flex-grow: 1;
}
h2 {
font-size: 110%;
padding: 4px;
}
#mainLabel {
font-size: 120%;
color: #9ab8fd;
text-decoration: initial;
}
</style>
<div class="device">
<h2 style$="[[bgStyle]]">
<resource-display id="mainLabel" graph="{{graph}}" uri="{{uri}}"></resource-display>
a <resource-display minor graph="{{graph}}" uri="{{deviceClass}}"></resource-display>
</h2>
<template is="dom-repeat" items="{{deviceAttrs}}" as="dattr">
<div class="deviceAttr">
<span>attr <resource-display minor graph="{{graph}}" uri="{{dattr.uri}}"></resource-display></span>
<light9-live-control device="{{uri}}" device-attr="{{dattr}}"></light9-live-control>
</div>
</template>
</div>
</template>
</dom-module>
<dom-module id="light9-live-controls">
<template>
<style>
#preview {
width: 100%;
}
#deviceControls {
column-width: 400px;
}
light9-live-device-control > div {
break-inside: avoid-column;
}
</style>
<rdfdb-synced-graph graph="{{graph}}"></rdfdb-synced-graph>
<light9-collector-client self="{{client}}"></light9-collector-client>
<h1>device control <button on-click="resendAll">resend all</button> <button on-click="clearAll">clear all</button></h1>
<div id="save">
<div>
effect name: <input type="input" value="{{newEffectName::change}}">
<button on-click="saveNewEffect">save new effect</button>
</div>
<textarea id="preview" value="{{effectPreview}}"></textarea>
</div>
<div id="deviceControls">
<template is="dom-repeat" items="{{devices}}" as="device">
<light9-live-device-control graph="{{graph}}" uri="{{device.uri}}"></light9-live-device-control>
</template>
</div>
</template>
</dom-module>
<light9-live-controls></light9-live-controls>
<script src="live.js"></script>
</body>
</html>
|