|
|
vor 3 Wochen | |
|---|---|---|
| assets | vor 3 Wochen | |
| docs | vor 3 Wochen | |
| src | vor 3 Wochen | |
| typings | vor 3 Wochen | |
| .gitignore | vor 3 Wochen | |
| README.md | vor 3 Wochen | |
| agent.md | vor 3 Wochen | |
| index.html | vor 3 Wochen | |
| package-lock.json | vor 3 Wochen | |
| package.json | vor 3 Wochen | |
| share.html | vor 3 Wochen | |
| tsconfig.json | vor 3 Wochen | |
| vite.config.js | vor 3 Wochen |
本项目是一个基于 Vue3 + TypeScript + Vite 的项目,核心是基于webgl的web端填色,用于创建可播放的广告。
我们有一个填色应用app,已经上架到google play 和 app store。 但是投放的广告基本上是静态图片或视频, 没有playable的广告, 本项目立足制作playable的广告, 用于提升广告的互动性和效果。
playable广告的核心是H5页面, 本工程已经实现了基于webgl的web端填色核心玩法,现在需要进一步完善制作成可播放的广告。
以下是几家竞品的playbale 广告, 可以作为分析参考, 尤其是页面的规范方面。
1.
https://creative-ag-global.umcdn.cn/html/14/df/cf/14dfcf467412065a43ec4d2f1ad63971.html
主要展示了一屏十几个填色作品的填列表页,所谓互动的部分其实就是可以滑动该列表页,点击某个列表页进入一个详情页,这属于简单的内容互动展示,没有涉及游戏核心玩法
2.
https://creative-ag-global.umcdn.cn/html/df/3a/14/df3a14870fcb67b02292a0eac34c5ab1.html
可以滑动选择几个有吸引力的上色作品,点击进入填色详情页, 但同样不能进行填色操作,没有涉及游戏核心玩法,本质还是简单的内容互动展示
1.
https://creative-ag-global.umcdn.cn/html/83/d5/81/83d5810d37e36b92ee5d90517e31b0f9.html
页面动效较好, 但也属于内容展示,没有体现核心玩法, 能够互动的部分就是一个手指指向的 PLAY NOW 按钮,点击即进入安装弹框
2.
https://creative-ag-global.umcdn.cn/html/85/8a/03/858a031936edfda1009dd6acb5c3ec2f.html
这个有涉及一点核心玩法,有提示手型,可点击上色。
https://creative-ag-global.umcdn.cn/html/09/2d/44/092d441b80639f462fa667bb3f8964bf.html
这个有涉及核心玩法, 可点击上色,结束后撒花动画,展示典型内容,显示“Over 10,000+ pictures”, 可以作为重点对标研究对象
各家广告平台对于playable的广告规范如下, 需要仔细研读理解,我们最终发布的内容要符合所有平台的规范:
mintergal
https://www.playturbo.com/review/doc
applovin
https://p.applov.in/playablePreview?create=1
unity
https://docs.unity.com/zh-cn/grow/acquire/creatives/playable/specifications
google admod
https://support.google.com/google-ads/answer/9981650?hl=en#_HTML
gemini关于playable广告的讲解:
https://gemini.google.com/share/8340c20dd2d1
制作符合各广告平台的playable ads, 当前可聚焦核心填色玩法的模版, 未来可以可能开发更多模版。
| 层级 | 技术 |
|---|---|
| 渲染引擎 | WebGL 2(自研,无外部 GL 框架) |
| 构建工具 | Vite 5 + TypeScript 5 |
| 打包插件 | vite-plugin-singlefile(输出单文件 HTML) |
| 广告平台适配 | AdPlatformAdapter(Applovin / Unity / Playturbo-Mintegral / Google) |
| 单文件产物 | 默认与各平台 profile 均输出自包含 HTML |
src/
filler/ # 广告主逻辑
index.ts # 入口,整合加载/CTA/平台初始化
cta.ts # CTA 按钮点击 + 高亮动画
ad-platform/ # 平台 Adapter;构建时通过 Vite alias 选择目标平台
FillerScene.ts# WebGL 填色场景
FingerHint.ts # 指引手指 DOM overlay
Loader.ts # 资源加载
base/ # 自研 WebGL 2 渲染层
assets/
res/ # 填色资源包(config.json + 图片)
css/ # 样式
dist/
index.html # 默认产物
applovin/index.html # Applovin 产物
unity/index.html # Unity 产物
playturbo/index.html # Playturbo 产物
mintegral/index.html # Mintegral 产物
google/index.html # Google 产物
npm install
npm run dev
ssh -R 0.0.0.0:5173:localhost:5173 ecs
然后可以在浏览器打开:
http://42.193.231.145:5173
本项目保持一套业务源码,通过 Vite --mode 在构建期选择平台 Adapter,并输出平台专用单文件 HTML。默认构建使用 Google-like adapter,输出 dist/index.html。
npm run build # dist/index.html
npm run build:applovin # dist/applovin/index.html
npm run build:unity # dist/unity/index.html
npm run build:playturbo # dist/playturbo/index.html
npm run build:mintegral # dist/mintegral/index.html
npm run build:google # dist/google/index.html
npm run build:all # 依次输出以上全部产物
所有产物均为单文件自包含 HTML,JS/CSS/图片/字体均内联。构建后会移除 Vite 单文件产物中的 type="module" 和 crossorigin 属性,以满足 Playturbo 对本地 HTML 文件的扫描要求。
| 指标 | 数值 |
|---|---|
| 文件大小 | ~1.02 MB |
| Gzip 大小 | ~673 KB |
| 平台大小限制 | 5 MB(各平台均满足) |
平台选择由 vite.config.js 中的 platformBuilds 控制:playturbo 与 mintegral 都使用 Playturbo adapter,但输出到不同目录和文件名。当前不需要 .env.applovin / .env.unity 等环境文件。
注意:非 Playturbo/Mintegral 平台的 Store 链接集中在
src/filler/ad-platform/adapters/storeUrls.ts:
- 测试阶段:使用 PBN 落地页(当前默认),避免产生无效转化
- 正式上线:换回自己 app 的 Store 链接(文件内有注释说明)
Playturbo/Mintegral 产物不会内置 Store URL,CTA 只调用平台要求的
window.install()。
npm run build:all 生成全部产物src/filler/ad-platform/adapters/storeUrls.ts 中的落地页 URL 符合当前测试目的预览工具:https://p.applov.in/playablePreview?create=1
npm run build:applovin,打开预览工具,上传 dist/applovin/index.htmlExitApi.exit() 关闭广告,落地页由平台后台配置)规范文档:https://docs.unity.com/zh-cn/grow/acquire/creatives/playable/specifications
验证方式:Unity 没有 Web 端预览工具,需通过 Ad Testing App(iOS / Android,最新版 4.0.0)扫码验证。
npm run build:unity,将 dist/unity/index.html 托管到可访问的 HTTPS URLdapi.gameReady() 被正确调用(可在控制台确认)mraid.open(url) 跳转)规范文档:https://support.google.com/google-ads/answer/9981650?hl=en#_HTML
验证工具:https://h5validator.appspot.com/adwords/asset
Google 的官方验证器要求上传 .zip 而非裸 HTML。需要先将产物打包为 zip,上传时勾选 "Select for App Campaigns",然后点击眼睛图标预览。
npm run build:google,将 dist/google/index.html 打包为 google-ad.zipExitApi.exit())document.write 或被禁用 API<meta name="ad.orientation" content="portrait">)规范文档:https://www.playturbo.com/review/doc
预览工具:https://www.playturbo.com/review
npm run build:playturbo 或 npm run build:mintegral,按平台文档要求上传对应产物window.gameReady()window.gameEnd()window.install(),不主动 window.open 或跳 Store URLtype="module"、crossorigin、import、exportwindow.gameStart / window.gameClose在真实设备上直接用浏览器打开 dist/index.html(可通过云服务器地址访问):
http://42.193.231.145:5173 # dev 模式
# 或将 dist/index.html 放到静态服务器后访问
| 设备 | 浏览器 | 检查项 |
|---|---|---|
| iOS | Safari | 音频首次交互解锁、手势填色、CTA 跳转 App Store |
| Android | Chrome | 音频、手势、CTA 跳转 Google Play |
| Android | WebView | 广告平台内嵌 WebView 行为是否一致 |
Q: 填色区域点击没反应? A: 检查 WebGL context 是否初始化成功,Console 有无报错。
Q: 音效不播放(iOS)? A: iOS 要求用户交互后才能播放音频,代码已有 unlock 逻辑,确认首次点击后音效正常即可。
Q: CTA 点击没有跳转?
A: 各平台跳转机制不同:Applovin 优先用 ExitApi.exit();Unity/通用 MRAID 环境用 mraid.open(url);Google-like 环境用 window.open(url);Playturbo/Mintegral 只允许调用 window.install(),不应主动跳 Store URL。
Q: 构建产物超过平台大小限制?
A: 检查 assets/res/ 下的图片资源,压缩大尺寸图片后重新构建。