标题卡

屏幕顶部边缘的一条横杆:左槽和右槽,以及一条静止、滚动或翻页的信息。

一条宽度铺满屏幕、紧贴顶边的横杆,汇总屏幕所需的小项。左右槽各显示一项:文字、标签、时钟、当前天气、图标、日期、状态点、你的标志、倒计时、数字、当前页码或一个静默警报,警报会变暖或变红。中间显示一条静止、长时滚动或最多翻八页的信息。你设置这些项和信息,并可在横杆播放时更改;它在每个屏幕上保持位置。

直播卡片

此卡由浏览器绘制,使用与播放器相同的代码,带示例数据。

类别:消息。标签:大厅与接待,办公室与工作场所,商店。

布局

此条形卡作为页眉放置:全宽条,80 高,紧贴顶边。它不占用布局或锚点。

布局:页眉。表单:条带。

卡片布局、主题和发布。浏览卡片。

数据与隐私

信息源:screenrig.weather/v1。

信息源文档带有来源归属。播放器向卡片提供信息源。

天气归属:天气数据由 Weatherbit 提供,源文档中有说明。

属性

有关主题、背景和强调色,请参见通用属性。条形卡没有layout或anchor属性:它总是作为页眉放置。

创建卡片时,在卡片的params中设置静态属性。其数据文档仅包含动态属性。嵌套行描述其父属性的内容。

静态属性

名称类型默认数值和限制描述
location对象,空值nulladditionalProperties:false天气项目读取条件的位置;无指定无天气数据,项目保持空白。
location.namestringmaxLength:40;必填
location.latitudenumber最小值:-90;最大值:90;必填
location.longitudenumber最小值:-180;最大值:180;必填
timeZone字符串,空值nullmaxLength:64时钟、日期和倒计时项目的 IANA 时区;空值使用屏幕时区。
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})?$"覆盖主文本和次要文本颜色。强调色和语义状态色保持原有功能。

动态属性

