forked from cyanzhong/jsbox-docs
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Lock Screen Widgets (Beta) | ||
|
||
In iOS 16 Beta, lock screen can also have widgets, and JSBox supports building them as well (currently in TestFlight). | ||
|
||
## Building Lock Screen Widgets | ||
|
||
Lock screen widgets are essentially just widgets that you're familiar with on your home screen, with two major differences. | ||
|
||
### Vibrant Colors | ||
|
||
In lock screen, widgets are rendered with vibrant colors instead of full colors. | ||
|
||
You're encouraged to use full-alpha colors, such as white or black to build lock screen widgets. Translucent color will be mixed with the wallpaper and the result will not be readable. | ||
|
||
### Smaller Sizes | ||
|
||
There are three new sizes compared to widgets on home screen: | ||
|
||
```js | ||
const $widgetFamily = { | ||
// small, medium, large, xLarge | ||
accessoryCircular: 4, | ||
accessoryRectangular: 5, | ||
accessoryInline: 6, | ||
} | ||
``` | ||
|
||
- `accessoryCircular`: 1 * 1 circular | ||
- `accessoryRectangular`: 1 * 2 rectangular | ||
- `accessoryInline`: one line info right after the date | ||
|
||
To detect the current running environment, check [here](en/home-widget/timeline.md?id=render). | ||
|
||
## In-app Preview | ||
|
||
The in-app preview built for widgets currently doesn't support lock screen widgets previewing, please stay tuned for upcoming updates. | ||
|
||
## Example Scripts | ||
|
||
Please check out this [GitHub repo](https://github.com/cyanzhong/jsbox-widgets) for reference. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# 锁屏小组件 (Beta) | ||
|
||
在 iOS 16 Beta 中,锁屏界面也可以有小组件,JSBox 也支持构建它们(目前在 TestFlight 版本)。 | ||
|
||
## 构建锁屏小组件 | ||
|
||
锁屏小组件本质上就是您熟悉的桌面小组件,有两个主要区别。 | ||
|
||
### 明亮的颜色 | ||
|
||
在锁屏状态下,小组件是用明亮的颜色而不是全色来呈现的。 | ||
|
||
您应该使用没有透明度的颜色,如纯白或纯黑来构建锁屏小组件。半透明的颜色将与墙纸混合,结果将无法阅读。 | ||
|
||
### 更小的尺寸 | ||
|
||
与桌面小组件相比,锁屏小组件有三种新的尺寸: | ||
|
||
```js | ||
const $widgetFamily = { | ||
// small, medium, large, xLarge | ||
accessoryCircular: 4, | ||
accessoryRectangular: 5, | ||
accessoryInline: 6, | ||
} | ||
``` | ||
|
||
- `accessoryCircular`: 1 * 1 圆形 | ||
- `accessoryRectangular`: 1 * 2 长方形 | ||
- `accessoryInline`: 在日期后面的一行信息 | ||
|
||
要检测当前的运行环境,请参考[这里](home-widget/timeline.md?id=render)。 | ||
|
||
## 应用内预览 | ||
|
||
为小组件提供的应用内预览目前不支持锁屏小组件的预览,请继续关注即将到来的更新。 | ||
|
||
## 样例代码 | ||
|
||
请参考这个 [GitHub 仓库](https://github.com/cyanzhong/jsbox-widgets) 以了解更多。 |