askrobots / dbbasic-web-native
Public
100+ copy-paste UI components in plain HTML and CSS: no dependencies, no build step.
danq9
Add canonical.html v1.0 - The single source of truth for usability standards
fb6e650
1 year ago
History
semantic-adjuster.html · 8.2 KB · 160 lines
| 1 | <!DOCTYPE html> |
| 2 | <html lang="en"> |
| 3 | <head> |
| 4 | <meta charset="UTF-8"> |
| 5 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 6 | <title>semantic-adjuster - Semantic Components</title> |
| 7 | <script src="../semantic-components.js"></script> |
| 8 | <link rel="stylesheet" href="component-docs.css"> |
| 9 | </head> |
| 10 | <body> |
| 11 | <div class="container"> |
| 12 | <!-- Header --> |
| 13 | <div class="header"> |
| 14 | <h1 class="component-name"><semantic-adjuster></h1> |
| 15 | <p class="tagline">Multi-modal number/value adjusters with voice, gesture, and button controls</p> |
| 16 | <div class="quick-example"> |
| 17 | <semantic-adjuster label="Volume" value="75" min="0" max="100" step="5"></semantic-adjuster> |
| 18 | </div> |
| 19 | </div> |
| 20 | |
| 21 | <!-- Overview --> |
| 22 | <section class="section"> |
| 23 | <h2 class="section-title">Overview</h2> |
| 24 | <p class="section-description">The semantic-adjuster component provides increment/decrement controls for numeric values. It supports button clicks, voice commands ("increase", "decrease"), gestures, and keyboard arrows.</p> |
| 25 | </section> |
| 26 | |
| 27 | <!-- Examples --> |
| 28 | <section class="section"> |
| 29 | <h2 class="section-title">Examples</h2> |
| 30 | <div class="grid"> |
| 31 | |
| 32 | <div class="example"> |
| 33 | <div class="example-label">Volume Control</div> |
| 34 | <div class="example-demo"> |
| 35 | <semantic-adjuster label="Volume" value="75" min="0" max="100" step="5"></semantic-adjuster> |
| 36 | </div> |
| 37 | <div class="example-code"><semantic-adjuster label="Volume" value="75" min="0" max="100" step="5"></semantic-adjuster></div> |
| 38 | <div class="example-notes">Use for: Volume, brightness, quantity adjustments<br>Voice: "Increase volume", "Decrease volume"<br>Gestures: Swipe up/down in AR/VR</div> |
| 39 | </div> |
| 40 | <div class="example"> |
| 41 | <div class="example-label">Temperature Setting</div> |
| 42 | <div class="example-demo"> |
| 43 | <semantic-adjuster label="Temperature" value="20" min="15" max="30" step="0.5"></semantic-adjuster> |
| 44 | </div> |
| 45 | <div class="example-code"><semantic-adjuster label="Temperature" value="20" min="15" max="30" step="0.5"></semantic-adjuster></div> |
| 46 | <div class="example-notes">Use for: Numeric settings, sliders, counters<br>Keyboard: Arrow up/down to adjust<br>Touch: Tap +/- or swipe</div> |
| 47 | </div> |
| 48 | </div> |
| 49 | </section> |
| 50 | |
| 51 | <!-- Interactive States --> |
| 52 | <section class="section"> |
| 53 | <h2 class="section-title">Interactive States</h2> |
| 54 | <div class="state-showcase"> |
| 55 | |
| 56 | <div class="state-box"> |
| 57 | <div class="state-label">Default State</div> |
| 58 | <div class="state-visual state-default"> |
| 59 | <semantic-adjuster intent="primary" >Default</semantic-adjuster> |
| 60 | </div> |
| 61 | <div class="state-description">Circular +/- buttons, large center value</div> |
| 62 | </div> |
| 63 | <div class="state-box"> |
| 64 | <div class="state-label">Hover State</div> |
| 65 | <div class="state-visual state-hover"> |
| 66 | <semantic-adjuster intent="primary" >Hover</semantic-adjuster> |
| 67 | </div> |
| 68 | <div class="state-description">Button hover shows blue background</div> |
| 69 | </div> |
| 70 | <div class="state-box"> |
| 71 | <div class="state-label">Min/Max Reached State</div> |
| 72 | <div class="state-visual state-min/max reached"> |
| 73 | <semantic-adjuster intent="primary" >Min/Max Reached</semantic-adjuster> |
| 74 | </div> |
| 75 | <div class="state-description">Corresponding button disabled (grey)</div> |
| 76 | </div> |
| 77 | </div> |
| 78 | </section> |
| 79 | |
| 80 | <!-- Properties --> |
| 81 | <section class="section"> |
| 82 | <h2 class="section-title">Properties & Attributes</h2> |
| 83 | <table class="property-table"> |
| 84 | <thead> |
| 85 | <tr> |
| 86 | <th>Attribute</th> |
| 87 | <th>Type</th> |
| 88 | <th>Values</th> |
| 89 | <th>Default</th> |
| 90 | <th>Description</th> |
| 91 | </tr> |
| 92 | </thead> |
| 93 | <tbody> |
| 94 | |
| 95 | <tr style="border-bottom: 1px solid #333;"> |
| 96 | <td style="padding: 12px;"><span class="prop-name">value</span></td> |
| 97 | <td style="padding: 12px;"><span class="prop-type">number</span></td> |
| 98 | <td style="padding: 12px;"><span class="prop-values">number</span></td> |
| 99 | <td style="padding: 12px;">50</td> |
| 100 | <td style="padding: 12px;">Current numeric value</td> |
| 101 | </tr> |
| 102 | <tr style="border-bottom: 1px solid #333;"> |
| 103 | <td style="padding: 12px;"><span class="prop-name">min</span></td> |
| 104 | <td style="padding: 12px;"><span class="prop-type">number</span></td> |
| 105 | <td style="padding: 12px;"><span class="prop-values">number</span></td> |
| 106 | <td style="padding: 12px;">0</td> |
| 107 | <td style="padding: 12px;">Minimum allowed value</td> |
| 108 | </tr> |
| 109 | <tr style="border-bottom: 1px solid #333;"> |
| 110 | <td style="padding: 12px;"><span class="prop-name">max</span></td> |
| 111 | <td style="padding: 12px;"><span class="prop-type">number</span></td> |
| 112 | <td style="padding: 12px;"><span class="prop-values">number</span></td> |
| 113 | <td style="padding: 12px;">100</td> |
| 114 | <td style="padding: 12px;">Maximum allowed value</td> |
| 115 | </tr> |
| 116 | <tr style="border-bottom: 1px solid #333;"> |
| 117 | <td style="padding: 12px;"><span class="prop-name">step</span></td> |
| 118 | <td style="padding: 12px;"><span class="prop-type">number</span></td> |
| 119 | <td style="padding: 12px;"><span class="prop-values">number</span></td> |
| 120 | <td style="padding: 12px;">1</td> |
| 121 | <td style="padding: 12px;">Increment/decrement amount</td> |
| 122 | </tr> |
| 123 | <tr style="border-bottom: 1px solid #333;"> |
| 124 | <td style="padding: 12px;"><span class="prop-name">label</span></td> |
| 125 | <td style="padding: 12px;"><span class="prop-type">string</span></td> |
| 126 | <td style="padding: 12px;"><span class="prop-values">text</span></td> |
| 127 | <td style="padding: 12px;">Value</td> |
| 128 | <td style="padding: 12px;">Label for the adjuster</td> |
| 129 | </tr> |
| 130 | |
| 131 | </tbody> |
| 132 | </table> |
| 133 | </section> |
| 134 | |
| 135 | <!-- Events --> |
| 136 | <section class="section"> |
| 137 | <h2 class="section-title">Events</h2> |
| 138 | <table class="property-table"> |
| 139 | <thead> |
| 140 | <tr> |
| 141 | <th>Event</th> |
| 142 | <th>Trigger</th> |
| 143 | <th>Detail</th> |
| 144 | <th>Description</th> |
| 145 | </tr> |
| 146 | </thead> |
| 147 | <tbody> |
| 148 | |
| 149 | <tr style="border-bottom: 1px solid #333;"> |
| 150 | <td style="padding: 12px;"><span class="prop-name">adjust</span></td> |
| 151 | <td style="padding: 12px;">Value changed (button, voice, gesture)</td> |
| 152 | <td style="padding: 12px;"><code>{ value }</code></td> |
| 153 | <td style="padding: 12px;">Value adjustment event</td> |
| 154 | </tr> |
| 155 | </tbody> |
| 156 | </table> |
| 157 | </section> |
| 158 | </div> |
| 159 | </body> |
| 160 | </html> |