| 1 | <!DOCTYPE html> |
| 2 | <html> |
| 3 | |
| 4 | <head> |
| 5 | <meta charset="UTF-8"> |
| 6 | <meta name="template:media-width" content="1024"> |
| 7 | <meta name="template:media-height" content="1024"> |
| 8 | <style> |
| 9 | html { |
| 10 | margin: 0; |
| 11 | padding: 0; |
| 12 | } |
| 13 | |
| 14 | body { |
| 15 | margin: 0; |
| 16 | padding: 0; |
| 17 | width: 1080px; |
| 18 | height: 1920px; |
| 19 | font-family: 'PingFang SC', 'Source Han Sans', 'Microsoft YaHei', sans-serif; |
| 20 | overflow: hidden; |
| 21 | } |
| 22 | |
| 23 | .page-container { |
| 24 | width: 1080px; |
| 25 | height: 1920px; |
| 26 | position: relative; |
| 27 | overflow: hidden; |
| 28 | } |
| 29 | |
| 30 | /* 1. Background Media Layer (背景媒体层) |
| 31 | - For image assets: displays the image |
| 32 | - For video assets: hidden (video is composited in later step) |
| 33 | */ |
| 34 | .background-layer { |
| 35 | position: absolute; |
| 36 | top: 0; |
| 37 | left: 0; |
| 38 | width: 100%; |
| 39 | height: 100%; |
| 40 | z-index: 0; |
| 41 | } |
| 42 | |
| 43 | .background-layer img { |
| 44 | width: 100%; |
| 45 | height: 100%; |
| 46 | object-fit: contain; |
| 47 | display: block; |
| 48 | } |
| 49 | |
| 50 | /* Hide background layer when no image (video mode) */ |
| 51 | .background-layer:empty { |
| 52 | display: none; |
| 53 | } |
| 54 | |
| 55 | /* 2. Gradient Overlay (渐变遮罩) |
| 56 | Ensures text readability regardless of background brightness |
| 57 | Top: Darker for Title |
| 58 | Middle: Transparent for Media visibility |
| 59 | Bottom: Darker for Subtitles |
| 60 | */ |
| 61 | .gradient-overlay { |
| 62 | position: absolute; |
| 63 | top: 0; |
| 64 | left: 0; |
| 65 | width: 100%; |
| 66 | height: 100%; |
| 67 | z-index: 1; |
| 68 | background: linear-gradient(to bottom, |
| 69 | rgba(0, 0, 0, 0.6) 0%, |
| 70 | rgba(0, 0, 0, 0.1) 25%, |
| 71 | rgba(0, 0, 0, 0.1) 60%, |
| 72 | rgba(0, 0, 0, 0.8) 100%); |
| 73 | } |
| 74 | |
| 75 | /* 3. Content Layer (内容层) */ |
| 76 | .content-layer { |
| 77 | position: relative; |
| 78 | z-index: 2; |
| 79 | width: 100%; |
| 80 | height: 100%; |
| 81 | padding: 120px 80px 0px 80px; |
| 82 | /* Top, Right, Bottom, Left */ |
| 83 | box-sizing: border-box; |
| 84 | display: flex; |
| 85 | flex-direction: column; |
| 86 | justify-content: flex-start; |
| 87 | color: #ffffff; |
| 88 | } |
| 89 | |
| 90 | /* Title Styling */ |
| 91 | .video-title { |
| 92 | font-size: 80px; |
| 93 | font-weight: 700; |
| 94 | line-height: 1.2; |
| 95 | text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5); |
| 96 | margin-bottom: 40px; |
| 97 | text-align: center; |
| 98 | } |
| 99 | |
| 100 | /* Hide title when empty */ |
| 101 | .video-title:empty { |
| 102 | display: none; |
| 103 | } |
| 104 | |
| 105 | /* Flex spacer to push subtitle to bottom */ |
| 106 | .spacer { |
| 107 | flex-grow: 1; |
| 108 | } |
| 109 | |
| 110 | /* Narration/Subtitle Styling */ |
| 111 | .subtitle-wrapper { |
| 112 | margin-bottom: 60px; |
| 113 | } |
| 114 | |
| 115 | .text { |
| 116 | font-size: 52px; |
| 117 | font-weight: 500; |
| 118 | line-height: 1.6; |
| 119 | text-align: center; |
| 120 | text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6); |
| 121 | backdrop-filter: blur(4px); |
| 122 | } |
| 123 | </style> |
| 124 | </head> |
| 125 | |
| 126 | <body> |
| 127 | <div class="page-container"> |
| 128 | <!-- Background Media Layer |
| 129 | - For image assets: contains <img> tag |
| 130 | - For video assets: empty (hidden by CSS) |
| 131 | --> |
| 132 | <div class="background-layer" id="bg-layer"> |
| 133 | <!-- Image will be inserted here for image assets only --> |
| 134 | </div> |
| 135 | |
| 136 | <!-- Shadow Overlay for Text Readability --> |
| 137 | <div class="gradient-overlay"></div> |
| 138 | |
| 139 | <!-- Main Content --> |
| 140 | <div class="content-layer"> |
| 141 | <!-- Top Section: Title --> |
| 142 | <div class="video-title"> |
| 143 | {{title}} |
| 144 | </div> |
| 145 | |
| 146 | <!-- Spacer pushes content apart --> |
| 147 | <div class="spacer"></div> |
| 148 | |
| 149 | <!-- Bottom Section: Narration/Text --> |
| 150 | <div class="subtitle-wrapper"> |
| 151 | <div class="text">{{text}}</div> |
| 152 | </div> |
| 153 | </div> |
| 154 | </div> |
| 155 | |
| 156 | <script> |
| 157 | // Conditionally add image if provided |
| 158 | (function () { |
| 159 | var imageUrl = "{{image}}"; |
| 160 | var bgLayer = document.getElementById('bg-layer'); |
| 161 | |
| 162 | // Only add img tag if image URL is provided and not empty |
| 163 | if (imageUrl && imageUrl.trim() !== "" && imageUrl !== "None") { |
| 164 | var img = document.createElement('img'); |
| 165 | img.src = imageUrl; |
| 166 | img.alt = "Background"; |
| 167 | bgLayer.appendChild(img); |
| 168 | } |
| 169 | // Otherwise, bg-layer stays empty and gets hidden by CSS |
| 170 | })(); |
| 171 | </script> |
| 172 | </body> |
| 173 | |
| 174 | </html> |