Misc · Codes and checks: a QR code scanner and a captcha
misc::QrCodeScanner reads QR codes with rqrr 0.11 from the frames the host hands in, one at a time off the main thread, and hands each code to the owner once. misc::Captcha shows the owner's picture over an answer field that empties and keeps focus with each answer; the owner says how it stood. BarcodeDisplay, Signature and Rating Widget point to their homes.
This commit is contained in:
1 parent
dc4911a68f
commit
692fae6244
14 files changed
+785
-10
No files matched your search
@@ -7,11 +7,13 @@ use crate::probe::probe;
|
||||
use crate::script::Step;
|
||||
use crate::ui::{section, specimen, specimens};
|
||||
|
||||
mod codes;
|
||||
|
||||
pub const PAGE: Page = Page {
|
||||
number: 42,
|
||||
slug: "misc",
|
||||
title: "Misc",
|
||||
summary: "Small tools that stand alone: clocks, a stopwatch, a calculator, a unit converter.",
|
||||
summary: "Small tools that stand alone: clocks, a stopwatch, a calculator, a unit converter, a QR code scanner, a captcha.",
|
||||
render,
|
||||
script: &[
|
||||
Step::DownAt("stopwatch-start", 30.0, 62.0),
|
||||
@@ -32,6 +34,14 @@ pub const PAGE: Page = Page {
|
||||
Step::Key("cmd-a"),
|
||||
Step::Type("1000000000000000"),
|
||||
Step::Shot("converter-long"),
|
||||
Step::DownAt("captcha", 24.0, 104.0),
|
||||
Step::UpAt("captcha", 24.0, 104.0),
|
||||
Step::Type("abcd"),
|
||||
Step::Key("enter"),
|
||||
Step::Shot("captcha-wrong"),
|
||||
Step::Type("w7xk"),
|
||||
Step::Key("enter"),
|
||||
Step::Shot("captcha-passed"),
|
||||
],
|
||||
};
|
||||
|
||||
@@ -39,12 +49,13 @@ fn zone(name: &str) -> TimeZone {
|
||||
TimeZone::get(name).unwrap_or_else(|error| panic!("the zone {name}: {error}"))
|
||||
}
|
||||
|
||||
fn render(_: &mut Window, cx: &mut App) -> AnyElement {
|
||||
fn render(window: &mut Window, cx: &mut App) -> AnyElement {
|
||||
div()
|
||||
.child(clocks(cx))
|
||||
.child(stopwatch(cx))
|
||||
.child(calculator(cx))
|
||||
.child(converter(cx))
|
||||
.child(codes::render(window, cx))
|
||||
.into_any_element()
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user