| 屬性 | 類型 | 必要 | 範例 | 值範圍 | 描述 |
|---|---|---|---|---|---|
| type | string | false | video | video | animation | 專案的類型(例如,“視頻”或“動畫”)。 |
| width | number | true | 1920 | 720 - 3840 | 專案畫布的寬度。用作縮放的基準解析度。 |
| height | number | true | 1080 | 720 - 3840 | 專案畫布的高度。用作縮放的基準解析度。 |
| fill | string | object | true | #000000 | - | 專案畫布的背景。可以是十六進制顏色字符串(例如,“#000000”)或一個類型為“linear”或“radial”的漸層物件,顏色停靠數組,以及起始/結束坐標。 |
| duration | number | true | 10 | > 0 | 專案的總持續時間,以秒為單位。 |
| view | array | true | - | - | 一個包含代表專案中視覺內容的元素數組,包括 2D 元素(圖像、視頻、文本、形狀等)和 3D 元素。該數組不能為空。 |
| audio | array | false | - | - | 一個用於專案中的音頻軌道數組。 |
| effect | array | false | - | - | 一個應用於畫布的視覺效果數組。 |
| transition | array | false | - | - | 一個應用於不同視圖之間的過渡數組。 |
| remoteFonts | array | false | - | - | 一個可以在文本和字幕元素中使用的遠端字型定義數組。 |
remoteFonts 欄位允許您在專案中包含自定義的網頁字型。每個字型定義必須包含指向字型檔案的直接鏈接(僅限 HTTPS)和字型元數據。
| 屬性 | 類型 | 必要 | 範例 | 值範圍 | 描述 |
|---|---|---|---|---|---|
| family | string | true | My Custom Font | - | 將用於在文本元素中引用此字型的字型系列名稱。 |
| url | string | true | https://example.com/fonts/mycustomfont.woff2 | - | 指向字型檔案的直接 HTTPS URL。必須是公開可訪問的鏈接。 |
| weight | string | false | 400 | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | 字型的字重。常見值為 100-900。 |
| style | string | false | normal | normal, italic | 字型樣式。 |
| formatHint | string | false | woff2 | woff2, woff, opentype, truetype | 字型檔案的格式。這有助於瀏覽器優化字型加載。 |
| unicodeRange | string | false | U+0000-00FF | - | 可選的 Unicode 範圍,以限制此字型適用的字符。 |
重要:
- 字型 URL 必須使用 HTTPS 協議以確保安全
- 字型檔案必須是公開可訪問的
- 支援的格式:WOFF2(推薦)、WOFF、OpenType、TrueType
- 您可以定義同一字型系列的多個變體,具有不同的字重和樣式
fill 欄位可以接受具有以下結構的漸層物件:
| 屬性 | 類型 | 必要 | 範例 | 值範圍 | 描述 |
|---|---|---|---|---|---|
| type | string | true | - | linear, radial | 漸層的類型。 |
| colorStops | array | true | - | - | 一個顏色停靠物件數組,定義顏色及其在漸層中的位置。 |
| start | object | true | - | - | 漸層的起始坐標,作為具有 x 和 y 屬性的物件。 |
| end | object | true | - | - | 漸層的結束坐標,作為具有 x 和 y 屬性的物件。 |
| 屬性 | 類型 | 必要 | 範例 | 值範圍 | 描述 |
|---|---|---|---|---|---|
| color | string | true | - | - | 此停靠處的顏色值,以十六進制格式表示。 |
| offset | number | true | - | 0 - 1 | 此顏色停靠在漸層中的位置(0.0 到 1.0)。 |
{
"type": "",
"width": 1920,
"height": 1080,
"fill": "#000000",
"view": [
{
"id": "8ecf7475-2c6c-47f9-827b-a09c7913f4c0",
"type": "Image",
"start": 0,
"duration": 5,
"trackIndex": 0,
"x": -570.0335392757963,
"y": -170.90659033307685,
"blendMode": "normal",
"anchorX": 1302,
"anchorY": 2312,
"rotation": 0,
"scaleX": 0.23356401384083045,
"scaleY": 0.23356401384083045,
"alpha": 1,
"skewX": 0,
"skewY": 0,
"keyframes": [],
"externalUrl": "https://images.pexels.com/photos/30465303/pexels-photo-30465303.jpeg",
"ext": "jpeg"
}
],
"audio": [],
"effect": [],
"transition": [],
"remoteFonts": [
{
"family": "My Custom Font",
"url": "https://example.com/fonts/mycustomfont.woff2",
"weight": "400",
"style": "normal",
"formatHint": "woff2"
},
{
"family": "My Custom Font",
"url": "https://example.com/fonts/mycustomfont-bold.woff2",
"weight": "700",
"style": "normal",
"formatHint": "woff2"
}
],
"version": 0,
"duration": 5
}