单词附带发音、含义和示例句。问题模式添加可选提示和答案,教师显示或到达指定揭示时间时出现。
直播卡片
类别:学校。标签:学校和校园,大堂和接待处。
布局
此全屏卡在横屏或竖屏时填满整个屏幕,不作为角落、芯片或条带放置。
布局:全屏。表单:横向,纵向。
数据与隐私
此卡使用其配置的属性和实时卡数据。
属性
有关主题、背景、强调色和位置,请参见通用属性。
创建卡片时,在卡片的params中设置静态属性。其数据文档仅包含动态属性。嵌套行描述其父属性的内容。
静态属性
| 名称 | 类型 | 默认 | 数值和限制 | 描述 |
|---|---|---|---|---|
showDate | boolean | true | ||
hour12 | boolean | false | ||
timeZone | 字符串,空值 | null | ||
backgroundColor | 字符串,空值 | null | 模式:"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$" | 用纯色 CSS 顺序覆盖卡片背景和底板。#RRGGBBAA 提供透明度。背景无则优先。 |
textColor | 字符串,空值 | null | 模式:"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$" | 覆盖主文本和次要文本颜色。强调色和语义状态色保持原有功能。 |
动态属性
| 名称 | 类型 | 默认 | 数值和限制 | 描述 |
|---|---|---|---|---|
mode | string | "word" | "word", "problem" | word 显示每日单词;problem 显示每日问题。 |
title | string | "" | maxLength:40 | 标题。空白时显示:每日词汇,或每日难题。 |
word | string | "" | maxLength:30 | |
pronunciation | string | "" | maxLength:30 | 发音方式,例如 AD-ven-cher。 |
partOfSpeech | string | "" | maxLength:20 | 名词、动词、形容词等。 |
definition | string | "" | maxLength:160 | 用孩子能理解的词语说明含义。 |
sentence | string | "" | maxLength:160 | 句子中使用的词。 |
icon | string | "none" | "none", "star", "sparkles", "lightbulb", "leaf-01", "sun-03", "moon-02", "droplet", "favourite", "music-note-01", "apple", "restaurant-01", "walking", "volleyball", "basketball-01", "rocket-01", "trophy", "party", "gift", "home-01", "bus-01", "bell-ring", "megaphone-01", "message-01", "news-01", "target-02", "hourglass", "fire", "snowflake", "humidity", "wrench-01", "globe-02", "camera-01", "medal-first-place", "user-group" | 单词的图片。 |
problem | string | "" | maxLength:200 | 当天的问题,例如12 + 7 = ? |
hint | string | "" | maxLength:80 | |
answer | string | "" | maxLength:60 | |
showAnswer | boolean | false | 为真时显示答案。 | |
revealAt | string | "" | maxLength:40 | 答案出现的 ISO 8601 时间点(无偏移时间为屏幕所在时区的本地时间)。在此之前卡片显示时间。 |
画布示例
将静态属性保存为 params.json 并创建卡片。结果中包含它的 crd_ ID。
{
"theme": "neomustard"
}
screenrig card create --type word-of-the-day --major 1 --file params.json
将此项目添加到播放列表页面的primitives中,并用该 ID 替换示例中的 ID。发布播放列表并分配屏幕。
{
"id": "word-of-the-day",
"primitive": "card",
"card": "crd_01EXAMPLECARD000000000",
"layout": "full",
"content_fit": "fill"
}
写入实时数据
创建卡片后向其写入文档,之后替换该文档即可更新屏幕,无需重新发布。卡片会按其动态属性检查每次写入,并拒绝它不接受的文档。请使用与播放列表相同的项目。
将文档保存为card-data.json。CLI直接读取文档,无需包装:
{
"mode": "word",
"title": "",
"word": "",
"pronunciation": "",
"partOfSpeech": "",
"definition": "",
"sentence": "",
"icon": "none",
"problem": "",
"hint": "",
"answer": "",
"showAnswer": false,
"revealAt": ""
}
screenrig card data put crd_01EXAMPLECARD000000000 --file card-data.json
或直接调用 API。API 将相同文档包装在 document 字段中。智能体令牌已指定其项目,因此不发送项目头;若发送 ScreenRig-Project,必须与令牌项目匹配。通过环境提供 API 授权;详见 API 认证。
curl --request PUT "https://api.screenrig.ai/api/cards/crd_01EXAMPLECARD000000000/data" \
--header "Authorization: Bearer $SCREENRIG_TOKEN" \
--header "Content-Type: application/json" \
--data '{"document":{"mode":"word","title":"","word":"","pronunciation":"","partOfSpeech":"","definition":"","sentence":"","icon":"none","problem":"","hint":"","answer":"","showAnswer":false,"revealAt":""}}'