名称类型默认数值和限制描述
left对象,空值nulladditionalProperties:false左槽,宽 250 px(其中内容区 240 x 70),内容靠起始端,距屏幕边缘 24 px。null 表示留空,但仍保留其占位空间。kind 读取的内容:文本和标签 text;时钟 hourCycle 和 timeZone;天气 unit(来自天气数据源);图标 icon;日期 dateStyle 和 timeZone;状态 text、tone 和 pulse;标志 media;倒计时 at 和 label;数字 label 和 value;页面 page、of 和 style;警报 active、severity 和 text。时钟的 hourCycle、天气项的 unit 以及日期的顺序遵循 Player 的区域设置,除非该项另行设置。
left.kindstring"text"、"tag"、"clock"、"weather"、"icon"、"date"、"status"、"logo"、"countdown"、"number"、"page"、"alert";必填时段显示内容。
left.textstring""maxLength:60文本、标签、状态或警报项的文字。
left.sizestring"small""small", "medium", "large"文本、标签、状态和警报项的字号(1080p 下为 24、32 和 44 px;小号文本占两行,其余占一行)、日期的字号(32、44 和 56 px,单行),以及时钟、天气、倒计时、页面和图标项中数字的字号。
left.color字符串,空值null模式:"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$"#RRGGBB 或 #RRGGBBAA 文字或图标颜色;null 表示使用主题的文字颜色。
left.fill字符串,空值null模式:"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$"标签的圆角矩形颜色:#RRGGBB或#RRGGBBAA;null表示文本颜色半透明(Clear主题为轮廓色)。
left.icon空值,字符串nullnull, "activity-01", "air-vent", "airplane-01", "alert-01", "alert-02", "american-football", "analytics-up", "apple", "arrow-down-01", "arrow-down-right-01", "arrow-up-01", "arrow-up-right-01", "award-01", "baseball", "basketball-01", "battery-full", "bell-ring", "bicycle", "birthday-cake", "bitcoin", "bus-01", "calendar-03", "calendar-04", "calendar-add-01", "calendar-check", "call-02", "camera-01", "cancel-circle", "car-01", "champion", "chart-decrease", "chart-increase", "checkmark-circle-02", "clock-01", "clock-02", "cloud", "cloud-angled-rain", "cloud-angled-zap", "cloud-big-rain", "cloud-drizzle", "cloud-fog", "cloud-hailstone", "cloud-snow", "coffee-01", "coffee-02", "contact-01", "container-truck-01", "cricket-bat", "crown", "delivery-truck-01", "dices", "discord", "discount-tag-01", "dollar-02", "door-closed-locked", "door-open", "drink", "droplet", "ethereum", "euro", "exchange-01", "facebook-01", "factory", "fast-wind", "favourite", "ferry-boat", "fire", "fire-02", "first-aid-kit", "flag-01", "flag-02", "flash", "flower-01", "football", "gauge", "gift", "git-branch", "globe-02", "google", "hand-prayer", "heart", "help-circle", "home-01", "hourglass", "humidity", "ice-hockey", "information-circle", "instagram", "lamp-01", "lantern", "leaf-01", "leaf-02", "lightbulb", "link-01", "linkedin-01", "litecoin", "location-01", "location-04", "mail-01", "medal-first-place", "medical-mask", "meeting-room", "megaphone-01", "message-01", "money-exchange-02", "moon-02", "moon-cloud", "moon-star", "music-note-01", "navigation-03", "new-releases", "new-twitter", "news", "news-01", "noodles", "package-delivered", "parking-area-square", "party", "party-popper", "pause-circle", "percent-circle", "pinterest", "pizza-01", "play-circle", "play-store", "podium", "pound", "pumpkin", "qr-code", "qr-code-01", "queue-01", "quote-down", "quote-up", "ranking", "restaurant-01", "rocket-01", "rss", "running-shoes", "sale-tag-01", "security-check", "shop-sign", "shopping-bag-01", "siren", "smart-phone-01", "snapchat", "snowflake", "sparkles", "spotify", "star", "star-half", "star-off", "stop-circle", "store-01", "sun-03", "sun-cloud-02", "sunrise", "sunset", "swimming", "tag-01", "target-02", "temperature", "tennis-ball", "thermometer", "thermometer-cold", "thermometer-warm", "threads", "ticket-01", "tiktok", "time-quarter-pass", "timer-01", "tornado-02", "train-01", "tram", "trophy", "tropical-storm", "tsunami", "user-02", "user-group", "user-love-01", "vegetarian-food", "volleyball", "volume-high", "vote", "walking", "warehouse", "waves", "whatsapp", "wheat-off", "wifi-01", "wifi-full-signal", "wifi-lock", "wrench-01", "yen", "youtube"图标项的图标。
left.tonestring"cool"模式:"^(success|warm|danger|cool|accent|muted|#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?)$"状态点的颜色:调色板键(成功为 ok 或 open,警告为 warm watch 或 soon,危险为 alarm 或 closed,信息为 cool information)或 #RRGGBB。
left.pulsebooleanfalse每秒闪烁一次的状态点。
left.hourCyclestring"auto""auto", "12", "24"时钟小时:自动跟随播放器的区域设置(通常显示12小时制的2:05 PM,否则显示14:05);12表示所有区域的2:05 PM,24表示所有区域的14:05。
left.timeZone字符串,空值nullmaxLength:64时钟、日期或倒计时的 IANA 时区;空值使用条带时区,否则使用屏幕时区。
left.dateStylestring"short""short", "long"一个日期项:短格式为Wed 21 Oct,长格式为Wednesday 21 October;在美国区域设置中月份排在前(Wed Oct 21,Wednesday, October 21)。星期几和月份名称为英文;长日期若不适合则降级为短格式。
left.at字符串,空值nullmaxLength:40倒计时运行到的 ISO 8601 瞬时;无偏移时为该项目时区的墙钟时间。
left.labelstring""maxLength:24数字项的标签显示在数值上方;倒计时项在计时期间把标签显示在数字上方(放不下完整标签时省略),时刻到达后则显示相应的文字。
left.valuestring""maxLength:16数字的值,按您希望的格式显示(1,284 或 98%)。
left.mediastring""maxLength:200标志项图像:一个项目媒体引用(media:<id>),完整适配 240 x 70。
left.pageinteger1最小值:1;最大值:999页面项的当前页,从 1 开始。
left.ofinteger1最小值:1;最大值:999页面项的页数。
left.stylestring"numbers""dots", "numbers"页面项以 3 / 8 或点显示(点最多显示十二页)。
left.activebooleanfalse警报项:假为静默勾选,真则显示严重性颜色及文字。
left.severitystring"warm""warm", "danger"活动警报项的颜色:观察为暖色,警报为危险色。
left.unitstring"auto""auto", "c", "f"天气项目的温度单位:自动时,播放器地区使用华氏度(美国、波多黎各、关岛、维尔京群岛、美属萨摩亚、北马里亚纳群岛、巴哈马、伯利兹、开曼群岛、帕劳、利比里亚)显示华氏度,其他地区显示摄氏度;c和f强制所有地区使用摄氏度或华氏度。
right对象,空值nulladditionalProperties:false右槽,宽 250 px(其中内容区 240 x 70),内容靠末端,距屏幕边缘 24 px。项目与左槽相同,区域设置规则也相同。
right.kindstring"text"、"tag"、"clock"、"weather"、"icon"、"date"、"status"、"logo"、"countdown"、"number"、"page"、"alert";必填时段显示内容。
right.textstring""maxLength:60文本、标签、状态或警报项的文字。
right.sizestring"small""small", "medium", "large"文本、标签、状态和警报项的字号(1080p 下为 24、32 和 44 px;小号文本占两行,其余占一行)、日期的字号(32、44 和 56 px,单行),以及时钟、天气、倒计时、页面和图标项中数字的字号。
right.color字符串,空值null模式:"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$"#RRGGBB 或 #RRGGBBAA 文字或图标颜色;null 表示使用主题的文字颜色。
right.fill字符串,空值null模式:"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$"标签的圆角矩形颜色:#RRGGBB或#RRGGBBAA;null表示文本颜色半透明(Clear主题为轮廓色)。
right.icon空值,字符串nullnull, "activity-01", "air-vent", "airplane-01", "alert-01", "alert-02", "american-football", "analytics-up", "apple", "arrow-down-01", "arrow-down-right-01", "arrow-up-01", "arrow-up-right-01", "award-01", "baseball", "basketball-01", "battery-full", "bell-ring", "bicycle", "birthday-cake", "bitcoin", "bus-01", "calendar-03", "calendar-04", "calendar-add-01", "calendar-check", "call-02", "camera-01", "cancel-circle", "car-01", "champion", "chart-decrease", "chart-increase", "checkmark-circle-02", "clock-01", "clock-02", "cloud", "cloud-angled-rain", "cloud-angled-zap", "cloud-big-rain", "cloud-drizzle", "cloud-fog", "cloud-hailstone", "cloud-snow", "coffee-01", "coffee-02", "contact-01", "container-truck-01", "cricket-bat", "crown", "delivery-truck-01", "dices", "discord", "discount-tag-01", "dollar-02", "door-closed-locked", "door-open", "drink", "droplet", "ethereum", "euro", "exchange-01", "facebook-01", "factory", "fast-wind", "favourite", "ferry-boat", "fire", "fire-02", "first-aid-kit", "flag-01", "flag-02", "flash", "flower-01", "football", "gauge", "gift", "git-branch", "globe-02", "google", "hand-prayer", "heart", "help-circle", "home-01", "hourglass", "humidity", "ice-hockey", "information-circle", "instagram", "lamp-01", "lantern", "leaf-01", "leaf-02", "lightbulb", "link-01", "linkedin-01", "litecoin", "location-01", "location-04", "mail-01", "medal-first-place", "medical-mask", "meeting-room", "megaphone-01", "message-01", "money-exchange-02", "moon-02", "moon-cloud", "moon-star", "music-note-01", "navigation-03", "new-releases", "new-twitter", "news", "news-01", "noodles", "package-delivered", "parking-area-square", "party", "party-popper", "pause-circle", "percent-circle", "pinterest", "pizza-01", "play-circle", "play-store", "podium", "pound", "pumpkin", "qr-code", "qr-code-01", "queue-01", "quote-down", "quote-up", "ranking", "restaurant-01", "rocket-01", "rss", "running-shoes", "sale-tag-01", "security-check", "shop-sign", "shopping-bag-01", "siren", "smart-phone-01", "snapchat", "snowflake", "sparkles", "spotify", "star", "star-half", "star-off", "stop-circle", "store-01", "sun-03", "sun-cloud-02", "sunrise", "sunset", "swimming", "tag-01", "target-02", "temperature", "tennis-ball", "thermometer", "thermometer-cold", "thermometer-warm", "threads", "ticket-01", "tiktok", "time-quarter-pass", "timer-01", "tornado-02", "train-01", "tram", "trophy", "tropical-storm", "tsunami", "user-02", "user-group", "user-love-01", "vegetarian-food", "volleyball", "volume-high", "vote", "walking", "warehouse", "waves", "whatsapp", "wheat-off", "wifi-01", "wifi-full-signal", "wifi-lock", "wrench-01", "yen", "youtube"图标项的图标。
right.tonestring"cool"模式:"^(success|warm|danger|cool|accent|muted|#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?)$"状态点的颜色:调色板键(成功为 ok 或 open,警告为 warm watch 或 soon,危险为 alarm 或 closed,信息为 cool information)或 #RRGGBB。
right.pulsebooleanfalse每秒闪烁一次的状态点。
right.hourCyclestring"auto""auto", "12", "24"时钟小时:自动跟随播放器的区域设置(通常显示12小时制的2:05 PM,否则显示14:05);12表示所有区域的2:05 PM,24表示所有区域的14:05。
right.timeZone字符串,空值nullmaxLength:64时钟、日期或倒计时的 IANA 时区;空值使用条带时区,否则使用屏幕时区。
right.dateStylestring"short""short", "long"一个日期项:短格式为Wed 21 Oct,长格式为Wednesday 21 October;在美国区域设置中月份排在前(Wed Oct 21,Wednesday, October 21)。星期几和月份名称为英文;长日期若不适合则降级为短格式。
right.at字符串,空值nullmaxLength:40倒计时运行到的 ISO 8601 瞬时;无偏移时为该项目时区的墙钟时间。
right.labelstring""maxLength:24数字项的标签显示在数值上方;倒计时项在计时期间把标签显示在数字上方(放不下完整标签时省略),时刻到达后则显示相应的文字。
right.valuestring""maxLength:16数字的值,按您希望的格式显示(1,284 或 98%)。
right.mediastring""maxLength:200标志项图像:一个项目媒体引用(media:<id>),完整适配 240 x 70。
right.pageinteger1最小值:1;最大值:999页面项的当前页,从 1 开始。
right.ofinteger1最小值:1;最大值:999页面项的页数。
right.stylestring"numbers""dots", "numbers"页面项以 3 / 8 或点显示(点最多显示十二页)。
right.activebooleanfalse警报项:假为静默勾选,真则显示严重性颜色及文字。
right.severitystring"warm""warm", "danger"活动警报项的颜色:观察为暖色,警报为危险色。
right.unitstring"auto""auto", "c", "f"天气项目的温度单位:自动时,播放器地区使用华氏度(美国、波多黎各、关岛、维尔京群岛、美属萨摩亚、北马里亚纳群岛、巴哈马、伯利兹、开曼群岛、帕劳、利比里亚)显示华氏度,其他地区显示摄氏度;c和f强制所有地区使用摄氏度或华氏度。
middle对象,空值nulladditionalProperties:false时隙间的消息。无文本(或页面)时中间保持空白并保留空间;宽度小于 100 像素时隐藏。
middle.textstring""maxLength:160静态或滚动消息的文字。
middle.sizestring"small""small", "medium", "large"1080p 下,最多两行时为 28 px,单行时为 38 px 或 52 px。
middle.alignstring"center""start", "center", "end"文字在中间的位置。
middle.color字符串,空值null模式:"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$"#RRGGBB 或 #RRGGBBAA 文字颜色;null 表示使用主题的文字颜色。
middle.modestring"static""static", "crawl", "pages"static 把放不下的消息按完整句子依次显示;crawl 在动画运行时让消息从中部滚过(放得下时静止不动;静止画面或减少动画时按完整句子显示);pages 依次显示 pages 中的各个字符串。
middle.pagesarray[]maxItems:8页面模式下的消息,按顺序排列。
middle.pageSecondsinteger8最小值:3;最大值:60每页保持的秒数;显示的页面跟随时钟,因此每个屏幕显示相同页面。

画布示例

将静态属性保存为 params.json 并创建卡片。结果中包含它的 crd_ ID。

{
  "theme": "neomustard",
  "location": {
    "name": "Vancouver",
    "latitude": 49.25,
    "longitude": -123.0
  }
}
screenrig card create --type header --major 1 --file params.json

将此项目添加到播放列表页面的primitives中,并用该 ID 替换示例中的 ID。发布播放列表并分配屏幕。

{
  "id": "header",
  "primitive": "card",
  "card": "crd_01EXAMPLECARD000000000",
  "layout": "header",
  "content_fit": "fill"
}

写入实时数据

创建卡片后向其写入文档,之后替换该文档即可更新屏幕,无需重新发布。卡片会按其动态属性检查每次写入,并拒绝它不接受的文档。请使用与播放列表相同的项目。

将文档保存为card-data.json。CLI直接读取文档,无需包装:

{
  "left": null,
  "right": null,
  "middle": null
}
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":{"left":null,"right":null,"middle":null}}'