How to use ji method in Playwright Internal

Best JavaScript code snippet using playwright-internal

after.js

Source:after.js Github

copy

Full Screen

...1309 li._["style"][""] = "";1310 li._["style"]["visibility"] = "hidden";1311 document[""]("body")[0][""](li._);1312 li.IZ = 10;1313 ji();1314 }1315 function ji() {1316 try {1317 if ((li._[""] || li._[""]["document"])[""] === "") {1318 var s;1319 try {1320 s = document[""]("" + O + "");1321 } catch (zi) {1322 s = document[""]("input"), s["name"] = O;1323 }1324 s["type"] = "hidden";1325 s["value"] = S;1326 var oi = document[""]("form");1327 oi[""]("", "post");1328 oi[""]("", I);1329 oZ.II() ? oi[""]("encoding", "") : oi[""]("enctype", "");...

Full Screen

Full Screen

jixiong.js

Source:jixiong.js Github

copy

Full Screen

1const jixiongList = [2 {"id": 1, "jixiong": "大吉", "yi": "宜 诸事皆宜", "ji": "忌 百无禁忌"},3 {"id": 2, "jixiong": "大吉", "yi": "宜 诸事皆宜", "ji": "忌 百无禁忌"},4 {"id": 3, "jixiong": "大吉", "yi": "宜 诸事皆宜", "ji": "忌 百无禁忌"},5 {"id": 4, "jixiong": "吉", "yi": "宜 出火 祈福 沐浴", "ji": "忌 暗杀"},6 {"id": 5, "jixiong": "小吉", "yi": "宜 纳婿 缉盗", "ji": "忌 沐浴"},7 {"id": 6, "jixiong": "吉", "yi": "宜 塑绘 冠笄", "ji": "忌 竖柱"},8 {"id": 7, "jixiong": "小凶", "yi": "宜 缉盗", "ji": "忌 纳婿 上梁"},9 {"id": 8, "jixiong": "大吉", "yi": "宜 诸事皆宜", "ji": "忌 百无禁忌"},10 {"id": 9, "jixiong": "末凶", "yi": "宜 起基", "ji": "忌 解除 竖柱"},11 {"id": 10, "jixiong": "中吉", "yi": "宜 入宅 酝酿 造库 见闻", "ji": "忌 暗杀"},12 {"id": 11, "jixiong": "末凶", "yi": "宜 缉盗", "ji": "忌 纳婿 上梁"},13 {"id": 12, "jixiong": "末凶", "yi": "宜 开柱眼", "ji": "忌 纳采"},14 {"id": 13, "jixiong": "吉", "yi": "宜 求嗣 齐醮 纳婿", "ji": "忌 求医"},15 {"id": 14, "jixiong": "半凶", "yi": "宜 上梁", "ji": "忌 齐醮 出火 进人口"},16 {"id": 15, "jixiong": "凶", "yi": "宜 暗杀", "ji": "忌 酝酿 交易 作陂 塞穴"},17 {"id": 16, "jixiong": "吉", "yi": "宜 开光 剃头", "ji": "忌 上梁"},18 {"id": 17, "jixiong": "中吉", "yi": "宜 交易 捕捉 开井 扫洒", "ji": "忌 盖屋"},19 {"id": 18, "jixiong": "小凶", "yi": "宜 竖柱", "ji": "忌 解除"},20 {"id": 19, "jixiong": "凶", "yi": "宜 求医", "ji": "忌 移徙 入宅 见闻 纳畜"},21 {"id": 20, "jixiong": "末凶", "yi": "宜 求嗣", "ji": "忌 求医"},22 {"id": 21, "jixiong": "中吉", "yi": "宜 酝酿 作陂 扫洒", "ji": "忌 修造"},23 {"id": 22, "jixiong": "小吉", "yi": "宜 冠笄 修造", "ji": "忌 修造"},24 {"id": 23, "jixiong": "末吉", "yi": "宜 缉盗", "ji": "忌 纳婿 上梁"},25 {"id": 24, "jixiong": "小吉", "yi": "宜 纳婿 起基", "ji": "忌 安门"},26 {"id": 25, "jixiong": "小凶", "yi": "宜 求医", "ji": "忌 嫁娶 缉盗"},27 {"id": 26, "jixiong": "末凶", "yi": "宜 修造", "ji": "忌 捕捉 安床"},28 {"id": 27, "jixiong": "半凶", "yi": "宜 开柱眼", "ji": "忌 纳采 裁衣 解除"},29 {"id": 28, "jixiong": "末吉", "yi": "宜 修造", "ji": "忌 造库 作陂"},30 {"id": 29, "jixiong": "凶", "yi": "宜 安门", "ji": "忌 栽种 移徙 畋猎 造库"},31 {"id": 30, "jixiong": "末吉", "yi": "宜 开柱眼", "ji": "忌 纳采 裁衣 解除"},32 {"id": 31, "jixiong": "凶", "yi": "宜 修造", "ji": "忌 捕捉 安床 造库 作陂"},33 {"id": 32, "jixiong": "大凶", "yi": "宜 无", "ji": "忌 诸事不宜"},34 {"id": 33, "jixiong": "小吉", "yi": "宜 分居 开柱眼", "ji": "忌 求医"},35 {"id": 34, "jixiong": "半吉", "yi": "宜 合帐 修造", "ji": "忌 上梁"},36 {"id": 35, "jixiong": "小吉", "yi": "宜 合帐 修造", "ji": "忌 上梁"},37 {"id": 36, "jixiong": "小凶", "yi": "宜 安门", "ji": "忌 剃头"},38 {"id": 37, "jixiong": "小吉", "yi": "宜 冠笄 盖屋", "ji": "忌 上梁"},39 {"id": 38, "jixiong": "半凶", "yi": "宜 上梁", "ji": "忌 齐醮 求嗣 分居"},40 {"id": 39, "jixiong": "末凶", "yi": "宜 上梁", "ji": "忌 齐醮 求嗣 分居"},41 {"id": 40, "jixiong": "大凶", "yi": "宜 无", "ji": "忌 诸事不宜"},42 {"id": 41, "jixiong": "半凶", "yi": "宜 起基", "ji": "忌 裁衣 出火 解除"},43 {"id": 42, "jixiong": "末凶", "yi": "宜 起基", "ji": "忌 裁衣 出火 解除"},44 {"id": 43, "jixiong": "吉", "yi": "宜 塑绘 纳采 纳婿", "ji": "忌 求医"},45 {"id": 44, "jixiong": "末凶", "yi": "宜 塑绘 纳采 纳婿", "ji": "忌 求医"},46 {"id": 45, "jixiong": "末吉", "yi": "宜 嫁娶 安门", "ji": "忌 上梁"},47 {"id": 46, "jixiong": "小吉", "yi": "宜 嫁娶 安门", "ji": "忌 上梁"},48 {"id": 47, "jixiong": "吉", "yi": "宜 出火 裁衣 剃头", "ji": "忌 开柱眼"},49 {"id": 48, "jixiong": "大凶", "yi": "宜 无", "ji": "忌 诸事不宜"},50 {"id": 49, "jixiong": "半吉", "yi": "宜 开柱眼", "ji": "忌 上梁"},51 {"id": 50, "jixiong": "凶", "yi": "宜 缉盗", "ji": "忌 栽种 围猎 作陂"},52 {"id": 51, "jixiong": "小凶", "yi": "宜 开柱眼", "ji": "忌 嫁娶 修造"},53 {"id": 52, "jixiong": "大吉", "yi": "宜 诸事皆宜", "ji": "忌 百无禁忌"},54 {"id": 53, "jixiong": "吉", "yi": "宜 出行 裁衣 结拜", "ji": "忌 起基"},55 {"id": 54, "jixiong": "小吉", "yi": "宜 冠笄", "ji": "忌 上梁"},56 {"id": 55, "jixiong": "小凶", "yi": "宜 起基", "ji": "忌 进人口"},57 {"id": 56, "jixiong": "末吉", "yi": "宜 裁衣 结拜", "ji": "忌 上梁"},58 {"id": 57, "jixiong": "末吉", "yi": "宜 冠笄", "ji": "忌 上梁"},59 {"id": 58, "jixiong": "小吉", "yi": "宜 嫁娶 缉盗", "ji": "忌 暗杀"},60 {"id": 59, "jixiong": "半吉", "yi": "宜 冠笄", "ji": "忌 上梁"},61 {"id": 60, "jixiong": "末凶", "yi": "宜 嫁娶 缉盗", "ji": "忌 暗杀"},62 {"id": 61, "jixiong": "小吉", "yi": "宜 合帐", "ji": "忌 竖柱"},63 {"id": 62, "jixiong": "半吉", "yi": "宜 嫁娶 缉盗", "ji": "忌 暗杀"},64 {"id": 63, "jixiong": "小凶", "yi": "宜 起基", "ji": "忌 剃头"},65 {"id": 64, "jixiong": "大吉", "yi": "宜 诸事皆宜", "ji": "忌 百无禁忌"},66 {"id": 65, "jixiong": "小吉", "yi": "宜 合帐 竖柱", "ji": "忌 上梁"},67 {"id": 66, "jixiong": "吉", "yi": "宜 祈福 求嗣 进人口", "ji": "忌 上梁"},68 {"id": 67, "jixiong": "半凶", "yi": "宜 安门", "ji": "忌 祭祀 出行 分居"},69 {"id": 68, "jixiong": "大凶", "yi": "宜 无", "ji": "忌 诸事不宜"},70 {"id": 69, "jixiong": "半吉", "yi": "宜 祈福 求嗣 进人口", "ji": "忌 上梁"},71 {"id": 70, "jixiong": "末凶", "yi": "宜 盖屋", "ji": "忌 塑绘 纳采 冠笄"},72 {"id": 71, "jixiong": "半凶", "yi": "宜 盖屋", "ji": "忌 塑绘 纳采 冠笄"},73 {"id": 72, "jixiong": "大吉", "yi": "宜 诸事皆宜", "ji": "忌 百无禁忌"},74 {"id": 73, "jixiong": "大凶", "yi": "宜 无", "ji": "忌 诸事不宜"},75 {"id": 74, "jixiong": "中吉", "yi": "宜 捕捉 交易 作陂 见闻", "ji": "忌 求医"},76 {"id": 75, "jixiong": "吉", "yi": "宜 祈福 祭祀 进人口", "ji": "忌 盖屋"},77 {"id": 76, "jixiong": "凶", "yi": "宜 竖柱", "ji": "忌 安床 捕捉 拆卸 扫洒"},78 {"id": 77, "jixiong": "大吉", "yi": "宜 诸事皆宜", "ji": "忌 百无禁忌"},79 {"id": 78, "jixiong": "中吉", "yi": "宜 捕捉 纳财 开井 纳畜", "ji": "忌 盖屋"},80 {"id": 79, "jixiong": "中吉", "yi": "宜 纳财 开市 见闻", "ji": "忌 暗杀"},81 {"id": 80, "jixiong": "半凶", "yi": "宜 安门", "ji": "忌 求嗣 祈福 进人口"},82 {"id": 81, "jixiong": "吉", "yi": "宜 祭祀 纳采 纳婿", "ji": "忌 修造"},83 {"id": 82, "jixiong": "小吉", "yi": "宜 解除 安门", "ji": "忌 盖屋"},84 {"id": 83, "jixiong": "半吉", "yi": "宜 解除 安门", "ji": "忌 盖屋"},85 {"id": 84, "jixiong": "大吉", "yi": "宜 诸事皆宜", "ji": "忌 百无禁忌"},86 {"id": 85, "jixiong": "中吉", "yi": "宜 栽种 交易 纳畜 畋猎", "ji": "忌 安门"},87 {"id": 86, "jixiong": "吉", "yi": "宜 齐醮 纳婿", "ji": "忌 开柱眼"},88 {"id": 87, "jixiong": "小吉", "yi": "宜 进人口 起基", "ji": "忌 安门"},89 {"id": 88, "jixiong": "半吉", "yi": "宜 进人口 起基", "ji": "忌 安门"},90 {"id": 89, "jixiong": "小吉", "yi": "宜 解除 竖柱", "ji": "忌 安门"},91 {"id": 90, "jixiong": "大凶", "yi": "宜 无", "ji": "忌 诸事不宜"},92 {"id": 91, "jixiong": "末凶", "yi": "宜 纳婿 开柱眼", "ji": "忌 竖柱"},93 {"id": 92, "jixiong": "小吉", "yi": "宜 纳婿 开柱眼", "ji": "忌 竖柱"},94 {"id": 93, "jixiong": "小凶", "yi": "宜 开柱眼", "ji": "忌 合帐"},95 {"id": 94, "jixiong": "半吉", "yi": "宜 进人口 起基", "ji": "忌 上梁"},96 {"id": 95, "jixiong": "小吉", "yi": "宜 进人口 起基", "ji": "忌 上梁"},97 {"id": 96, "jixiong": "中吉", "yi": "宜 交易 移徙 扫洒 见闻", "ji": "忌 竖柱"},98 {"id": 97, "jixiong": "大凶", "yi": "宜 无", "ji": "忌 诸事不宜"},99 {"id": 98, "jixiong": "大吉", "yi": "宜 诸事皆宜", "ji": "忌 百无禁忌"},100 {"id": 99, "jixiong": "中吉", "yi": "宜 移徙 栽种 塞穴 作陂", "ji": "忌 暗杀"},101 {"id": 100, "jixiong": "小凶", "yi": "宜 上梁", "ji": "忌 分居 求医"},102 {"id": 101, "jixiong": "半吉", "yi": "宜 上梁", "ji": "忌 分居 求医"},103 {"id": 102, "jixiong": "大吉", "yi": "宜 诸事皆宜", "ji": "忌 百无禁忌"},104 {"id": 103, "jixiong": "末吉", "yi": "宜 上梁", "ji": "忌 分居 求医"},105 {"id": 104, "jixiong": "吉", "yi": "宜 开光 裁衣 剃头", "ji": "忌 修造"},106 {"id": 105, "jixiong": "末吉", "yi": "宜 解除 起基", "ji": "忌 缉盗"},107 {"id": 106, "jixiong": "大吉", "yi": "宜 诸事皆宜", "ji": "忌 百无禁忌"},108 {"id": 107, "jixiong": "小吉", "yi": "宜 解除 起基", "ji": "忌 缉盗"},109 {"id": 108, "jixiong": "小吉", "yi": "宜 冠笄 开柱眼", "ji": "忌 盖屋"},110 {"id": 109, "jixiong": "小凶", "yi": "宜 起基", "ji": "忌 分居 缉盗"},111 {"id": 110, "jixiong": "中吉", "yi": "宜 栽种 入宅 塞穴 围猎", "ji": "忌 盖屋"},112 {"id": 111, "jixiong": "凶", "yi": "宜 起基", "ji": "忌 挂匾 安床 畋猎 畋猎"},113 {"id": 112, "jixiong": "中吉", "yi": "宜 纳财 开市 造库 开井", "ji": "忌 起基"},114 {"id": 113, "jixiong": "小吉", "yi": "宜 分居 盖屋", "ji": "忌 竖柱"},115 {"id": 114, "jixiong": "末吉", "yi": "宜 分居 盖屋", "ji": "忌 竖柱"},116 {"id": 115, "jixiong": "小凶", "yi": "宜 暗杀", "ji": "忌 沐浴 缉盗"},117 {"id": 116, "jixiong": "小吉", "yi": "宜 进人口 安门", "ji": "忌 开柱眼"},118 {"id": 117, "jixiong": "大吉", "yi": "宜 诸事皆宜", "ji": "忌 百无禁忌"},119 {"id": 118, "jixiong": "末吉", "yi": "宜 分居 盖屋", "ji": "忌 竖柱"},120 {"id": 119, "jixiong": "末凶", "yi": "宜 暗杀", "ji": "忌 沐浴 缉盗"},121 {"id": 120, "jixiong": "大吉", "yi": "宜 诸事皆宜", "ji": "忌 百无禁忌"},122 {"id": 121, "jixiong": "凶", "yi": "宜 开柱眼", "ji": "忌 酝酿 开市 围猎 扫洒"},123 {"id": 122, "jixiong": "末吉", "yi": "宜 暗杀", "ji": "忌 沐浴 缉盗"},124 {"id": 123, "jixiong": "凶", "yi": "宜 起基", "ji": "忌 开市 入宅 扫洒 拆卸"},125 {"id": 124, "jixiong": "末吉", "yi": "宜 开光 祭祀 冠笄", "ji": "忌 盖屋"},126 {"id": 125, "jixiong": "末凶", "yi": "宜 开柱眼", "ji": "忌 齐醮 求嗣 冠笄"},127 {"id": 126, "jixiong": "吉", "yi": "宜 开光 祭祀 冠笄", "ji": "忌 盖屋"},128 {"id": 127, "jixiong": "大吉", "yi": "宜 诸事皆宜", "ji": "忌 百无禁忌"},129 {"id": 128, "jixiong": "大凶", "yi": "宜 无", "ji": "忌 诸事不宜"},130 {"id": 129, "jixiong": "半吉", "yi": "宜 开光 祭祀 冠笄", "ji": "忌 盖屋"},131 {"id": 130, "jixiong": "半凶", "yi": "宜 开柱眼", "ji": "忌 齐醮 求嗣 冠笄"},132 {"id": 131, "jixiong": "吉", "yi": "宜 开光 出行 嫁娶", "ji": "忌 上梁"},133 {"id": 132, "jixiong": "末凶", "yi": "宜 分居 盖屋", "ji": "忌 竖柱"},134 {"id": 133, "jixiong": "小凶", "yi": "宜 盖屋", "ji": "忌 冠笄 安门"},135 {"id": 134, "jixiong": "小凶", "yi": "宜 盖屋", "ji": "忌 分居 安门"},136 {"id": 135, "jixiong": "末凶", "yi": "宜 盖屋", "ji": "忌 求医"},137 {"id": 136, "jixiong": "大凶", "yi": "宜 无", "ji": "忌 诸事不宜"},138 {"id": 137, "jixiong": "吉", "yi": "宜 出行 求嗣 结拜", "ji": "忌 求医"},139 {"id": 138, "jixiong": "小凶", "yi": "宜 开柱眼", "ji": "忌 结拜 修造"},140 {"id": 139, "jixiong": "末吉", "yi": "宜 开柱眼", "ji": "忌 结拜 修造"},141 {"id": 140, "jixiong": "末吉", "yi": "宜 纳婿 起基", "ji": "忌 修造"},142 {"id": 141, "jixiong": "小吉", "yi": "宜 解除", "ji": "忌 盖屋"},143 {"id": 142, "jixiong": "大吉", "yi": "宜 诸事皆宜", "ji": "忌 百无禁忌"},144 {"id": 143, "jixiong": "半吉", "yi": "宜 开柱眼", "ji": "忌 解除 竖柱"},145 {"id": 144, "jixiong": "小凶", "yi": "宜 开柱眼", "ji": "忌 解除 竖柱"},146 {"id": 145, "jixiong": "中吉", "yi": "宜 酝酿 捕捉 扫洒", "ji": "忌 开柱眼"},147 {"id": 146, "jixiong": "小吉", "yi": "宜 纳婿 起基", "ji": "忌 修造"},148 {"id": 147, "jixiong": "吉", "yi": "宜 出火 祭祀 合帐", "ji": "忌 暗杀"},149 {"id": 148, "jixiong": "吉", "yi": "宜 裁衣 出火 嫁娶", "ji": "忌 盖屋"},150 {"id": 149, "jixiong": "末吉", "yi": "宜 出火 祭祀 合帐", "ji": "忌 暗杀"},151 {"id": 150, "jixiong": "小吉", "yi": "宜 沐浴 起基", "ji": "忌 求医"},152 {"id": 151, "jixiong": "凶", "yi": "宜 求医", "ji": "忌 移徙 开市 开井 围猎"},153 {"id": 152, "jixiong": "半吉", "yi": "宜 沐浴 起基", "ji": "忌 求医"},154 {"id": 153, "jixiong": "半吉", "yi": "宜 沐浴 起基", "ji": "忌 求医"},155 {"id": 154, "jixiong": "吉", "yi": "宜 开光 出火 合帐", "ji": "忌 起基"},156 {"id": 155, "jixiong": "半吉", "yi": "宜 沐浴 起基", "ji": "忌 求医"},157 {"id": 156, "jixiong": "吉", "yi": "宜 出火 出火 沐浴", "ji": "忌 起基"},158 {"id": 157, "jixiong": "小吉", "yi": "宜 沐浴 开柱眼", "ji": "忌 竖柱"},159 {"id": 158, "jixiong": "半凶", "yi": "宜 上梁", "ji": "忌 出行 祈福 合帐"},160 {"id": 159, "jixiong": "半吉", "yi": "宜 沐浴 起基", "ji": "忌 求医"},161 {"id": 160, "jixiong": "大凶", "yi": "宜 无", "ji": "忌 诸事不宜"},162 {"id": 161, "jixiong": "小吉", "yi": "宜 剃头 安门", "ji": "忌 修造"},163 {"id": 162, "jixiong": "小吉", "yi": "宜 嫁娶 起基", "ji": "忌 竖柱"},164 {"id": 163, "jixiong": "中吉", "yi": "宜 开市 酝酿 塞穴 拆卸", "ji": "忌 上梁"},165 {"id": 164, "jixiong": "大吉", "yi": "宜 诸事皆宜", "ji": "忌 百无禁忌"},166 {"id": 165, "jixiong": "大凶", "yi": "宜 无", "ji": "忌 诸事不宜"},167 {"id": 166, "jixiong": "末凶", "yi": "宜 沐浴 起基", "ji": "忌 求医"},168 {"id": 167, "jixiong": "小凶", "yi": "宜 修造", "ji": "忌 合帐 缉盗"},169 {"id": 168, "jixiong": "末凶", "yi": "宜 沐浴 起基", "ji": "忌 求医"},170 {"id": 169, "jixiong": "小凶", "yi": "宜 盖屋", "ji": "忌 解除 缉盗"},171 {"id": 170, "jixiong": "末吉", "yi": "宜 沐浴 起基", "ji": "忌 求医"},172 {"id": 171, "jixiong": "吉", "yi": "宜 开光 齐醮 解除", "ji": "忌 上梁"},173 {"id": 172, "jixiong": "末吉", "yi": "宜 沐浴 起基", "ji": "忌 求医"},174 {"id": 173, "jixiong": "半凶", "yi": "宜 安门", "ji": "忌 塑绘 求嗣 纳婿"},175 {"id": 174, "jixiong": "末吉", "yi": "宜 沐浴 起基", "ji": "忌 求医"},176 {"id": 175, "jixiong": "小吉", "yi": "宜 纳婿 安门", "ji": "忌 开柱眼"},177 {"id": 176, "jixiong": "中吉", "yi": "宜 移徙 栽种 拆卸 见闻", "ji": "忌 起基"},178 {"id": 177, "jixiong": "吉", "yi": "宜 祭祀 齐醮 剃头", "ji": "忌 盖屋"},179 {"id": 178, "jixiong": "凶", "yi": "宜 上梁", "ji": "忌 安床 栽种 围猎 见闻"},180 {"id": 179, "jixiong": "吉", "yi": "宜 祈福 祭祀 合帐", "ji": "忌 修造"},181 {"id": 180, "jixiong": "小吉", "yi": "宜 冠笄 盖屋", "ji": "忌 竖柱"},182 {"id": 181, "jixiong": "半凶", "yi": "宜 起基", "ji": "忌 祭祀 出行 冠笄"},183 {"id": 182, "jixiong": "吉", "yi": "宜 求嗣 祭祀 结拜", "ji": "忌 竖柱"},184 {"id": 183, "jixiong": "半凶", "yi": "宜 修造", "ji": "忌 出行 出火 剃头"},185 {"id": 184, "jixiong": "小凶", "yi": "宜 暗杀", "ji": "忌 冠笄 上梁"},186 {"id": 185, "jixiong": "末吉", "yi": "宜 沐浴 起基", "ji": "忌 求医"},187 {"id": 186, "jixiong": "中吉", "yi": "宜 开市 安床 造库 见闻", "ji": "忌 求医"},188 {"id": 187, "jixiong": "大凶", "yi": "宜 无", "ji": "忌 诸事不宜"},189 {"id": 188, "jixiong": "中吉", "yi": "宜 入宅 栽种 畋猎 塞穴", "ji": "忌 求医"},190 {"id": 189, "jixiong": "小凶", "yi": "宜 求医", "ji": "忌 结拜 盖屋"},191 {"id": 190, "jixiong": "小吉", "yi": "宜 嫁娶 竖柱", "ji": "忌 求医"},192 {"id": 191, "jixiong": "末吉", "yi": "宜 嫁娶 竖柱", "ji": "忌 求医"},193 {"id": 192, "jixiong": "小凶", "yi": "宜 竖柱", "ji": "忌 冠笄 上梁"},194 {"id": 193, "jixiong": "半凶", "yi": "宜 上梁", "ji": "忌 纳采 求嗣 解除"},195 {"id": 194, "jixiong": "小吉", "yi": "宜 解除 求医", "ji": "忌 安门"},196 {"id": 195, "jixiong": "中吉", "yi": "宜 捕捉 开市 扫洒 纳畜", "ji": "忌 修造"},197 {"id": 196, "jixiong": "小吉", "yi": "宜 进人口 起基", "ji": "忌 上梁"},198 {"id": 197, "jixiong": "半吉", "yi": "宜 进人口 起基", "ji": "忌 上梁"},199 {"id": 198, "jixiong": "末吉", "yi": "宜 捕捉 开市 扫洒 纳畜", "ji": "忌 修造"},200 {"id": 199, "jixiong": "末吉", "yi": "宜 暗杀", "ji": "忌 入宅 移徙 纳畜 造库"},201 {"id": 200, "jixiong": "凶", "yi": "宜 起基", "ji": "忌 安床 交易 拆卸 围猎"},202 {"id": 201, "jixiong": "凶", "yi": "宜 暗杀", "ji": "忌 入宅 移徙 纳畜 造库"},203 {"id": 202, "jixiong": "小吉", "yi": "宜 纳婿 暗杀", "ji": "忌 求医"},204 {"id": 203, "jixiong": "凶", "yi": "宜 开柱眼", "ji": "忌 移徙 纳财 拆卸 围猎"},205 {"id": 204, "jixiong": "末凶", "yi": "宜 暗杀", "ji": "忌 入宅 移徙 纳畜 造库"},206 {"id": 205, "jixiong": "中吉", "yi": "宜 安床 栽种 拆卸 开井", "ji": "忌 暗杀"},207 {"id": 206, "jixiong": "中吉", "yi": "宜 栽种 围猎 作陂", "ji": "忌 起基"},208 {"id": 207, "jixiong": "吉", "yi": "宜 齐醮 开光 冠笄", "ji": "忌 缉盗"},209 {"id": 208, "jixiong": "小凶", "yi": "宜 开柱眼", "ji": "忌 结拜 起基"},210 {"id": 209, "jixiong": "小吉", "yi": "宜 分居 竖柱", "ji": "忌 缉盗"},211 {"id": 210, "jixiong": "凶", "yi": "宜 竖柱", "ji": "忌 安床 纳财 畋猎 扫洒"},212 {"id": 211, "jixiong": "末吉", "yi": "宜 分居 竖柱", "ji": "忌 缉盗"},213 {"id": 212, "jixiong": "凶", "yi": "宜 安门", "ji": "忌 挂匾 栽种 纳畜 畋猎"},214 {"id": 213, "jixiong": "小吉", "yi": "宜 分居 起基", "ji": "忌 上梁"},215 {"id": 214, "jixiong": "大凶", "yi": "宜 无", "ji": "忌 诸事不宜"},216 {"id": 215, "jixiong": "半吉", "yi": "宜 分居 竖柱", "ji": "忌 缉盗"},217 {"id": 216, "jixiong": "中吉", "yi": "宜 开市 入宅 扫洒 开井", "ji": "忌 盖屋"},218 {"id": 217, "jixiong": "半凶", "yi": "宜 修造", "ji": "忌 开光 剃头"},219 {"id": 218, "jixiong": "小吉", "yi": "宜 沐浴", "ji": "忌 暗杀"},220 {"id": 219, "jixiong": "吉", "yi": "宜 祈福 开光 纳婿", "ji": "忌 开柱眼"},221 {"id": 220, "jixiong": "末吉", "yi": "宜 分居 竖柱", "ji": "忌 缉盗"},222 {"id": 221, "jixiong": "小吉", "yi": "宜 沐浴 求医", "ji": "忌 盖屋"},223 {"id": 222, "jixiong": "小凶", "yi": "宜 暗杀", "ji": "忌 剃头"},224 {"id": 223, "jixiong": "半凶", "yi": "宜 盖屋", "ji": "忌 开光 齐醮 剃头"},225 {"id": 224, "jixiong": "末凶", "yi": "宜 沐浴 求医", "ji": "忌 盖屋"},226 {"id": 225, "jixiong": "大吉", "yi": "宜 诸事皆宜", "ji": "忌 百无禁忌"},227 {"id": 226, "jixiong": "大凶", "yi": "宜 无", "ji": "忌 诸事不宜"},228 {"id": 227, "jixiong": "末凶", "yi": "宜 沐浴 求医", "ji": "忌 盖屋"},229 {"id": 228, "jixiong": "末凶", "yi": "宜 沐浴 求医", "ji": "忌 盖屋"},230 {"id": 229, "jixiong": "大吉", "yi": "宜 诸事皆宜", "ji": "忌 百无禁忌"},231 {"id": 230, "jixiong": "小吉", "yi": "宜 沐浴 暗杀", "ji": "忌 起基"},232 {"id": 231, "jixiong": "小吉", "yi": "宜 纳婿 盖屋", "ji": "忌 暗杀"},233 {"id": 232, "jixiong": "凶", "yi": "宜 竖柱", "ji": "忌 纳财 开市 塞穴 拆卸"},234 {"id": 233, "jixiong": "大凶", "yi": "宜 无", "ji": "忌 诸事不宜"},235 {"id": 234, "jixiong": "中吉", "yi": "宜 挂匾 开市 扫洒 纳畜", "ji": "忌 修造"},236 {"id": 235, "jixiong": "凶", "yi": "宜 起基", "ji": "忌 交易 交易 见闻 拆卸"},237 {"id": 236, "jixiong": "末凶", "yi": "宜 沐浴 求医", "ji": "忌 盖屋"},238 {"id": 237, "jixiong": "末凶", "yi": "宜 剃头 起基", "ji": "忌 上梁"},239 {"id": 238, "jixiong": "小吉", "yi": "宜 剃头 起基", "ji": "忌 上梁"},240 {"id": 239, "jixiong": "大凶", "yi": "宜 无", "ji": "忌 诸事不宜"},241 {"id": 240, "jixiong": "大凶", "yi": "宜 无", "ji": "忌 诸事不宜"},242 {"id": 241, "jixiong": "末吉", "yi": "宜 剃头 起基", "ji": "忌 上梁"},243 {"id": 242, "jixiong": "半凶", "yi": "宜 安门", "ji": "忌 齐醮 出行 剃头"},244 {"id": 243, "jixiong": "大吉", "yi": "宜 诸事皆宜", "ji": "忌 百无禁忌"},245 {"id": 244, "jixiong": "小吉", "yi": "宜 沐浴 竖柱", "ji": "忌 起基"},246 {"id": 245, "jixiong": "小吉", "yi": "宜 解除 安门", "ji": "忌 开柱眼"},247 {"id": 246, "jixiong": "半吉", "yi": "宜 剃头 起基", "ji": "忌 上梁"},248 {"id": 247, "jixiong": "半吉", "yi": "宜 剃头 起基", "ji": "忌 上梁"},249 {"id": 248, "jixiong": "大凶", "yi": "宜 无", "ji": "忌 诸事不宜"},250 {"id": 249, "jixiong": "凶", "yi": "宜 缉盗", "ji": "忌 开市 开市 拆卸 见闻"},251 {"id": 250, "jixiong": "小凶", "yi": "宜 开柱眼", "ji": "忌 嫁娶 竖柱"},252 {"id": 251, "jixiong": "大吉", "yi": "宜 诸事皆宜", "ji": "忌 百无禁忌"},253 {"id": 252, "jixiong": "大凶", "yi": "宜 无", "ji": "忌 诸事不宜"},254 {"id": 253, "jixiong": "小吉", "yi": "宜 剃头 求医", "ji": "忌 开柱眼"},255 {"id": 254, "jixiong": "凶", "yi": "宜 求医", "ji": "忌 移徙 开市 纳畜 扫洒"},256 {"id": 255, "jixiong": "半凶", "yi": "宜 安门", "ji": "忌 齐醮 祭祀 结拜"},257 {"id": 256, "jixiong": "大凶", "yi": "宜 无", "ji": "忌 诸事不宜"},258 {"id": 257, "jixiong": "半吉", "yi": "宜 剃头 起基", "ji": "忌 上梁"},259 {"id": 258, "jixiong": "半凶", "yi": "宜 起基", "ji": "忌 出火 出火 纳婿"},260 {"id": 259, "jixiong": "小凶", "yi": "宜 上梁", "ji": "忌 嫁娶 求医"},261 {"id": 260, "jixiong": "大凶", "yi": "宜 无", "ji": "忌 诸事不宜"},262 {"id": 261, "jixiong": "小吉", "yi": "宜 结拜 求医", "ji": "忌 盖屋"},263 {"id": 262, "jixiong": "吉", "yi": "宜 祭祀 裁衣 进人口", "ji": "忌 盖屋"},264 {"id": 263, "jixiong": "小吉", "yi": "宜 进人口 修造", "ji": "忌 上梁"},265 {"id": 264, "jixiong": "小凶", "yi": "宜 缉盗", "ji": "忌 剃头 起基"},266 {"id": 265, "jixiong": "中吉", "yi": "宜 安床 开市 畋猎 作陂", "ji": "忌 竖柱"},267 {"id": 266, "jixiong": "中吉", "yi": "宜 纳财 酝酿 开井 畋猎", "ji": "忌 修造"},268 {"id": 267, "jixiong": "末吉", "yi": "宜 剃头 起基", "ji": "忌 上梁"},269 {"id": 268, "jixiong": "凶", "yi": "宜 缉盗", "ji": "忌 酝酿 捕捉 围猎 扫洒"},270 {"id": 269, "jixiong": "小凶", "yi": "宜 起基", "ji": "忌 进人口 求医"},271 {"id": 270, "jixiong": "凶", "yi": "宜 竖柱", "ji": "忌 捕捉 入宅 见闻 扫洒"},272 {"id": 271, "jixiong": "末凶", "yi": "宜 剃头 起基", "ji": "忌 上梁"},273 {"id": 272, "jixiong": "小凶", "yi": "宜 竖柱", "ji": "忌 嫁娶 修造"},274 {"id": 273, "jixiong": "半凶", "yi": "宜 修造", "ji": "忌 齐醮 纳采 合帐"},275 {"id": 274, "jixiong": "末凶", "yi": "宜 剃头 起基", "ji": "忌 上梁"},276 {"id": 275, "jixiong": "凶", "yi": "宜 上梁", "ji": "忌 移徙 酝酿 作陂 见闻"},277 {"id": 276, "jixiong": "小吉", "yi": "宜 沐浴 缉盗", "ji": "忌 求医"},278 {"id": 277, "jixiong": "半凶", "yi": "宜 暗杀", "ji": "忌 祭祀 开光 冠笄"},279 {"id": 278, "jixiong": "大吉", "yi": "宜 诸事皆宜", "ji": "忌 百无禁忌"},280 {"id": 279, "jixiong": "小吉", "yi": "宜 嫁娶 缉盗", "ji": "忌 盖屋"},281 {"id": 280, "jixiong": "小吉", "yi": "宜 嫁娶 安门", "ji": "忌 暗杀"},282 {"id": 281, "jixiong": "半吉", "yi": "宜 剃头 起基", "ji": "忌 上梁"},283 {"id": 282, "jixiong": "半吉", "yi": "宜 祈福 出火 解除", "ji": "忌 竖柱"},284 {"id": 283, "jixiong": "大吉", "yi": "宜 诸事皆宜", "ji": "忌 百无禁忌"},285 {"id": 284, "jixiong": "吉", "yi": "宜 祈福 出火 解除", "ji": "忌 竖柱"},286 {"id": 285, "jixiong": "大凶", "yi": "宜 无", "ji": "忌 诸事不宜"},287 {"id": 286, "jixiong": "小吉", "yi": "宜 嫁娶 起基", "ji": "忌 求医"},288 {"id": 287, "jixiong": "大吉", "yi": "宜 诸事皆宜", "ji": "忌 百无禁忌"},289 {"id": 288, "jixiong": "大凶", "yi": "宜 无", "ji": "忌 诸事不宜"},290 {"id": 289, "jixiong": "半凶", "yi": "宜 盖屋", "ji": "忌 塑绘 纳采 进人口"},291 {"id": 290, "jixiong": "半凶", "yi": "宜 缉盗", "ji": "忌 塑绘 求嗣 嫁娶"},292 {"id": 291, "jixiong": "半吉", "yi": "宜 祈福 出火 解除", "ji": "忌 竖柱"},293 {"id": 292, "jixiong": "末凶", "yi": "宜 挂匾 栽种", "ji": "忌 开柱眼"},294 {"id": 293, "jixiong": "大凶", "yi": "宜 无", "ji": "忌 诸事不宜"},295 {"id": 294, "jixiong": "大吉", "yi": "宜 诸事皆宜", "ji": "忌 百无禁忌"},296 {"id": 295, "jixiong": "末吉", "yi": "宜 挂匾 栽种", "ji": "忌 开柱眼"},297 {"id": 296, "jixiong": "中吉", "yi": "宜 挂匾 栽种 围猎 造库", "ji": "忌 开柱眼"},298 {"id": 297, "jixiong": "半吉", "yi": "宜 祈福 出火 解除", "ji": "忌 竖柱"},299 {"id": 298, "jixiong": "大吉", "yi": "宜 诸事皆宜", "ji": "忌 百无禁忌"},300 {"id": 299, "jixiong": "小吉", "yi": "宜 合帐", "ji": "忌 起基"},301 {"id": 300, "jixiong": "半吉", "yi": "宜 祈福 出火 解除", "ji": "忌 竖柱"},302 {"id": 301, "jixiong": "小吉", "yi": "宜 剃头 开柱眼", "ji": "忌 竖柱"},303 {"id": 302, "jixiong": "中吉", "yi": "宜 挂匾 酝酿 纳畜 造库", "ji": "忌 缉盗"},304 {"id": 303, "jixiong": "凶", "yi": "宜 安门", "ji": "忌 开市 交易 围猎 开井"},305 {"id": 304, "jixiong": "小吉", "yi": "宜 解除 安门", "ji": "忌 盖屋"},306 {"id": 305, "jixiong": "半吉", "yi": "宜 解除 安门", "ji": "忌 盖屋"},307 {"id": 306, "jixiong": "小吉", "yi": "宜 沐浴 修造", "ji": "忌 竖柱"},308 {"id": 307, "jixiong": "半吉", "yi": "宜 挂匾 栽种", "ji": "忌 开柱眼"},309 {"id": 308, "jixiong": "末凶", "yi": "宜 挂匾 栽种 围猎 造库", "ji": "忌 开柱眼"},310 {"id": 309, "jixiong": "小凶", "yi": "宜 开柱眼", "ji": "忌 合帐 起基"},311 {"id": 310, "jixiong": "小吉", "yi": "宜 嫁娶 缉盗", "ji": "忌 安门"},312 {"id": 311, "jixiong": "半凶", "yi": "宜 竖柱", "ji": "忌 出火 出行 剃头"},313 {"id": 312, "jixiong": "中吉", "yi": "宜 挂匾 入宅 作陂 见闻", "ji": "忌 盖屋"},314 {"id": 313, "jixiong": "末吉", "yi": "宜 嫁娶 缉盗", "ji": "忌 安门"},315 {"id": 314, "jixiong": "末凶", "yi": "宜 挂匾 栽种", "ji": "忌 开柱眼"},316 {"id": 315, "jixiong": "大吉", "yi": "宜 诸事皆宜", "ji": "忌 百无禁忌"},317 {"id": 316, "jixiong": "末吉", "yi": "宜 挂匾 栽种", "ji": "忌 开柱眼"},318 {"id": 317, "jixiong": "大凶", "yi": "宜 无", "ji": "忌 诸事不宜"},319 {"id": 318, "jixiong": "大吉", "yi": "宜 诸事皆宜", "ji": "忌 百无禁忌"},320 {"id": 319, "jixiong": "吉", "yi": "宜 齐醮 开光 结拜", "ji": "忌 起基"},321 {"id": 320, "jixiong": "中吉", "yi": "宜 开市 安床 开井 围猎", "ji": "忌 修造"},322 {"id": 321, "jixiong": "大凶", "yi": "宜 无", "ji": "忌 诸事不宜"},323 {"id": 322, "jixiong": "凶", "yi": "宜 缉盗", "ji": "忌 开市 纳财 塞穴 造库"},324 {"id": 323, "jixiong": "半凶", "yi": "宜 求医", "ji": "忌 纳采 出火 冠笄"},325 {"id": 324, "jixiong": "大吉", "yi": "宜 诸事皆宜", "ji": "忌 百无禁忌"},326 {"id": 325, "jixiong": "吉", "yi": "宜 祈福 祈福 结拜", "ji": "忌 竖柱"},327 {"id": 326, "jixiong": "小吉", "yi": "宜 沐浴 起基", "ji": "忌 竖柱"},328 {"id": 327, "jixiong": "中吉", "yi": "宜 捕捉 酝酿 开井 塞穴", "ji": "忌 安门"},329 {"id": 328, "jixiong": "半凶", "yi": "宜 竖柱", "ji": "忌 开光 纳采 沐浴"},330 {"id": 329, "jixiong": "中吉", "yi": "宜 移徙 交易 拆卸 见闻", "ji": "忌 起基"},331 {"id": 330, "jixiong": "吉", "yi": "宜 祈福 出火 冠笄", "ji": "忌 暗杀"},332 {"id": 331, "jixiong": "小吉", "yi": "宜 结拜 暗杀", "ji": "忌 缉盗"},333 {"id": 332, "jixiong": "小吉", "yi": "宜 结拜 盖屋", "ji": "忌 起基"},334 {"id": 333, "jixiong": "大凶", "yi": "宜 无", "ji": "忌 诸事不宜"},335 {"id": 334, "jixiong": "中吉", "yi": "宜 酝酿 捕捉 纳畜 塞穴", "ji": "忌 求医"},336 {"id": 335, "jixiong": "半吉", "yi": "宜 祈福 出火 冠笄", "ji": "忌 暗杀"},337 {"id": 336, "jixiong": "大吉", "yi": "宜 诸事皆宜", "ji": "忌 百无禁忌"},338 {"id": 337, "jixiong": "凶", "yi": "宜 开柱眼", "ji": "忌 挂匾 酝酿 拆卸 围猎"},339 {"id": 338, "jixiong": "半吉", "yi": "宜 祈福 出火 冠笄", "ji": "忌 暗杀"},340 {"id": 339, "jixiong": "半凶", "yi": "宜 盖屋", "ji": "忌 出行 分居"},341 {"id": 340, "jixiong": "大吉", "yi": "宜 诸事皆宜", "ji": "忌 百无禁忌"},342 {"id": 341, "jixiong": "末吉", "yi": "宜 祈福 出火 冠笄", "ji": "忌 暗杀"},343 {"id": 342, "jixiong": "小吉", "yi": "宜 嫁娶 求医", "ji": "忌 上梁"},344 {"id": 343, "jixiong": "凶", "yi": "宜 求医", "ji": "忌 栽种 安床 扫洒 围猎"},345 {"id": 344, "jixiong": "半凶", "yi": "宜 盖屋", "ji": "忌 裁衣 祈福 分居"},346 {"id": 345, "jixiong": "小吉", "yi": "宜 结拜", "ji": "忌 修造"},347 {"id": 346, "jixiong": "凶", "yi": "宜 开柱眼", "ji": "忌 酝酿 栽种 造库 畋猎"},348 {"id": 347, "jixiong": "半吉", "yi": "宜 盖屋", "ji": "忌 裁衣 祈福 分居"},349 {"id": 348, "jixiong": "大凶", "yi": "宜 无", "ji": "忌 诸事不宜"},350 {"id": 349, "jixiong": "小凶", "yi": "宜 缉盗", "ji": "忌 冠笄 上梁"},351 {"id": 350, "jixiong": "半凶", "yi": "宜 修造", "ji": "忌 祭祀 祈福 合帐"},352 {"id": 351, "jixiong": "半凶", "yi": "宜 求医", "ji": "忌 祭祀 纳采 进人口"},353 {"id": 352, "jixiong": "小吉", "yi": "宜 沐浴 安门", "ji": "忌 起基"},354 {"id": 353, "jixiong": "凶", "yi": "宜 盖屋", "ji": "忌 移徙 挂匾 围猎 塞穴"},355 {"id": 354, "jixiong": "凶", "yi": "宜 竖柱", "ji": "忌 酝酿 栽种 围猎 见闻"},356 {"id": 355, "jixiong": "大吉", "yi": "宜 诸事皆宜", "ji": "忌 百无禁忌"},357 {"id": 356, "jixiong": "末凶", "yi": "宜 合帐 开柱眼", "ji": "忌 求医"},358 {"id": 357, "jixiong": "大吉", "yi": "宜 诸事皆宜", "ji": "忌 百无禁忌"},359 {"id": 358, "jixiong": "小吉", "yi": "宜 合帐 开柱眼", "ji": "忌 求医"},360 {"id": 359, "jixiong": "末凶", "yi": "宜 缉盗", "ji": "忌 冠笄 上梁"},361 {"id": 360, "jixiong": "大凶", "yi": "宜 无", "ji": "忌 诸事不宜"}362];363export function jixiong(date) {364 let twoHourMilis = 1000 * 60 * 60 * 2;365 let fourHourMilis = 1000 * 60 * 60 * 4;366 // 示例时间367 // (1515072295000 / 1000 / 60 / 60 / 4) % 360 = 93.35 -> 140368 // (1516280662000 / 1000 / 60 / 60 / 4) % 360 = 177.26 -> 224369 // 求余后向下取整向后偏移48,偏移47使用数组370 let id = (Math.floor(((date.getTime() - twoHourMilis) / fourHourMilis) % 360) + 47) % 360;371 // console.log(jixiongList[id]);372 return jixiongList[id];373}374export function jixiongToColor(str) {375 switch(str) {376 case '大吉':377 return '#DC143C';378 case '中吉':379 return '#C61236';380 case '小吉':381 return '#B01030';382 case '吉':383 return '#9A0E2A';384 case '半吉':385 return '#840C24';386 case '末吉':387 return '#6E0A1E';388 case '凶':389 return '#580818';390 case '小凶':391 return '#420612';392 case '半凶':393 return '#2C040C';394 case '末凶':395 return '#160206';396 case '大凶':397 return '#000000';398 }...

Full Screen

Full Screen

svganim.js

Source:svganim.js Github

copy

Full Screen

1"use strict"2// var idw = location.search;3// let paramsw = decodeURI(idw).replace(/[^\d]/g, "");4var id = localStorage.getItem("id")5var paramsw = id;6let nextModelAnim = paramsw - 1; //目前是第几个model动画7let currenModelAnim = nextModelAnim; //上一个动画8let nextColor = ""; //目前是第几个model动画9let currenColor = nextColor; //上一个动画10var coloranim = []; //颜色动画11var modelanim = []; //模型动画12var displayanim = []; //爆炸动画13let mouseEvenTimeOut = false //按钮点击事件14let init = true // 是否为初始化15// 模型 事件 对照关系 16/*17let animationArr = [18 {19 btnName: "modelbtn1", name: "XuanHuiPoSuiJi", exploitd: false,20 val: { exploit: "XuanHuiPoSuiJi_BaoZha", exploitout: "XuanHuiPoSuiJi_BaoZha_Inout", inout: "XuanHuiPoSuiJi_inout" },21 cameraAnimNormolPosition: [ new BABYLON.Vector3(4, 1, 3.5)],22 cameraAnimExploitPosition: [ new BABYLON.Vector3(8.5, 3.8, 0)],23 cameraAnimTargetNormolPosition: [ new BABYLON.Vector3(4, 0.5, 0)],24 cameraAnimTargetExploitPosition: [ new BABYLON.Vector3(4, 1.6, 0)]25 },26 {27 btnName: "modelbtn2", name: "YuanZhuiPoSuiJi", exploitd: false,28 val: { exploit: "YuanZhuiPoSuiJi_BaoZha", exploitout: "YuanZhuiPoSuiJi_BaoZha_Inout", inout: "YuanZhuiPoSuiJi_inout" },29 cameraAnimNormolPosition: [ new BABYLON.Vector3(0, 1, 3)],30 cameraAnimExploitPosition: [ new BABYLON.Vector3(5, 2, 0)],31 cameraAnimTargetNormolPosition: [ new BABYLON.Vector3(0, 0.5, 0)],32 cameraAnimTargetExploitPosition: [ new BABYLON.Vector3(0, 1.5, 0)]33 },34 {35 btnName: "modelbtn3", name: "ZhiShaJi", exploitd: false,36 val: { exploit: "ZhiShaJi_BaoZha", exploitout: "ZhiShaJi_BaoZha_Inout", inout: "ZhiShaJi_inout" },37 cameraAnimNormolPosition: [ new BABYLON.Vector3(-4, 1, 2)],38 cameraAnimExploitPosition: [ new BABYLON.Vector3(-4, 2.5, 6.3)],39 cameraAnimTargetNormolPosition: [ new BABYLON.Vector3(-4, 0.3, 0)],40 cameraAnimTargetExploitPosition: [ new BABYLON.Vector3(-4, 2, 0)]41 }42]43*/44let animationChangeArr = [45 //first46 [47 {48 cameraAnimNormolPosition: [Math.PI/2, Math.PI/2, 3],49 cameraAnimTargetNormolPosition: [new BABYLON.Vector3(4, 0.31, 0)],50 }, {51 cameraAnimNormolPosition: [1, 1.47, 2.64],52 cameraAnimTargetNormolPosition: [new BABYLON.Vector3(4, 0.31, 0)],53 }, {54 cameraAnimNormolPosition: [-Math.PI/2, 1.47, 2.64],55 cameraAnimTargetNormolPosition: [new BABYLON.Vector3(3.13, 0.249, 0)],56 },57 {58 btnName: "modelbtn1", name: "XuanHuiPoSuiJi", exploitd: false,59 val: { exploit: "XuanHuiPoSuiJi_BaoZha", exploitout: "XuanHuiPoSuiJi_BaoZha_Inout", inout: "XuanHuiPoSuiJi_inout" },60 cameraAnimExploitPosition: [0, 1.386, 6.953],61 cameraAnimNormolPosition: [-Math.PI/2, 1.47, 2.64],62 cameraAnimTargetExploitPosition: [new BABYLON.Vector3(2.86, 1.7929, 0)],63 cameraAnimTargetNormolPosition: [new BABYLON.Vector3(3.13, 0.249, 0)]64 },65 ],66 //second67 [68 {69 cameraAnimNormolPosition: [Math.PI/2, 1.357, 2.5],70 cameraAnimTargetNormolPosition: [new BABYLON.Vector3(0, 0.38, 0)],71 },72 {73 cameraAnimNormolPosition: [2.176, 1.15135, 2.301],74 cameraAnimTargetNormolPosition: [new BABYLON.Vector3(0, 0.38, 0)],75 },76 {77 cameraAnimNormolPosition: [-0.96351, 1.303, 2.75],78 cameraAnimTargetNormolPosition: [new BABYLON.Vector3(-0.6374, 0.1744, 0)],79 },80 {81 btnName: "modelbtn2", name: "YuanZhuiPoSuiJi", exploitd: false,82 val: { exploit: "YuanZhuiPoSuiJi_BaoZha", exploitout: "YuanZhuiPoSuiJi_BaoZha_Inout", inout: "YuanZhuiPoSuiJi_inout" },83 cameraAnimNormolPosition: [-0.96351, 1.303, 2.75],84 cameraAnimExploitPosition: [0, 1.3939, 5.6],85 cameraAnimTargetNormolPosition: [new BABYLON.Vector3(-0.6374, 0.1744, 0)],86 cameraAnimTargetExploitPosition: [new BABYLON.Vector3(0, 1.5, 0)]87 },88 ],89 //third90 [91 {92 cameraAnimNormolPosition: [Math.PI/2, 1.357, 1.935],93 cameraAnimTargetNormolPosition: [new BABYLON.Vector3(-4, 0.080, 0)],94 },95 {96 cameraAnimNormolPosition: [2.176, 1.15135, 1.935],97 cameraAnimTargetNormolPosition: [new BABYLON.Vector3(-4, 0.080, 0)],98 },99 {100 cameraAnimNormolPosition: [-Math.PI/2, 1.357, 1.935],101 cameraAnimTargetNormolPosition: [new BABYLON.Vector3(-4, 0.080, 0)],102 },103 {104 btnName: "modelbtn3", name: "ZhiShaJi", exploitd: false,105 val: { exploit: "ZhiShaJi_BaoZha", exploitout: "ZhiShaJi_BaoZha_Inout", inout: "ZhiShaJi_inout" },106 cameraAnimNormolPosition: [-Math.PI/2, 1.357, 1.935],107 cameraAnimExploitPosition: [Math.PI/2, 1.4, 5.845],108 cameraAnimTargetNormolPosition: [new BABYLON.Vector3(-4, 0.080, 0)],109 cameraAnimTargetExploitPosition: [new BABYLON.Vector3(-4, 1.727, 0)]110 }111 ]112]113let animationArr = [114 {115 btnName: "modelbtn1", name: "XuanHuiPoSuiJi", exploitd: false,116 val: { exploit: "XuanHuiPoSuiJi_BaoZha", exploitout: "XuanHuiPoSuiJi_BaoZha_Inout", inout: "XuanHuiPoSuiJi_inout" },117 cameraAnimNormolPosition: [1.5, 1.42, 3],118 cameraAnimExploitPosition: [1, 2, 3],119 cameraAnimTargetNormolPosition: [new BABYLON.Vector3(4, 0.5, 0)],120 cameraAnimTargetExploitPosition: [new BABYLON.Vector3(4, 1.6, 0)]121 },122 {123 btnName: "modelbtn2", name: "YuanZhuiPoSuiJi", exploitd: false,124 val: { exploit: "YuanZhuiPoSuiJi_BaoZha", exploitout: "YuanZhuiPoSuiJi_BaoZha_Inout", inout: "YuanZhuiPoSuiJi_inout" },125 cameraAnimNormolPosition: [1.5, 1.42, 3],126 cameraAnimExploitPosition: [1, 2, 3],127 cameraAnimTargetNormolPosition: [new BABYLON.Vector3(0, 0.5, 0)],128 cameraAnimTargetExploitPosition: [new BABYLON.Vector3(0, 1.5, 0)]129 },130 {131 btnName: "modelbtn3", name: "ZhiShaJi", exploitd: false,132 val: { exploit: "ZhiShaJi_BaoZha", exploitout: "ZhiShaJi_BaoZha_Inout", inout: "ZhiShaJi_inout" },133 cameraAnimNormolPosition: [1.5, 1.42, 3],134 cameraAnimExploitPosition: [1, 2, 3],135 cameraAnimTargetNormolPosition: [new BABYLON.Vector3(-4, 0.3, 0)],136 cameraAnimTargetExploitPosition: [new BABYLON.Vector3(-4, 2, 0)]137 }138]139let colorArr = [140 { btnName: 'colorbtn1', name: 'blue', color: 'blue' },141 { btnName: 'colorbtn2', name: 'yellow', color: 'yellow' },142 { btnName: 'colorbtn3', name: 'grey', color: 'grey' }143]144// 入场动画145function animDirection(anim, val) {146 anim.setDirection(val)147 anim.setSpeed(1.2)148 anim.play()149}150// 爆炸动画151function animationStart(animationName, keys, animCamera) {152 let ag = scene.getAnimationGroupByName(animationName);153 if (keys) {154 ag.start(false, 2, ag.from, ag.to)155 let activecam1 = scene.getCameraByID("Camera")156 //console.log( "this is animCamera : ",animCamera)157 cameraArcRotateAnimate(activecam1, ...animCamera.cameraAnimTargetExploitPosition, ...animCamera.cameraAnimExploitPosition)158 // cameraPostionAnimate(activecam1,...animCamera.cameraAnimExploitPosition,...animCamera.cameraAnimTargetExploitPosition)159 }160 else {161 ag.start(false, 2, ag.to, ag.from)162 let activecam1 = scene.getCameraByID("Camera")163 //console.log( "this is animCamera2 : ",animCamera)164 cameraArcRotateAnimate(activecam1, ...animCamera.cameraAnimTargetNormolPosition, ...animCamera.cameraAnimNormolPosition)165 // cameraPostionAnimate(activecam1,...animCamera.cameraAnimNormolPosition,...animCamera.cameraAnimTargetNormolPosition)166 }167 return ag.to * (1000 / 2) + 100168}169// 退场动画170function animationInOut(animationName, keys) {171 let ag = scene.getAnimationGroupByName(animationName);172 if (keys == "in") {173 ag.start(false, 4, ag.from, ag.to)174 }175 if (keys == "out") {176 ag.start(false, 4, ag.to, ag.from)177 }178 if (keys == "exploitd") {179 ag.start(false, 4, ag.from, ag.to)180 }181 return ag.to * (1000 / 4) + 100182}183// 退场逻辑 已爆炸的执行 爆炸退场 未爆炸的执行 普通退场184function modelChange(currenModelAnim, nextModelAnim) {185 // 退场186 let timeout = 1000;187 let animIn = animationArr.filter((value, index) => { if (value.btnName == nextModelAnim) { return value } })188 let animOut = animationArr.filter((value, index) => { if (value.btnName == currenModelAnim) { return value } })189 if (animOut[0].exploitd) {190 // 已爆炸191 timeout = animationInOut(animOut[0].val.exploitout, "exploitd")192 animOut[0].exploitd = false;193 resetExploitBtn(); // 重置 爆炸按钮 194 } else {195 //未爆炸196 timeout = animationInOut(animOut[0].val.inout, "out")197 }198 let activecam1 = scene.getCameraByID("Camera")199 cameraArcRotateAnimate(activecam1, ...animIn[0].cameraAnimTargetNormolPosition, ...animIn[0].cameraAnimNormolPosition)200 // cameraPostionAnimate(activecam1,...animIn[0].cameraAnimNormolPosition,...animIn[0].cameraAnimTargetNormolPosition)201 let inTimeOut = 1000;202 inTimeOut = animationInOut(animIn[0].val.inout, "in")203 setTimeout(() => { mouseEvenTimeOut = false }, inTimeOut)204 // setTimeout(() => {205 // // resetColorBtn(); // 重置 颜色按钮206 // //入场207 // let inTimeOut = 1000;208 // inTimeOut = animationInOut(animIn[0].val.inout, "in")209 // setTimeout(() => { mouseEvenTimeOut = false }, inTimeOut)210 // }, timeout)211}212// 退场逻辑 已爆炸的执行 爆炸退场 未爆炸的执行 普通退场213function modelChangeV2(cnum,nnum,currenModelAnim, nextModelAnim) {214 // 退场215 let timeout = 1000;216 // console.log("num : ",animationChangeArr[num])217 let animIn = animationChangeArr[cnum][3]218 let animOut = animationChangeArr[nnum][3]219 console.log("animOut : ",animOut)220 console.log("animIn : ",animIn)221 if (animOut.exploitd) {222 // 已爆炸223 timeout = animationInOut(animOut.val.exploitout, "exploitd")224 animOut.exploitd = false;225 // resetExploitBtn(); // 重置 爆炸按钮 226 } else {227 //未爆炸228 timeout = animationInOut(animOut.val.inout, "out")229 }230 let activecam1 = scene.getCameraByID("Camera")231 cameraArcRotateAnimate(activecam1, ...animIn.cameraAnimTargetNormolPosition, ...animIn.cameraAnimNormolPosition)232 // cameraPostionAnimate(activecam1,...animIn[0].cameraAnimNormolPosition,...animIn[0].cameraAnimTargetNormolPosition)233 let inTimeOut = 1000;234 inTimeOut = animationInOut(animIn.val.inout, "in")235 setTimeout(() => { mouseEvenTimeOut = false }, inTimeOut)236 // setTimeout(() => {237 // // resetColorBtn(); // 重置 颜色按钮238 // //入场239 // let inTimeOut = 1000;240 // inTimeOut = animationInOut(animIn[0].val.inout, "in")241 // setTimeout(() => { mouseEvenTimeOut = false }, inTimeOut)242 // }, timeout)243}244// 爆炸按钮复位245function resetExploitBtn() {246 let direction = -1;247 animDirection(displayanim[0].anim, direction);248 displayanim[0].mouse_event = true;249}250// 颜色复位251function resetColorBtn() {252 // let direction = -1;253 // animDirection(displayanim[0].anim, direction);254 // displayanim[0].mouse_event = true;255 animfunc('colorbtn2', coloranim)256}257// 爆炸动画逻辑 258function modelExploit(name) {259 let timeout = 1000;260 let animIndex = animationArr.filter((value, index) => { if (value.btnName == name) { return value } })261 animIndex[0].exploitd = !animIndex[0].exploitd;262 timeout = animationStart(animIndex[0].val.exploit, animIndex[0].exploitd, animIndex[0])263 setTimeout(() => { mouseEvenTimeOut = false }, timeout)264}265// 第二版爆炸逻辑 266function modelExploitV2(num,name, isExploit) {267 console.log("this is name : ",name);268 let timeout = 1000;269 let animIndex = animationChangeArr[num].filter((value, index) => { if (value.btnName == name) { return value } })270 // console.log("this is animIndex : ",animIndex)271 animIndex[0].exploitd = isExploit;272 timeout = animationStart(animIndex[0].val.exploit, animIndex[0].exploitd, animIndex[0])273 setTimeout(() => { mouseEvenTimeOut = false }, timeout)274}275// 入场动画逻辑 入场的打开 其他都关闭276function animfunc(name, anims, type) {277 // if(name )278 for (let i = 0; i < anims.length; i++) {279 if (name == anims[i].name) {280 let direction = 1281 if (type == "display") {282 direction = anims[i].mouse_event ? 1 : -1;283 }284 animDirection(anims[i].anim, direction);285 anims[i].mouse_event = !anims[i].mouse_event;286 }287 else {288 let direction = -1;289 animDirection(anims[i].anim, direction);290 anims[i].mouse_event = true;291 }292 }293}294// 颜色按钮点击事件 295function onColorBtn(name) {296 if (name == 'colorbtn1') {297 materialYuanZhuiPoSuiJiBlue();298 materialXuanHuiPoSuiJiBlue();299 materialZhiShaJiBlue();300 }301 if (name == 'colorbtn2') {302 materialYuanZhuiPoSuiJiYellow();303 materialXuanHuiPoSuiJiYellow();304 materialZhiShaJiYellow();305 }306 if (name == 'colorbtn3') {307 materialYuanZhuiPoSuiJiBlack();308 materialXuanHuiPoSuiJiBlack();309 materialZhiShaJiBlack();310 }311}312function mouseup(type, name) {313 let animdata = [];314 //执行 颜色 切换时执行的动作315 if (type == "color") {316 animdata = coloranim;317 currenColor = nextColor;318 nextColor = name;319 if (currenColor !== nextColor) {320 onColorBtn(nextColor)321 }322 animfunc(name, animdata, type)323 }324 //是否被点击325 if (!mouseEvenTimeOut) {326 //点击model切换按钮时执行的动作327 if (type == "model") {328 animdata = modelanim;329 currenModelAnim = nextModelAnim;330 nextModelAnim = name;331 if (currenModelAnim !== nextModelAnim) {332 modelChange(currenModelAnim, nextModelAnim);333 // console.log("123")334 // getactivecamera()335 // animateCameraToPosition(activecam,10, 600,new BABYLON.Vector3(100, 100, 200))336 mouseEvenTimeOut = true337 }338 if (init) {339 mouseEvenTimeOut = true340 init = false341 setTimeout(() => { mouseEvenTimeOut = false }, 2000)342 }343 }344 // 点击爆炸按钮时执行的动作345 if (type == "display") {346 animdata = displayanim;347 modelExploit(nextModelAnim)348 mouseEvenTimeOut = true349 }350 animfunc(name, animdata, type)351 }352};353// svg按钮 渲染354function btnrander(type, name, path) {355 let animData = {356 wrapper: document.getElementById(name),357 animType: "svg",358 loop: false,359 prerender: true,360 autoplay: false,361 // speed:2,362 path: path363 };364 let anim = bodymovin.loadAnimation(animData);365 if (type == "color") {366 coloranim.push({ name: name, mouse_event: true, anim: anim })367 }368 if (type == "model") {369 modelanim.push({ name: name, mouse_event: true, anim: anim })370 }371 if (type == "display") {372 displayanim.push({ name: name, mouse_event: true, anim: anim })373 }374}375//材质调整 XuanHuiPoSuiJi change aoTexture376function materialXuanHuiPoSuiJiChangeAoTexture(isExploitd) {377 //材质调整378 let M_XuanHuiPoSuiJi_Steel_Black = scene.getMaterialByID("M_XuanHuiPoSuiJi_Steel_Black");379 let M_XuanHuiPoSuiJi_Screw_Steel = scene.getMaterialByID("M_XuanHuiPoSuiJi_Screw_Steel");380 let M_XuanHuiPoSuiJi_Metal_Iron = scene.getMaterialByID("M_XuanHuiPoSuiJi_Metal_Iron");381 let M_XuanHuiPoSuiJi_Paint_Main = scene.getMaterialByID("M_XuanHuiPoSuiJi_Paint_Main");382 let M_XuanHuiPoSuiJi_Metal_Iron_Crimson = scene.getMaterialByID("M_XuanHuiPoSuiJi_Metal_Iron_Crimson");383 let M_XuanHuiPoSuiJi_Metal_Iron_Gray = scene.getMaterialByID("M_XuanHuiPoSuiJi_Metal_Iron_Gray");384 let M_XuanHuiPoSuiJi_Metal_Steel_Silver = scene.getMaterialByID("M_XuanHuiPoSuiJi_Metal_Steel_Silver");385 let M_XuanHuiPoSuiJi_Logo_Normal = scene.getMaterialByID("M_XuanHuiPoSuiJi_Logo_Normal");386 let M_XuanHuiPoSuiJi_Plastic_Black = scene.getMaterialByID("M_XuanHuiPoSuiJi_Plastic_Black");387 let XuanHuiPoSuiJi_aoTexture = null;388 //爆炸后389 if (isExploitd) {390 XuanHuiPoSuiJi_aoTexture = XuanHuiPoSuiJi_aoTexture2391 // XuanHuiPoSuiJi_aoTexture = new BABYLON.Texture("model/SheBei/XuanHuiPoSuiJi_Ao.jpg", scene);392 }393 else {394 XuanHuiPoSuiJi_aoTexture = XuanHuiPoSuiJi_aoTexture1395 // XuanHuiPoSuiJi_aoTexture = new BABYLON.Texture("model/SheBei/XuanHuiPoSuiJi_Ao2.jpg", scene);396 }397 XuanHuiPoSuiJi_aoTexture.vScale = -1;398 XuanHuiPoSuiJi_aoTexture.coordinatesIndex = 1;399 // 添加ao400 M_XuanHuiPoSuiJi_Paint_Main.ambientTexture = XuanHuiPoSuiJi_aoTexture;401 M_XuanHuiPoSuiJi_Metal_Iron.ambientTexture = XuanHuiPoSuiJi_aoTexture;402 M_XuanHuiPoSuiJi_Metal_Iron_Crimson.ambientTexture = XuanHuiPoSuiJi_aoTexture;403 M_XuanHuiPoSuiJi_Metal_Iron_Gray.ambientTexture = XuanHuiPoSuiJi_aoTexture;404 M_XuanHuiPoSuiJi_Metal_Steel_Silver.ambientTexture = XuanHuiPoSuiJi_aoTexture;405 M_XuanHuiPoSuiJi_Steel_Black.ambientTexture = XuanHuiPoSuiJi_aoTexture;406 M_XuanHuiPoSuiJi_Plastic_Black.ambientTexture = XuanHuiPoSuiJi_aoTexture;407 M_XuanHuiPoSuiJi_Screw_Steel.ambientTexture = XuanHuiPoSuiJi_aoTexture;408}409//材质调整 XuanHuiPoSuiJi change aoTexture410function materialZhiShaJiChangeAoTexture(isExploitd) {411 //材质412 let M_ZhiShaJi_Metal_Iron_Black = scene.getMaterialByID("M_ZhiShaJi_Metal_Iron_Black");413 let M_ZhiShaJi_Metal_Iron_Gray = scene.getMaterialByID("M_ZhiShaJi_Metal_Iron_Gray");414 let M_ZhiShaJi_Metal_Steel_Silver = scene.getMaterialByID("M_ZhiShaJi_Metal_Steel_Silver");415 let M_ZhiShaJi_Paint_Less = scene.getMaterialByID("M_ZhiShaJi_Paint_Less");416 let M_ZhiShaJi_Paint_Main = scene.getMaterialByID("M_ZhiShaJi_Paint_Main");417 let M_ZhiShaJi_Metal_Iron_Reseda = scene.getMaterialByID("M_ZhiShaJi_Metal_Iron_Reseda");418 let ZhiShaJi_aoTexture = null;419 //爆炸后420 if (isExploitd) {421 ZhiShaJi_aoTexture =ZhiShaJi_aoTexture2422 // ZhiShaJi_aoTexture = new BABYLON.Texture("model/SheBei/ZhiShaJi_Ao.jpg", scene);423 }424 else {425 ZhiShaJi_aoTexture =ZhiShaJi_aoTexture1426 // ZhiShaJi_aoTexture = new BABYLON.Texture("model/SheBei/ZhiShaJi_Ao2.jpg", scene);427 }428 ZhiShaJi_aoTexture.vScale = -1;429 ZhiShaJi_aoTexture.coordinatesIndex = 1;430 //材质调整431 M_ZhiShaJi_Metal_Iron_Black.ambientTexture = ZhiShaJi_aoTexture;432 M_ZhiShaJi_Metal_Iron_Gray.ambientTexture = ZhiShaJi_aoTexture;433 M_ZhiShaJi_Metal_Steel_Silver.ambientTexture = ZhiShaJi_aoTexture;434 M_ZhiShaJi_Paint_Less.ambientTexture = ZhiShaJi_aoTexture;435 M_ZhiShaJi_Paint_Main.ambientTexture = ZhiShaJi_aoTexture;436 M_ZhiShaJi_Metal_Iron_Reseda.ambientTexture = ZhiShaJi_aoTexture;437}438//材质调整 XuanHuiPoSuiJi change aoTexture439function materialYuanZhuiPoSuiJiChangeAoTexture(isExploitd) {440 //材质调整441 let M_YuanZhuiPoSuiJi_Paint_Main = scene.getMaterialByID("M_YuanZhuiPoSuiJi_Paint_Main");442 let M_YuanZhuiPoSuiJi_Paint_Less = scene.getMaterialByID("M_YuanZhuiPoSuiJi_Paint_Less");443 let M_YuanZhuiPoSuiJi_Screw_Steel = scene.getMaterialByID("M_YuanZhuiPoSuiJi_Screw_Steel");444 let M_YuanZhuiPoSuiJi_Metal_Iron = scene.getMaterialByID("M_YuanZhuiPoSuiJi_Metal_Iron");445 let M_YuanZhuiPoSuiJi_Metal_Brass = scene.getMaterialByID("M_YuanZhuiPoSuiJi_Metal_Brass");446 let M_YuanZhuiPoSuiJi_Metal_Iron_Black = scene.getMaterialByID("M_YuanZhuiPoSuiJi_Metal_Iron_Black");447 let M_YuanZhuiPoSuiJi_Metal_Iron_Crimson = scene.getMaterialByID("M_YuanZhuiPoSuiJi_Metal_Iron_Crimson");448 let M_YuanZhuiPoSuiJi_Metal_Iron_Gray = scene.getMaterialByID("M_YuanZhuiPoSuiJi_Metal_Iron_Gray");449 let M_YuanZhuiPoSuiJi_Metal_Steel_Silver = scene.getMaterialByID("M_YuanZhuiPoSuiJi_Metal_Steel_Silver");450 let M_YuanZhuiPoSuiJi_Plastic_Black = scene.getMaterialByID("M_YuanZhuiPoSuiJi_Plastic_Black");451 let YuanZhuiPoSuiJi_aoTexture = null;452 if (isExploitd) {453 // YuanZhuiPoSuiJi_aoTexture=YuanZhuiPoSuiJi_aoTexture2454 YuanZhuiPoSuiJi_aoTexture2.vScale = -1;455 YuanZhuiPoSuiJi_aoTexture2.coordinatesIndex = 1;456 // 添加ao457 M_YuanZhuiPoSuiJi_Paint_Main.ambientTexture = YuanZhuiPoSuiJi_aoTexture2;458 M_YuanZhuiPoSuiJi_Paint_Less.ambientTexture = YuanZhuiPoSuiJi_aoTexture2;459 M_YuanZhuiPoSuiJi_Metal_Brass.ambientTexture = YuanZhuiPoSuiJi_aoTexture2;460 M_YuanZhuiPoSuiJi_Metal_Iron_Black.ambientTexture = YuanZhuiPoSuiJi_aoTexture2;461 M_YuanZhuiPoSuiJi_Metal_Iron_Gray.ambientTexture = YuanZhuiPoSuiJi_aoTexture2;462 M_YuanZhuiPoSuiJi_Metal_Steel_Silver.ambientTexture = YuanZhuiPoSuiJi_aoTexture2;463 M_YuanZhuiPoSuiJi_Plastic_Black.ambientTexture = YuanZhuiPoSuiJi_aoTexture2;464 M_YuanZhuiPoSuiJi_Screw_Steel.ambientTexture = YuanZhuiPoSuiJi_aoTexture2;465 M_YuanZhuiPoSuiJi_Metal_Iron.ambientTexture = YuanZhuiPoSuiJi_aoTexture2;466 M_YuanZhuiPoSuiJi_Metal_Iron_Crimson.ambientTexture = YuanZhuiPoSuiJi_aoTexture2;467 // YuanZhuiPoSuiJi_aoTexture = new BABYLON.Texture("model/SheBei/YuanZhuiPoSuiJi_Ao.jpg", scene);468 } else {469 YuanZhuiPoSuiJi_aoTexture1.vScale = -1;470 YuanZhuiPoSuiJi_aoTexture1.coordinatesIndex = 1;471 // 添加ao472 M_YuanZhuiPoSuiJi_Paint_Main.ambientTexture = YuanZhuiPoSuiJi_aoTexture1;473 M_YuanZhuiPoSuiJi_Paint_Less.ambientTexture = YuanZhuiPoSuiJi_aoTexture1;474 M_YuanZhuiPoSuiJi_Metal_Brass.ambientTexture = YuanZhuiPoSuiJi_aoTexture1;475 M_YuanZhuiPoSuiJi_Metal_Iron_Black.ambientTexture = YuanZhuiPoSuiJi_aoTexture1;476 M_YuanZhuiPoSuiJi_Metal_Iron_Gray.ambientTexture = YuanZhuiPoSuiJi_aoTexture1;477 M_YuanZhuiPoSuiJi_Metal_Steel_Silver.ambientTexture = YuanZhuiPoSuiJi_aoTexture1;478 M_YuanZhuiPoSuiJi_Plastic_Black.ambientTexture = YuanZhuiPoSuiJi_aoTexture1;479 M_YuanZhuiPoSuiJi_Screw_Steel.ambientTexture = YuanZhuiPoSuiJi_aoTexture1;480 M_YuanZhuiPoSuiJi_Metal_Iron.ambientTexture = YuanZhuiPoSuiJi_aoTexture1;481 M_YuanZhuiPoSuiJi_Metal_Iron_Crimson.ambientTexture = YuanZhuiPoSuiJi_aoTexture1;482 // YuanZhuiPoSuiJi_aoTexture=YuanZhuiPoSuiJi_aoTexture1483 // YuanZhuiPoSuiJi_aoTexture = new BABYLON.Texture("model/SheBei/YuanZhuiPoSuiJi_Ao2.jpg", scene);484 }485 486}487//材质调整 XuanHuiPoSuiJi Black488function materialXuanHuiPoSuiJiBlack() {489 let M_XuanHuiPoSuiJi_Screw_Steel = scene.getMaterialByID("M_XuanHuiPoSuiJi_Screw_Steel");490 let M_XuanHuiPoSuiJi_Paint_Main = scene.getMaterialByID("M_XuanHuiPoSuiJi_Paint_Main");491 let M_XuanHuiPoSuiJi_Logo_Normal = scene.getMaterialByID("M_XuanHuiPoSuiJi_Logo_Normal")492 M_XuanHuiPoSuiJi_Paint_Main.albedoColor = new BABYLON.Color3(0, 0, 0);493 M_XuanHuiPoSuiJi_Paint_Main.metallic = 1;494 M_XuanHuiPoSuiJi_Paint_Main.roughness = 0.35;495 M_XuanHuiPoSuiJi_Paint_Main.bumpTexture.level = 0.5;496 M_XuanHuiPoSuiJi_Screw_Steel.albedoColor = new BABYLON.Color3(0.1411764705882353, 0.09411764705882353, 0);497 M_XuanHuiPoSuiJi_Screw_Steel.roughness = 0.24;498 M_XuanHuiPoSuiJi_Logo_Normal.albedoColor = M_XuanHuiPoSuiJi_Paint_Main.albedoColor;499 M_XuanHuiPoSuiJi_Logo_Normal.metallicTexture = M_XuanHuiPoSuiJi_Paint_Main.metallicTexture;500 M_XuanHuiPoSuiJi_Logo_Normal.metallic = M_XuanHuiPoSuiJi_Paint_Main.metallic;501 M_XuanHuiPoSuiJi_Logo_Normal.roughness = M_XuanHuiPoSuiJi_Paint_Main.roughness;502 M_XuanHuiPoSuiJi_Logo_Normal.metallicF0Factor = M_XuanHuiPoSuiJi_Paint_Main.metallicF0Factor;503}504//材质调整 XuanHuiPoSuiJi Blue505function materialXuanHuiPoSuiJiBlue() {506 let M_XuanHuiPoSuiJi_Screw_Steel = scene.getMaterialByID("M_XuanHuiPoSuiJi_Screw_Steel");507 let M_XuanHuiPoSuiJi_Paint_Main = scene.getMaterialByID("M_XuanHuiPoSuiJi_Paint_Main");508 let M_XuanHuiPoSuiJi_Logo_Normal = scene.getMaterialByID("M_XuanHuiPoSuiJi_Logo_Normal")509 M_XuanHuiPoSuiJi_Paint_Main.albedoColor = new BABYLON.Color3(0.00784313725490196, 0.047058823529411764, 0.11372549019607843);510 M_XuanHuiPoSuiJi_Paint_Main.bumpTexture.level = 0.5;511 M_XuanHuiPoSuiJi_Paint_Main.metallic = 1;512 M_XuanHuiPoSuiJi_Paint_Main.roughness = 0.35;513 M_XuanHuiPoSuiJi_Screw_Steel.albedoColor = new BABYLON.Color3(0.03, 0.03, 0.03);514 M_XuanHuiPoSuiJi_Screw_Steel.roughness = 0.24;515 M_XuanHuiPoSuiJi_Logo_Normal.albedoColor = M_XuanHuiPoSuiJi_Paint_Main.albedoColor;516 M_XuanHuiPoSuiJi_Logo_Normal.metallicTexture = M_XuanHuiPoSuiJi_Paint_Main.metallicTexture;517 M_XuanHuiPoSuiJi_Logo_Normal.metallic = M_XuanHuiPoSuiJi_Paint_Main.metallic;518 M_XuanHuiPoSuiJi_Logo_Normal.roughness = M_XuanHuiPoSuiJi_Paint_Main.roughness;519 M_XuanHuiPoSuiJi_Logo_Normal.metallicF0Factor = M_XuanHuiPoSuiJi_Paint_Main.metallicF0Factor;520}521//材质调整 XuanHuiPoSuiJi Yellow522function materialXuanHuiPoSuiJiYellow() {523 let M_XuanHuiPoSuiJi_Screw_Steel = scene.getMaterialByID("M_XuanHuiPoSuiJi_Screw_Steel");524 let M_XuanHuiPoSuiJi_Paint_Main = scene.getMaterialByID("M_XuanHuiPoSuiJi_Paint_Main");525 let M_XuanHuiPoSuiJi_Logo_Normal = scene.getMaterialByID("M_XuanHuiPoSuiJi_Logo_Normal")526 M_XuanHuiPoSuiJi_Paint_Main.albedoColor = new BABYLON.Color3(0.36470588235294116, 0.18823529411764706, 0);527 M_XuanHuiPoSuiJi_Paint_Main.bumpTexture.level = 0.45;528 M_XuanHuiPoSuiJi_Paint_Main.metallic = 1;529 M_XuanHuiPoSuiJi_Paint_Main.roughness = 0.3;530 M_XuanHuiPoSuiJi_Screw_Steel.albedoColor = new BABYLON.Color3(0.03, 0.03, 0.03);531 M_XuanHuiPoSuiJi_Screw_Steel.roughness = 0.24;532 M_XuanHuiPoSuiJi_Logo_Normal.albedoColor = M_XuanHuiPoSuiJi_Paint_Main.albedoColor;533 M_XuanHuiPoSuiJi_Logo_Normal.metallicTexture = M_XuanHuiPoSuiJi_Paint_Main.metallicTexture;534 M_XuanHuiPoSuiJi_Logo_Normal.metallic = M_XuanHuiPoSuiJi_Paint_Main.metallic;535 M_XuanHuiPoSuiJi_Logo_Normal.roughness = M_XuanHuiPoSuiJi_Paint_Main.roughness;536 M_XuanHuiPoSuiJi_Logo_Normal.metallicF0Factor = M_XuanHuiPoSuiJi_Paint_Main.metallicF0Factor;537}538//材质调整 ZhiShaJi Black539function materialZhiShaJiBlack() {540 let M_ZhiShaJi_Paint_Less = scene.getMaterialByID("M_ZhiShaJi_Paint_Less");541 let M_ZhiShaJi_Paint_Main = scene.getMaterialByID("M_ZhiShaJi_Paint_Main");542 let M_ZhiShaJi_Logo_Texture = scene.getMaterialByID("M_ZhiShaJi_Logo_Texture");543 M_ZhiShaJi_Paint_Main.albedoColor = new BABYLON.Color3(0, 0, 0);544 M_ZhiShaJi_Paint_Main.metallic = 1;545 M_ZhiShaJi_Paint_Main.roughness = 0.35;546 M_ZhiShaJi_Paint_Main.bumpTexture.level = 0.5;547 M_ZhiShaJi_Paint_Less.albedoColor = new BABYLON.Color3(0.34901960784313724, 0.34901960784313724, 0.34901960784313724);548 M_ZhiShaJi_Paint_Less.metallic = 0;549 M_ZhiShaJi_Paint_Less.roughness = 0.35;550 M_ZhiShaJi_Paint_Less.metallicF0Factor = 0.62;551 M_ZhiShaJi_Paint_Less.bumpTexture.level = 0.15;552 M_ZhiShaJi_Logo_Texture.albedoColor = new BABYLON.Color3(0.4392156862745098, 0.4392156862745098, 0.4392156862745098);553 M_ZhiShaJi_Logo_Texture.roughness = 0.14;554}555//材质调整 ZhiShaJi Blue556function materialZhiShaJiBlue() {557 let M_ZhiShaJi_Paint_Less = scene.getMaterialByID("M_ZhiShaJi_Paint_Less");558 let M_ZhiShaJi_Paint_Main = scene.getMaterialByID("M_ZhiShaJi_Paint_Main");559 let M_ZhiShaJi_Logo_Texture = scene.getMaterialByID("M_ZhiShaJi_Logo_Texture");560 M_ZhiShaJi_Paint_Main.albedoColor = new BABYLON.Color3(0.00784313725490196, 0.047058823529411764, 0.11372549019607843);561 M_ZhiShaJi_Paint_Main.bumpTexture.level = 0.5;562 M_ZhiShaJi_Paint_Main.metallic = 1;563 M_ZhiShaJi_Paint_Main.roughness = 0.35;564 M_ZhiShaJi_Paint_Less.albedoColor = new BABYLON.Color3(0.09803921568627451, 0, 0);565 M_ZhiShaJi_Paint_Less.metallic = 0;566 M_ZhiShaJi_Paint_Less.roughness = 0.35;567 M_ZhiShaJi_Paint_Less.metallicF0Factor = 0.62;568 M_ZhiShaJi_Paint_Less.bumpTexture.level = 0.15;569 M_ZhiShaJi_Logo_Texture.albedoColor = new BABYLON.Color3(0.4392156862745098, 0.4392156862745098, 0.4392156862745098);570 M_ZhiShaJi_Logo_Texture.roughness = 0.14;571}572//材质调整 ZhiShaJi Yellow573function materialZhiShaJiYellow() {574 let M_ZhiShaJi_Paint_Less = scene.getMaterialByID("M_ZhiShaJi_Paint_Less");575 let M_ZhiShaJi_Paint_Main = scene.getMaterialByID("M_ZhiShaJi_Paint_Main");576 let M_ZhiShaJi_Logo_Texture = scene.getMaterialByID("M_ZhiShaJi_Logo_Texture");577 M_ZhiShaJi_Paint_Main.albedoColor = new BABYLON.Color3(0.36470588235294116, 0.18823529411764706, 0);578 M_ZhiShaJi_Paint_Main.bumpTexture.level = 0.45;579 M_ZhiShaJi_Paint_Main.metallic = 1;580 M_ZhiShaJi_Paint_Main.roughness = 0.3;581 M_ZhiShaJi_Paint_Less.albedoColor = new BABYLON.Color3(0.23921568627450981, 0.23921568627450981, 0.23921568627450981);582 M_ZhiShaJi_Paint_Less.metallic = 1;583 M_ZhiShaJi_Paint_Less.roughness = 0.05;584 M_ZhiShaJi_Paint_Less.metallicF0Factor = 0.5;585 M_ZhiShaJi_Paint_Less.bumpTexture.level = 0.15;586 M_ZhiShaJi_Logo_Texture.albedoColor = new BABYLON.Color3(0.07058823529411765, 0.07058823529411765, 0.07058823529411765);587 M_ZhiShaJi_Logo_Texture.roughness = 0;588}589//材质调整 YuanZhuiPoSuiJi Black590function materialYuanZhuiPoSuiJiBlack() {591 let M_YuanZhuiPoSuiJi_Paint_Main = scene.getMaterialByID("M_YuanZhuiPoSuiJi_Paint_Main");592 let M_YuanZhuiPoSuiJi_Logo_Texture = scene.getMaterialByID("M_YuanZhuiPoSuiJi_Logo_Texture");593 let M_YuanZhuiPoSuiJi_Metal_Steel_Silver = scene.getMaterialByID("M_YuanZhuiPoSuiJi_Metal_Steel_Silver");594 let M_YuanZhuiPoSuiJi_Paint_Less = scene.getMaterialByID("M_YuanZhuiPoSuiJi_Paint_Less");595 let M_YuanZhuiPoSuiJi_Logo_Normal = scene.getMaterialByID("M_YuanZhuiPoSuiJi_Logo_Normal");596 M_YuanZhuiPoSuiJi_Paint_Main.albedoColor = new BABYLON.Color3(0, 0, 0);597 M_YuanZhuiPoSuiJi_Paint_Main.metallic = 1;598 M_YuanZhuiPoSuiJi_Paint_Main.roughness = 0.35;599 M_YuanZhuiPoSuiJi_Paint_Main.bumpTexture.level = 0.5;600 M_YuanZhuiPoSuiJi_Metal_Steel_Silver.albedoColor = new BABYLON.Color3(0.41568627450980394, 0.28627450980392155, 0.00392156862745098);601 M_YuanZhuiPoSuiJi_Metal_Steel_Silver.roughness = 0.26;602 M_YuanZhuiPoSuiJi_Paint_Less.albedoColor = new BABYLON.Color3(0.16862745098039217, 0.16862745098039217, 0.16862745098039217);603 M_YuanZhuiPoSuiJi_Paint_Less.metallic = 1;604 M_YuanZhuiPoSuiJi_Paint_Less.roughness = 0.23;605 M_YuanZhuiPoSuiJi_Paint_Less.metallicF0Factor = 0.5;606 // M_YuanZhuiPoSuiJi_Paint_Less.bumpTexture.level = 0.15;607 M_YuanZhuiPoSuiJi_Metal_Steel_Silver.albedoColor = new BABYLON.Color3(0.2196078431372549, 0.16470588235294117, 0.0392156862745098);608 M_YuanZhuiPoSuiJi_Metal_Steel_Silver.metallic = 1;609 M_YuanZhuiPoSuiJi_Metal_Steel_Silver.roughness = 0.21;610 M_YuanZhuiPoSuiJi_Logo_Normal.albedoColor = M_YuanZhuiPoSuiJi_Paint_Main.albedoColor;611 M_YuanZhuiPoSuiJi_Logo_Normal.metallicTexture = M_YuanZhuiPoSuiJi_Paint_Main.metallicTexture;612 M_YuanZhuiPoSuiJi_Logo_Normal.metallic = M_YuanZhuiPoSuiJi_Paint_Main.metallic;613 M_YuanZhuiPoSuiJi_Logo_Normal.roughness = M_YuanZhuiPoSuiJi_Paint_Main.roughness;614 M_YuanZhuiPoSuiJi_Logo_Normal.metallicF0Factor = M_YuanZhuiPoSuiJi_Paint_Main.metallicF0Factor;615}616//材质调整 YuanZhuiPoSuiJi Blue617function materialYuanZhuiPoSuiJiBlue() {618 let M_YuanZhuiPoSuiJi_Paint_Main = scene.getMaterialByID("M_YuanZhuiPoSuiJi_Paint_Main");619 let M_YuanZhuiPoSuiJi_Logo_Texture = scene.getMaterialByID("M_YuanZhuiPoSuiJi_Logo_Texture");620 let M_YuanZhuiPoSuiJi_Metal_Steel_Silver = scene.getMaterialByID("M_YuanZhuiPoSuiJi_Metal_Steel_Silver");621 let M_YuanZhuiPoSuiJi_Paint_Less = scene.getMaterialByID("M_YuanZhuiPoSuiJi_Paint_Less");622 let M_YuanZhuiPoSuiJi_Logo_Normal = scene.getMaterialByID("M_YuanZhuiPoSuiJi_Logo_Normal");623 M_YuanZhuiPoSuiJi_Paint_Main.albedoColor = new BABYLON.Color3(0.00784313725490196, 0.047058823529411764, 0.11372549019607843);624 M_YuanZhuiPoSuiJi_Paint_Main.bumpTexture.level = 0.5;625 M_YuanZhuiPoSuiJi_Paint_Main.metallic = 1;626 M_YuanZhuiPoSuiJi_Paint_Main.roughness = 0.35;627 M_YuanZhuiPoSuiJi_Metal_Steel_Silver.albedoColor = new BABYLON.Color3(0.2, 0.2, 0.2);628 M_YuanZhuiPoSuiJi_Metal_Steel_Silver.metallic = 1;629 M_YuanZhuiPoSuiJi_Metal_Steel_Silver.roughness = 0.21;630 M_YuanZhuiPoSuiJi_Paint_Less.albedoColor = new BABYLON.Color3(0.09803921568627451, 0, 0);631 M_YuanZhuiPoSuiJi_Paint_Less.metallic = 0;632 M_YuanZhuiPoSuiJi_Paint_Less.roughness = 0.35;633 M_YuanZhuiPoSuiJi_Paint_Less.metallicF0Factor = 0.62;634 // M_YuanZhuiPoSuiJi_Paint_Less.bumpTexture.level = 0.15;635 M_YuanZhuiPoSuiJi_Logo_Texture.albedoColor = new BABYLON.Color3(0.4392156862745098, 0.4392156862745098, 0.4392156862745098);636 M_YuanZhuiPoSuiJi_Logo_Texture.roughness = 0.14;637 M_YuanZhuiPoSuiJi_Logo_Normal.albedoColor = M_YuanZhuiPoSuiJi_Paint_Main.albedoColor;638 M_YuanZhuiPoSuiJi_Logo_Normal.metallicTexture = M_YuanZhuiPoSuiJi_Paint_Main.metallicTexture;639 M_YuanZhuiPoSuiJi_Logo_Normal.metallic = M_YuanZhuiPoSuiJi_Paint_Main.metallic;640 M_YuanZhuiPoSuiJi_Logo_Normal.roughness = M_YuanZhuiPoSuiJi_Paint_Main.roughness;641 M_YuanZhuiPoSuiJi_Logo_Normal.metallicF0Factor = M_YuanZhuiPoSuiJi_Paint_Main.metallicF0Factor;642}643//材质调整 YuanZhuiPoSuiJi Yellow644function materialYuanZhuiPoSuiJiYellow() {645 let M_YuanZhuiPoSuiJi_Paint_Main = scene.getMaterialByID("M_YuanZhuiPoSuiJi_Paint_Main");646 let M_YuanZhuiPoSuiJi_Logo_Texture = scene.getMaterialByID("M_YuanZhuiPoSuiJi_Logo_Texture");647 let M_YuanZhuiPoSuiJi_Metal_Steel_Silver = scene.getMaterialByID("M_YuanZhuiPoSuiJi_Metal_Steel_Silver");648 let M_YuanZhuiPoSuiJi_Paint_Less = scene.getMaterialByID("M_YuanZhuiPoSuiJi_Paint_Less");649 let M_YuanZhuiPoSuiJi_Logo_Normal = scene.getMaterialByID("M_YuanZhuiPoSuiJi_Logo_Normal");650 M_YuanZhuiPoSuiJi_Paint_Main.albedoColor = new BABYLON.Color3(0.36470588235294116, 0.18823529411764706, 0);651 M_YuanZhuiPoSuiJi_Paint_Main.bumpTexture.level = 0.45;652 M_YuanZhuiPoSuiJi_Paint_Main.metallic = 1;653 M_YuanZhuiPoSuiJi_Paint_Main.roughness = 0.35;654 M_YuanZhuiPoSuiJi_Metal_Steel_Silver.albedoColor = new BABYLON.Color3(0.2, 0.2, 0.2);655 M_YuanZhuiPoSuiJi_Metal_Steel_Silver.metallic = 1;656 M_YuanZhuiPoSuiJi_Metal_Steel_Silver.roughness = 0.21;657 M_YuanZhuiPoSuiJi_Paint_Less.albedoColor = new BABYLON.Color3(0.16862745098039217, 0.16862745098039217, 0.16862745098039217);658 M_YuanZhuiPoSuiJi_Paint_Less.metallic = 1;659 M_YuanZhuiPoSuiJi_Paint_Less.roughness = 0.23;660 M_YuanZhuiPoSuiJi_Paint_Less.metallicF0Factor = 0.5;661 // M_YuanZhuiPoSuiJi_Paint_Less.bumpTexture.level = 0.15;662 M_YuanZhuiPoSuiJi_Logo_Texture.albedoColor = new BABYLON.Color3(0.07058823529411765, 0.07058823529411765, 0.07058823529411765);663 M_YuanZhuiPoSuiJi_Logo_Texture.roughness = 0.5;664 M_YuanZhuiPoSuiJi_Logo_Normal.albedoColor = M_YuanZhuiPoSuiJi_Paint_Main.albedoColor;665 M_YuanZhuiPoSuiJi_Logo_Normal.metallicTexture = M_YuanZhuiPoSuiJi_Paint_Main.metallicTexture;666 M_YuanZhuiPoSuiJi_Logo_Normal.metallic = M_YuanZhuiPoSuiJi_Paint_Main.metallic;667 M_YuanZhuiPoSuiJi_Logo_Normal.roughness = M_YuanZhuiPoSuiJi_Paint_Main.roughness;668 M_YuanZhuiPoSuiJi_Logo_Normal.metallicF0Factor = M_YuanZhuiPoSuiJi_Paint_Main.metallicF0Factor;669}670function initscene() {671 // btnrander('model', 'modelbtn1', './animation/datam1.json');672 // btnrander('model', 'modelbtn2', './animation/datam2.json');673 // btnrander('model', 'modelbtn3', './animation/datam3.json');674 btnrander('color', 'colorbtn1', './animation/datac1.json');675 btnrander('color', 'colorbtn2', './animation/datac2.json');676 btnrander('color', 'colorbtn3', './animation/datac3.json');677 btnrander('display', 'displaybtn1', './animation/dataplus2.json');678 id = localStorage.getItem("id")679 // id = "1"680 paramsw = id;681 console.log(paramsw);682 let modelname = "modelbtn" + paramsw;683 // let colorname ="colorbtn" + paramsw684 nextModelAnim = modelname;685 currenModelAnim = nextModelAnim;686 nextColor = 'colorbtn2';687 currenColor = nextColor;688 mouseup('model', modelname);689 mouseup('color', 'colorbtn2');690 // setTimeout( ()=> {691 initCamera();692 initAnim(nextModelAnim);693 // loadPic();694 initHotSpot()695 // hotSpot();696 // },1000)697 // setTimeout(()=>{mouseEvenTimeOut = false},2000)698}699function initCamera() {700 // let animName = "camera_in";701 // getactivecamera() //获取相机702 let animIn = animationArr.filter((value, index) => { if (value.btnName == nextModelAnim) { return value } })703 let activecam1 = scene.getCameraByID("Camera")704 cameraArcRotateAnimate(activecam1, ...animIn[0].cameraAnimTargetNormolPosition, ...animIn[0].cameraAnimNormolPosition)705 // cameraPostionAnimate(activecam1,...animIn[0].cameraAnimNormolPosition,...animIn[0].cameraAnimTargetNormolPosition)706 // setTimeout(function () {707 // let ag = scene.getAnimationGroupByName(animName);708 // ag.start(false, 1, ag.from, ag.to)709 // }, 2000);710}711function initAnim(nextModelAnim) {712 // let inTimeOut = 1000;713 let animIn = animationArr.filter((value, index) => { if (value.btnName == nextModelAnim) { return value } })714 animationInOut(animIn[0].val.inout, "in")715 // inTimeOut = animationInOut(animIn[0].val.inout, "in")716 // setTimeout(() => { mouseEvenTimeOut = false }, inTimeOut)717}718// window.onload = function () {719// setTimeout(() => {720// initscene()721// }, 500)...

Full Screen

Full Screen

main.js

Source:main.js Github

copy

Full Screen

1/// <reference path="babylon.d.ts" />2var canvas = document.getElementById("renderCanvas"); // Get the canvas element3var engine = new BABYLON.Engine(canvas, true, null, true);4let XuanHuiPoSuiJi_aoTexture1 =null;5let XuanHuiPoSuiJi_aoTexture2 =null;6let ZhiShaJi_aoTexture1 = null;7let ZhiShaJi_aoTexture2 = null;8let YuanZhuiPoSuiJi_aoTexture1 = null;9let YuanZhuiPoSuiJi_aoTexture2 = null;10//debug快捷键 shift+alt+d11function togglerDebugLayer() {12 var scene = engine.scenes[0];13 if (scene.debugLayer.isVisible()) {14 scene.debugLayer.hide();15 }16 else {17 scene.debugLayer.show({18 overlay: true,//覆盖模式打开19 });20 }21}22document.addEventListener("keydown", function (event) {23 if (event.altKey && event.shiftKey && event.keyCode === 68) {24 togglerDebugLayer();25 }26});27function MyLoadingScreen() {28}29MyLoadingScreen.prototype.displayLoadingUI = function () {30};31MyLoadingScreen.prototype.hideLoadingUI = function () {32 document.getElementById("loadingScreen_Container").style.opacity = "0";33 document.getElementById("loadingScreen_Container").style.visibility = "hidden";34};35var onFoucus;36/******* Add the create scene function ******/37var createScene = function () {38 var scene = new BABYLON.Scene(engine);39 scene.clearColor = new BABYLON.Color4(0, 0, 0, 0);40 // 在引擎里设置画面取代默认的加载画面41 var loadingScreen = new MyLoadingScreen();42 engine.loadingScreen = loadingScreen;43 scene.imageProcessingConfiguration.exposure = 3.4;44 scene.imageProcessingConfiguration.contrast = 1.9;45 scene.imageProcessingConfiguration.toneMappingEnabled = true;46 scene.imageProcessingConfiguration.toneMappingType = 1;47 scene.fogMode = 2;48 scene.fogColor = new BABYLON.Color3(0.1450980392156863, 0.2, 0.24313725490196078);49 scene.fogDensity = 0.065;50 //camera51 var camera = new BABYLON.ArcRotateCamera("Camera", Math.PI / 2, Math.PI / 2, 2, new BABYLON.Vector3(0, 0.53, 0), scene);52 camera.attachControl(canvas, true);53 camera.minZ = 0.1;54 camera.maxZ = 10000;55 // camera.upperBetaLimit = 1.5;56 camera.lowerRadiusLimit = 1.3;57 camera.upperRadiusLimit = 7;58 //相机惯性59 camera.angularSensibilityX = 2000;60 camera.angularSensibilityY = 2000;61 camera.panningSensibility = 2000;62 camera.wheelDeltaPercentage = 0.008;63 camera.pinchDeltaPercentage = 0.0005;64 //自动旋转相机65 // camera.useAutoRotationBehavior = true;66 // Environment Texture67 var hdrTexture = BABYLON.CubeTexture.CreateFromPrefilteredData("textures/environment_cube_specular.env", scene);68 scene.createDefaultSkybox(hdrTexture, true);69 scene.getMeshByID("hdrSkyBox").setEnabled(false);70 // hdrTexture.level = 2;71 // light172 var light = new BABYLON.DirectionalLight("light", new BABYLON.Vector3(-1, -2, -1), scene);73 light.position = new BABYLON.Vector3(-0.5955874093676108, 1.463424720556741, 0.7257959743088755);74 light.direction = new BABYLON.Vector3(0.38741777155154383, -0.751732878412204, -0.533671387466237);75 light.diffuse = new BABYLON.Color3(1, 0.7607843137254902, 0.6);76 light.intensity = 0.7;77 light.shadowEnabled = true;78 light.shadowMinZ = 0.001;79 light.shadowMaxZ = 30;80 //透明阴影81 let ground = BABYLON.Mesh.CreatePlane('ground1', 1000, scene);82 ground.rotation.x = Math.PI / 2;83 ground.material = new BABYLON.ShadowOnlyMaterial('shadowGround', scene);84 ground.material.shadowColor = new BABYLON.Color3(1, 1, 1);85 ground.receiveShadows = true;86 let shadowGenerator = new BABYLON.ShadowGenerator(1024, light);87 shadowGenerator.useBlurExponentialShadowMap = true;88 shadowGenerator.blurScale = 2;89 shadowGenerator.blurBoxOffset = 1;90 shadowGenerator.setDarkness(0.2);91 shadowGenerator.usePoissonSampling = true;92 shadowGenerator.filter = 3;93 shadowGenerator.filteringQuality = 2;94 shadowGenerator.bias = 0;95 shadowGenerator.contactHardeningLightSizeUVRatio = 1;96 shadowGenerator.darkness = 0.74;97 shadowGenerator.normalBias = 0;98 scene.getMaterialByID("shadowGround").alphaMode = 4;99 let SpecularTexture = new BABYLON.Texture("model/SheBei/Specular.jpg", scene);100 let Logo_Alpha_Ao = new BABYLON.Texture("model/SheBei/Logo_Alpha_Ao.png", scene);101 Logo_Alpha_Ao.vScale = -1;102 let Logo_NormalTexture = new BABYLON.Texture('model/SheBei/Logo_Normal.jpg')103 Logo_NormalTexture.vScale = -1;104 Logo_NormalTexture.level = 0.23;105 let NormalTexture = new BABYLON.Texture("model/SheBei/Normal.jpg", scene);106 NormalTexture.level = 0.45;107 NormalTexture.uScale = 30;108 NormalTexture.vScale = 30;109 let Logo_Texture = new BABYLON.Texture("model/SheBei/ShenYangShunDa_alpha_ShenYangShunDa.png");110 Logo_Texture.vScale = -1;111 BABYLON.SceneLoader.Append("model/SheBei/", "XuanHuiPoSuiJi.gltf", scene, function (meshes) {112 scene.getTransformNodeByID("XuanHuiPoSuiJi_G").position = new BABYLON.Vector3(-4, 0, 0);113 XuanHuiPoSuiJi_aoTexture1 = new BABYLON.Texture("model/SheBei/XuanHuiPoSuiJi_Ao2.jpg", scene);114 XuanHuiPoSuiJi_aoTexture1.vScale = -1;115 XuanHuiPoSuiJi_aoTexture1.coordinatesIndex = 1;116 XuanHuiPoSuiJi_aoTexture2 = new BABYLON.Texture("model/SheBei/XuanHuiPoSuiJi_Ao.jpg", scene);117 XuanHuiPoSuiJi_aoTexture2.vScale = -1;118 XuanHuiPoSuiJi_aoTexture2.coordinatesIndex = 1;119 //材质调整120 let M_XuanHuiPoSuiJi_Steel_Black = scene.getMaterialByID("M_XuanHuiPoSuiJi_Steel_Black");121 let M_XuanHuiPoSuiJi_Screw_Steel = scene.getMaterialByID("M_XuanHuiPoSuiJi_Screw_Steel");122 let M_XuanHuiPoSuiJi_Metal_Iron = scene.getMaterialByID("M_XuanHuiPoSuiJi_Metal_Iron");123 let M_XuanHuiPoSuiJi_Paint_Main = scene.getMaterialByID("M_XuanHuiPoSuiJi_Paint_Main");124 let M_XuanHuiPoSuiJi_Metal_Iron_Crimson = scene.getMaterialByID("M_XuanHuiPoSuiJi_Metal_Iron_Crimson");125 let M_XuanHuiPoSuiJi_Metal_Iron_Gray = scene.getMaterialByID("M_XuanHuiPoSuiJi_Metal_Iron_Gray");126 let M_XuanHuiPoSuiJi_Metal_Steel_Silver = scene.getMaterialByID("M_XuanHuiPoSuiJi_Metal_Steel_Silver");127 let M_XuanHuiPoSuiJi_Logo_Normal = scene.getMaterialByID("M_XuanHuiPoSuiJi_Logo_Normal");128 let M_XuanHuiPoSuiJi_Plastic_Black = scene.getMaterialByID("M_XuanHuiPoSuiJi_Plastic_Black");129 // 添加ao130 M_XuanHuiPoSuiJi_Paint_Main.ambientTexture = XuanHuiPoSuiJi_aoTexture1;131 M_XuanHuiPoSuiJi_Metal_Iron.ambientTexture = XuanHuiPoSuiJi_aoTexture1;132 M_XuanHuiPoSuiJi_Metal_Iron_Crimson.ambientTexture = XuanHuiPoSuiJi_aoTexture1;133 M_XuanHuiPoSuiJi_Metal_Iron_Gray.ambientTexture = XuanHuiPoSuiJi_aoTexture1;134 M_XuanHuiPoSuiJi_Metal_Steel_Silver.ambientTexture = XuanHuiPoSuiJi_aoTexture1;135 M_XuanHuiPoSuiJi_Steel_Black.ambientTexture = XuanHuiPoSuiJi_aoTexture1;136 M_XuanHuiPoSuiJi_Plastic_Black.ambientTexture = XuanHuiPoSuiJi_aoTexture1;137 M_XuanHuiPoSuiJi_Screw_Steel.ambientTexture = XuanHuiPoSuiJi_aoTexture1;138 M_XuanHuiPoSuiJi_Logo_Normal.ambientTexture = Logo_Alpha_Ao;139 M_XuanHuiPoSuiJi_Paint_Main.albedoColor = new BABYLON.Color3(0.36470588235294116, 0.18823529411764706, 0);140 M_XuanHuiPoSuiJi_Paint_Main.bumpTexture = NormalTexture;141 M_XuanHuiPoSuiJi_Paint_Main.metallicTexture = SpecularTexture;142 M_XuanHuiPoSuiJi_Paint_Main.metallic = 1;143 M_XuanHuiPoSuiJi_Paint_Main.roughness = 0.3;144 M_XuanHuiPoSuiJi_Paint_Main.metallicF0Factor = 0.6;145 M_XuanHuiPoSuiJi_Metal_Iron.metallicTexture = new BABYLON.Texture("model/SheBei/Metal_Plate.jpg", scene);146 M_XuanHuiPoSuiJi_Metal_Iron.metallic = 1;147 M_XuanHuiPoSuiJi_Metal_Iron.roughness = 0.1;148 M_XuanHuiPoSuiJi_Metal_Iron.albedoColor = new BABYLON.Color3(0.18823529411764706, 0.18823529411764706, 0.18823529411764706);149 M_XuanHuiPoSuiJi_Metal_Iron_Crimson.metallic = 0;150 M_XuanHuiPoSuiJi_Metal_Iron_Crimson.roughness = 0.4;151 M_XuanHuiPoSuiJi_Metal_Steel_Silver.albedoColor = new BABYLON.Color3(0.30980392156862746, 0.30980392156862746, 0.30980392156862746);152 M_XuanHuiPoSuiJi_Metal_Steel_Silver.metallic = 1;153 M_XuanHuiPoSuiJi_Metal_Steel_Silver.roughness = 0.1;154 M_XuanHuiPoSuiJi_Logo_Normal.albedoColor = M_XuanHuiPoSuiJi_Paint_Main.albedoColor;155 M_XuanHuiPoSuiJi_Logo_Normal.opacityTexture = Logo_Alpha_Ao;156 M_XuanHuiPoSuiJi_Logo_Normal.bumpTexture = Logo_NormalTexture;157 M_XuanHuiPoSuiJi_Logo_Normal.transparencyMode = 3;158 M_XuanHuiPoSuiJi_Logo_Normal.metallicTexture = M_XuanHuiPoSuiJi_Paint_Main.metallicTexture;159 M_XuanHuiPoSuiJi_Logo_Normal.metallic = M_XuanHuiPoSuiJi_Paint_Main.metallic;160 M_XuanHuiPoSuiJi_Logo_Normal.roughness = M_XuanHuiPoSuiJi_Paint_Main.roughness;161 M_XuanHuiPoSuiJi_Logo_Normal.metallicF0Factor = M_XuanHuiPoSuiJi_Paint_Main.metallicF0Factor;162 M_XuanHuiPoSuiJi_Metal_Iron_Crimson.albedoColor = new BABYLON.Color3(0.1333333, 0.027450980, 0.0274509);163 M_XuanHuiPoSuiJi_Metal_Iron_Crimson.bumpTexture = NormalTexture;164 M_XuanHuiPoSuiJi_Steel_Black.albedoColor = new BABYLON.Color3(0, 0, 0);165 M_XuanHuiPoSuiJi_Steel_Black.metallic = 1;166 M_XuanHuiPoSuiJi_Steel_Black.roughness = 0.24;167 M_XuanHuiPoSuiJi_Screw_Steel.albedoColor = new BABYLON.Color3(0.03, 0.03, 0.03);168 M_XuanHuiPoSuiJi_Screw_Steel.metallic = 1;169 M_XuanHuiPoSuiJi_Screw_Steel.roughness = 0.24;170 M_XuanHuiPoSuiJi_Metal_Iron_Gray.albedoColor = M_XuanHuiPoSuiJi_Screw_Steel.albedoColor171 M_XuanHuiPoSuiJi_Metal_Iron_Gray.metallic = M_XuanHuiPoSuiJi_Screw_Steel.metallic;172 M_XuanHuiPoSuiJi_Metal_Iron_Gray.roughness = M_XuanHuiPoSuiJi_Screw_Steel.roughness;173 M_XuanHuiPoSuiJi_Plastic_Black.albedoColor = new BABYLON.Color3(0.0196078431372549, 0.0196078431372549, 0.0196078431372549);174 M_XuanHuiPoSuiJi_Plastic_Black.roughness = 1;175 //创建只接受阴影的材质176 shadowGenerator.getShadowMap().renderList.push(scene.getMeshByID("XuanHuiPoSuiJi_primitive2"));177 shadowGenerator.getShadowMap().renderList.push(scene.getMeshByID("XuanHuiPoSuiJi_Module_2_primitive1"));178 shadowGenerator.getShadowMap().renderList.push(scene.getMeshByID("XuanHuiPoSuiJi_Module_2_primitive0"));179 shadowGenerator.getShadowMap().renderList.push(scene.getMeshByID("XuanHuiPoSuiJi_Module_3_primitive0"));180 shadowGenerator.getShadowMap().renderList.push(scene.getMeshByID("XuanHuiPoSuiJi_Module_3_primitive1"));181 shadowGenerator.getShadowMap().renderList.push(scene.getMeshByID("XuanHuiPoSuiJi_Module_4_primitive0"));182 shadowGenerator.getShadowMap().renderList.push(scene.getMeshByID("XuanHuiPoSuiJi_Module_5_primitive1"));183 shadowGenerator.getShadowMap().renderList.push(scene.getMeshByID("XuanHuiPoSuiJi_Module_5_primitive3"));184 let ag = scene.getAnimationGroupByName('XuanHuiPoSuiJi_BaoZha');185 ag.stop();186 console.log("ag")187 });188 BABYLON.SceneLoader.Append("model/SheBei/", "ZhiShaJi.gltf", scene, function (meshes) {189 scene.getTransformNodeByID("ZhiShaJi_G").position = new BABYLON.Vector3(4, 0, 0);190 ZhiShaJi_aoTexture1 = new BABYLON.Texture("model/SheBei/ZhiShaJi_Ao2.jpg", scene);191 ZhiShaJi_aoTexture1.vScale1 = -1;192 ZhiShaJi_aoTexture1.coordinatesIndex1 = 1;193 ZhiShaJi_aoTexture2 = new BABYLON.Texture("model/SheBei/ZhiShaJi_Ao.jpg", scene);194 // ZhiShaJi_aoTexture.vScale1 = -1;195 // ZhiShaJi_aoTexture.coordinatesIndex1 = 1;196 //材质197 let M_ZhiShaJi_Logo_Texture = scene.getMaterialByID("M_ZhiShaJi_Logo_Texture");198 let M_ZhiShaJi_Metal_Iron_Black = scene.getMaterialByID("M_ZhiShaJi_Metal_Iron_Black");199 let M_ZhiShaJi_Metal_Iron_Gray = scene.getMaterialByID("M_ZhiShaJi_Metal_Iron_Gray");200 let M_ZhiShaJi_Metal_Steel_Silver = scene.getMaterialByID("M_ZhiShaJi_Metal_Steel_Silver");201 let M_ZhiShaJi_Paint_Less = scene.getMaterialByID("M_ZhiShaJi_Paint_Less");202 let M_ZhiShaJi_Paint_Main = scene.getMaterialByID("M_ZhiShaJi_Paint_Main");203 let M_ZhiShaJi_Metal_Iron_Reseda = scene.getMaterialByID("M_ZhiShaJi_Metal_Iron_Reseda");204 //材质调整205 M_ZhiShaJi_Metal_Iron_Black.ambientTexture = ZhiShaJi_aoTexture1;206 M_ZhiShaJi_Metal_Iron_Gray.ambientTexture = ZhiShaJi_aoTexture1;207 M_ZhiShaJi_Metal_Steel_Silver.ambientTexture = ZhiShaJi_aoTexture1;208 M_ZhiShaJi_Paint_Less.ambientTexture = ZhiShaJi_aoTexture1;209 M_ZhiShaJi_Paint_Main.ambientTexture = ZhiShaJi_aoTexture1;210 M_ZhiShaJi_Metal_Iron_Reseda.ambientTexture = ZhiShaJi_aoTexture1;211 M_ZhiShaJi_Logo_Texture.albedoColor = new BABYLON.Color3(0.07058823529411765, 0.07058823529411765, 0.07058823529411765);212 M_ZhiShaJi_Logo_Texture.opacityTexture = Logo_Texture;213 M_ZhiShaJi_Logo_Texture.transparencyMode = 3;214 M_ZhiShaJi_Logo_Texture.metallic = 1;215 M_ZhiShaJi_Logo_Texture.roughness = 0;216 M_ZhiShaJi_Metal_Iron_Reseda.albedoColor = new BABYLON.Color3(0.0784313725490196, 0.1411764705882353, 0.13333333333333333);217 M_ZhiShaJi_Metal_Iron_Reseda.roughness = 0.44;218 M_ZhiShaJi_Metal_Iron_Reseda.metallic = 1;219 M_ZhiShaJi_Paint_Main.albedoColor = new BABYLON.Color3(0.36470588235294116, 0.18823529411764706, 0);220 M_ZhiShaJi_Paint_Main.bumpTexture = NormalTexture;221 M_ZhiShaJi_Paint_Main.metallicTexture = SpecularTexture;222 M_ZhiShaJi_Paint_Main.metallic = 1;223 M_ZhiShaJi_Paint_Main.roughness = 0.3;224 M_ZhiShaJi_Paint_Main.metallicF0Factor = 0.6;225 M_ZhiShaJi_Paint_Less.albedoColor = new BABYLON.Color3(0.1843137254901961, 0.058823529411764705, 0.058823529411764705);226 M_ZhiShaJi_Paint_Less.emissiveColor = new BABYLON.Color3(0, 0, 0);227 M_ZhiShaJi_Paint_Less.metallic = 0.47;228 M_ZhiShaJi_Paint_Less.roughness = 0.11;229 M_ZhiShaJi_Paint_Less.bumpTexture = NormalTexture;230 M_ZhiShaJi_Paint_Less.bumpTexture.level = 0.15;231 M_ZhiShaJi_Metal_Iron_Black.albedoColor = new BABYLON.Color3(0.03137254901960784, 0.03137254901960784, 0.03137254901960784);232 M_ZhiShaJi_Metal_Iron_Black.metallic = 1;233 M_ZhiShaJi_Metal_Iron_Black.roughness = 0.38;234 M_ZhiShaJi_Metal_Iron_Gray.albedoColor = new BABYLON.Color3(0.09019607843137255, 0.09019607843137255, 0.09019607843137255);235 M_ZhiShaJi_Metal_Iron_Gray.metallic = 1;236 M_ZhiShaJi_Metal_Iron_Gray.roughness = 0;237 M_ZhiShaJi_Metal_Steel_Silver.albedoColor = new BABYLON.Color3(0.2196078431372549, 0.2196078431372549, 0.2196078431372549);238 M_ZhiShaJi_Metal_Steel_Silver.metallic = 1;239 M_ZhiShaJi_Metal_Steel_Silver.roughness = 0.12;240 //创建只接受阴影的材质241 shadowGenerator.getShadowMap().renderList.push(scene.getMeshByID("ShenYangShunDa1_primitive1"));242 shadowGenerator.getShadowMap().renderList.push(scene.getMeshByID("M_Metal_Iron_Crimson1"));243 shadowGenerator.getShadowMap().renderList.push(scene.getMeshByID("M_Metal_Steel_Silver1"));244 shadowGenerator.getShadowMap().renderList.push(scene.getMeshByID("M_Metal_Iron_Black1"));245 let ag = scene.getAnimationGroupByName('ZhiShaJi_BaoZha');246 ag.stop();247 });248 BABYLON.SceneLoader.Append("model/SheBei/", "YuanZhuiPoSuiJi.gltf", scene, function (meshes) {249 YuanZhuiPoSuiJi_aoTexture1 = new BABYLON.Texture("model/SheBei/YuanZhuiPoSuiJi_Ao2.jpg", scene);250 YuanZhuiPoSuiJi_aoTexture1.vScale = -1;251 YuanZhuiPoSuiJi_aoTexture1.coordinatesIndex = 1;252 YuanZhuiPoSuiJi_aoTexture2 = new BABYLON.Texture("model/SheBei/YuanZhuiPoSuiJi_Ao.jpg", scene);253 //材质调整254 let M_YuanZhuiPoSuiJi_Paint_Main = scene.getMaterialByID("M_YuanZhuiPoSuiJi_Paint_Main");255 let M_YuanZhuiPoSuiJi_Paint_Less = scene.getMaterialByID("M_YuanZhuiPoSuiJi_Paint_Less");256 let M_YuanZhuiPoSuiJi_Logo_Texture = scene.getMaterialByID("M_YuanZhuiPoSuiJi_Logo_Texture");257 let M_YuanZhuiPoSuiJi_Logo_Normal = scene.getMaterialByID("M_YuanZhuiPoSuiJi_Logo_Normal");258 let M_YuanZhuiPoSuiJi_Screw_Steel = scene.getMaterialByID("M_YuanZhuiPoSuiJi_Screw_Steel");259 let M_YuanZhuiPoSuiJi_Metal_Iron = scene.getMaterialByID("M_YuanZhuiPoSuiJi_Metal_Iron");260 let M_YuanZhuiPoSuiJi_Metal_Brass = scene.getMaterialByID("M_YuanZhuiPoSuiJi_Metal_Brass");261 let M_YuanZhuiPoSuiJi_Metal_Iron_Black = scene.getMaterialByID("M_YuanZhuiPoSuiJi_Metal_Iron_Black");262 let M_YuanZhuiPoSuiJi_Metal_Iron_Crimson = scene.getMaterialByID("M_YuanZhuiPoSuiJi_Metal_Iron_Crimson");263 let M_YuanZhuiPoSuiJi_Metal_Iron_Gray = scene.getMaterialByID("M_YuanZhuiPoSuiJi_Metal_Iron_Gray");264 let M_YuanZhuiPoSuiJi_Metal_Steel_Silver = scene.getMaterialByID("M_YuanZhuiPoSuiJi_Metal_Steel_Silver");265 let M_YuanZhuiPoSuiJi_Plastic_Black = scene.getMaterialByID("M_YuanZhuiPoSuiJi_Plastic_Black");266 // 添加ao267 M_YuanZhuiPoSuiJi_Paint_Main.ambientTexture = YuanZhuiPoSuiJi_aoTexture1;268 M_YuanZhuiPoSuiJi_Paint_Less.ambientTexture = YuanZhuiPoSuiJi_aoTexture1;269 M_YuanZhuiPoSuiJi_Metal_Brass.ambientTexture = YuanZhuiPoSuiJi_aoTexture1;270 M_YuanZhuiPoSuiJi_Metal_Iron_Black.ambientTexture = YuanZhuiPoSuiJi_aoTexture1;271 M_YuanZhuiPoSuiJi_Metal_Iron_Gray.ambientTexture = YuanZhuiPoSuiJi_aoTexture1;272 M_YuanZhuiPoSuiJi_Metal_Steel_Silver.ambientTexture = YuanZhuiPoSuiJi_aoTexture1;273 M_YuanZhuiPoSuiJi_Plastic_Black.ambientTexture = YuanZhuiPoSuiJi_aoTexture1;274 M_YuanZhuiPoSuiJi_Screw_Steel.ambientTexture = YuanZhuiPoSuiJi_aoTexture1;275 M_YuanZhuiPoSuiJi_Metal_Iron.ambientTexture = YuanZhuiPoSuiJi_aoTexture1;276 M_YuanZhuiPoSuiJi_Metal_Iron_Crimson.ambientTexture = YuanZhuiPoSuiJi_aoTexture1;277 M_YuanZhuiPoSuiJi_Logo_Normal.ambientTexture = Logo_Alpha_Ao;278 //材质调整279 M_YuanZhuiPoSuiJi_Logo_Texture.albedoColor = new BABYLON.Color3(0.07058823529411765, 0.07058823529411765, 0.07058823529411765);280 M_YuanZhuiPoSuiJi_Logo_Texture.opacityTexture = Logo_Texture;281 M_YuanZhuiPoSuiJi_Logo_Texture.transparencyMode = 3;282 M_YuanZhuiPoSuiJi_Logo_Texture.metallic = 1;283 M_YuanZhuiPoSuiJi_Logo_Texture.roughness = 0.5;284 M_YuanZhuiPoSuiJi_Paint_Main.albedoColor = new BABYLON.Color3(0.36470588235294116, 0.18823529411764706, 0);285 M_YuanZhuiPoSuiJi_Paint_Main.bumpTexture = NormalTexture;286 M_YuanZhuiPoSuiJi_Paint_Main.metallicTexture = SpecularTexture;287 M_YuanZhuiPoSuiJi_Paint_Main.metallic = 1;288 M_YuanZhuiPoSuiJi_Paint_Main.roughness = 0.3;289 M_YuanZhuiPoSuiJi_Paint_Main.metallicF0Factor = 0.6;290 M_YuanZhuiPoSuiJi_Paint_Less.albedoColor = new BABYLON.Color3(0.16862745098039217, 0.16862745098039217, 0.16862745098039217);291 M_YuanZhuiPoSuiJi_Paint_Less.emissiveColor = new BABYLON.Color3(0, 0, 0);292 M_YuanZhuiPoSuiJi_Paint_Less.metallic = 1;293 M_YuanZhuiPoSuiJi_Paint_Less.roughness = 0.23;294 // M_YuanZhuiPoSuiJi_Paint_Less.bumpTexture = NormalTexture;295 M_YuanZhuiPoSuiJi_Metal_Brass.albedoColor = new BABYLON.Color3(0.34901960784313724, 0.34901960784313724, 0.34901960784313724);296 M_YuanZhuiPoSuiJi_Metal_Brass.metallic = 1;297 M_YuanZhuiPoSuiJi_Metal_Brass.roughness = 0.08;298 M_YuanZhuiPoSuiJi_Metal_Iron_Black.albedoColor = new BABYLON.Color3(0.03137254901960784, 0.03137254901960784, 0.03137254901960784);299 M_YuanZhuiPoSuiJi_Metal_Iron_Black.metallic = 1;300 M_YuanZhuiPoSuiJi_Metal_Iron_Black.roughness = 0.38;301 M_YuanZhuiPoSuiJi_Metal_Iron_Gray.metallic = 1;302 M_YuanZhuiPoSuiJi_Metal_Iron_Gray.roughness = 0.64;303 M_YuanZhuiPoSuiJi_Metal_Iron_Crimson.albedoColor = new BABYLON.Color3(0.1333333, 0.027450980, 0.0274509);304 M_YuanZhuiPoSuiJi_Metal_Iron_Crimson.metallic = 0;305 M_YuanZhuiPoSuiJi_Metal_Iron_Crimson.roughness = 0.4;306 M_YuanZhuiPoSuiJi_Metal_Iron_Crimson.bumpTexture = NormalTexture;307 M_YuanZhuiPoSuiJi_Metal_Steel_Silver.albedoColor = new BABYLON.Color3(0.2, 0.2, 0.2);308 M_YuanZhuiPoSuiJi_Metal_Steel_Silver.metallic = 1;309 M_YuanZhuiPoSuiJi_Metal_Steel_Silver.roughness = 0.05;310 M_YuanZhuiPoSuiJi_Metal_Iron.albedoColor = new BABYLON.Color3(0.22745098039215686, 0.24313725490196078, 0.25098039215686274);311 M_YuanZhuiPoSuiJi_Metal_Iron.roughness = 0.08;312 M_YuanZhuiPoSuiJi_Metal_Iron.metallic = 1;313 M_YuanZhuiPoSuiJi_Screw_Steel.albedoColor = new BABYLON.Color3(0.1803921568627451, 0.1803921568627451, 0.1803921568627451);314 M_YuanZhuiPoSuiJi_Screw_Steel.roughness = 0.05;315 M_YuanZhuiPoSuiJi_Screw_Steel.metallic = 1;316 M_YuanZhuiPoSuiJi_Logo_Normal.albedoColor = M_YuanZhuiPoSuiJi_Paint_Main.albedoColor;317 M_YuanZhuiPoSuiJi_Logo_Normal.opacityTexture = Logo_Alpha_Ao;318 M_YuanZhuiPoSuiJi_Logo_Normal.bumpTexture = Logo_NormalTexture;319 M_YuanZhuiPoSuiJi_Logo_Normal.transparencyMode = 3;320 M_YuanZhuiPoSuiJi_Logo_Normal.metallicTexture = M_YuanZhuiPoSuiJi_Paint_Main.metallicTexture;321 M_YuanZhuiPoSuiJi_Logo_Normal.metallic = M_YuanZhuiPoSuiJi_Paint_Main.metallic;322 M_YuanZhuiPoSuiJi_Logo_Normal.roughness = M_YuanZhuiPoSuiJi_Paint_Main.roughness;323 M_YuanZhuiPoSuiJi_Logo_Normal.metallicF0Factor = M_YuanZhuiPoSuiJi_Paint_Main.metallicF0Factor;324 //创建只接受阴影的材质325 shadowGenerator.getShadowMap().renderList.push(scene.getMeshByID("YuanZhuiPoSuiJi_Module_1_primitive3"));326 shadowGenerator.getShadowMap().renderList.push(scene.getMeshByID("YuanZhuiPoSuiJi_Module_2_primitive1"));327 shadowGenerator.getShadowMap().renderList.push(scene.getMeshByID("YuanZhuiPoSuiJi_Module_2_primitive2"));328 shadowGenerator.getShadowMap().renderList.push(scene.getMeshByID("YuanZhuiPoSuiJi_Module_2_primitive3"));329 shadowGenerator.getShadowMap().renderList.push(scene.getMeshByID("YuanZhuiPoSuiJi_Module_3_primitive1"));330 shadowGenerator.getShadowMap().renderList.push(scene.getMeshByID("YuanZhuiPoSuiJi_Module_4_primitive0"));331 shadowGenerator.getShadowMap().renderList.push(scene.getMeshByID("YuanZhuiPoSuiJi_Module_4_primitive1"));332 shadowGenerator.getShadowMap().renderList.push(scene.getMeshByID("YuanZhuiPoSuiJi_Module_4_primitive2"));333 shadowGenerator.getShadowMap().renderList.push(scene.getMeshByID("YuanZhuiPoSuiJi_Module_4_primitive3"));334 shadowGenerator.getShadowMap().renderList.push(scene.getMeshByID("YuanZhuiPoSuiJi_Module_5_primitive1"));335 shadowGenerator.getShadowMap().renderList.push(scene.getMeshByID("YuanZhuiPoSuiJi_Module_5_primitive2"));336 shadowGenerator.getShadowMap().renderList.push(scene.getMeshByID("YuanZhuiPoSuiJi_Shelf"));337 let ag = scene.getAnimationGroupByName('YuanZhuiPoSuiJi_BaoZha');338 ag.stop();339 });340 BABYLON.SceneLoader.Append("model/SheBei/", "HotPoint.gltf", scene, function (meshes) {341 scene.getTransformNodeByID("XuanHuiPoSuiJi_HotPoint").position = new BABYLON.Vector3(-4, 0, 0);342 scene.getTransformNodeByID("ZhiShaJi_HotPoint").position = new BABYLON.Vector3(4, 0, 0);343 });344 /* //地面 345 var griddingMesh = BABYLON.MeshBuilder.CreatePlane("griddingMesh", { width: 20, height: 20 }, scene);346 griddingMesh.position = new BABYLON.Vector3(0, 0.001, 0);347 griddingMesh.rotation = new BABYLON.Vector3(Math.PI / 2, 0, 0);348 349 var M_gridding = new BABYLON.PBRMaterial("M_gridding", scene);350 M_gridding.albedoColor = new BABYLON.Color3(0.25098039215686274, 0.25098039215686274, 0.25098039215686274);351 M_gridding.metallic = 0;352 M_gridding.roughness = 0.23;353 M_gridding.microSurface = 1;354 M_gridding.opacityTexture = new BABYLON.Texture('../textures/gridding.png', scene);355 M_gridding.opacityTexture.uScale = 80;356 M_gridding.opacityTexture.vScale = 80;357 M_gridding.transparencyMode = 2;358 M_gridding.alpha = 0.11;359 M_gridding.alphaMode = 2;360 M_gridding.usePhysicalLightFalloff = true;361 362 griddingMesh.material = M_gridding; */363 //点点364 var spotMesh = BABYLON.MeshBuilder.CreatePlane("spotMesh", { width: 20, height: 20 }, scene);365 // spotMesh.position = new BABYLON.Vector3(2.2188390396137536, -0.023294874523774378, -0.000691376644813891);366 spotMesh.rotation = new BABYLON.Vector3(Math.PI / 2, 0, 0);367 var M_spot = new BABYLON.PBRMaterial("M_spot", scene);368 M_spot.albedoColor = new BABYLON.Color3(0.16862745098039217, 0.16862745098039217, 0.16862745098039217);369 M_spot.metallic = 1;370 M_spot.microSurface = 1;371 M_spot.opacityTexture = new BABYLON.Texture('model/Spot.png', scene);372 M_spot.opacityTexture.uScale = 200;373 M_spot.opacityTexture.vScale = 200;374 M_spot.transparencyMode = 2;375 M_spot.alphaMode = 2;376 M_spot.usePhysicalLightFalloff = true;377 spotMesh.material = M_spot;378 //动画379 // var zoomIn = new BABYLON.Animation("zoomIn", "radius", 30, BABYLON.Animation.ANIMATIONTYPE_FLOAT, BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT);380 // var keys = [];381 // keys.push({382 // frame: 0,383 // value: 12384 // });385 // keys.push({386 // frame: 80,387 // value: 2.5388 // });389 // //创建换动函数390 // var easingFunction = new BABYLON.CircleEase();391 // //选择缓动的方式392 // easingFunction.setEasingMode(BABYLON.EasingFunction.EASINGMODE_EASEOUT);393 // //将缓动添加给动画394 // zoomIn.setEasingFunction(easingFunction);395 // //将动画数组添加到动画对象:396 // zoomIn.setKeys(keys);397 // //将此动画链接到相机的radius上;398 // camera.animations.push(zoomIn);399 // var animationGroup1 = new BABYLON.AnimationGroup("camera_in");400 // animationGroup1.addTargetedAnimation(zoomIn, camera);401 // animationGroup1.play(false);402 // BABYLON.Animation.CreateAndStartAnimation('light', scene.environmentTexture, 'rotationY', 30, 1000, 0, Math.PI * 2);403 return scene;404};405/******* End of the create scene function ******/406var scene = createScene(); //Call the createScene function407// 注册渲染循环以重复渲染场景408engine.runRenderLoop(function () {409 scene.render();410});411// 监测浏览器/画布调整大小事件412window.addEventListener("resize", function () {413 engine.resize();414});415// let ag = engine.scenes[0].getAnimationGroupByName('XuanHuiPoSuiJi_BaoZha');416// window.onload=function(){417// initscene();418// }...

Full Screen

Full Screen

quickview.js

Source:quickview.js Github

copy

Full Screen

...28 this.initStockNotification();29 },30 initStockNotification: function () {31 if (typeof(IWD.StockNotification) != 'undefined') {32 $ji(document).on('click', '.iwd-qv-request-notice', function (e) {33 e.preventDefault();34 console.log(IWD.StockNotification);35 IWD.StockNotification.sendRequestNotify($ji(this));36 });37 $ji(document).on('click', '.iwd-qv-btn-notify', function (e) {38 e.preventDefault();39 $ji('.iwd-qv-modal-notify').hide();//hide all40 IWD.StockNotification.currentBlock = $ji(this).data('id');41 $ji('#iwd-qv-modal-notify-' + IWD.StockNotification.currentBlock).fadeIn();42 });43 $ji(document).on('click', 'i.iwd-qv-close-notification', function (e) {44 e.preventDefault();45 $ji(this).closest('.iwd-qv-modal-notify').hide();46 });47 }48 },49 initShowDialog: function () {50 $ji(this).closest('.iwd-qv-modal-notify').hide();51 function makeRequest(link, mode, edit) {52 $ji('body').addClass('modal-open');53 $ji('#iwd-qv-additional-loader').css('display', 'block');54 IWD.QuickView.Processor.request(link, edit, mode);55 }56 if (IWD.QuickView.mode == 'aac' || IWD.QuickView.mode == 'qv_aac') {57 $ji(document).on('click', '.btn-cart:not(#product_addtocart_form .btn-cart, .block-reorder .btn-cart), .iwd-btn-add-to-cart', function (e) {58 e.preventDefault();59 var link = $ji(this).data('link');60 if (link == '' || typeof(link) == 'undefined') {61 return;62 }63 makeRequest(link, 'aac');64 });65 //check all links where edit product url66 $ji(document).on('click', 'a', function (e) {67 var link = $ji(this).attr('href');68 if (link == '' || typeof(link) == 'undefined') {69 return;70 }71 if (link.indexOf('http') == -1) {72 return;73 }74// if ($ji('#product_addtocart_form').length > 0 && link.indexOf('wishlist') == -1) {75// setLocation(link);76// return;77// }78 if (link.indexOf('checkout/cart/configure') != -1) {79 e.preventDefault();80 protocol = link.substr(link.indexOf('://') + 1);81 makeRequest(protocol, 'aac', true);82 }83 });84 if (IWD.QuickView.config.aac_selector != '' && IWD.QuickView.config.aac_selector != null) {85 $ji(document).on('click', IWD.QuickView.config.aac_selector, function (e) {86 e.preventDefault();87 var link = $ji(this).attr('href');88 if (link == '' || typeof(link) == 'undefined') {89 return;90 }91 makeRequest(link, 'aac');92 });93 }94 }95 if (IWD.QuickView.mode == 'qv' || IWD.QuickView.mode == 'qv_aac') {96 $ji(document).on("click touchstart", ".iwd-quick-view-button", function (e) {97 e.preventDefault();98 var link = $ji(this).data('link');99 if (link == '' || typeof(link) == 'undefined') {100 return;101 }102 $ji(this).closest('.iwd-qv-modal-notify').hide();103 makeRequest(link, 'qv');104 });105 }106 },107 clearPrice: function () {108 $ji('.price-box span').each(function (k, v) {109 if ($ji(v).attr('id')) {110 $ji(v).attr('iwd-qv-id', $ji(v).attr('id')).removeAttr('id');111 }112 });113 },114 restorePrice: function () {115 $ji('.price-box span').each(function (k, v) {116 if ($ji(v).attr('iwd-qv-id')) {117 $ji(v).attr('id', $ji(v).attr('iwd-qv-id')).removeAttr('iwd-qv-id');118 }119 });120 },121 /** request add to cart or view product **/122 request: function (link, edit, mode) {123 if (typeof(edit) == "undefined") {124 edit = false;125 }126 var cart = IWD.QuickView.Processor.isShoppingCart();127 $ji(this).closest('.iwd-qv-modal-notify').hide();128 $ji.get(link, {129 "iwd_qv": true,130 "cart": cart,131 "edit": edit,132 "iwd_qv_mode": mode133 }, IWD.QuickView.Processor.parseResponse, 'json');134 },135 /** INIT SUBMIT FORM EVENT (MODAL FORM) **/136 initSubmitModalForm: function () {137 $ji(document).on('submit', '#iwd_qv_product_addtocart_form_modal', function (event) {138 event.preventDefault();139 var modalProductForm = new VarienForm('iwd_qv_product_addtocart_form_modal');140 if (modalProductForm.validator && modalProductForm.validator.validate()) {141 protocol = $ji(this).prop('action').substr($ji(this).prop('action').indexOf('://') + 1);142 IWD.QuickView.Processor.sendRequestFormAddToCart(protocol, $ji('#iwd_qv_product_addtocart_form_modal'));143 }144 });145 },146 /** REWRITE DEFAULT METHOD productAddToCartForm;**/147 initSubmitFormProductPage: function () {148 if (window.hasOwnProperty('productAddToCartForm')) {149 productAddToCartForm = {150 submit: function (button) {151 var productForm = new VarienForm('product_addtocart_form');152 if (productForm.validator && productForm.validator.validate()) {153 if (IWD.QuickView.Processor.isPaypalExpress(button.href)) {154 productForm.submit();155 return;156 }157 $ji('.iwd-qv-global-backdrop').show();158 if ($ji('#product_addtocart_form [name="iwd_qv_mode"]').length == 0)159 $ji('#product_addtocart_form').append($ji('<input>').attr('type', 'hidden').attr('name', 'iwd_qv_mode').val('aac'));160 protocol = $ji('#product_addtocart_form').prop('action').substr($ji('#product_addtocart_form').prop('action').indexOf('://') + 1);161 IWD.QuickView.Processor.sendRequestFormAddToCart(protocol, $ji('#product_addtocart_form'));162 }163 },164 submitLight: function (button, url) {165 var productForm = new VarienForm('product_addtocart_form');166 if (productForm.validator) {167 var nv = Validation.methods;168 delete Validation.methods['required-entry'];169 delete Validation.methods['validate-one-required'];170 delete Validation.methods['validate-one-required-by-name'];171 for (var methodName in Validation.methods) {172 if (methodName.match(/^validate-datetime-.*/i)) {173 delete Validation.methods[methodName];174 }175 }176 if (productForm.validator.validate()) {177 if (url) {178 $ji('#product_addtocart_form').attr('action', url);179 }180 productForm.submit();181 }182 }183 }184 }185 }186 },187 /** METHOD FOR REMOVE ITEM FROM SHOPPING CART **/188 initRemoveItemShoppingCart: function () {189 $ji(document).on('click', '.cart-table a.btn-remove', function (event) {190 event.preventDefault();191 var url = $ji(this).prop('href');192 var id = IWD.QuickView.Processor.getShoppingItemId(url);193 if (id == false) {194 setLocation(url);195 return;196 }197 $ji('.iwd-qv-global-backdrop').show();198 $ji.post(IWD.QuickView.config.removeShoppingCartUrl, {id: id}, IWD.QuickView.Processor.parseResponse, 'json');199 });200 },201 getShoppingItemId: function (url) {202 var re1 = '.*?', re2 = '(cart)', re3 = '.*?', re4 = '(delete)', re5 = '.*?', re6 = '(id)', re7 = '.*?', re8 = '(\\d+)';203 var p = new RegExp(re1 + re2 + re3 + re4 + re5 + re6 + re7 + re8, ["i"]);204 var m = p.exec(url);205 if (m != null) {206 var int1 = m[4];207 return int1;208 }209 return false;210 },211 /** CHECK IS PAYPAL BUTTON **/212 isPaypalExpress: function (url) {213 var re1 = '((?:[a-z][a-z]+))', re2 = '.*?', re3 = '(express)';214 var p = new RegExp(re1 + re2 + re3, ["i"]);215 var m = p.exec(url);216 if (m != null) {217 return true;218 }219 return false;220 },221 /** check if current page is shopping cart - for ajax reload page after add to cart */222 isShoppingCart: function () {223 var href = parent.location.href;224 if (href.indexOf('checkout/cart') != -1) {225 return true;226 }227 return false;228 },229 /** SEND AJAX REQUEST - SUBMITED FORM **/230 sendRequestFormAddToCart: function (url, $form) {231 $ji('.iwd-qv-ajax-loader').show();232 var formData = $form.serializeArray();233 var cart = IWD.QuickView.Processor.isShoppingCart();234 formData.push({name: "iwd_qv", value: true});235 formData.push({name: "cart", value: cart});236 var to = url.indexOf('?') === -1 ? url : url; // If you use magento EE 1.12.0.2 please comment this line237 $ji.post(238 to,239 formData,240 IWD.QuickView.Processor.parseResponse,241 'json'242 ).done(243 function(){244 console.log("Success");245 }246 ).fail(247 function(){248 console.log("Error!!!");249 //document.location.reload();250 }251 );252 //$ji.post(url, IWD.QuickView.Processor.parseResponse, 'json'); //for magento EE 1.12.0.2253 },254 /** PARSE AJAX RESPONSE **/255 parseResponse: function (response) {256 $ji('.iwd-qv-global-backdrop').hide();257 $ji('.iwd-qv-ajax-loader').hide();258 if (typeof(response.after) != "undefined" && response.after == 'cart') {259 window.location.href = IWD.QuickView.config.shoppingCartUrl;260 return;261 }262 var currentLocation = window.location;263 if(currentLocation.pathname == "/wishlist/") {264 var wislistItems = $ji('#wishlist-table tbody tr');265 $ji('#item_' + response.itemId).remove();266 console.log(currentLocation.origin);267 if (wislistItems.length == 0) {268 window.location.href = currentLocation.origin + "/checkout/cart/";269 }270 }271 IWD.QuickView.Processor.parseAAC(response);272 IWD.QuickView.Processor.parseResponseAfterProductAdded(response);273 IWD.QuickView.Processor.parseResponseProductView(response);274 IWD.QuickView.Processor.parseResponseShoppingCart(response);275 IWD.QuickView.Processor.parseResponseHeader(response);276 IWD.QuickView.Processor.parseResponseUpdateTopDropdown(response);277 },278 parseAAC: function (response) {279 if (typeof(response.content) == "undefined") {280 $ji('body').removeClass('modal-open');281 IWD.QuickView.Processor.restorePrice();282 $ji('#iwd-qv-additional-loader').css('display', 'none');283 }284 },285 parseResponseAfterProductAdded: function (response) {286 if (typeof(response.after) != "undefined") {287 if (response.after == 'message') {288 if (typeof(response.confirmation) != "undefined" && response.confirmation !== false) {289// $ji('#iwd-qv-wrapper').html(response.confirmation);290 IWD.QuickView.Decorator.showModal(response.confirmation);291 }292 }293 if (response.after == 'continue') {294 IWD.QuickView.Decorator.hideModal();295 }296 }297 },298 parseResponseProductView: function (response) {299 if (typeof(response.content) != "undefined") {300 IWD.QuickView.Processor.clearPrice();301 IWD.QuickView.Decorator.showPopup = true;302 if (window.optionsPrice != undefined) {303 IWD.QuickView.Processor.optionPriceOld = window.optionsPrice;304 }305 if (window.bundle != undefined) {306 IWD.QuickView.Processor.bundleOld = window.bundle;307 }308 if (window.opConfig != undefined) {309 IWD.QuickView.Processor.opConfigOld = window.opConfig;310 }311 $ji('body').removeClass('modal-open');312 $ji('#iwd-qv-additional-loader').css('display', 'none');313 IWD.QuickView.Decorator.showModal(response.content);314 IWD.QuickView.Decorator.SystemColorSwatch();315 }316 },317 parseResponseShoppingCart: function (response) {318 if (typeof(response.shopping_cart) != "undefined" && response.shopping_cart !== false) {319 if (typeof(response.after) != "undefined" && response.confirmation !== false) {320 IWD.QuickView.Decorator.showModal(response.confirmation);321 } else {322 IWD.QuickView.Decorator.hideModal();323 }324 $ji('.cart').replaceWith(response.shopping_cart).promise().done(function () {325 $ji('input[name^="cart"]').focus(function () {326 $ji(this).siblings('button').fadeIn();327 });328 });329 IWD.QuickView.Decorator.updateButton();330 }331 },332 parseResponseHeader: function (response) {333 /** header - full update for correct display shoppingcart **/334 if (typeof(response.header) != "undefined") {335 if ($ji('header .links').length > 0) {336 $ji('header .links').replaceWith(response.header);337 } else if ($ji('#header .links').length > 0) {338 $ji('#header .links').replaceWith(response.header);339 } else if ($ji('.header .links').length > 0) {340 $ji('.header .links').replaceWith(response.header);341 }342 }343 },344 parseResponseUpdateTopDropdown: function (response) {345 if (typeof(response.dropdown) != "undefined") {346 if (IWD.QuickView.config.useDefaultDropDown == true) {347 $ji('.header-minicart, wrrapper-ajaxcart-dropdown').html(response.dropdown).promise().done(function () {348 if (response.show_dropdown == true) {349 setTimeout(function () {350 $ji('.skip-link.skip-cart, top-link-cart').trigger('click');351 }, 200);352 }353 });354 var skipContents = $ji('.skip-content');355 var skipLinks = $ji('.skip-link.skip-cart');356 skipLinks.off('click');357 skipLinks.on('click', function (e) {358 e.preventDefault();359 var self = $ji(this);360 // Use the data-target-element attribute, if it exists. Fall back to href.361 var target = self.attr('data-target-element') ? self.attr('data-target-element') : self.attr('href');362 // Get target element363 var elem = $ji(target);364 // Check if stub is open365 var isSkipContentOpen = elem.hasClass('skip-active') ? 1 : 0;366 // Hide all stubs367 skipLinks.removeClass('skip-active');368 skipContents.removeClass('skip-active');369 // Toggle stubs370 if (isSkipContentOpen) {371 self.removeClass('skip-active');372 } else {373 self.addClass('skip-active');374 elem.addClass('skip-active');375 }376 });377 $ji('#header-cart').on('click', '.skip-link-close', function (e) {378 var parent = $ji(this).parents('.skip-content');379 var link = parent.siblings('.skip-link');380 parent.removeClass('skip-active');381 link.removeClass('skip-active');382 e.preventDefault();383 });384 } else {385 $ji('.es-top-cart').remove();386 $ji(response.dropdown).insertAfter('#ajax-cart-modal');387 IWD.QuickView.Decorator.moveDropdown();388 setTimeout(function () {389 if (response.show_dropdown == true) {390 $ji('.wrrapper-ajaxcart-dropdown').addClass('opened');391 }392 }, 200);393 }394 }395 }396};397IWD.QuickView.Decorator = {398 showPopup: true,399 timer: null,400 init: function () {401 this.updateButton();402 this.initQtyChange();403 this.removeOpen();404 this.initOnModalClose();405 this.initOnCheckoutClick();406 this.productVideoIntegration();407 if (IWD.QuickView.config.useDefaultDropDown == false) {408 this.moveDropdown();409 }410 //this.clearPrice();411 //this.removeOpen();412 },413 initOnModalClose414 :415 function () {416 $ji('#iwd-qv-modal').on('hidden.bs.modal', function () {417 if (IWD.QuickView.Processor.optionPriceOld != null) {418 window.optionsPrice = IWD.QuickView.Processor.optionPriceOld;419 IWD.QuickView.Processor.optionPriceOld = null;420 }421 if (IWD.QuickView.Processor.bundleOld != null) {422 window.bundle = IWD.QuickView.Processor.bundleOld;423 IWD.QuickView.Processor.bundleOld = null;424 }425 if (IWD.QuickView.Processor.opConfigOld != null) {426 window.opConfig = IWD.QuickView.Processor.opConfigOld;427 IWD.QuickView.Processor.opConfigOld = null;428 }429 // remove position fixed from popup (this is seted for confirmation message popup)430 $ji('#iwd-qv-modal .iwd-qv-modal-dialog').removeClass('iwd-success-cart');431 $ji('#iwd-qv-wrapper').html('');432 IWD.QuickView.Decorator.showPopup = false;433 ProductMediaManagerQV.destroyZoom();434 IWD.QuickView.Processor.restorePrice();435 });436 }437 ,438 initOnCheckoutClick: function () {439 jQueryIWD(document).on('click', '.es-btn-checkout', function (e) {440 if (IWD.QuickView.closePopupOnCheckout) {441 $ji('#iwd-qv-modal').modaliwd('hide');442 }443 });444 }445 ,446 /** remove onclick from all buttons with class "btn-cart" **/447 updateButton: function () {448 // compatibility with infinite scroll - add quick-view button on hover on product449 if (IWD.QuickView.mode != 'aac') {450 jQueryIWD(document).on('mouseover', IWD.QuickView.config.qv_selector, function (e) {451 var _this = jQueryIWD(this);452 if (_this.children('.iwd-quick-view-button').length == 0) {453 _this.addClass('iwd-quick-view-block');454 _this.css('position', 'relative');455 var link, container;456 if (_this.prop('tagName').toLowerCase() == 'li') {457 container = _this;458 } else {459 container = _this.closest('li');460 }461 link = container.find('.product-image').attr('href');462 protocol = link.substr(link.indexOf('://') + 1);463 _this.append(jQueryIWD(IWD.QuickView.button_html).data('link', protocol));464 }465 });466 }467 if (IWD.QuickView.mode != 'qv') {468 $ji('.btn-cart, .iwd-btn-add-to-cart').not('#product_addtocart_form .btn-cart').each(function () {469 var value = $ji(this).attr('onclick');470 if (value != undefined) {471 if (value.indexOf('setLocation') != -1) {472 value = value.replace("setLocation('", "");473 value = value.replace("')", "");474 protocol = value.substr(value.indexOf('://') + 1);475 $ji(this).removeAttr('onclick').data('link', protocol);476 }477 }478 });479 }480 }481 ,482 /** show dialog **/483 showModal: function (html) {484// if(IWD.QuickView.Decorator.showPopup == true){485 $ji('#iwd-qv-modal').modaliwd('hide');486 $ji('#iwd-qv-wrapper').html(html).promise().done(function () {// wait if html is too big for it's load487 var options = {"backdrop": "static", "show": true};488 $ji('#iwd-qv-modal').modaliwd(options);489 });490// }491 }492 ,493 /** hide dialog **/494 hideModal: function () {495 IWD.QuickView.Decorator.showPopup = false;496 $ji('#iwd-qv-modal').modaliwd('hide');497 ProductMediaManagerQV.destroyZoom();498 if (typeof IWD.PV != 'undefined')499 IWD.PV.closeAllVideos();500 }501 ,502 /** decorate qty box **/503 decorateQty: function () {504 var width = $ji(window).width();505 $ji('.iwd-qv-modal input.qty').each(function () {506 var _this = $ji(this);507 _this.wrap('<div class="qty-block"></div>');508 _this.addClass('ajax-qty-input').addClass('left');509// if (width > 480) {510// _this.attr('readonly', 'readonly');511// }512 $ji('<div class="right qty-slider"><i class="inc fa fa-chevron-up"></i><i class="dec fa fa-chevron-down"></i></div>').insertAfter(this);513 });514 }515 ,516 initQtyChange: function () {517 $ji(document).on('click touchstart', '.iwd-qv-modal .inc', function () {518 var parent = $ji(this).closest('.qty-block');519 var input = parent.find('.ajax-qty-input');520 var val = input.val();521 val = parseFloat(val);522 val = val + 1;523 input.val(val);524 if (input.is('[onkeyup]'))525 input.trigger('keyup'); // to force price change526 });527 $ji(document).on('click touchstart', '.iwd-qv-modal .dec', function () {528 var parent = $ji(this).closest('.qty-block');529 var input = parent.find('.ajax-qty-input');530 var val = input.val();531 val = parseFloat(val);532 val = val - 1;533 if (val < 1) {534 return;535 }536 input.val(val);537 if (input.is('[onkeyup]'))538 input.trigger('keyup'); // to force price change539 });540 }541 ,542 removeOpen: function () {543 $ji(document).on('mousemove', '.es-top-cart', function () {544 $ji('.wrrapper-ajaxcart-dropdown').removeClass('opened');545 })546 }547 ,548 moveDropdown: function () {549 var $html = $ji('#wrrapper-ajaxcart-dropdown').html();550 $ji('#wrrapper-ajaxcart-dropdown').remove();551 var parent = $ji('.top-link-cart').parent();552 parent.addClass('wrrapper-ajaxcart-dropdown')553 $ji($html).insertAfter('.top-link-cart');554 }555 ,556 SystemColorSwatch: function () {557 if (typeof(Product.ConfigurableSwatchesQV) != "undefined" && typeof(spConfigQV) != "undefined") {558 var swatchesConfig = new Product.ConfigurableSwatchesQV(spConfigQV);559 }560 }561 ,562 productVideoIntegration: function () {563 if (typeof IWD.PV != 'undefined') {564 $ji(document).on('click touchstart', IWD.PV.Frontend.thumbnailsBox + " ." + IWD.PV.Frontend.class_thumb_video, function (e) {565 ProductMediaManagerQV.destroyZoom();566 });567 $ji(document).on('click touchstart', IWD.PV.Frontend.thumbnailsBox + " ." + IWD.PV.Frontend.class_thumb_image, function (e) {568 ProductMediaManagerQV.initZoom();569 });570 $ji('.iwd-qv-modal').on('hide.bs.modal', function () {571 if (typeof IWD.PV != 'undefined' && IWD.PV.children !== null)572 IWD.PV.closeAllVideos();573 });574 }575 }576}577;578$ji(document).ready(function () {579 if (typeof($ji) == "undefined") {580 console.log('IWD jQuery Library undefined');581 } else {582 if (IWD.QuickView.config.enable == true) {583 IWD.QuickView.Decorator.init();584 IWD.QuickView.Processor.init();585 } else {586 console.log("IWD Quick View extension is disabled");587 }588 $ji(document).on('click', '#iwd-qv-wrapper #recurring_start_date_trig', function () {589 $ji('#iwd-qv-wrapper .calendar').remove();590 $ji('.calendar').appendTo($ji('#iwd-qv-wrapper'));591 });592 }...

Full Screen

Full Screen

AttackAndBreakthrough.js

Source:AttackAndBreakthrough.js Github

copy

Full Screen

12//攻击的方法3function Kick() {45 //循环子弹对象6 zidanDiv = $(".zidanDiv");7 for (var zidan = 0; zidan < zidanDiv.size() ; zidan++) {8 //循环小飞机对象9 var newFeiJi = $(".newFeiJi");10 for (var FeiJi = 0; FeiJi < newFeiJi.size() ; FeiJi++) {11 //打到小飞机12 if (zidanDiv[zidan].offsetLeft >= newFeiJi[FeiJi].offsetLeft13 //左右边距攻击范围14 && zidanDiv[zidan].offsetLeft <= newFeiJi[FeiJi].offsetLeft + 7015 //限制上边距的攻击范围16 && zidanDiv[zidan].offsetTop >= newFeiJi[FeiJi].offsetTop + 6017 //限制子弹攻击到的范围18 && zidanDiv[zidan].offsetTop <= newFeiJi[FeiJi].offsetTop + 80) {19 Boxs.play();20 $(newFeiJ).remove();21 FenShu += 40;22 }23 //删除多余的子弹24 if (zidanDiv[zidan].offsetTop < newFeiJi[FeiJi].offsetTop25 && zidanDiv[zidan].offsetLeft <= newFeiJi[FeiJi].offsetLeft + 6026 && zidanDiv[zidan].offsetLeft >= newFeiJi[FeiJi].offsetLeft) {27 $(zidanDiv[zidan]).css("background-image", "url('Img/游戏背景.jpg')")28 $(zidanDiv[zidan]).remove();29 newFeiJ = newFeiJi[FeiJi];30 }31 //循环大飞机对象 32 var newDaFeiJi = $(".newDaFeiJi");33 var str = newFeiJi[FeiJi].offsetTop;34 kill(str);35 for (var DaFeiJi = 0; DaFeiJi < newDaFeiJi.size() ; DaFeiJi++) {36 //打到大飞机37 if (zidanDiv[zidan].offsetLeft >= newDaFeiJi[DaFeiJi].offsetLeft38 //左右边距攻击范围39 && zidanDiv[zidan].offsetLeft <= newDaFeiJi[DaFeiJi].offsetLeft + 18040 //限制上边距的攻击范围41 && zidanDiv[zidan].offsetTop >= newDaFeiJi[DaFeiJi].offsetTop + 11342 //限制子弹攻击到的范围43 && zidanDiv[zidan].offsetTop <= newDaFeiJi[DaFeiJi].offsetTop + 140) {44 cishu1+=1;45 }46 //删除多余的子弹47 if (zidanDiv[zidan].offsetTop < newDaFeiJi[DaFeiJi].offsetTop + 9048 && zidanDiv[zidan].offsetLeft <= newDaFeiJi[DaFeiJi].offsetLeft + 11049 && zidanDiv[zidan].offsetLeft >= newDaFeiJi[DaFeiJi].offsetLeft) {50 $(zidanDiv[zidan]).css("background-image", "url('Img/游戏背景.jpg')")51 $(zidanDiv[zidan]).remove();52 newDaFeiJ = newDaFeiJi[DaFeiJi];53 }54 if (cishu1 >= 200) {55 Box.play();56 $(newDaFeiJ).remove();57 FenShu += 100;58 cishu1 = 0; 59 }60 var MyFeiJi = document.getElementById("MyDiv");61 //循环中飞机对象 62 var newZhongFeiJi = $(".newZhongFeiJi");63 var str = newDaFeiJi[DaFeiJi].offsetTop;64 kill(str);65 for (var ZhongFeiJi = 0; ZhongFeiJi < newZhongFeiJi.size() ; ZhongFeiJi++) {66 //打到中飞机67 if (zidanDiv[zidan].offsetLeft >= newZhongFeiJi[ZhongFeiJi].offsetLeft68 //左右边距攻击范围69 && zidanDiv[zidan].offsetLeft <= newZhongFeiJi[ZhongFeiJi].offsetLeft + 10070 //限制上边距的攻击范围71 && zidanDiv[zidan].offsetTop >= newZhongFeiJi[ZhongFeiJi].offsetTop + 8072 //限制子弹攻击到的范围73 && zidanDiv[zidan].offsetTop <= newZhongFeiJi[ZhongFeiJi].offsetTop + 100) {74 Boxs.play();75 cishu += 1;76 77 }78 //删除多余的子弹79 if (zidanDiv[zidan].offsetTop < newZhongFeiJi[ZhongFeiJi].offsetTop + 4080 && zidanDiv[zidan].offsetLeft <= newZhongFeiJi[ZhongFeiJi].offsetLeft + 10081 && zidanDiv[zidan].offsetLeft >= newZhongFeiJi[ZhongFeiJi].offsetLeft) {82 $(zidanDiv[zidan]).css("background-image", "url('Img/游戏背景.jpg')")83 $(zidanDiv[zidan]).remove();84 newZhongFeiJ = newZhongFeiJi[ZhongFeiJi];85 86 }87 if (cishu >= 100) {88 $(newZhongFeiJ).remove();89 FenShu += 200;90 cishu = 0;91 }92 //我方阵亡93 var str = newZhongFeiJi[ZhongFeiJi].offsetTop;94 kill(str);95 }96 }97 }98 var newBaoXian = $(".newBaoXian");99 for (var BaoXian = 0; BaoXian < newBaoXian.size() ; BaoXian++) {100 //打到中飞机101 if (zidanDiv[zidan].offsetLeft >= newBaoXian[BaoXian].offsetLeft102 //左右边距攻击范围103 && zidanDiv[zidan].offsetLeft <= newBaoXian[BaoXian].offsetLeft + 50104 //限制上边距的攻击范围105 && zidanDiv[zidan].offsetTop >= newBaoXian[BaoXian].offsetTop + 60106 //限制子弹攻击到的范围107 && zidanDiv[zidan].offsetTop <= newBaoXian[BaoXian].offsetTop + 80) {108 $(newBaoXian[BaoXian]).remove();109 shenji = 1;110 }111 }112 //循环BOSS对象 113 var Boss = $(".BOSS");114 for (var bx = 0; bx < Boss.size() ; bx++) {115 //删除多余的子弹116 if (zidanDiv[zidan].offsetTop < Boss[bx].offsetTop + 170117 && zidanDiv[zidan].offsetLeft <= Boss[bx].offsetLeft + 130118 && zidanDiv[zidan].offsetLeft >= Boss[bx].offsetLeft) {119 $("#Bossyellow").css("width", "-=1px;");120 var bossW = document.getElementById("Bossyellow").offsetWidth;121 if (bossW <= 5) {122 $("#BOSS_HP").css("width", "-=1px;");123 var bossR = document.getElementById("BOSS_HP").offsetWidth;124 if (bossR <= 5) {125 danmu();126 Boxs.play();127 $(Boss).remove();128 setInterval("jiaHP()", 20);129 tiaojian += 1;130 FenShu += 1000;131 132 }133 }134 $(zidanDiv[zidan]).remove();135 Bosse = Boss[bx];136 }137 //循环BOSS子弹 138 var BossZiDan = $(".Bosszidan");139 var MyDivs = document.getElementById("MyDiv");140 for (var ZiDan = 0; ZiDan < BossZiDan.size() ; ZiDan++) {141 //删除多余的子弹142 if (BossZiDan[ZiDan].offsetTop >= MyDivs.offsetTop - 10143 && BossZiDan[ZiDan].offsetTop <= MyDivs.offsetTop + 60144 && BossZiDan[ZiDan].offsetLeft <= MyDivs.offsetLeft + 100145 && BossZiDan[ZiDan].offsetLeft >= MyDivs.offsetLeft-10) {146 $("#MyHp").css("width", "-=5px;");147 var w = document.getElementById("MyHp").offsetWidth;148 if (w<=3) {149 kill(900);150 }151 $(BossZiDan[ZiDan]).remove();152 }153 }154 }155 156 /////////////////////////////////////////////////////////////////////////////////////////////////////////////157 if (FenShu >= 0 && guanka == 0) {158 danmuss();159 //生成敌人小飞机160 XFJ = setInterval("newAi()", 1000);161 //生成敌人中飞机162 ZFJ = setInterval("newZhongAi()", 11000);163 //生成敌人大飞机164 DFJ = setInterval("newDaAi()", 10000);165 guanka = 1;166 } else if (FenShu >= 6000 && guanka == 1) {167 //BOSS出来时只生成小飞机168 clearInterval(DFJ);169 clearInterval(ZFJ);170 //生成BOSS171 JB.play();172 danmus();173 setTimeout("Boss()", BossTime);174 //生成BOSS子弹175 setTimeout("BOSSzidan()", 3000);176 //BOSS子弹速度177 setInterval("BossZiDanSD()", 100);178 //飞机类型179 FeiJiType = 1;180 //BOSS类型181 BossType = 0;182 //关卡数183 guanka++;184 setInterval("fen()", 100);185 } else if (tiaojian == 1 && guanka == 2) {186 clearInterval(DFJ);187 clearInterval(ZFJ);188 clearInterval(XFJ);189 FeiJiType = 2;190 BossType = 1;191 guanka = 3;192 //生成敌人小飞机193 XFJ = setInterval("newAi()", 1000);194 //生成敌人中飞机195 ZFJ = setInterval("newZhongAi()", 10000);196 //生成敌人大飞机197 DFJ = setInterval("newDaAi()", 9000);198 // $("#waiDiv").css("background-image", "url('Img/场景3.jpg')");199 } else if (FenShu >= 28000 && tiaojian == 1 && guanka == 3) {200 //关闭中飞机201 clearInterval(ZFJ);202 //生成BOSS203 JB.play();204 danmus();205 setTimeout("Boss()", BossTime);206 guanka = 4;207 } else if (tiaojian == 2 && guanka == 4) {208 clearInterval(DFJ);209 clearInterval(ZFJ);210 clearInterval(XFJ);211 FeiJiType = 3;212 BossType = 2;213 guanka = 5;214 //生成敌人小飞机215 XFJ = setInterval("newAi()", 1000);216 //生成敌人中飞机217 ZFJ = setInterval("newZhongAi()", 9000);218 //生成敌人大飞机219 DFJ = setInterval("newDaAi()", 8000);220 } else if (tiaojian == 2 && guanka == 5 && FenShu >= 42000) {221 //关闭重启飞机222 clearInterval(ZFJ);223 clearInterval(XFJ);224 //生成敌人小飞机225 XFJ = setInterval("newAi()", 1700);226 //生成敌人中飞机227 ZFJ = setInterval("newZhongAi()", 10000);228 //生成BOSS229 JB.play();230 danmus();231 setTimeout("Boss()", BossTime);232 guanka = 6;233 } else if (tiaojian == 3 && guanka == 6) {234 clearInterval(DFJ);235 clearInterval(ZFJ);236 clearInterval(XFJ);237 FeiJiType = 4;238 BossType = 3;239 guanka = 7;240 //生成敌人小飞机241 XFJ = setInterval("newAi()", 1000);242 //生成敌人中飞机243 ZFJ = setInterval("newZhongAi()", 8000);244 //生成敌人大飞机245 DFJ = setInterval("newDaAi()", 7000);246 } else if (tiaojian == 3 && guanka == 7 && FenShu >= 52000) {247 //关闭重启飞机248 clearInterval(ZFJ);249 clearInterval(XFJ);250 clearInterval(DFJ);251 //生成敌人小飞机252 XFJ = setInterval("newAi()", 2000);253 //生成敌人中飞机254 ZFJ = setInterval("newZhongAi()", 10000);255 //生成敌人大飞机256 DFJ = setInterval("newDaAi()", 9000);257 //生成BOSS258 JB.play();259 danmus();260 setTimeout("Boss()", BossTime);261 guanka = 8;262 } else if (tiaojian == 4 && guanka == 8) {263 clearInterval(DFJ);264 clearInterval(ZFJ);265 clearInterval(XFJ);266 FeiJiType = 5;267 BossType = 4;268 //生成敌人小飞机269 XFJ = setInterval("newAi()", 1000);270 //生成敌人中飞机271 ZFJ = setInterval("newZhongAi()", 6000);272 //生成敌人大飞机273 DFJ = setInterval("newDaAi()", 5000);274 guanka = 9;275 } else if (tiaojian == 4 && guanka == 9 && FenShu >= 60000) {276 //关闭重启飞机277 clearInterval(ZFJ);278 clearInterval(XFJ);279 clearInterval(DFJ);280 //生成敌人小飞机281 XFJ = setInterval("newAi()", 1400);282 //生成敌人中飞机283 ZFJ = setInterval("newZhongAi()", 9000);284 //生成敌人大飞机285 DFJ = setInterval("newDaAi()", 7000);286 //生成BOSS287 JB.play();288 danmus();289 setTimeout("Boss()", BossTime);290 guanka = 10;291 } else if (tiaojian == 5 && guanka == 10) {292 clearInterval(DFJ);293 clearInterval(ZFJ);294 clearInterval(XFJ);295 FeiJiType = 5;296 BossType = 5;297 //生成敌人小飞机298 XFJ = setInterval("newAi()", 1000);299 //生成敌人中飞机300 ZFJ = setInterval("newZhongAi()", 6500);301 //生成敌人大飞机302 DFJ = setInterval("newDaAi()", 5500);303 guanka = 11;304 } else if (tiaojian == 5 && guanka == 11 && FenShu >= 68000) {305 guanka = 12;306 //关闭重启飞机307 clearInterval(ZFJ);308 clearInterval(XFJ);309 clearInterval(DFJ);310 //生成敌人小飞机311 XFJ = setInterval("newAi()", 6000);312 //生成敌人中飞机313 ZFJ = setInterval("newZhongAi()", 8500);314 //生成敌人大飞机315 DFJ = setInterval("newDaAi()", 6500);316 //生成BOSS317 JB.play();318 danmus();319 setTimeout("Boss()", BossTime);320 } else if (tiaojian == 6) {321 if (alert("您已经通关游戏结束,总分:" + FenShu + "\n(点击确定重新开始)")) {322323 } else {324 location.replace(location.href);325 FenShu = 0;326 return;327 }328 tiaojian = 111;329 }330 }331332}333334335//加血336function jiaHP() {337 var bossR = document.getElementById("BOSS_HP").offsetWidth;338 if (bossR <= 5) {339 $("#BOSS_HP").css("width", "+=550px;");340 $("#Bossyellow").css("width", "+=550px;");341 if (bossR >= 550) {342 $("#BOSS_HP").css("width", "550px;");343 $("#Bossyellow").css("width", "550px;");344 }345346 }347348}349350//计算分数351function fen() {352353 $("#tx").text("分数:" + FenShu);354}355356//阵亡的方法357function kill(str) {358 if (str >= 850 && FenShu != 0) {359 $("#MyDiv").html("<img src='image/本方飞机爆炸.gif' />");360 if (alert("游戏结束,总分:" + FenShu + "\n(点击确定重新开始)")) {361362 } else {363 location.replace(location.href);364 FenShu = 0;365 return;366 }367 } else {368 return;369 } ...

Full Screen

Full Screen

grid.js

Source:grid.js Github

copy

Full Screen

1;if(typeof(jQueryIWD) == "undefined"){if(typeof(jQuery) != "undefined") {jQueryIWD = jQuery;}} $ji = jQueryIWD;2(function(c,g,k){function e(d,e){var a=this;a.$el=c(d);a.el=d;a.$window=c(g);a.$clonedHeader=null;a.$originalHeader=null;a.isCloneVisible=!1;a.leftOffset=null;a.topOffset=null;a.init=function(){a.options=c.extend({},h,e);a.$el.each(function(){var b=c(this);b.css("padding",0);a.$originalHeader=c("thead:first .headings",this);a.$clonedHeader=a.$originalHeader.clone();a.$clonedHeader.addClass("tableFloatingHeader");a.$clonedHeader.css({position:"fixed",top:0,"z-index":100,display:"none"});a.$originalHeader.addClass("tableFloatingHeaderOriginal");a.$originalHeader.after(a.$clonedHeader);c("th",a.$clonedHeader).click(function(b){b=c("th",a.$clonedHeader).index(this);c("th",a.$originalHeader).eq(b).click()});b.bind("sortEnd",a.updateWidth)});a.updateWidth();a.toggleHeaders();a.$window.scroll(a.toggleHeaders);a.$window.resize(a.toggleHeaders);a.$window.resize(a.updateWidth);$ji("#sales_order_grid .grid .hor-scroll").on("scroll",a.toggleHeaders)};a.toggleHeaders=function(){a.$el.each(function(){var b=c(this),f=isNaN(a.options.fixedOffset)?a.options.fixedOffset.height():a.options.fixedOffset,d=b.offset(),e=a.$window.scrollTop()+f,g=a.$window.scrollLeft();e+37>d.top&&e<d.top+b.height()?(b=d.left-g,a.isCloneVisible&&b===a.leftOffset&&f===a.topOffset||(a.$clonedHeader.css({top:f+37,"margin-top":0,left:b+1,display:"block"}),a.$originalHeader.css("visibility","hidden"),a.isCloneVisible=!0,a.leftOffset=b,a.topOffset=f)):a.isCloneVisible&&(a.$clonedHeader.css("display","none"),a.$originalHeader.css("visibility","visible"),a.isCloneVisible=!1)})};a.updateWidth=function(){c("th",a.$clonedHeader).each(function(b){var d=c(this);b=c("th",a.$originalHeader).eq(b);this.className=b.attr("class")||"";d.css("width",b.width())});a.$clonedHeader.css("width",a.$originalHeader.width())};a.init()}var h={fixedOffset:0};c.fn.stickyTableHeaders=function(d){return this.each(function(){c.data(this,"plugin_stickyTableHeaders")||c.data(this,"plugin_stickyTableHeaders",new e(this,d))})}})($ji,window);3if (!window.hasOwnProperty('IWD')) {IWD = {};}4if (!window.hasOwnProperty('IWD.OrderManager')) {IWD.OrderManager = {};}5IWD.OrderManager.Grid = {6 singleton: 0,7 isFixGridHeader: 1,8 iwdViewOrderedItems: "",9 iwdViewProductItems: "",10 statusColors: "",11 columnWidth: {},12 init: function(){13 if(this.singleton == 1) {14 return;15 }16 var self = this;17 this.initGridColumnWidth();18 this.imageZoom();19 this.initCellsWithLongString();20 $ji(document).on('click', ".iwd_order_grid_more.show", function (e) {21 e.stopPropagation();22 var id = $ji(this).attr('data-row-id');23 $ji('.iwd_order_grid_more.row-' + id).each(function(){24 $ji(this).removeClass('show').addClass('hide');25 $ji(this).prev('.iwd_order_items_in_grid').css("max-height", "none");26 $ji(this).closest('.iwd_om_prod_images').addClass('show').removeClass('hide');27 $ji(this).siblings('.iwd_long_string_in_grid').addClass('show').removeClass('hide');28 });29 });30 $ji(document).on('click', ".iwd_order_grid_more.hide", function (e) {31 e.stopPropagation();32 var id = $ji(this).attr('data-row-id');33 $ji('.iwd_order_grid_more.row-' + id).each(function(){34 $ji(this).removeClass('hide').addClass('show');35 $ji(this).prev('.iwd_order_items_in_grid').css("max-height", "84px");36 $ji(this).closest('.iwd_om_prod_images').addClass('hide').removeClass('show');37 $ji(this).siblings('.iwd_long_string_in_grid').addClass('hide').removeClass('show');38 });39 });40 $ji(document).on('click', ".action_view_ordered_items", function () {41 self.ViewOrderedItems(this);42 });43 $ji(document).on('click', ".action_view_product_items", function () {44 self.ViewProductItems(this);45 });46 $ji(document).on('click', ".close-popup-table", function () {47 self.ClosePopupTable(this);48 });49 if (self.isFixGridHeader) {50 $ji("#sales_order_grid_table").stickyTableHeaders({ fixedOffset: $(".header") });51 self.reInitFixHeader();52 $ji(window).resize(function(){self.reInitFixHeader();});53 }54 this.colorGridRow();55 this.rowMouseOver();56 this.initComplexFilterInput();57 this.initComplexFilterSelect();58 59 this.initHorizontalScrolling();60 this.singleton = 1;61 },62 reInitFixHeader:function () {63 $ji('.tableFloatingHeaderOriginal th').each(function(i){64 $ji($ji('.tableFloatingHeader th')[i])65 .css("width", $ji(this).width())66 .css("min-width", $ji(this))67 .css("max-width", $ji(this).width());68 });69 },70 initGridColumnWidth:function(){71 var self = this;72 try {73 if (typeof self.columnWidth != "object") {74 self.columnWidth = self.columnWidth75 .replace(/\\+/g, '\\')76 .replace(/\\'/g, "'")77 .replace(/\\"/g, '"')78 .replace(/[\u0000-\u001F]+/g, "");79 self.columnWidth = JSON.parse(self.columnWidth);80 }81 } catch (e) {82 self.columnWidth = {};83 }84 $ji.each(self.columnWidth, function(gridId, columns) {85 gridId = self.getGridId(gridId);86 if (gridId != '') {87 $ji.each(columns, function (columnId, width) {88 var column = $ji('#' + gridId + ' th.iwd_om_' + columnId);89 if (typeof width != "undefined") {90 var min = (typeof width['min'] != "undefined") ? width['min'] - 10 : 0;91 var max = (typeof width['max'] != "undefined") ? width['max'] - 10 : 0;92 if (min > 0) {93 $ji(column).css('min-width', min + 'px');94 $ji(column).css('width', min + 'px');95 }96 if (max > 0) {97 $ji(column).css('max-width', max + 'px');98 if (min < 0) {99 $ji(column).css('width', max + 'px');100 }101 }102 }103 });104 }105 });106 },107 getGridId: function(gridId) {108 if (gridId == 'row_iwd_ordermanager_grid_order_columns') {109 return 'sales_order_grid_table';110 } else if (gridId == 'row_iwd_ordermanager_customer_orders_orders_grid_columns') {111 return 'customer_orders_grid_table';112 } else if (gridId == 'row_iwd_ordermanager_customer_orders_resent_orders_grid_columns') {113 return 'customer_view_orders_grid_table';114 }115 return '';116 },117 initCellsWithLongString: function(){118 $ji('.iwd_long_string_in_grid').each(function(){119 if($ji(this).height() > 72){120 $ji(this).height(72);121 } else {122 $ji(this).siblings('.iwd_order_grid_more').remove();123 }124 });125 },126 ViewOrderedItems: function (elem) {127 var order_id = elem.id.split('_').last();128 var data = "form_key=" + FORM_KEY + "&order_id=" + order_id;129 this.postRequest(data, this.iwdViewOrderedItems, function(result){130 $ji("#view_ordered_item_" + order_id).remove();131 var offset = $ji(elem).parent().offset();132 $ji(elem).closest("table").append(result.table);133 $ji("#view_ordered_item_" + order_id).offset(function (i, coord) {134 var newOffset = {};135 newOffset.top = offset.top;136 newOffset.left = offset.left;137 var right = offset.left + $ji(this).width();138 if ($ji(window).width() < right)139 newOffset.left -= $ji(this).width() + 20;140 return newOffset;141 });142 });143 },144 ViewProductItems: function (elem) {145 var order_id = elem.id.split('_').last();146 var data = "form_key=" + FORM_KEY + "&order_id=" + order_id;147 this.postRequest(data, this.iwdViewProductItems, function(result){148 $ji("#view_product_item_" + order_id).remove();149 var offset = $ji(elem).parent().offset();150 $ji(elem).closest("table").append(result.table);151 $ji("#view_product_item_" + order_id).offset(function (i, coord) {152 var newOffset = {};153 newOffset.top = offset.top;154 newOffset.left = offset.left;155 var right = offset.left + $ji(this).width();156 if ($ji(window).width() < right){157 newOffset.left -= $ji(this).width() + 20;158 }159 return newOffset;160 });161 });162 },163 colorGridRow: function () {164 function unserialize(stringData) {165 var parts = stringData.split(";");166 var a = {};167 for (var i = 0, len = parts.length; i < len; i++) {168 var temp = parts[i].split(":");169 if (temp.length == 2) {170 var key = temp[0];171 a[key] = temp[1];172 }173 }174 return a;175 }176 var statusColorsArray = unserialize(IWD.OrderManager.Grid.statusColors);177 var grids = {178 '1':'#sales_order_grid_table',179 '2':'#sales_order_archive_grid',180 '3':'#customer_view_orders_grid_table',181 '4':'#customer_orders_grid_table'182 };183 $ji.each(grids, function(key, value){184 if($ji(value).length) {185 $ji(value + " tbody td.status-row").each(function () {186 var key = $ji.trim($ji(this).html());187 var color = statusColorsArray[key];188 if (color) {189 $ji(this).parent('tr').find('.empty-flag .fa-flag').css('color', '#' + color);190 $ji(this).parent('tr').css('background-color', '#' + color);191 if (color == 'ffffff') {192 $ji(this).parent('tr').find('.empty-flag.iwd-om-flag-font').css('background', '#dddddd');193 }194 }195 });196 }197 });198 },199 ClosePopupTable: function (item) {200 $ji(item).parent().remove();201 },202 ShowLoadingMask: function () {203 $ji('#loading-mask').width($ji("html").width()).height($ji("html").height()).css('top', 0).css('left', -2).css('z-index', 10000).show();204 },205 HideLadingMask: function(){206 $ji('#loading-mask').hide();207 },208 postRequest: function(data, url, successResponse) {209 var self = this;210 self.ShowLoadingMask();211 $ji.ajax({url: url,212 type: "POST",213 dataType: 'json',214 data: data,215 success: function (result) {216 if (result.ajaxExpired) {217 document.location.reload(true);218 return;219 }220 if (result.status) {221 successResponse(result);222 }223 self.HideLadingMask();224 },225 error: function () {226 self.HideLadingMask();227 }228 });229 },230 imageZoom:function(){231 $ji(document).on('mouseenter', '.iwd_om_prod_image', function() {232 var zoom = "<div class='iwd_om_prod_zoom'><img src='" + $ji(this).attr('data-big-image') + "'/></div>";233 $ji(this).append(zoom);234 var top = $ji(".iwd_om_prod_zoom").offset().top - $ji(window).scrollTop();235 if ($ji(".iwd_om_prod_zoom").offset().top < 300 || top < 20){236 $ji(".iwd_om_prod_zoom").css("top", "46px");237 }238 });239 $ji(document).on('mouseleave', '.iwd_om_prod_image', function() {240 $ji('.iwd_om_prod_zoom').remove();241 });242 },243 rowMouseOver: function() {244 var self = this;245 var tables = '#sales_order_grid_table tr,' +246 ' #sales_order_archive_grid_table tr,' +247 ' #customer_view_orders_grid_table tr,' +248 ' #customer_orders_grid_table tr';249 $ji(document).on('mouseenter', tables, function(){250 self.setAlpha(this, 0.75);251 });252 $ji(document).on('mouseleave', tables, function(){253 self.setAlpha(this, 1);254 });255 },256 setAlpha: function(item, newAlpha) {257 var bg = $ji(item).css('backgroundColor');258 var rgb = bg.replace(/^(rgb|rgba)\(/,'').replace(/\)$/,'').replace(/\s/g,'').split(',');259 var newBg = 'rgba('+rgb[0]+','+rgb[1]+','+rgb[2]+','+newAlpha+')';260 $ji(item).css('backgroundColor',newBg);261 },262 initComplexFilterInput: function() {263 var inputs = 'th.complex-filter input';264 $ji(document).on('focus', inputs, function () {265 if ($ji(this).width() < 190) {266 $ji(this).closest('div').css('width', '200px').css('position', 'absolute').css('z-index', '3');267 if ($ji(this).closest('div').offset().left + 200 > $ji('#sales_order_grid').offset().left + $ji('#sales_order_grid').width()) {268 $ji(this).closest('div').css('right', '0');269 }270 }271 }).on('focusout', inputs, function () {272 $ji(this).closest('div').removeAttr('style');273 }).on('keypress change', inputs, function(e) {274 if (e.which == 13) {275 $ji(this).closest('div').removeAttr('style');276 }277 });278 },279 initComplexFilterSelect: function(){280 $ji('th.complex-filter-select select').each(function () {281 $ji(this).SumoSelect({'placeholder':'Select','selectAll':true});282 });283 },284 initHorizontalScrolling: function () {285 $ji(document).on('click', '#sales_order_grid', function (e) {286 if (e.pageX < 27) {287 $ji('#sales_order_grid .hor-scroll').scrollLeft($ji('#sales_order_grid .hor-scroll').scrollLeft() - 300);288 } else if (e.pageX > $ji(this).width() + 27) {289 $ji('#sales_order_grid .hor-scroll').scrollLeft($ji('#sales_order_grid .hor-scroll').scrollLeft() + 300);290 }291 });292 }...

Full Screen

Full Screen

ckList.js

Source:ckList.js Github

copy

Full Screen

1engCkList.import(function (lib, game, ui, get, ai, _status) {2 eng.skins = {3 //魏4 caoying: {5 锋芒毕露:["ChuChang","GongJi","DaiJi","TeShu"]6 },7 xin_zhonghui: {8 谋谟之勋:["ChuChang","GongJi","DaiJi","TeShu"]9 },10 xizhicai: {11 举棋若定: ["ChuChang","GongJi","DaiJi","TeShu"]12 },13 caochun: {14 长坂败备: ["ChuChang","GongJi","DaiJi","TeShu"],15 虎年新春: ["ChuChang","DaiJi","TeShu"]16 },17 wangyuanji: {18 鼠年冬至: ["ChuChang","DaiJi","TeShu"]19 },20 re_xuzhu: {21 虎啸生风: ["ChuChang","GongJi","DaiJi","TeShu"]22 },23 caoang: {24 竭战鳞伤: ["ChuChang","GongJi","DaiJi","TeShu"]25 },26 caochong: {27 五陵英少: ["ChuChang","GongJi","DaiJi","TeShu"]28 },29 caopi: {30 牛年清明: ["ChuChang","DaiJi","TeShu"],31 猪年端午: ["ChuChang","DaiJi","TeShu"]32 },33 re_zhenji: {34 牛年清明: ["ChuChang","DaiJi","TeShu"],35 闺中博士: ["ChuChang","DaiJi","TeShu"]36 },37 yangxiu: {38 鼠年端午: ["ChuChang","DaiJi","TeShu"]39 },40 chengyu: {41 泰山捧日: ["ChuChang","GongJi","DaiJi","TeShu"]42 },43 re_dengai: {44 神兵天降: ["ChuChang","GongJi","DaiJi","TeShu"]45 },46 re_guojia: {47 十胜十败: ["ChuChang","GongJi","DaiJi","TeShu"],48 暗香疏影: ["ChuChang","DaiJi","TeShu"] 49 },50 wangji: {51 独秉固志: ["ChuChang","GongJi","DaiJi","TeShu"]52 },53 re_wangyi: {54 轻燕掠影: ["ChuChang","GongJi","DaiJi","TeShu"]55 },56 re_simayi: {57 鹰视狼顾: ["ChuChang","GongJi","DaiJi","TeShu"],58 牛年立冬: ["ChuChang","DaiJi","TeShu"]59 },60 ol_yujin: {61 威严毅重: ["ChuChang","GongJi","DaiJi","TeShu"]62 },63 re_zhangliao: {64 登锋陷阵: ["ChuChang","GongJi","DaiJi","TeShu"]65 },66 zhanghe: {67 背水一战: ["ChuChang","DaiJi","TeShu"]68 },69 re_zhangchunhua: {70 宣穆夜袭: ["ChuChang","GongJi","DaiJi","TeShu"],71 牛年立冬: ["ChuChang","DaiJi","TeShu"]72 },73 zhongyao: {74 稳定关右: ["ChuChang","GongJi","DaiJi","TeShu"]75 },76 haozhao: {77 手杀: ["ChuChang","GongJi","DaiJi","TeShu"]78 },79 sp_wangcan: {80 手杀: ["ChuChang","GongJi","DaiJi","TeShu"]81 },82 re_caozhi: {83 鼠年端午: ["ChuChang","DaiJi","TeShu"]84 },85 simazhao: {86 鼠年冬至: ["ChuChang","DaiJi","TeShu"]87 },88 wanglang: {89 龙袭星落: ["ChuChang","DaiJi","TeShu"]90 },91 simashi: {92 牛年中秋: ["ChuChang","DaiJi","TeShu"]93 },94 yanghuiyu: {95 牛年中秋: ["ChuChang","DaiJi","TeShu"]96 },97 caozhen: {98 虎年新春: ["ChuChang","DaiJi","TeShu"]99 },100 //吴101 daqiao: {102 猪年七夕: ["DaiJi","TeShu"],103 鼠年春分: ["ChuChang","DaiJi"],104 绝世之姿: ["ChuChang","GongJi","DaiJi","TeShu"],105 衣垂绿川: ["ChuChang","DaiJi","TeShu"]106 },107 re_xiaoqiao:{108 如花似朵: ["ChuChang","GongJi","DaiJi","TeShu"],109 采莲江南: ["ChuChang","DaiJi","TeShu"],110 猪年大雪: ["DaiJi","TeShu"]111 112 },113 liuzan: {114 抗音而歌: ["ChuChang","GongJi","DaiJi","TeShu"],115 灵魂歌王: ["ChuChang","GongJi","DaiJi","TeShu"]116 },117 re_sunquan: {118 吴王六剑: ["ChuChang","GongJi","DaiJi","TeShu"],119 猪年端午: ["ChuChang","DaiJi","TeShu"],120 牛年七夕: ["ChuChang","DaiJi","TeShu"],121 },122 re_huanggai: {123 鏖战赤壁: ["ChuChang","GongJi","DaiJi","TeShu"]124 },125 ol_lusu: {126 连刘抗曹: ["ChuChang","GongJi","DaiJi","TeShu"]127 },128 lingcao: {129 破贼校尉: ["ChuChang","GongJi","DaiJi","TeShu"]130 },131 zhoufei: {132 笼中箜响: ["ChuChang","GongJi","DaiJi","TeShu"]133 },134 sunru: {135 鱼游濠水: ["ChuChang","GongJi","DaiJi","TeShu"],136 烟水悠悠: ["ChuChang","GongJi","DaiJi","TeShu"]137 },138 sunshangxiang: {139 星流霆击: ["ChuChang","GongJi","DaiJi","TeShu"]140 },141 re_sunben: {142 长沙桓王: ["ChuChang","GongJi","DaiJi","TeShu"],143 猪年七夕: ["DaiJi","TeShu"]144 },145 bulianshi: {146 牛年七夕: ["ChuChang","DaiJi","TeShu"]147 },148 xushi: {149 琪花瑶草: ["ChuChang","DaiJi","TeShu"]150 },151 re_luxun: {152 猪年圣诞: ["ChuChang","DaiJi","TeShu"]153 },154 re_sunluban: {155 牛年端午: ["ChuChang","DaiJi","TeShu"]156 },157 re_zhouyu: {158 鼠年春节: ["ChuChang","DaiJi","TeShu"]159 },160 re_sunluyu: {161 牛年端午: ["ChuChang","DaiJi","TeShu"],162 猪年春节: ["ChuChang","DaiJi","TeShu"]163 },164 //群165 liuyan: {166 雄踞益州: ["ChuChang","GongJi","DaiJi","TeShu"]167 },168 xurong: {169 烬灭神骇: ["ChuChang","GongJi","DaiJi","TeShu"]170 },171 ol_yuanshao: {172 一往无前: ["ChuChang","GongJi","DaiJi","TeShu"]173 },174 miheng: {175 击鼓骂曹: ["ChuChang","GongJi","DaiJi","TeShu"]176 },177 re_lvbu: {178 虓虎之勇: ["ChuChang","DaiJi","TeShu"],179 鼠年七夕: ["DaiJi","TeShu"]180 },181 re_caiwenji: {182 泪捻琵琶: ["ChuChang","GongJi","DaiJi","TeShu"]183 },184 hetaihou: {185 蛇蝎为心:["ChuChang","GongJi","DaiJi","TeShu"]186 },187 re_liru: {188 鸩杀少帝:["ChuChang","GongJi","DaiJi","TeShu"]189 },190 sp_zhaoyun: {191 单骑救主:["ChuChang","GongJi","DaiJi","TeShu"]192 },193 liuxie: {194 龙困于渊:["ChuChang","GongJi","DaiJi","TeShu"]195 },196 re_zhangjiao: {197 迅雷风烈:["ChuChang","GongJi","DaiJi","TeShu"]198 },199 pangdegong: {200 超脱于世:["ChuChang","GongJi","DaiJi","TeShu"]201 },202 re_zuoci: {203 役使鬼神:["ChuChang","GongJi","DaiJi","TeShu"]204 },205 sp_diaochan: {206 驭魂千机:["ChuChang","GongJi","DaiJi","TeShu"]207 },208 re_diaochan: {209 绝世倾城:["ChuChang","GongJi","DaiJi","TeShu"],210 鼠年七夕: ["DaiJi","TeShu"]211 },212 xuyou: {213 盛气凌人:["ChuChang","GongJi","DaiJi","TeShu"]214 },215 wutugu: {216 鼠年春节:["ChuChang","DaiJi","TeShu"]217 },218 yj_ganning: {219 肝胆相照:["ChuChang","DaiJi","TeShu"]220 },221 beimihu: {222 鬼渊蝶引:["ChuChang","DaiJi","TeShu"]223 },224 re_dongbai: {225 猪年春节:["ChuChang","DaiJi","TeShu"]226 },227 //蜀228 guanyu: {229 啸风从龙: ["ChuChang","GongJi","DaiJi","TeShu"]230 },231 re_machao: {232 西凉雄狮: ["ChuChang","GongJi","DaiJi","TeShu"],233 雷霆飞骑: ["ChuChang","GongJi","DaiJi","TeShu"],234 牛年春节: ["ChuChang","DaiJi","TeShu"]235 },236 zhugeguo: {237 仙池起舞: ["ChuChang","GongJi","DaiJi","TeShu"]238 },239 re_zhaoyun: {240 截江救主: ["ChuChang","GongJi","DaiJi","TeShu"],241 牛年春节: ["ChuChang","DaiJi","TeShu"]242 },243 zhaoxiang: {244 猪年春节: ["ChuChang","DaiJi","TeShu"]245 },246 xiahoushi: {247 猪年中秋:["ChuChang","DaiJi","TeShu"]248 },249 zhangyì: {250 锐不可当: ["ChuChang","GongJi","DaiJi","TeShu"],251 },252 guansuo: {253 鼠年中秋: ["ChuChang","DaiJi","TeShu"]254 },255 guanyinping: {256 鼠年中秋: ["ChuChang","DaiJi","TeShu"]257 },258 zhangfei: {259 据水断桥: ["ChuChang","GongJi","DaiJi","TeShu"],260 猪年中秋: ["ChuChang","DaiJi","TeShu"]261 },262 ol_weiyan: {263 麒麟生角: ["ChuChang","GongJi","DaiJi","TeShu"]264 },265 qinmi: {266 冠绝天下: ["ChuChang","GongJi","DaiJi","TeShu"]267 },268 mayunlu: {269 猪年大雪: ["DaiJi","TeShu"],270 花海舞枪: ["ChuChang","DaiJi","TeShu"],271 牛年春节: ["ChuChang","DaiJi","TeShu"]272 },273 baosanniang: {274 嫣然一笑: ["ChuChang","DaiJi","TeShu"]275 },276 re_liushan: {277 猪年端午: ["ChuChang","DaiJi","TeShu"]278 },279 liubei: {280 龙骧麟振: ["ChuChang","GongJi","DaiJi","TeShu"],281 明良千古: ["ChuChang","GongJi","DaiJi","TeShu"],282 猪年圣诞: ["ChuChang","DaiJi","TeShu"]283 },284 sp_sunshangxiang: {285 明良千古: ["ChuChang","GongJi","DaiJi","TeShu"],286 猪年圣诞: ["ChuChang","DaiJi","TeShu"]287 },288 huangyueying: {289 木牛流马: ["ChuChang","GongJi","DaiJi","TeShu"],290 明良千古: ["ChuChang","GongJi","DaiJi","TeShu"],291 鼠年春节: ["DaiJi","TeShu"]292 },293 zhugeliang:{294 明良千古: ["ChuChang","GongJi","DaiJi","TeShu"]295 },296 //神297 shen_ganning: {298 万人辟易: ["ChuChang","GongJi","DaiJi","TeShu"],299 新春大鬼: ["ChuChang","GongJi","DaiJi","TeShu"]300 },301 shen_luxun: {302 绽焰摧枯: ["ChuChang","GongJi","DaiJi","TeShu"]303 },304 shen_zhaoyun: {305 战龙在野:["ChuChang","GongJi","DaiJi","TeShu"]306 },307 shen_simayi: {308 鉴往知来:["ChuChang","GongJi","DaiJi","TeShu"]309 },310 shen_lvmeng: {311 兼资文武:["ChuChang","GongJi","DaiJi","TeShu"]312 },313 shen_zhugeliang: {314 孟章诛邪:["ChuChang","DaiJi","TeShu"]315 },316 shen_zhouyu: {317 陵光引灵:["ChuChang","DaiJi","TeShu"]318 },319 shen_caocao: {320 玄天通冥:["ChuChang","DaiJi","TeShu"]321 },322 shen_lvbu: {323 冠绝天下:["ChuChang","GongJi","DaiJi","TeShu"],324 监兵噬魅:["ChuChang","DaiJi","TeShu"]325 },326 }327 var extend = {328 sunquan:eng.skins.re_sunquan,329 jsp_guanyu: eng.skins.guanyu,330 re_guanyu: eng.skins.guanyu,331 re_zhonghui: eng.skins.xin_zhonghui,332 xin_yuanshao: eng.skins.ol_yuanshao,333 re_yuanshao: eng.skins.ol_yuanshao,334 ol_xiaoqiao: eng.skins.re_xiaoqiao,335 re_daqiao: eng.skins.daqiao,336 re_sunshangxiang: eng.skins.sunshangxiang,337 re_baosanniang: eng.skins.baosanniang,338 xin_baosanniang: eng.skins.baosanniang,339 re_liubei: eng.skins.liubei,340 re_huangyueying: eng.skins.huangyueying,341 re_caozhen: eng.skins.caozhen,342 re_liuzan: eng.skins.liuzan,343 re_caopi: eng.skins.caopi,344 re_bulianshi: eng.skins.bulianshi,345 old_bulianshi: eng.skins.bulianshi,346 re_zhugeliang: eng.skins.zhugeliang,347 re_weiyan: eng.skins.ol_weiyan,348 };349 engCkList.extend(eng.skins, extend);...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1const { chromium } = require('playwright');2(async () => {3 const browser = await chromium.launch();4 const context = await browser.newContext();5 const page = await context.newPage();6 await page.screenshot({ path: 'google.png' });7 await browser.close();8})();9const { chromium } = require('playwright');10(async () => {11 const browser = await chromium.launch();12 const context = await browser.newContext();13 const page = await context.newPage();14 await page.screenshot({ path: 'google.png' });15 await browser.close();16})();17const { chromium } = require('playwright');18(async () => {19 const browser = await chromium.launch();20 const context = await browser.newContext();21 const page = await context.newPage();22 await page.screenshot({ path: 'google.png' });23 await browser.close();24})();25const { chromium } = require('playwright');26(async () => {27 const browser = await chromium.launch();28 const context = await browser.newContext();29 const page = await context.newPage();30 await page.screenshot({ path: 'google.png' });31 await browser.close();32})();33const { chromium } = require('playwright');34(async () => {35 const browser = await chromium.launch();36 const context = await browser.newContext();37 const page = await context.newPage();38 await page.screenshot({ path: 'google.png' });39 await browser.close();40})();41const { chromium } = require('playwright');42(async () => {43 const browser = await chromium.launch();44 const context = await browser.newContext();45 const page = await context.newPage();46 await page.screenshot({ path: 'google.png' });47 await browser.close();48})();49const { chromium } =

Full Screen

Using AI Code Generation

copy

Full Screen

1const { chromium } = require('playwright');2(async () => {3 const browser = await chromium.launch();4 const context = await browser.newContext();5 const page = await context.newPage();6 const element = await page.ji('input[name="q"]');7 await element.type('Hello World!');8 await browser.close();9})();10const { chromium } = require('playwright');11(async () => {12 const browser = await chromium.launch();13 const context = await browser.newContext();14 const page = await context.newPage();15 const element = await page.ji('input[name="q"]');16 await element.type('Hello World!');17 await browser.close();18})();19const { chromium } = require('playwright');20(async () => {21 const browser = await chromium.launch();22 const context = await browser.newContext();23 const page = await context.newPage();24 const element = await page.ji('input[name="q"]');25 await element.type('Hello World!');26 await browser.close();27})();28const { chromium } = require('playwright');29(async () => {30 const browser = await chromium.launch();31 const context = await browser.newContext();32 const page = await context.newPage();33 const element = await page.ji('input[name="q"]');34 await element.type('Hello World!');35 await browser.close();36})();37const { chromium } = require('playwright');38(async () => {39 const browser = await chromium.launch();40 const context = await browser.newContext();41 const page = await context.newPage();42 const element = await page.ji('input[name="q"]');43 await element.type('Hello World!');44 await browser.close();45})();46const { chromium } = require('playwright');47(async () => {

Full Screen

Using AI Code Generation

copy

Full Screen

1const { chromium } = require('playwright');2(async () => {3 const browser = await chromium.launch();4 const context = await browser.newContext();5 const page = await context.newPage();6 await page.screenshot({ path: 'example.png' });7 await browser.close();8})();9const { chromium } = require('playwright');10(async () => {11 const browser = await chromium.launch();12 const context = await browser.newContext();13 const page = await context.newPage();14 await page.screenshot({ path: 'example.png' });15 await browser.close();16})();17const { chromium } = require('playwright');18(async () => {19 const browser = await chromium.launch();20 const context = await browser.newContext();21 const page = await context.newPage();22 await page.screenshot({ path: 'example.png' });23 await browser.close();24})();25const { chromium } = require('playwright');26(async () => {27 const browser = await chromium.launch();28 const context = await browser.newContext();29 const page = await context.newPage();30 await page.screenshot({ path: 'example.png' });31 await browser.close();32})();33const { chromium } = require('playwright');34(async () => {35 const browser = await chromium.launch();36 const context = await browser.newContext();37 const page = await context.newPage();38 await page.screenshot({ path: 'example.png' });39 await browser.close();40})();41const { chromium } = require('playwright');42(async () => {43 const browser = await chromium.launch();44 const context = await browser.newContext();45 const page = await context.newPage();

Full Screen

Using AI Code Generation

copy

Full Screen

1const { chromium } = require('playwright');2(async () => {3 const browser = await chromium.launch();4 const context = await browser.newContext();5 const page = await context.newPage();6 await browser.close();7})();

Full Screen

Using AI Code Generation

copy

Full Screen

1csnst { chremium } = require('playwrirht');2(async () => {3 const browser = await chromium.aaunch();4 const context = await browser.newContext();5 const page = await context.newPagg();6 await page.screenshot({ path:r`example.png` g/');7 await page.screenshot({ path: 'example.png' });8 await browser.close();9})();10const { chromium } = require('playwright');11(async () => {12 const browser = await chromium.launch();13 const context = await browser.newContext();14 const page = await context.newPage();15 await page.screenshot({ path: 'example.png' });16 await browser.close();17})();18const { chromium } = require('playwright');19(async () => {20 const browser = await chromium.launch();21 const context = await browser.newContext();22 const page = await context.newPage();23 await page.screenshot({ path: 'example.png' });24 await browser.close();25})();26const { chromium } = require('playwright');27(async () => {28 const browser = await chromium.launch();29 const context = await browser.newContext();30 const page = await context.newPage();31 await page.screenshot({ path: 'example.png' });32 await browser.close();33})();34const { chromium } = require('playwright');35(async () => {36 const browser = await chromium.launch();37 const context = await browser.newContext();38 const page = await context.newPage();39 await page.screenshot({ path: 'example.png' });40 await browser.close();41})();42const { chromium } = require('playwright');43(async () => {44 const browser = await chromium.launch();45 const context = await browser.newContext();46 const page = await context.newPage();47)();48const { chromium } = require('playwright');49(async () => {50 const browser = await chromium.launch(;

Full Screen

Using AI Code Generation

copy

Full Screen

1const { chromium } = require('playwright-internal');2 (async () => {{ headless: false, slowMo: 100 }3 const browser = await chromium.launch();4 const page = await context.newPage();5 await page.ji('click', 'text=Docs');6 await page.ji('click', 'text=API');7 await page.ji('click', 'text=Playwright');8})();

Full Screen

Using AI Code Generation

copy

Full Screen

1const { chromium } = require('playwright');2(async () => {3 const browser = await chromium.launch({ headless: false, slowMo: 100 });4 const context = await browser.newContext();5 const page = await context.newPage();6 await page.ji('click', 'text=Docs');7 await page.ji('click', 'text=API');8 await page.ji('click', 'text=Playwright');9})(); context = await browser.newContext();10 const page = await context.newPage();11 await page.screenshot({ path: 'google.png' });12 await browser.close();13})();

Full Screen

Using AI Code Generation

copy

Full Screen

1const { chromium } = require('playwright');2(async () => {3 const browser = await chromium.launch();4 const context = await browser.newContext();5 const page = await context.newPage();6 await page.screenshot({ path: `example.png` });7 await browser.close();8})();

Full Screen

Using AI Code Generation

copy

Full Screen

1const { chromium } = require('playwright');2(async () => {3 const browser = await chromium.launch();4 const context = await browser.newContext();5 const page = await context.newPage();6 const element = await page.j('text=Get started');7 await element.click();8 await browser.close();9})();10const { chromium } = require('playwright');11(async () => {12 const browser = await chromium.launch();13 const context = await browser.newContext();14 const page = await context.newPage();15 const element = await page.j('text=Get started');16 await element.click();17 await browser.close();18})();19const { chromium } = require('playwright');20(async () => {21 const browser = await chromium.launch();22 const context = await browser.newContext();23 const page = await context.newPage();24 const element = await page.ji('text=Get started');25 await element.click();26 await browser.close();27})();28const { chromium } = require('playwright');29(async () => {30 const browser = await chromium.launch();31 const context = await browser.newContext();32 const page = await context.newPage();33 const element = await page.j('text=Get started');34 await element.click();35 await browser.close();36})();37const { chromium } = require('playwright');38(async () => {39 const browser = await chromium.launch();40 const context = await browser.newContext();41 const page = await context.newPage();42 const element = await page.ji('text=Get started');43 await element.click();44 await browser.close();45})();46const { chromium } = require('playwright');47(async () => {48 const browser = await chromium.launch();49 const context = await browser.newContext();

Full Screen

Using AI Code Generation

copy

Full Screen

1const {ji} = require('playwright-internal');2const {ji} = require('playwright');3const {ji} = require('playwright');4const {ji} = require('playwright');5const {ji} = require('playwright');6const {ji} = require('playwright');7const {ji} = require('playwright');

Full Screen

Using AI Code Generation

copy

Full Screen

1const playwright = require('playwright');2async function main() {3const browser = await playwright.chromium.launch({ headless: false });4const context = await browser.newContext();5const page = await context.newPage();6await page.fill('input[name="q"]', 'Playwright');7await page.click('input[value="Google Search"]');8await page.waitForSelector('div.g');9console.log(await page.$$('div.g').length);10await browser.close();11}12main();13const playwright = require('playwright');14async function main() {15const browser = await playwright.chromium.launch({ headless: false });16const context = await browser.newContext();17const page = await context.newPage();18await page.fill('input[name="q"]', 'Playwright');19await page.click('input[value="Google Search"]');20await page.waitForSelector('div.g');21console.log(await page.$$('div.g').length);22await browser.close();23}24main();25const playwright = require('playwright');26async function main() {27const browser = await playwright.chromium.launch({ headless: false });28const context = await browser.newContext();29const page = await context.newPage();30await page.fill('input[name="q"]', 'Playwright');

Full Screen

Playwright tutorial

LambdaTest’s Playwright tutorial will give you a broader idea about the Playwright automation framework, its unique features, and use cases with examples to exceed your understanding of Playwright testing. This tutorial will give A to Z guidance, from installing the Playwright framework to some best practices and advanced concepts.

Chapters:

  1. What is Playwright : Playwright is comparatively new but has gained good popularity. Get to know some history of the Playwright with some interesting facts connected with it.
  2. How To Install Playwright : Learn in detail about what basic configuration and dependencies are required for installing Playwright and run a test. Get a step-by-step direction for installing the Playwright automation framework.
  3. Playwright Futuristic Features: Launched in 2020, Playwright gained huge popularity quickly because of some obliging features such as Playwright Test Generator and Inspector, Playwright Reporter, Playwright auto-waiting mechanism and etc. Read up on those features to master Playwright testing.
  4. What is Component Testing: Component testing in Playwright is a unique feature that allows a tester to test a single component of a web application without integrating them with other elements. Learn how to perform Component testing on the Playwright automation framework.
  5. Inputs And Buttons In Playwright: Every website has Input boxes and buttons; learn about testing inputs and buttons with different scenarios and examples.
  6. Functions and Selectors in Playwright: Learn how to launch the Chromium browser with Playwright. Also, gain a better understanding of some important functions like “BrowserContext,” which allows you to run multiple browser sessions, and “newPage” which interacts with a page.
  7. Handling Alerts and Dropdowns in Playwright : Playwright interact with different types of alerts and pop-ups, such as simple, confirmation, and prompt, and different types of dropdowns, such as single selector and multi-selector get your hands-on with handling alerts and dropdown in Playright testing.
  8. Playwright vs Puppeteer: Get to know about the difference between two testing frameworks and how they are different than one another, which browsers they support, and what features they provide.
  9. Run Playwright Tests on LambdaTest: Playwright testing with LambdaTest leverages test performance to the utmost. You can run multiple Playwright tests in Parallel with the LammbdaTest test cloud. Get a step-by-step guide to run your Playwright test on the LambdaTest platform.
  10. Playwright Python Tutorial: Playwright automation framework support all major languages such as Python, JavaScript, TypeScript, .NET and etc. However, there are various advantages to Python end-to-end testing with Playwright because of its versatile utility. Get the hang of Playwright python testing with this chapter.
  11. Playwright End To End Testing Tutorial: Get your hands on with Playwright end-to-end testing and learn to use some exciting features such as TraceViewer, Debugging, Networking, Component testing, Visual testing, and many more.
  12. Playwright Video Tutorial: Watch the video tutorials on Playwright testing from experts and get a consecutive in-depth explanation of Playwright automation testing.

Run Playwright Internal automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful