This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Doric/doric-h5/dist/DoricPlayground.js

158 lines
29 KiB
JavaScript
Raw Normal View History

2019-12-26 11:25:41 +08:00
'use strict';
var doric = require('doric');
const colors = [
"#70a1ff",
"#7bed9f",
"#ff6b81",
"#a4b0be",
"#f0932b",
"#eb4d4b",
"#6ab04c",
"#e056fd",
"#686de0",
"#30336b",
].map(e => doric.Color.parse(e));
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
const files = [
{
name: "五子棋",
url: "./dist/Gobang.js",
alias: "Gobang.js",
icon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAfE0lEQVR4Xu1dB1RVx9b+rFgSKyAq9hqwoUQRUVEUxPZU1AhJbM9o7NGoL8lvLDGJRmPsiYmVZ42K+sQIogRBVEosUTE2BFsAY+/Y+Ne+Ce/5fOece8qce++5d/Zad7EWd2bvmW/mu/vMmZm9C4ALR4AjIIpAAY4NR4AjII4AJwifHRwBCQQ4Qfj04AhwgvA5wBFQhwD3IOpw47UcBAFOEAcZaN5NdQhwgqjDjddyEAQ4QRxkoHk31SHACaION17LQRDgBHGQgebdVIcAJ4g63HgtB0HA0QjiDaDhX2N7AsAvDjLOWrvZAYAngJsAjgP4VatCo9R3JIJMBTDtlYGZLvA/o4ydpdoZDSDoJWO3AAwEsMNSDbCmHUchSCOJX73Gf/0qWnMcbNX22wDWCjQuEUBrW200y3ZpIkheeo88lo3RS9e3azMwcqrwU8GS6Y0x4p0aepk2tN4+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R3UxT/P8INglQdjw4X0gOQRa+T2tevdv52SvbeTjY/h+g5o9C2
2019-12-28 15:19:43 +08:00
},
{
name: "列表",
url: "./dist/ListDemo.js",
alias: "ListDemo.js",
icon: "",
},
{
name: "Counter",
url: "../doric-demo/bundle/src/Counter.js",
alias: "Counter.js",
icon: "",
},
{
name: "EffectsDemo",
url: "../doric-demo/bundle/src/EffectsDemo.js",
alias: "EffectsDemo.js",
icon: "",
},
{
name: "ImageDemo",
url: "../doric-demo/bundle/src/ImageDemo.js",
alias: "ImageDemo.js",
icon: "",
},
{
name: "LayoutDemo",
url: "../doric-demo/bundle/src/LayoutDemo.js",
alias: "LayoutDemo.js",
icon: "",
2019-12-26 11:25:41 +08:00
},
];
let DoricPlayground = class DoricPlayground extends doric.Panel {
onShow() {
doric.navbar(context).setTitle("Doric Playground");
}
build(rootView) {
doric.scroller(doric.vlayout([
doric.hlayout([
doric.text({
text: "Demo列表",
2019-12-26 11:25:41 +08:00
textSize: 20,
}).apply({
layoutConfig: doric.layoutConfig().fit().configAlignmnet(doric.gravity().centerY()).configMargin({
left: 15,
})
})
]).apply({
layoutConfig: doric.layoutConfig().just().configWidth(doric.LayoutSpec.MOST).configMargin({
top: 0,
}),
height: 50,
backgroundColor: colors[3].alpha(0.2),
}),
...files.map(e => doric.vlayout([
doric.hlayout([
doric.image({
imageBase64: e.icon,
layoutConfig: doric.layoutConfig().just(),
width: 50,
height: 50,
scaleType: doric.ScaleType.ScaleAspectFit,
}),
doric.text({
text: e.name,
textSize: 30,
textColor: doric.Color.BLACK,
}).apply({
layoutConfig: doric.layoutConfig().fit().configAlignmnet(doric.gravity().centerY()).configMargin({
left: 15,
})
}),
]).apply({
layoutConfig: doric.layoutConfig().just().configWidth(doric.LayoutSpec.MOST).configMargin({
top: 10,
bottom: 10
}),
height: 50,
}),
(new doric.Stack).apply({
layoutConfig: doric.layoutConfig().just().configWidth(doric.LayoutSpec.MOST),
height: 1,
backgroundColor: colors[3].alpha(0.2),
}),
]).apply({
layoutConfig: doric.layoutConfig().fit().configWidth(doric.LayoutSpec.MOST),
onClick: () => {
doric.navigator(context).push(e.url, {
alias: e.alias,
});
},
})),
doric.hlayout([
doric.text({
text: "待上线",
textSize: 20,
}).apply({
layoutConfig: doric.layoutConfig().fit().configAlignmnet(doric.gravity().centerY()).configMargin({
left: 15,
})
})
]).apply({
layoutConfig: doric.layoutConfig().just().configWidth(doric.LayoutSpec.MOST).configMargin({
top: 0,
}),
height: 50,
backgroundColor: colors[3].alpha(0.2),
}),
])
.apply({
layoutConfig: doric.layoutConfig().fit().configWidth(doric.LayoutSpec.MOST)
}))
.apply({
layoutConfig: doric.layoutConfig().most()
})
.in(rootView);
}
};
DoricPlayground = __decorate([
Entry
], DoricPlayground);
//# sourceMappingURL=DoricPlayground.js.map