Commit 19f8d3e9 authored by Friends233's avatar Friends233

init

parents
#/////////////////////////////////////////////////////////////////////////////
# Fireball Projects
#/////////////////////////////////////////////////////////////////////////////
/library/
/temp/
/local/
#/////////////////////////////////////////////////////////////////////////////
# npm files
#/////////////////////////////////////////////////////////////////////////////
npm-debug.log
node_modules/
#/////////////////////////////////////////////////////////////////////////////
# Logs and databases
#/////////////////////////////////////////////////////////////////////////////
*.log
*.sql
*.sqlite
#/////////////////////////////////////////////////////////////////////////////
# files for debugger
#/////////////////////////////////////////////////////////////////////////////
*.sln
*.pidb
*.suo
#/////////////////////////////////////////////////////////////////////////////
# OS generated files
#/////////////////////////////////////////////////////////////////////////////
.DS_Store
ehthumbs.db
Thumbs.db
#/////////////////////////////////////////////////////////////////////////////
# WebStorm files
#/////////////////////////////////////////////////////////////////////////////
.idea/
#//////////////////////////
# VS Code files
#//////////////////////////
.vscode/
# hello-world
Hello world new project template.
{
"ver": "1.1.3",
"uuid": "c0d16779-083c-4779-ad39-de39402534fb",
"importer": "folder",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
{
"ver": "1.3.2",
"uuid": "2d2f792f-a40c-49bb-a189-ed176a246e49",
"importer": "scene",
"asyncLoadAssets": false,
"autoReleaseAssets": false,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.3",
"uuid": "4734c20c-0db8-4eb2-92ea-e692f4d70934",
"importer": "folder",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.3",
"uuid": "301e5d0e-73ce-43f5-8bb5-56e84e1f94ce",
"importer": "folder",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
import menu = cc._decorator.menu;
const {ccclass, property} = cc._decorator;
// TODO 把编辑器里的实现一下
@ccclass
@menu('自定义组件/位图字')
export default class BitText extends cc.Component {
private atlas: cc.Node;
private _w: number;
get w() {
return this._w
}
set w(value) {
this._w = value;
}
@property
private _gap: number = 0;
@property
get gap() {
return this._gap;
};
set gap(gap: number) {
this._gap = gap;
this.permutation();
};
@property
private _text: string = "";
@property
get text() {
return this._text;
};
set text(text: string) {
this._text = text;
this.node.destroyAllChildren();
this.node.removeAllChildren()
text.split("").forEach((v) => {
const code = this.atlas.getChildByName(v)
if (!code) return console.warn(`没配置 ${v} 这个字符`);
const txt = cc.instantiate(code);
txt.anchorX = 0;
this.node.addChild(txt);
});
this.permutation();
};
@property(cc.Prefab)
texture: cc.Prefab = null;
onLoad() {
this.atlas = cc.instantiate(this.texture);
}
start() {
}
permutation() {
const {gap} = this;
let w = 0;
this.node.children.forEach((v) => {
v.anchorX = 0;
v.x = w;
w += v.width + gap;
});
this.w = w;
const halfW = w / 2;
this.node.children.forEach((v) => v.x -= halfW);
}
// update(dt) {
//
// }
}
{
"ver": "1.1.0",
"uuid": "bd5dec9b-3430-4e73-98bf-f4fd9652d000",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
import ccclass = cc._decorator.ccclass;
import property = cc._decorator.property;
import menu = cc._decorator.menu;
export enum FitSpriteType {
Horizontal,
Vertical,
}
@ccclass
@menu('渲染组件/FitSprite')
export default class FitSprite extends cc.Component {
@property({
type: cc.Enum(FitSpriteType),
tooltip: '类型'
})
private _fitSpriteType = FitSpriteType.Vertical;
@property("最大宽度")
maxWidth: number = 0;
@property("最大高度")
maxHeight: number = 0;
set fitSpriteType(type: FitSpriteType) {
this._fitSpriteType = type;
this.updateSpriteSize();
}
@property({
type: cc.Enum(FitSpriteType),
tooltip: '类型'
})
get fitSpriteType() {
return this._fitSpriteType;
}
onLoad() {
this.node.on(cc.Node.EventType.SIZE_CHANGED, this.updateSpriteSize, this);
// this.updateSpriteSize();
}
setTexture(sf: cc.SpriteFrame) {
this.node.getComponent(cc.Sprite).spriteFrame = sf;
this.updateSpriteSize();
}
/**当尺寸变化时,重置node节点大小 */
updateSpriteSize() {
const sprite = this.node.getComponent(cc.Sprite), spriteFrame = sprite.spriteFrame, texture = spriteFrame.getTexture();
if (this.fitSpriteType === FitSpriteType.Horizontal) {
this.node.height = texture.height / texture.width * this.maxWidth;
this.node.width = this.maxWidth;
}else {
this.node.width = texture.width / texture.height * this.maxHeight;
this.node.height = this.maxHeight;
}
}
}
{
"ver": "1.1.0",
"uuid": "55f2be98-6365-4db2-9da9-bd533fdd93a5",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.3",
"uuid": "25d44dd3-9433-4607-a4f1-f5439f551c0a",
"importer": "folder",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
{
"ver": "1.1.0",
"uuid": "ac135762-e6e6-457d-a3ed-248f6f71a8d0",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
import {IVideoEntity} from "./interface";
import {SvgaTrack} from "./SvgaTrack";
import executeInEditMode = cc._decorator.executeInEditMode;
import playOnFocus = cc._decorator.playOnFocus;
import {SvgaEvent} from "./SvgaEvent";
import {createImage, loadSvga} from "./loadSvga";
import menu = cc._decorator.menu;
import disallowMultiple = cc._decorator.disallowMultiple;
const {ccclass, property} = cc._decorator;
@ccclass
@executeInEditMode
@disallowMultiple
@playOnFocus
@menu('自定义组件/Svga')
export default class Svga extends cc.Component {
/************************ on Editor ************************/
private edit_update: boolean = false;
protected onFocusInEditor() {
this.edit_update = true;
this.play(0);
}
protected onLostFocusInEditor() {
this.edit_update = false;
}
protected async resetInEditor() {
await this._load();
this.edit_update = true;
this.play(0);
}
protected onEnable() {
this.play(0);
}
/************************ on Editor ************************/
/************************ ************************/
private aniNode: cc.Node = null;
@property(cc.Asset)
private _svga: cc.Asset = null;
@property(cc.Asset)
get svga() {
return this._svga;
}
set svga(svga) {
if (svga !== this._svga) {
this._svga = svga;
this._load().then(() => {
this.play(0);
});
}
}
private tracks: SvgaTrack[] = [];
isPlaying: boolean = false;
vmData: IVideoEntity = null;
async onLoad() {
this.aniNode = this.node.getChildByName("aniNode");
if (!this.aniNode) {
this.aniNode = new cc.Node("aniNode");
// this.aniNode.setAnchorPoint(0, 1);
this.aniNode.scaleY = -1;
this.node.addChild(this.aniNode);
}
await this._load();
(this.autoPlay || CC_EDITOR) && this.play(0);
}
start() {
// const url = "https://yun.duiba.com.cn/spark/assets/yuyu.6473bb2ef640b556f35096428847216e72499d90.svga";
// const url = "//yun.duiba.com.cn/polaris/step1-1.f073ab1f1c085c6579cbb6b8a9fc61ee80145beb.svga";
// const url = "//yun.duiba.com.cn/polaris/ani-coin2.de33d071c7e5138c862812099d818f108c7e88f7.svga";
}
play(frame = 0) {
this.curFrame = frame;
this.isPlaying = true;
}
stop(isReset: boolean = false) {
if (isReset) this.curFrame = 0;
this.isPlaying = false;
}
// 初始化就播放
@property({tooltip: "是否自动播放"})
private autoPlay: boolean = true;
// 是否循环
@property
private _loop: boolean = false;
@property({tooltip: "是否循环"})
get loop() {
return this._loop;
}
set loop(loop) {
this._loop = loop;
CC_EDITOR && this.play();
}
// 总时间,秒计
get totalTime(): number {
return this._totalFrames * (1 / this.fps) || 0;
};
// 总帧数
private _totalFrames: number = 0;
get totalFrames() {
return this._totalFrames;
}
// 帧时间
private _frameTime = 0;
// fps 没设置就会用vmData里的帧率
@property
private _fps: number = 0;
@property
get fps() {
return this._fps || this.vmData?.FPS || 0;
}
set fps(fps) {
this._fps = fps;
this._frameTime = 1 / fps;
}
// 当前时间
private _curTime = 0;
get curTime() {
return this._curTime;
}
set curTime(time) {
this._curTime = time;
this._curFrame = time * this.fps;
}
// 当前帧
private _curFrame = 0;
get curFrame() {
return this._curFrame;
}
set curFrame(frame) {
this._curFrame = frame;
this._curTime = frame / this.fps;
}
update(dt) {
if (
(CC_EDITOR && !this.edit_update)
|| !this.isPlaying
) return;
this.curTime += dt;
if (this._curFrame > this.totalFrames) {
this.node.emit(SvgaEvent.END_FRAME); // 触发结束事件
if (this.loop) {
this.curTime = (this._curFrame - this.totalFrames) * this._frameTime;
} else {
this.stop(true);
}
}
this.tracks.forEach((v) => {
v.setValue(this._curFrame);
});
}
protected onDestroy() {
for (let i = 0; i < this.tracks.length; i++) {
this.tracks[i].destroy();
}
this.tracks = [];
}
async _load() {
if (!this.svga) return;
this.aniNode.removeAllChildren(true);
return new Promise<void>(async (resolve, reject) => {
const vm = await loadSvga(this.svga);
vm.textures = {};
this.vmData = vm;
const {FPS, videoSize, images, sprites, textures, frames,} = vm;
if (!this.fps) this.fps = FPS;
this._totalFrames = frames;
this.node.setContentSize(videoSize.width, videoSize.height);
// this.aniNode.setContentSize(videoSize.width, videoSize.height);
this.aniNode.setPosition(-videoSize.width / 2, videoSize.height / 2);
const ps = [];
for (let key in images) {
let src = images[key];
if (
src.indexOf("iVBO") === 0
|| src.indexOf("/9j/2w") === 0
) {
src = 'data:image/png;base64,' + src;
}
ps.push(new Promise<void>(async (r) => {
const img = await createImage(src);
const texture = new cc.Texture2D();
texture.initWithElement(img);
textures[key] = new cc.SpriteFrame(texture);
r();
// 编辑器里用不了
// cc.assetManager.loadRemote<cc.Texture2D>(
// base64, {ext: ".png"},
// (err, texture) => {
// textures[key] = new cc.SpriteFrame(texture);
// r();
// }
// );
}));
}
await Promise.all(ps);
for (let i = 0; i < sprites.length; i++) {
const {imageKey, frames} = sprites[i];
if (!imageKey) return;
const node = new cc.Node(imageKey);
node.setAnchorPoint(0, 1);
this.aniNode.addChild(node);
const sp = node.addComponent(cc.Sprite);
sp.spriteFrame = textures[imageKey];
const track = new SvgaTrack(node, frames);
track.resetValue();
this.tracks.push(track);
}
resolve();
});
}
}
{
"ver": "1.1.0",
"uuid": "7c5ff865-1c3a-41a6-80d0-f307ca37ba6e",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
export enum SvgaEvent {
END_FRAME = 'end_frame',
}
\ No newline at end of file
{
"ver": "1.1.0",
"uuid": "070401a6-b252-47b3-b275-a54c4be8aafb",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
import {IFrameEntity, IAnimationTrack} from "./interface";
export class SvgaTrack implements IAnimationTrack {
constructor(
private node: cc.Node,
private frames: IFrameEntity[],
) {
}
/**
* 这里用的帧数
* @param time 帧小数
*/
setValue(time: number) {
const {node, frames} = this;
// time = time % this.frames.length;
//处理time
time = Math.round(cc.misc.clampf(time, 0, frames.length - 1));
//找对应数据
const {alpha, transform, maskPath} = frames[time];
// layout不晓得干嘛用,暂不管
if (alpha < 0.05) {
node.opacity = 0;
} else {
node.opacity = alpha * 255;
// 修改临时矩阵
const {a, b, c, d, tx, ty} = transform;
const mat: cc.Mat4 = node["_matrix"];
const trs = node["_trs"];
const tm = mat.m;
tm[0] = a;
tm[1] = b;
// 以下四个数据要取反,因为cocos坐标系和svga坐标系不一样,y轴相反
tm[4] = -c;
tm[5] = -d;
tm[6] = -tm[6];
tm[7] = -tm[7];
trs[0] = tx;
trs[1] = ty;
// mat.scale(cc.v3(1, -1, 1), mat);
// @ts-ignore
// 增加计算世界矩阵的标记,让渲染器计算世界矩阵
node._renderFlag |= cc.RenderFlow.FLAG_WORLD_TRANSFORM;
}
}
resetValue() {
// @ts-ignore
// 重置计算本地矩阵的标记,让渲染器不计算本地矩阵,不重置的话,会在刚开始的时候计算一次
this.node._renderFlag &= ~cc.RenderFlow.FLAG_LOCAL_TRANSFORM;
this.setValue(0);
}
destroy() {
this.node = null;
// this.frames.length = 0; // 不能加!!!
}
}
\ No newline at end of file
{
"ver": "1.1.0",
"uuid": "5eefef5b-f769-4053-8198-fa7070f661b8",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
/**
* 导出只是当作类型接口用
*/
export interface IVideoEntity {
/**
* SVGA 文件版本
*/
version: string;
/**
* 影片尺寸
*/
videoSize: {
width: number;
height: number;
};
/**
* 帧率,60,30等每秒
*/
FPS: number;
/**
* 总帧数
*/
frames: number;
/**
* base64图片数据记录
*/
images: { [key: string]: string };
/**
* 缓存的纹理
*/
textures: { [key: string]: cc.SpriteFrame };
// textures: { [key: string]: cc.Node };
/**
* 图片是否已被缓存,缓存全局,注意名字覆盖
*/
hasBeenCached: boolean;
/**
* sprite对象数据
*/
sprites: ISpriteEntity[];
}
export interface ISpriteEntity {
/**
* 暂时没用
*/
matteKey: string;
/**
* 图片key值
*/
imageKey: string;
/**
* 帧数据数组
*/
frames: IFrameEntity[];
}
/**
* 还有很多其他数据,暂不需要,比如矢量路径和遮罩路径暂时都无
*/
export interface IFrameEntity {
/**
* 透明度
*/
alpha: number;
/**
* 2维矩阵数据
*/
transform: {
a: number,
b: number,
c: number,
d: number,
tx: number,
ty: number,
};
/**
* 遮罩数据
*/
maskPath?: { _d: string, _styles: any, _transform: any }
}
/**
* 就是个时间轴,setValue和resetValue方法自行实现
*/
export interface IAnimationTrack {
setValue: (time: number) => void
resetValue: () => void
}
\ No newline at end of file
{
"ver": "1.1.0",
"uuid": "dbeb7c7f-ca46-42d7-8b41-ab1396f60b69",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
import {IVideoEntity} from "./interface";
export const SvgaCache: { [key in string]: IVideoEntity } = {}
cc.assetManager.downloader.register('.svga', (path, options, onComplete) => {
// @ts-ignore
cc.assetManager.downloader.downloadFile(path, {responseType: 'arraybuffer'}, onComplete);
});
export function loadSvga(svga: cc.Asset | string) {
return new Promise<IVideoEntity>((resolve) => {
let key = "";
if (svga instanceof cc.Asset) {
key = svga["_uuid"];
svga = svga["_nativeAsset"];
} else {
key = svga;
}
if (SvgaCache[key]) {
resolve(SvgaCache[key]);
} else {
// @ts-ignore
SvgaParser.loadSvga(svga, (vm: IVideoEntity) => {
SvgaCache[key] = vm;
resolve(vm);
});
}
});
}
export const ImgCache: { [key in string]: HTMLImageElement } = {}
export function createImage(src) {
return new Promise<HTMLImageElement>((resolve) => {
if (ImgCache[src]) {
resolve(ImgCache[src]);
} else {
const img = new Image();
img.onload = () => {
ImgCache[src] = img;
resolve(img);
}
img.src = src;
}
});
}
\ No newline at end of file
{
"ver": "1.1.0",
"uuid": "d0e08115-3ffa-4584-95dd-529ce75ef0fe",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
const {ccclass, property} = cc._decorator;
@ccclass
export default class Helloworld extends cc.Component {
@property(cc.Label)
label: cc.Label = null;
@property
text: string = 'hello';
start () {
// init logic
this.label.string = this.text;
}
}
{
"ver": "1.1.0",
"uuid": "e1b90feb-a217-4493-849d-9a611900d683",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.3",
"uuid": "b5271d3d-2a3b-4405-bc87-d790b04ea909",
"importer": "folder",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
{
"ver": "1.1.0",
"uuid": "73c9b000-2b0e-43c3-a8b8-720072b190bd",
"importer": "javascript",
"isPlugin": true,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": true,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.3",
"uuid": "7b81d4e8-ec84-4716-968d-500ac1d78a54",
"importer": "folder",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.7",
"uuid": "6aa0aa6a-ebee-4155-a088-a687a6aadec4",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 256,
"height": 256,
"platformSettings": {},
"subMetas": {
"HelloWorld": {
"ver": "1.0.6",
"uuid": "31bc895a-c003-4566-a9f3-2e54ae1c17dc",
"importer": "sprite-frame",
"rawTextureUuid": "6aa0aa6a-ebee-4155-a088-a687a6aadec4",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 3.5,
"offsetY": 1,
"trimX": 44,
"trimY": 14,
"width": 175,
"height": 226,
"rawWidth": 256,
"rawHeight": 256,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.7",
"uuid": "a8027877-d8d6-4645-97a0-52d4a0123dba",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 2,
"height": 2,
"platformSettings": {},
"subMetas": {
"singleColor": {
"ver": "1.0.6",
"uuid": "410fb916-8721-4663-bab8-34397391ace7",
"importer": "sprite-frame",
"rawTextureUuid": "a8027877-d8d6-4645-97a0-52d4a0123dba",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 2,
"height": 2,
"rawWidth": 2,
"rawHeight": 2,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "1.0.3",
"uuid": "df51dcb9-23f6-4691-ba91-8e58280c178c",
"importer": "asset",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.3",
"uuid": "f473c4e7-898b-45f1-bb3e-ba4646a8bf3e",
"importer": "folder",
"isBundle": true,
"bundleName": "resources",
"priority": 8,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>拯救北极熊</title>
<!--http://www.html5rocks.com/en/mobile/mobifying/-->
<meta name="viewport"
content="width=device-width,user-scalable=no,initial-scale=1, minimum-scale=1,maximum-scale=1"/>
<!--https://developer.apple.com/library/safari/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html-->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="format-detection" content="telephone=no">
<!-- force webkit on 360 -->
<meta name="renderer" content="webkit"/>
<meta name="force-rendering" content="webkit"/>
<!-- force edge on IE -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<meta name="msapplication-tap-highlight" content="no">
<!-- force full screen on some browser -->
<meta name="full-screen" content="yes"/>
<meta name="x5-fullscreen" content="true"/>
<meta name="360-fullscreen" content="true"/>
<!-- force screen orientation on some browser -->
<meta name="screen-orientation" content="portrait"/>
<meta name="x5-orientation" content="portrait">
<!--fix fireball/issues/3568 -->
<!--<meta name="browsermode" content="application">-->
<meta name="x5-page-mode" content="app">
<!--<link rel="apple-touch-icon" href=".png" />-->
<!--<link rel="apple-touch-icon-precomposed" href=".png" />-->
<!-- <script src="//yun.duiba.com.cn/db_games/libs0924/svgaParser.minWeb.js" crossorigin="anonymous"></script>-->
<link rel="stylesheet" type="text/css" href="{{__remoteUrl__}}style-mobile.css"/>
<style>
body {
background-color: black !important;
}
/* 易盾css*/
.sui-captcha {
visibility: hidden;
position: fixed;
z-index: 10000;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: rgba(0, 0, 0, 0.7);
}
.neCaptcha-dialog {
visibility: hidden;
background-color: #fff;
box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.35);
-webkit-box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.35);
position: absolute;
left: 50%;
top: 45%;
-moz-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
-o-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
-webkit-transform: translate(-50%, -50%);
padding: 10px;
min-width: 100px;
border-radius: 10px;
width: 80%;
}
</style>
</head>
<body>
<canvas id="GameCanvas" oncontextmenu="event.preventDefault()" tabindex="0"></canvas>
<div id="splash" style="display: none;">
<div class="progress-bar stripes">
<span style="width: 0%"></span>
</div>
</div>
<script src="{{__remoteUrl__}}src/settings.js" charset="utf-8"></script>
<script src="{{__remoteUrl__}}main.js" charset="utf-8"></script>
<script type="text/javascript">
(function () {
// open web debugger console
if (typeof VConsole !== 'undefined') {
window.vConsole = new VConsole();
}
var debug = window._CCSettings.debug;
var splash = document.getElementById('splash');
splash.style.display = 'none';
function loadScript(moduleName, cb) {
function scriptLoaded() {
document.body.removeChild(domScript);
domScript.removeEventListener('load', scriptLoaded, false);
cb && cb();
}
var domScript = document.createElement('script');
domScript.async = true;
domScript.src = moduleName;
domScript.addEventListener('load', scriptLoaded, false);
document.body.appendChild(domScript);
}
var engineUrl = window.__remoteUrl__ + (debug ? 'cocos2d-js.js' : 'cocos2d-js-min.js');
loadScript(engineUrl, function () {
if (CC_PHYSICS_BUILTIN || CC_PHYSICS_CANNON) {
var physicsUrl = window.__remoteUrl__ + (debug ? 'physics.js' : 'physics-min.js');
loadScript(physicsUrl, window.boot);
} else {
window.boot();
}
});
})();
</script>
</body>
</html>
window.boot = function () {
var settings = window._CCSettings;
var onProgress = null;
var RESOURCES = cc.AssetManager.BuiltinBundleName.RESOURCES;
var INTERNAL = cc.AssetManager.BuiltinBundleName.INTERNAL;
var MAIN = cc.AssetManager.BuiltinBundleName.MAIN;
function setLoadingDisplay () {
// Loading splash scene
var splash = document.getElementById('splash');
var progressBar = splash.querySelector('.progress-bar span');
onProgress = function (finish, total) {
var percent = 100 * finish / total;
if (progressBar) {
progressBar.style.width = percent.toFixed(2) + '%';
}
};
splash.style.display = 'none';
progressBar.style.width = '0%';
cc.director.once(cc.Director.EVENT_AFTER_SCENE_LAUNCH, function () {
splash.style.display = 'none';
});
}
var onStart = function () {
cc.view.enableRetina(true);
cc.view.resizeWithBrowserSize(true);
if (cc.sys.isBrowser) {
// setLoadingDisplay();
}
if (cc.sys.isMobile) {
if (settings.orientation === 'landscape') {
cc.view.setOrientation(cc.macro.ORIENTATION_LANDSCAPE);
}
else if (settings.orientation === 'portrait') {
cc.view.setOrientation(cc.macro.ORIENTATION_PORTRAIT);
}
cc.view.enableAutoFullScreen([
cc.sys.BROWSER_TYPE_BAIDU,
cc.sys.BROWSER_TYPE_BAIDU_APP,
cc.sys.BROWSER_TYPE_WECHAT,
cc.sys.BROWSER_TYPE_MOBILE_QQ,
cc.sys.BROWSER_TYPE_MIUI,
cc.sys.BROWSER_TYPE_HUAWEI,
cc.sys.BROWSER_TYPE_UC,
].indexOf(cc.sys.browserType) < 0);
}
// Limit downloading max concurrent task to 2,
// more tasks simultaneously may cause performance draw back on some android system / browsers.
// You can adjust the number based on your own test result, you have to set it before any loading process to take effect.
if (cc.sys.isBrowser && cc.sys.os === cc.sys.OS_ANDROID) {
cc.assetManager.downloader.maxConcurrency = 2;
cc.assetManager.downloader.maxRequestsPerFrame = 2;
}
var launchScene = settings.launchScene;
var bundle = cc.assetManager.bundles.find(function (b) {
return b.getSceneInfo(launchScene);
});
bundle.loadScene(launchScene, null, onProgress,
function (err, scene) {
if (!err) {
cc.director.runSceneImmediate(scene);
if (cc.sys.isBrowser) {
// show canvas
var canvas = document.getElementById('GameCanvas');
canvas.style.visibility = '';
var div = document.getElementById('GameDiv');
if (div) {
div.style.backgroundImage = '';
}
console.log('Success to load scene: ' + launchScene);
}
}
}
);
};
var option = {
id: 'GameCanvas',
debugMode: settings.debug ? cc.debug.DebugMode.INFO : cc.debug.DebugMode.ERROR,
showFPS: settings.debug,
frameRate: 60,
groupList: settings.groupList,
collisionMatrix: settings.collisionMatrix,
};
cc.assetManager.init({
bundleVers: settings.bundleVers,
remoteBundles: settings.remoteBundles,
server: settings.server
});
var bundleRoot = [INTERNAL];
settings.hasResourcesBundle && bundleRoot.push(RESOURCES);
var count = 0;
function cb (err) {
if (err) return console.error(err.message, err.stack);
count++;
if (count === bundleRoot.length + 1) {
cc.assetManager.loadBundle(window.__remoteAssets__ + MAIN, function (err) {
if (!err) cc.game.run(option, onStart);
});
}
}
cc.assetManager.loadScript(settings.jsList.map(function (x) { return window.__remoteUrl__ + "src/" + x;}), cb);
for (var i = 0; i < bundleRoot.length; i++) {
cc.assetManager.loadBundle(window.__remoteAssets__ + bundleRoot[i], cb);
}
};
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<title>我的奖品</title>
<script src="//yun.duiba.com.cn/spark/v2/spark.base.fz.wxpollyfill.js"></script>
<script src="//yun.duiba.com.cn/js-libs/rem/1.1.3/rem.min.js"></script>
<script>"use strict";
window['stop_report_page_remain_time'] = true;
var CFG = {};</script>
<link href="//yun.duiba.com.cn/spark/v2/my-records-page/1657162270291/styles/main.7c65ce7aa33e9fd368a7.css" rel="stylesheet"></head>
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div id="root"></div>
<script src="//yun.duiba.com.cn/spark/v2/my-records-page/1657162270291/js/runtime-main.a6bfc822.js"></script><script src="//yun.duiba.com.cn/spark/v2/my-records-page/1657162270291/js/vendors.2c40989b.js"></script><script src="//yun.duiba.com.cn/spark/v2/my-records-page/1657162270291/js/main.fe29f0c7.js"></script></body>
</html>
{"paths":{"0":["effects/builtin-2d-spine",0],"1":["effects/builtin-2d-gray-sprite",0],"2":["effects/builtin-2d-sprite",0],"3":["materials/builtin-unlit",1],"4":["effects/builtin-3d-trail",0],"5":["effects/builtin-2d-graphics",0],"6":["materials/builtin-2d-gray-sprite",1],"7":["materials/builtin-3d-trail",1],"8":["effects/builtin-unlit",0],"9":["materials/builtin-2d-base",1],"10":["materials/builtin-2d-spine",1],"11":["materials/builtin-2d-graphics",1],"12":["effects/builtin-clear-stencil",0],"13":["materials/builtin-clear-stencil",1],"14":["materials/builtin-2d-label",1],"15":["materials/builtin-2d-sprite",1],"16":["effects/builtin-2d-label",0]},"types":["cc.EffectAsset","cc.Material"],"uuids":["0ek66qC1NOQLjgYmi04HvX","14TDKXr2NJ6LjvHPops74o","28dPjdQWxEQIG3VVl1Qm6T","2aKWBXJHxKHLvrBUi2yYZQ","2afAA24LNP4YmYiaVLiivs","30aC+Hnw1PF4pEcoY3kUYb","3ae7efMv1CLq2ilvUY/tQi","46bU+b5fROqIXVPG6aZWWK","6dkeWRTOBGXICfYQ7JUBnG","6fgBCSDDdPMInvyNlggls2","7a/QZLET9IDreTiBfRn2PD","a1U5RdJRFMFL57BdJC9H1X","c0BAyVxX9JzZy8EjFrc9DU","cffgu4qBxEqa150o1DmRAy","e0LYfU5ZlNFoAB4UiRrGUG","ecpdLyjvZBwrvm+cedCcQy","f1h0LXVtJOta5JLZ1xCzfI","02delMVqdBD70a/HSD99FK"],"scenes":{},"redirect":[],"deps":[],"packs":{"0967b326a":[17,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]},"name":"internal","importBase":"import","nativeBase":"native","debug":false,"isZip":false,"encrypted":false}
\ No newline at end of file
This diff is collapsed.
(function r(e,n,t){function i(u,f){if(!n[u]){if(!e[u]){var _=u.split("/");if(_=_[_.length-1],!e[_]){var p="function"==typeof __require&&__require;if(!f&&p)return p(_,!0);if(o)return o(_,!0);throw new Error("Cannot find module '"+u+"'")}u=_}var a=n[u]={exports:{}};e[u][0].call(a.exports,function(r){return i(e[u][1][r]||r)},a,a.exports,r,e,n,t)}return n[u].exports}for(var o="function"==typeof __require&&__require,u=0;u<t.length;u++)i(t[u]);return i})({},{},[]);
\ No newline at end of file
{"paths":{},"types":[],"uuids":["2dL3kvpAxJu6GJ7RdqJG5J","31vIlawANFZqnzLlSuHBfc","41D7kWhyFGY7q4NDlzkazn","6aoKpq6+5BVaCIpoemqt7E","a8Anh32NZGRZegUtSgEj26","dfUdy5I/ZGkbqRjlgoDBeM","ecpdLyjvZBwrvm+cedCcQy"],"scenes":{"db://assets/Scenes/Game.fire":0},"redirect":[6,0],"deps":["internal"],"packs":{"068ea0462":[0,1,2,3,4,5]},"name":"main","importBase":"import","nativeBase":"native","debug":false,"isZip":false,"encrypted":false}
\ No newline at end of file
[1,["ecpdLyjvZBwrvm+cedCcQy","41D7kWhyFGY7q4NDlzkazn","31vIlawANFZqnzLlSuHBfc","dfUdy5I/ZGkbqRjlgoDBeM","6aoKpq6+5BVaCIpoemqt7E","a8Anh32NZGRZegUtSgEj26"],["node","_parent","_spriteFrame","_textureSetter","label","scene","_svga"],[["cc.Node",["_name","_id","_contentSize","_components","_trs","_parent","_children","_anchorPoint","_color","_eulerAngles"],1,5,9,7,1,2,5,5,5],["cc.Sprite",["_type","_sizeMode","node","_materials","_spriteFrame"],1,1,3,6],"cc.SpriteFrame","cc.Texture2D",["cc.Widget",["_alignFlags","alignMode","_originalWidth","_originalHeight","node"],-1,1],["cc.SceneAsset",["_name","asyncLoadAssets"],1],["cc.Node",["_name","_parent","_components","_contentSize","_trs"],2,1,2,5,7],["cc.Canvas",["node","_designResolution"],3,1,5],["e1b90/rohdEk4SdmmEZANaD",["node","label"],3,1,1],["7c5ffhlHDpBpoDQ8wfKN7pu",["_loop","node","_svga"],2,1,6],["cc.Scene",["_name","_children","_anchorPoint","_trs"],2,2,5,7],["cc.Camera",["_clearFlags","_depth","node"],1,1],["cc.Label",["_string","_fontSize","_lineHeight","_N$horizontalAlign","_N$verticalAlign","node","_materials"],-2,1,3],["cc.Asset",["_name","_native"],1]],[[1,2,3,1],[0,0,5,3,2,7,4,9,2],[0,0,5,3,2,7,4,2],[5,0,1,3],[0,0,6,2,7,4,2],[0,0,1,6,3,8,2,4,3],[0,0,5,3,8,2,2],[0,0,5,6,3,2,4,2],[0,0,5,3,2],[0,0,5,3,2,4,2],[6,0,1,2,3,4,2],[7,0,1,1],[8,0,1,1],[4,0,4,2],[4,1,0,2,3,4,5],[1,0,1,2,3,4,3],[1,2,3,4,1],[9,0,1,2,2],[10,0,1,2,3,2],[11,0,1,2,3],[12,0,1,2,3,4,5,6,6],[13,0,1,3]],[[[[3,"Game",null],[4,"aniNode",[-1,-2,-3,-4,-5,-6,-7,-8,-9,-10,-11,-12,-13],[5,308,308],[0,0,1],[-154,154,0,0,0,0,1,1,1,1]],[5,"Canvas","a286bbGknJLZpRpxROV6M94",[-18,-19,-20,-21,-22],[[11,-14,[5,750,1624]],[12,-16,-15],[13,45,-17]],[4,4294769916],[5,750,1624],[375,812,0,0,0,0,1,1,1,1]],[6,"background",2,[[14,0,45,200,150,-23],[15,1,0,-24,[0],1]],[4,4281214491],[5,750,1624]],[7,"New Node",2,[1],[[17,true,-25,18]],[5,308,308],[-197.633,6.815,0,0,0,0,1,1,1,1]],[18,"New Node",[2],[0,0,0],[0,0,0,0,0,0,1,1,1,1]],[8,"Main Camera",2,[[19,7,-1,-26]]],[9,"cocos",2,[[16,-27,[2],3]],[5,175,226],[0,50,0,0,0,0,1,1,1,1]],[10,"label",2,[-28],[5,342.33,75.6],[0,-180,0,0,0,0,1,1,1,1]],[20,"Hello, World!",60,60,1,1,8,[4]],[2,"psd_205",1,[[0,-29,[5]]],[5,305,304],[0,0,1],[2,-2,0,0,0,0,1,1,1,1]],[1,"psd_209",1,[[0,-30,[6]]],[5,69,117],[0,0,1],[28.94371223449707,-29.941835403442383,0,0,0,0.004138034146815086,0.9999914383000486,1.000000272014994,1.000000272014994,1],[1,0,0,0.47418513746477436]],[2,"psd_211",1,[[0,-31,[7]]],[5,229,162],[0,0,1],[25,-134,0,0,0,0,1,1,1,1]],[1,"psd_213",1,[[0,-32,[8]]],[5,245,251],[0,0,1],[37.72652053833008,-24.958627700805664,0,0,0,-0.0035470216453093516,0.9999937092989374,1.000000188383684,1.000000188383684,1],[1,0,0,-0.4064595925411712]],[1,"psd_215",1,[[0,-33,[9]]],[5,179,164],[0,0,1],[82.8388900756836,-40.63901138305664,0,0,0,-0.0035470216453093516,0.9999937092989374,1.000000188383684,1.000000188383684,1],[1,0,0,-0.4064595925411712]],[1,"psd_217",1,[[0,-34,[10]]],[5,32,18],[0,0,1],[158.95755004882812,-56.87425231933594,0,0,0,0.0034910200774421513,0.9999939063708432,1.0000003537791409,1.0000003537791409,1],[1,0,0,0.4000422458357659]],[1,"psd_219",1,[[0,-35,[11]]],[5,92,46],[0,0,1],[152.39755249023438,-119.1475601196289,0,0,0,-0.0035470216453093516,0.9999937092989374,1.000000188383684,1.000000188383684,1],[1,0,0,-0.4064595925411712]],[1,"psd_221",1,[[0,-36,[12]]],[5,40,27],[0,0,1],[180.75856018066406,-124.94651794433594,0,0,0,-0.003546619755142193,0.9999937107243788,0.9840417700652906,0.9840417700652906,1],[1,0,0,-0.40641353903068317]],[1,"psd_223",1,[[0,-37,[13]]],[5,98,44],[0,0,1],[151.3621063232422,-114.15477752685547,0,0,0,-0.0035470216453093516,0.9999937092989374,1.000000188383684,1.000000188383684,1],[1,0,0,-0.4064595925411712]],[1,"psd_225",1,[[0,-38,[14]]],[5,84,28],[0,0,1],[149.184814453125,-89.16959381103516,0,0,0,-0.0035470216453093516,0.9999937092989374,1.000000188383684,1.000000188383684,1],[1,0,0,-0.4064595925411712]],[1,"psd_227",1,[[0,-39,[15]]],[5,22,17],[0,0,1],[189.3469696044922,-111.88526916503906,0,0,0,-0.0035470216453093516,0.9999937092989374,1.000000188383684,1.000000188383684,1],[1,0,0,-0.4064595925411712]],[1,"psd_229",1,[[0,-40,[16]]],[5,67,13],[0,0,1],[153.0854034423828,-75.14157104492188,0,0,0,-0.0035470216453093516,0.9999937092989374,1.000000188383684,1.000000188383684,1],[1,0,0,-0.4064595925411712]],[2,"psd_233",1,[[0,-41,[17]]],[5,303,304],[0,0,1],[3,-2,0,0,0,0,1,1,1,1]]],0,[0,-1,10,0,-2,11,0,-3,12,0,-4,13,0,-5,14,0,-6,15,0,-7,16,0,-8,17,0,-9,18,0,-10,19,0,-11,20,0,-12,21,0,-13,22,0,0,2,0,4,9,0,0,2,0,0,2,0,-1,6,0,-2,3,0,-3,7,0,-4,8,0,-5,4,0,0,3,0,0,3,0,0,4,0,0,6,0,0,7,0,-1,9,0,0,10,0,0,11,0,0,12,0,0,13,0,0,14,0,0,15,0,0,16,0,0,17,0,0,18,0,0,19,0,0,20,0,0,21,0,0,22,0,5,5,1,1,4,2,1,5,41],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[-1,2,-1,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,6],[0,1,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3]],[[{"name":"HelloWorld","rect":[44,14,175,226],"offset":[3.5,1],"originalSize":[256,256],"capInsets":[0,0,0,0]}],[2],0,[0],[3],[4]],[[{"name":"singleColor","rect":[0,0,2,2],"offset":[0,0],"originalSize":[2,2],"capInsets":[0,0,0,0]}],[2],0,[0],[3],[5]],[["0,9729,9729,33071,33071,0,0,1",-1],[3],0,[],[],[]],[["0,9729,9729,33071,33071,0,0,1",-1],[3],0,[],[],[]],[[[21,"狮子动效",".svga"],-1],0,0,[],[],[]]]]
\ No newline at end of file
This diff is collapsed.
{"paths":{},"types":[],"uuids":[],"scenes":{},"redirect":[],"deps":[],"packs":{},"name":"resources","importBase":"import","nativeBase":"native","debug":false,"isZip":false,"encrypted":false}
\ No newline at end of file
(function r(e,n,t){function i(u,f){if(!n[u]){if(!e[u]){var _=u.split("/");if(_=_[_.length-1],!e[_]){var p="function"==typeof __require&&__require;if(!f&&p)return p(_,!0);if(o)return o(_,!0);throw new Error("Cannot find module '"+u+"'")}u=_}var a=n[u]={exports:{}};e[u][0].call(a.exports,function(r){return i(e[u][1][r]||r)},a,a.exports,r,e,n,t)}return n[u].exports}for(var o="function"==typeof __require&&__require,u=0;u<t.length;u++)i(t[u]);return i})({},{},[]);
\ No newline at end of file
This diff is collapsed.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>拯救北极熊</title>
<!--http://www.html5rocks.com/en/mobile/mobifying/-->
<meta name="viewport"
content="width=device-width,user-scalable=no,initial-scale=1, minimum-scale=1,maximum-scale=1"/>
<!--https://developer.apple.com/library/safari/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html-->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="format-detection" content="telephone=no">
<!-- force webkit on 360 -->
<meta name="renderer" content="webkit"/>
<meta name="force-rendering" content="webkit"/>
<!-- force edge on IE -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<meta name="msapplication-tap-highlight" content="no">
<!-- force full screen on some browser -->
<meta name="full-screen" content="yes"/>
<meta name="x5-fullscreen" content="true"/>
<meta name="360-fullscreen" content="true"/>
<!-- force screen orientation on some browser -->
<meta name="screen-orientation" content="portrait"/>
<meta name="x5-orientation" content="portrait">
<!--fix fireball/issues/3568 -->
<!--<meta name="browsermode" content="application">-->
<meta name="x5-page-mode" content="app">
<!--<link rel="apple-touch-icon" href=".png" />-->
<!--<link rel="apple-touch-icon-precomposed" href=".png" />-->
<!-- <script src="//yun.duiba.com.cn/db_games/libs0924/svgaParser.minWeb.js" crossorigin="anonymous"></script>-->
<link rel="stylesheet" type="text/css" href="https://yun.duiba.com.cn/db_games/ccc_game/template/1678691545118/style-mobile.css"/>
<style>
body {
background-color: black !important;
}
/* 易盾css*/
.sui-captcha {
visibility: hidden;
position: fixed;
z-index: 10000;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: rgba(0, 0, 0, 0.7);
}
.neCaptcha-dialog {
visibility: hidden;
background-color: #fff;
box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.35);
-webkit-box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.35);
position: absolute;
left: 50%;
top: 45%;
-moz-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
-o-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
-webkit-transform: translate(-50%, -50%);
padding: 10px;
min-width: 100px;
border-radius: 10px;
width: 80%;
}
</style>
</head>
<body>
<canvas id="GameCanvas" oncontextmenu="event.preventDefault()" tabindex="0"></canvas>
<div id="splash" style="display: none;">
<div class="progress-bar stripes">
<span style="width: 0%"></span>
</div>
</div>
<script src="https://yun.duiba.com.cn/db_games/ccc_game/template/1678691545118/src/settings.js" charset="utf-8"></script>
<script src="https://yun.duiba.com.cn/db_games/ccc_game/template/1678691545118/main.js" charset="utf-8"></script>
<script type="text/javascript">
(function () {
// open web debugger console
if (typeof VConsole !== 'undefined') {
window.vConsole = new VConsole();
}
var debug = window._CCSettings.debug;
var splash = document.getElementById('splash');
splash.style.display = 'none';
function loadScript(moduleName, cb) {
function scriptLoaded() {
document.body.removeChild(domScript);
domScript.removeEventListener('load', scriptLoaded, false);
cb && cb();
}
var domScript = document.createElement('script');
domScript.async = true;
domScript.src = moduleName;
domScript.addEventListener('load', scriptLoaded, false);
document.body.appendChild(domScript);
}
var engineUrl = window.__remoteUrl__ + (debug ? 'cocos2d-js.js' : 'cocos2d-js-min.js');
loadScript(engineUrl, function () {
if (CC_PHYSICS_BUILTIN || CC_PHYSICS_CANNON) {
var physicsUrl = window.__remoteUrl__ + (debug ? 'physics.js' : 'physics-min.js');
loadScript(physicsUrl, window.boot);
} else {
window.boot();
}
});
})();
</script>
</body>
</html>
window.__remoteUrl__ = "https://yun.duiba.com.cn/db_games/ccc_game/template/1678691545118/";
window.__remoteAssets__ = window.__remoteUrl__ + "assets/";
window.__version__ = 1678691545118;
window.__ENV__ = "prod";
window.boot = function () {
var settings = window._CCSettings;
var onProgress = null;
var RESOURCES = cc.AssetManager.BuiltinBundleName.RESOURCES;
var INTERNAL = cc.AssetManager.BuiltinBundleName.INTERNAL;
var MAIN = cc.AssetManager.BuiltinBundleName.MAIN;
function setLoadingDisplay () {
// Loading splash scene
var splash = document.getElementById('splash');
var progressBar = splash.querySelector('.progress-bar span');
onProgress = function (finish, total) {
var percent = 100 * finish / total;
if (progressBar) {
progressBar.style.width = percent.toFixed(2) + '%';
}
};
splash.style.display = 'none';
progressBar.style.width = '0%';
cc.director.once(cc.Director.EVENT_AFTER_SCENE_LAUNCH, function () {
splash.style.display = 'none';
});
}
var onStart = function () {
cc.view.enableRetina(true);
cc.view.resizeWithBrowserSize(true);
if (cc.sys.isBrowser) {
// setLoadingDisplay();
}
if (cc.sys.isMobile) {
if (settings.orientation === 'landscape') {
cc.view.setOrientation(cc.macro.ORIENTATION_LANDSCAPE);
}
else if (settings.orientation === 'portrait') {
cc.view.setOrientation(cc.macro.ORIENTATION_PORTRAIT);
}
cc.view.enableAutoFullScreen([
cc.sys.BROWSER_TYPE_BAIDU,
cc.sys.BROWSER_TYPE_BAIDU_APP,
cc.sys.BROWSER_TYPE_WECHAT,
cc.sys.BROWSER_TYPE_MOBILE_QQ,
cc.sys.BROWSER_TYPE_MIUI,
cc.sys.BROWSER_TYPE_HUAWEI,
cc.sys.BROWSER_TYPE_UC,
].indexOf(cc.sys.browserType) < 0);
}
// Limit downloading max concurrent task to 2,
// more tasks simultaneously may cause performance draw back on some android system / browsers.
// You can adjust the number based on your own test result, you have to set it before any loading process to take effect.
if (cc.sys.isBrowser && cc.sys.os === cc.sys.OS_ANDROID) {
cc.assetManager.downloader.maxConcurrency = 2;
cc.assetManager.downloader.maxRequestsPerFrame = 2;
}
var launchScene = settings.launchScene;
var bundle = cc.assetManager.bundles.find(function (b) {
return b.getSceneInfo(launchScene);
});
bundle.loadScene(launchScene, null, onProgress,
function (err, scene) {
if (!err) {
cc.director.runSceneImmediate(scene);
if (cc.sys.isBrowser) {
// show canvas
var canvas = document.getElementById('GameCanvas');
canvas.style.visibility = '';
var div = document.getElementById('GameDiv');
if (div) {
div.style.backgroundImage = '';
}
console.log('Success to load scene: ' + launchScene);
}
}
}
);
};
var option = {
id: 'GameCanvas',
debugMode: settings.debug ? cc.debug.DebugMode.INFO : cc.debug.DebugMode.ERROR,
showFPS: settings.debug,
frameRate: 60,
groupList: settings.groupList,
collisionMatrix: settings.collisionMatrix,
};
cc.assetManager.init({
bundleVers: settings.bundleVers,
remoteBundles: settings.remoteBundles,
server: settings.server
});
var bundleRoot = [INTERNAL];
settings.hasResourcesBundle && bundleRoot.push(RESOURCES);
var count = 0;
function cb (err) {
if (err) return console.error(err.message, err.stack);
count++;
if (count === bundleRoot.length + 1) {
cc.assetManager.loadBundle(window.__remoteAssets__ + MAIN, function (err) {
if (!err) cc.game.run(option, onStart);
});
}
}
cc.assetManager.loadScript(settings.jsList.map(function (x) { return window.__remoteUrl__ + "src/" + x;}), cb);
for (var i = 0; i < bundleRoot.length; i++) {
cc.assetManager.loadBundle(window.__remoteAssets__ + bundleRoot[i], cb);
}
};
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<title>我的奖品</title>
<script src="//yun.duiba.com.cn/spark/v2/spark.base.fz.wxpollyfill.js"></script>
<script src="//yun.duiba.com.cn/js-libs/rem/1.1.3/rem.min.js"></script>
<script>"use strict";
window['stop_report_page_remain_time'] = true;
var CFG = {};</script>
<link href="//yun.duiba.com.cn/spark/v2/my-records-page/1657162270291/styles/main.7c65ce7aa33e9fd368a7.css" rel="stylesheet"></head>
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div id="root"></div>
<script src="//yun.duiba.com.cn/spark/v2/my-records-page/1657162270291/js/runtime-main.a6bfc822.js"></script><script src="//yun.duiba.com.cn/spark/v2/my-records-page/1657162270291/js/vendors.2c40989b.js"></script><script src="//yun.duiba.com.cn/spark/v2/my-records-page/1657162270291/js/main.fe29f0c7.js"></script></body>
</html>
This diff is collapsed.
window._CCSettings={platform:"web-mobile",groupList:["default"],collisionMatrix:[[true]],hasResourcesBundle:true,hasStartSceneBundle:false,remoteBundles:[],subpackages:[],launchScene:"db://assets/Scenes/Game.fire",orientation:"portrait",jsList:["assets/Script/plugin/svgaParser.min.js"]};
\ No newline at end of file
body {
cursor: default;
padding: 0;
border: 0;
margin: 0;
text-align: center;
background-color: white;
font-family: Helvetica, Verdana, Arial, sans-serif;
}
body, canvas, div {
outline: none;
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
-khtml-user-select: none;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
/* Remove spin of input type number */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
/* display: none; <- Crashes Chrome on hover */
-webkit-appearance: none;
margin: 0; /* <-- Apparently some margin are still there even though it's hidden */
}
#Cocos2dGameContainer {
position: absolute;
margin: 0;
overflow: hidden;
left: 0px;
top: 0px;
}
canvas {
background-color: rgba(0, 0, 0, 0);
}
a:link, a:visited {
color: #000;
}
a:active, a:hover {
color: #666;
}
p.header {
font-size: small;
}
p.footer {
font-size: x-small;
}
#splash {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: #171717 url(./splash.png) no-repeat center;
background-size: 350px;
}
.progress-bar {
background-color: #1a1a1a;
position: absolute;
left: 50%;
top: 80%;
height: 5px;
width: 300px;
margin: 0 -150px;
border-radius: 5px;
box-shadow: 0 1px 5px #000 inset, 0 1px 0 #444;
}
.progress-bar span {
display: block;
height: 100%;
border-radius: 5px;
box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset;
transition: width .4s ease-in-out;
background-color: #3dc5de;
}
.stripes span {
background-size: 30px 30px;
background-image: linear-gradient(135deg, rgba(255, 255, 255, .15) 25%, transparent 25%,
transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%,
transparent 75%, transparent);
animation: animate-stripes 1s linear infinite;
}
@keyframes animate-stripes {
0% {background-position: 0 0;} 100% {background-position: 60px 0;}
}
h1 {
color: #444;
text-shadow: 3px 3px 15px;
}
#GameDiv {
width: 800px;
height: 450px;
margin: 0 auto;
background: black;
position: relative;
border: 3px solid black;
border-radius: 6px;
box-shadow: 0 5px 40px #333
}
html {
-ms-touch-action: none;
}
body, canvas, div {
display: block;
outline: none;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
user-select: none;
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
-khtml-user-select: none;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
/* Remove spin of input type number */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
/* display: none; <- Crashes Chrome on hover */
-webkit-appearance: none;
margin: 0; /* <-- Apparently some margin are still there even though it's hidden */
}
body {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
padding: 0;
border: 0;
margin: 0;
cursor: default;
color: #888;
background-color: #333;
text-align: center;
font-family: Helvetica, Verdana, Arial, sans-serif;
display: flex;
flex-direction: column;
/* fix bug: https://github.com/cocos-creator/2d-tasks/issues/791 */
/* overflow cannot be applied in Cocos2dGameContainer,
otherwise child elements will be hidden when Cocos2dGameContainer rotated 90 deg */
overflow: hidden;
}
#Cocos2dGameContainer {
position: absolute;
margin: 0;
left: 0px;
top: 0px;
display: -webkit-box;
-webkit-box-orient: horizontal;
-webkit-box-align: center;
-webkit-box-pack: center;
}
canvas {
background-color: rgba(0, 0, 0, 0);
}
a:link, a:visited {
color: #666;
}
a:active, a:hover {
color: #666;
}
p.header {
font-size: small;
}
p.footer {
font-size: x-small;
}
#splash {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: #171717 url(./splash.png) no-repeat center;
background-size: 45%;
}
.progress-bar {
position: absolute;
left: 27.5%;
top: 80%;
height: 3px;
padding: 2px;
width: 45%;
border-radius: 7px;
box-shadow: 0 1px 5px #000 inset, 0 1px 0 #444;
}
.progress-bar span {
display: block;
height: 100%;
border-radius: 3px;
transition: width .4s ease-in-out;
background-color: #3dc5de;
}
.stripes span {
background-size: 30px 30px;
background-image: linear-gradient(135deg, rgba(255, 255, 255, .15) 25%, transparent 25%,
transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%,
transparent 75%, transparent);
animation: animate-stripes 1s linear infinite;
}
@keyframes animate-stripes {
0% {background-position: 0 0;} 100% {background-position: 60px 0;}
}
This diff is collapsed.
{
"compilerOptions": {
"target": "es6",
"module": "commonjs"
},
"exclude": [
"node_modules",
"library",
"local",
"settings",
"temp"
]
}
\ No newline at end of file
{
"name": "cocos-template",
"version": "1.0.0",
"description": "Hello world new project template.",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git@gitlab2.dui88.com:db-delivery-center-fore-end/cocos-template.git"
},
"keywords": [
"cocos",
"cocos-template",
"duiba",
"db-cocos",
"db-cocos-template",
"Edwise",
"haiyoucuv"
],
"author": "爱德 <caoxingru@duiba.com.cn>",
"license": "MIT",
"dependencies": {
"ali-oss": "^6.17.1",
"chokidar": "^3.5.3",
"co": "^4.6.0",
"os": "^0.1.2",
"progress": "^2.0.3",
"psd": "^3.2.0"
}
}
\ No newline at end of file
const chokidar = require("chokidar");
const path = require("path");
function _debounce(fn, delay = 1000) {
let timer = null;
return function (...args) {
timer && clearTimeout(timer);
timer = setTimeout(fn, delay, ...args);
};
}
let watcher = null;
const autoRefreshType = [
"ts",
"js",
];
const requestCocosRefreshApi = _debounce(async (filePath) => {
const type = filePath.substring(filePath.lastIndexOf(".") + 1, filePath.length);
if (autoRefreshType.indexOf(type) > -1) {
// Editor.Ipc.sendToPanel('scene', 'scene:stash-and-save');
Editor.assetdb.refresh("db://assets" + filePath.split("assets")[1], function (err, results) {
console.log(err, results);
});
}
});
module.exports = {
load() {
watcher = chokidar.watch(path.join(Editor.Project.path, './assets'), {
ignored: "*.meta",
persistent: true,
// awaitWriteFinish: true,
}).on('change', requestCocosRefreshApi)
.on('add', requestCocosRefreshApi);
},
async unload() {
await watcher.close();
},
messages: {
"auto-refresh:test": (event, question) => {
Editor.Ipc.sendToPanel('scene', 'scene:stash-and-save');
}
}
};
\ No newline at end of file
{
"name": "auto-refresh",
"version": "0.0.1",
"description": "兑吧 Cocos Creator 预览自动刷新脚本",
"author": "haiyoucuv",
"main": "main.js",
"main-menu": {
"i18n:MAIN_MENU.package.title/aa/aa": {
"message": "auto-refresh:test"
}
}
}
\ No newline at end of file
This diff is collapsed.
const path = require("path");
const fs = require("fs");
const AutoUpload = require("./upload");
const compressAllImage = require("./minImg");
let buildVersion = 0;
function getRemotePath() {
return `/db_games/ccc_game/template/${buildVersion}/`;
}
function getRemoteUrl() {
return `https://yun.duiba.com.cn${getRemotePath()}`;
}
/**
* 开始打包
* @param options
* @param callback
*/
function onBuildStart(options, callback) {
if (options.platform !== "web-mobile") return;
buildVersion = Date.now();
callback();
}
/**
* 打包结束之前
* @param options
* @param callback
*/
async function onBeforeBuildFinish(options, callback) {
if (options.platform !== "web-mobile") return;
const remoteUrl = getRemoteUrl();
Editor.success("兑吧发布插件 >> 开始修改脚本");
// main.js 所在路径
const mainJsPath = path.join(options.dest, "main.js");
// 读取 main.js
let script = fs.readFileSync(mainJsPath, "utf8");
// 添加一点脚本
script = `window.__remoteUrl__ = \"${remoteUrl}\";\n`
+ `window.__remoteAssets__ = window.__remoteUrl__ + \"assets/\";\n`
+ `window.__version__ = ${buildVersion};\n`
+ `window.__ENV__ = "prod";\n`
+ script;
// 保存
fs.writeFileSync(mainJsPath, script);
Editor.success("兑吧发布插件 >> 修改脚本完成");
Editor.success("兑吧发布插件 >> 开始压缩图片");
await compressAllImage(options);
Editor.success("兑吧发布插件 >> 压缩图片结束");
callback();
}
/**
* 打包完成
* @param options
* @param callback
*/
async function onBuildFinish(options, callback) {
if (options.platform !== "web-mobile") return;
const remoteUrl = getRemoteUrl();
Editor.success("兑吧发布插件 >> 开始生成皮肤模版");
const htmlPath = path.join(options.dest, "index.html");
const indexHtml = fs.readFileSync(htmlPath, "utf8")
.replace(/{{__remoteUrl__}}/g, remoteUrl);
fs.writeFileSync(htmlPath, indexHtml);
Editor.success("兑吧发布插件 >> 生成皮肤模版完成");
Editor.success("兑吧发布插件 >> 打包完成,开始上传");
const dir = path.join(Editor.Project.path, "build/web-mobile");
const autoUpload = new AutoUpload({
dir: dir,
originDir: getRemotePath(),
});
await autoUpload.start();
Editor.success("兑吧发布插件 >> 上传完成");
Editor.success("兑吧发布插件 >> 版本号:" + buildVersion);
callback();
}
module.exports = {
load() {
Editor.Builder.on("build-start", onBuildStart);
Editor.Builder.on("before-change-files", onBeforeBuildFinish);
Editor.Builder.on("build-finished", onBuildFinish);
},
unload() {
Editor.Builder.removeListener("build-start", onBuildStart);
Editor.Builder.removeListener("before-change-files", onBeforeBuildFinish);
Editor.Builder.removeListener("build-finished", onBuildFinish);
},
messages: {
"duiba-publish:test": function (event, question) {
// const dir = path.resolve(Editor.Project.path, "build/web-mobile");
//
// const autoUpload = new AutoUpload({
// dir: dir,
// originDir: `/db_games/cocosTest/${Date.now()}/`
// });
//
// autoUpload.start();
// const tempDir = Editor.url("packages://duiba-publish/index.html");
// let indexHtml = fs.readFileSync(tempDir, "utf8");
// indexHtml = indexHtml.replace(/{{__remoteUrl__}}/g, "1231231");
// fs.writeFileSync(path.join(Editor.Project.path, "build-templates/web-mobile/index1.html"), indexHtml);
}
}
};
const fs = require("fs");
const Os = require('os');
const path = require('path');
const { exec } = require('child_process');
/** 压缩引擎路径表 */
const enginePathMap = {
/** macOS */
'darwin': 'pngquant/macos/pngquant',
/** Windows */
'win32': 'pngquant/windows/pngquant'
}
/**
* 压缩
* @param {string[]} pathArr 文件数组
* @param {object} options 压缩参数
*/
async function compress(pathArr, options) {
const pngquantPath = this.pngquantPath;
const tasks = [];
pathArr.forEach((filePath, i) => {
if (!filePath) {
Editor.error(i);
Editor.error(filePath);
return;
}
// 加入压缩队列
tasks.push(new Promise((resolve) => {
try {
const sizeBefore = fs.statSync(filePath).size,
command = `"${pngquantPath}" ${options} -- "${filePath}"`;
// pngquant $OPTIONS -- "$FILE"
exec(command, (error, stdout, stderr) => {
const sizeAfter = fs.statSync(filePath).size
if (!error) {
const radio = ((1 - sizeAfter / sizeBefore) * 100).toFixed(2);
// Editor.success(`压缩图片成功: ${filePath}, 压缩率:${radio}`);
}
resolve();
});
} catch (e) {
Editor.error(e);
resolve();
}
}));
});
await Promise.all(tasks);
}
module.exports = async function compressAllImage(options) {
const images = [];
options.bundles.forEach((bundle) => {
const buildResults = bundle.buildResults;
// get all textures in build
if (!buildResults) return;
const assets = buildResults.getAssetUuids();
const textureType = cc.js._getClassId(cc.Texture2D);
for (let i = 0; i < assets.length; ++i) {
const asset = assets[i];
if (buildResults.getAssetType(asset) === textureType) {
images.push(buildResults.getNativeAssetPath(asset));
}
}
});
const platform = Os.platform(),
pngquantPath = this.pngquantPath = path.join(__dirname, enginePathMap[platform]);
// 设置引擎文件的执行权限(仅 macOS)
if (pngquantPath && platform === 'darwin') {
if (fs.statSync(pngquantPath).mode != 33261) {
// 默认为 33188
fs.chmodSync(pngquantPath, 33261);
}
}
const qualityParam = `--quality 0-99`,
speedParam = `--speed 3`,
skipParam = '--skip-if-larger',
outputParam = '--ext=.png',
writeParam = '--force',
// colorsParam = config.colors,
// compressOptions = `${qualityParam} ${speedParam} ${skipParam} ${outputParam} ${writeParam} ${colorsParam}`;
compressOptions = `${qualityParam} ${speedParam} ${skipParam} ${outputParam} ${writeParam}`;
await compress(images, compressOptions);
}
\ No newline at end of file
{
"name": "duiba-publish",
"version": "0.0.1",
"description": "兑吧 Cocos Creator Web 发布插件",
"author": "haiyoucuv",
"main": "main.js",
"main-menu": {
"i18n:MAIN_MENU.package.title/兑吧发布插件/测试": {
"message": "duiba-publish:test"
}
}
}
\ No newline at end of file
This diff is collapsed.
# pngquant 2 [![build](https://travis-ci.org/kornelski/pngquant.svg?branch=master)](https://travis-ci.org/kornelski/pngquant)
[pngquant](https://pngquant.org) is a PNG compressor that significantly reduces file sizes by converting images to a more efficient 8-bit PNG format *with alpha channel* (often 60-80% smaller than 24/32-bit PNG files). Compressed images are fully standards-compliant and are supported by all web browsers and operating systems.
[This](https://github.com/kornelski/pngquant) is the official `pngquant` repository. The compression engine is also available [as an embeddable library](https://github.com/ImageOptim/libimagequant).
## Usage
- batch conversion of multiple files: `pngquant *.png`
- Unix-style stdin/stdout chaining: `… | pngquant - | …`
To further reduce file size, try [optipng](http://optipng.sourceforge.net), [ImageOptim](https://imageoptim.com), or [zopflipng](https://github.com/google/zopfli).
## Features
* High-quality palette generation
- advanced quantization algorithm with support for gamma correction and premultiplied alpha
- unique dithering algorithm that does not add unnecessary noise to the image
* Configurable quality level
- automatically finds required number of colors and can skip images which can't be converted with the desired quality
* Fast, modern code
- based on a portable [libimagequant library](https://github.com/ImageOptim/libimagequant)
- C99 with no workarounds for legacy systems or compilers ([apart from Visual Studio](https://github.com/kornelski/pngquant/tree/msvc))
- multicore support (via OpenMP) and Intel SSE optimizations
## Options
See `pngquant -h` for full list.
### `--quality min-max`
`min` and `max` are numbers in range 0 (worst) to 100 (perfect), similar to JPEG. pngquant will use the least amount of colors required to meet or exceed the `max` quality. If conversion results in quality below the `min` quality the image won't be saved (if outputting to stdin, 24-bit original will be output) and pngquant will exit with status code 99.
pngquant --quality=65-80 image.png
### `--ext new.png`
Set custom extension (suffix) for output filename. By default `-or8.png` or `-fs8.png` is used. If you use `--ext=.png --force` options pngquant will overwrite input files in place (use with caution).
### `-o out.png` or `--output out.png`
Writes converted file to the given path. When this option is used only single input file is allowed.
### `--skip-if-larger`
Don't write converted files if the conversion isn't worth it.
### `--speed N`
Speed/quality trade-off from 1 (slowest, highest quality, smallest files) to 11 (fastest, less consistent quality, light comperssion). The default is 4. It's recommended to keep the default, unless you need to generate images in real time (e.g. map tiles). Higher speeds are fine with 256 colors, but don't handle lower number of colors well.
### `--nofs`
Disables Floyd-Steinberg dithering.
### `--floyd=0.5`
Controls level of dithering (0 = none, 1 = full). Note that the `=` character is required.
### `--posterize bits`
Reduce precision of the palette by number of bits. Use when the image will be displayed on low-depth screens (e.g. 16-bit displays or compressed textures in ARGB444 format).
### `--strip`
Don't copy optional PNG chunks. Metadata is always removed on Mac (when using Cocoa reader).
See [man page](https://github.com/kornelski/pngquant/blob/master/pngquant.1) (`man pngquant`) for the full list of options.
## License
pngquant is dual-licensed:
* Under **GPL v3** or later with an additional [copyright notice](https://github.com/kornelski/pngquant/blob/master/COPYRIGHT) that must be kept for the older parts of the code.
* Or [a **commercial license**](https://supso.org/projects/pngquant) for use in non-GPL software (e.g. closed-source or App Store distribution). You can [get the license via Super Source](https://supso.org/projects/pngquant). Email kornel@pngquant.org if you have any questions.
This diff is collapsed.
@echo off
set path=%~d0%~p0
:start
"%path%pngquant.exe" --force --verbose --quality=45-85 %1
"%path%pngquant.exe" --force --verbose --ordered --speed=1 --quality=50-90 %1
shift
if NOT x%1==x goto start
@echo off
set path=%~d0%~p0
:start
"%path%pngquant.exe" --force --verbose 256 %1
shift
if NOT x%1==x goto start
# pngquant 2
[pngquant](https://pngquant.org) is a PNG compresor that significantly reduces file sizes by converting images to a more efficient 8-bit PNG format *with alpha channel* (often 60-80% smaller than 24/32-bit PNG files). Compressed images are fully standards-compliant and are supported by all web browsers and operating systems.
[This](https://github.com/kornelski/pngquant) is the official `pngquant` repository. The compression engine is also available [as an embeddable library](https://github.com/ImageOptim/libimagequant).
## Usage
- batch conversion of multiple files: `pngquant *.png`
- Unix-style stdin/stdout chaining: `… | pngquant - | …`
To further reduce file size, try [optipng](http://optipng.sourceforge.net), [ImageOptim](https://imageoptim.com), or [zopflipng](https://github.com/google/zopfli).
## Features
* High-quality palette generation
- advanced quantization algorithm with support for gamma correction and premultiplied alpha
- unique dithering algorithm that does not add unnecessary noise to the image
* Configurable quality level
- automatically finds required number of colors and can skip images which can't be converted with the desired quality
* Fast, modern code
- based on a portable [libimagequant library](https://github.com/ImageOptim/libimagequant)
- C99 with no workarounds for legacy systems or compilers ([apart from Visual Studio](https://github.com/kornelski/pngquant/tree/msvc))
- multicore support (via OpenMP) and Intel SSE optimizations
## Options
See `pngquant -h` for full list.
### `--quality min-max`
`min` and `max` are numbers in range 0 (worst) to 100 (perfect), similar to JPEG. pngquant will use the least amount of colors required to meet or exceed the `max` quality. If conversion results in quality below the `min` quality the image won't be saved (if outputting to stdin, 24-bit original will be output) and pngquant will exit with status code 99.
pngquant --quality=65-80 image.png
### `--ext new.png`
Set custom extension (suffix) for output filename. By default `-or8.png` or `-fs8.png` is used. If you use `--ext=.png --force` options pngquant will overwrite input files in place (use with caution).
### `-o out.png` or `--output out.png`
Writes converted file to the given path. When this option is used only single input file is allowed.
### `--skip-if-larger`
Don't write converted files if the conversion isn't worth it.
### `--speed N`
Speed/quality trade-off from 1 (slowest, highest quality, smallest files) to 11 (fastest, less consistent quality, light comperssion). The default is 3. It's recommended to keep the default, unless you need to generate images in real time (e.g. map tiles). Higher speeds are fine with 256 colors, but don't handle lower number of colors well.
### `--nofs`
Disables Floyd-Steinberg dithering.
### `--floyd=0.5`
Controls level of dithering (0 = none, 1 = full). Note that the `=` character is required.
### `--posterize bits`
Reduce precision of the palette by number of bits. Use when the image will be displayed on low-depth screens (e.g. 16-bit displays or compressed textures in ARGB444 format).
### `--strip`
Don't copy optional PNG chunks. Metadata is always removed on Mac (when using Cocoa reader).
See [man page](https://github.com/kornelski/pngquant/blob/master/pngquant.1) (`man pngquant`) for the full list of options.
## License
pngquant is dual-licensed:
* Under **GPL v3** or later with an additional [copyright notice](https://github.com/kornelski/pngquant/blob/master/COPYRIGHT) that must be kept for the older parts of the code.
* Or [a **commercial license**](https://supportedsource.org/projects/pngquant) for use in non-GPL software (e.g. closed-source or App Store distribution). You can [get the license via Supported Source](https://supportedsource.org/projects/pngquant/purchase). Email kornel@pngquant.org if you have any questions.
This diff is collapsed.
'use strict';
module.exports = {
load () {
// execute when package loaded
},
unload () {
// execute when package unloaded
},
// register your ipc messages here
messages: {
'open' () {
// open entry panel registered in package.json
Editor.Panel.open('zbw_web_load');
},
'clicked' () {
Editor.log('Button clicked!');
}
},
};
\ No newline at end of file
{
"name": "zbw_web_load",
"version": "0.0.2",
"description": "web项目",
"author": "张佰万",
"main": "main.js",
"main-menu": {
"i18n:MAIN_MENU.package.title/webLoad": {
"message": "zbw_web_load:open"
}
},
"panel": {
"main": "panel/index.js",
"type": "dockable",
"title": "自定义webLoad样式",
"width": 0,
"height": 520,
"min-width": 420,
"min-height": 520,
"max-width": 430,
"max-height": 540
}
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
{
"success": true,
"data": {
"teamId": 1,
"teamName": "sasdfa"
}
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
{
"success": true,
"code": "officia cupidatat Duis",
"message": "enim"
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment