function loadAssest() {
manifest = [
{ src: "clearLight/blue.png", id: "blue" }
...
]
var loadCount = 0
preload = new createjs.LoadQueue(false, "./images/");
preload.on("fileload", function (event) {
loadCount++
document.querySelector("#process").innerHTML = (loadCount * 100 / manifest.length).toFixed(0) + '%'
})
preload.on('complete', function (event) {
document.querySelector(".loading-cover").style.display = 'none'
document.querySelector(".swiper-container").style.display = "block"
renderPage1()
})
preload.loadManifest(manifest)
}
第一个页面绘制代码
function renderPage1() {
var canvas = document.getElementById("canvas1")
var stage = new createjs.Stage(canvas)
createjs.Ticker.addEventListener("tick", handleTicker);
function handleTicker() {
stage.update();
}
var title = this.createText(stage, "超浓缩", "normal 80px microsoft yahei", "#fff", 40, 40)
var subTitle1 = this.createText(stage, "·科技突破,高能量配方,活性物浓度高达47%,是普通洗衣液\n的三倍以上,获得「浓缩+」洗衣液认证", "normal 24px microsoft yahei", "#fff", 40, 160)
var subTitle2 = this.createText(stage, "·一泵8g洗8件,小体积,大能量,660g=2.2kg,用量减少\n70%以上", "normal 24px microsoft yahei", "#fff", 40, 240)
var logo = this.createImage(stage, 'superEnrichment/logo', 116, 83, 320, 60)
var bigPower = this.createImage(stage, 'big_power', 163, 154, 40, 320)
var concentration = this.createImage(stage, 'concentration', 230, 154, 250, 320)
var bottom = this.createImage(stage, 'bottom', 600, 360, 75, 800)
var waterDrop = this.createImage(stage,'water_drop', 300, 350, 223, 600)
var light_line_long = this.createImage(stage,'light_line_long', 23, 300, 110, 670)
var light_line_long2 = this.createImage(stage,'light_line_long', 23, 300, 365, 810)
var light_line_long3 = this.createImage(stage,'light_line_long', 23, 300, 620, 670)
createjs.Tween.get(title).to({ alpha: 1 }, 300)
createjs.Tween.get(subTitle1).to({ alpha: 1 }, 300)
createjs.Tween.get(subTitle2).to({ alpha: 1 }, 300)
createjs.Tween.get(logo).to({ alpha: 1 }, 300)
createjs.Tween.get(bigPower).to({ alpha: 1 }, 300)
createjs.Tween.get(concentration).to({ alpha: 1 }, 300)
createjs.Tween.get(waterDrop).to({ alpha: 1 }, 300)
createjs.Tween.get(waterDrop, { loop: true }).to({ y: 570 }, 1000, createjs.Ease.getPowInOut(2)).to({ y: 600 }, 1000, createjs.Ease.getPowInOut(2))
createjs.Tween.get(bottom).to({ alpha: 1 }, 300)
createjs.Tween.get(light_line_long, { loop: true }).to({ alpha: 1 }, 1000).to({ alpha: 0.4 }, 1000)
createjs.Tween.get(light_line_long2, { loop: true }).to({ alpha: 1 }, 1000).to({ alpha: 0.4 }, 1000)
createjs.Tween.get(light_line_long3, { loop: true }).to({ alpha: 1 }, 1000).to({ alpha: 0.4 }, 1000)
}
近期评论