Documentation

Smart Clock (Voice Control)

Voice-controlled 7-segment smart clock (zh-TW Web Speech API) on QuickUI 0.6.2: shows time, date, year, seconds and runs spoken countdowns.

Overview

Item Value
Created 2024-12-20
Category App & Platform Examples
HTML files index.html
Source target/20241220

Live Preview

Open the example in a new tab

Page Sections

Section Description
Clock (#timer.timer) Four div.number digits of 7 span segments each plus a div.colon; digits render from data-value.
Hint (section.bottom) Lists supported commands: 顯示當前日期/年份/時間/秒數、計時xx分鐘、計時xx秒.

Interactions

Dependencies

Name Version Source
Font Awesome Free 6.5.2 https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.5.2/css/all.min.css
QuickUI (@pardnchiu/quickui) 0.6.2 https://cdn.jsdelivr.net/npm/@pardnchiu/quickui@0.6.2/dist/QuickUI.js
Google Analytics (gtag.js) - https://www.googletagmanager.com/gtag/js?id=G-L5VYEZPVXX
Noto Sans / Noto Sans TC (font-family only) - declared in SCSS; no font stylesheet linked
Web Speech API (webkitSpeechRecognition) - browser built-in

Styling

Item Value
SCSS entry sass/index.scss
Output CSS css/index.css
Partials _init.scss, function/_hsbTohsl.scss

_init holds the reset; function/_hsbTohsl provides hsb()/hsba(). index.scss sizes the clock with --width: calc(100vw / 40), --height and --triHeight, and toggles segment opacity per [data-value] (0-9, '-', eye, mouth/none for the colon).

cd target/20241220
npx sass sass/index.scss css/index.css --no-source-map || exit 1

Techniques

External Assets

中文