12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508 |
- <template>
- <div>
- <div class="tip">
- <img src="../assets/img/shop/tips.png" alt="" />
- </div>
- <div class="img">
- <div
- v-show="f3 != 1"
- id="screan"
- v-drag="{
- go,
- setPan,
- getPan,
- setTou,
- getTou,
- setAi,
- getAi,
- setScrean,
- getScrean,
- setlightWhite,
- getlightWhite,
- setlightBlue,
- getlightBlue,
- setf1White,
- getf1White,
- setF4,
- getF4,
- setF2,
- getF2,
- setLight,
- getLight,
- setwheelWhite,
- getwheelWhite,
- setwheelBlack,
- getwheelBlack,
- setF3,
- getF3,
- }"
- >
- <img src="../assets/img/light/screan.png" alt="" />
- </div>
- <div
- v-show="f3 != 1"
- id="tou"
- v-drag="{
- go,
- setPan,
- getPan,
- setTou,
- getTou,
- setAi,
- getAi,
- setScrean,
- getScrean,
- setlightWhite,
- getlightWhite,
- setlightBlue,
- getlightBlue,
- setf1White,
- getf1White,
- setF4,
- getF4,
- setF2,
- getF2,
- setLight,
- getLight,
- setwheelWhite,
- getwheelWhite,
- setwheelBlack,
- getwheelBlack,
- setF3,
- getF3,
- }"
- >
- <img src="../assets/img/tou1.png" alt="" />
- </div>
- <div
- v-show="f3 != 1"
- id="ai"
- v-drag="{
- go,
- setPan,
- getPan,
- setTou,
- getTou,
- setAi,
- getAi,
- setScrean,
- getScrean,
- setlightWhite,
- getlightWhite,
- setlightBlue,
- getlightBlue,
- setf1White,
- getf1White,
- setF4,
- getF4,
- setF2,
- getF2,
- setLight,
- getLight,
- setwheelWhite,
- getwheelWhite,
- setwheelBlack,
- getwheelBlack,
- setF3,
- getF3,
- }"
- >
- <img src="../assets/img/ai.png" alt="" />
- </div>
- <div
- id="lightBlue"
- v-drag="{
- go,
- setPan,
- getPan,
- setTou,
- getTou,
- setAi,
- getAi,
- setScrean,
- getScrean,
- setlightWhite,
- getlightWhite,
- setlightBlue,
- getlightBlue,
- setf1White,
- getf1White,
- setF4,
- getF4,
- setF2,
- getF2,
- setLight,
- getLight,
- setwheelWhite,
- getwheelWhite,
- setwheelBlack,
- getwheelBlack,
- setF3,
- getF3,
- }"
- >
- <img src="../assets/img/car/lightBlue.png" alt="" />
- </div>
- <div
- id="lightWhite"
- v-drag="{
- go,
- setPan,
- getPan,
- setTou,
- getTou,
- setAi,
- getAi,
- setScrean,
- getScrean,
- setlightWhite,
- getlightWhite,
- setlightBlue,
- getlightBlue,
- setf1White,
- getf1White,
- setF4,
- getF4,
- setF2,
- getF2,
- setLight,
- getLight,
- setwheelWhite,
- getwheelWhite,
- setwheelBlack,
- getwheelBlack,
- setF3,
- getF3,
- }"
- >
- <img src="../assets/img/car/lightWhite.png" alt="" />
- </div>
- <div
- v-show="f3 != 1"
- id="F3"
- v-drag="{
- go,
- setPan,
- getPan,
- setTou,
- getTou,
- setAi,
- getAi,
- setScrean,
- getScrean,
- setlightWhite,
- getlightWhite,
- setlightBlue,
- getlightBlue,
- setf1White,
- getf1White,
- setF4,
- getF4,
- setF2,
- getF2,
- setLight,
- getLight,
- setwheelWhite,
- getwheelWhite,
- setwheelBlack,
- getwheelBlack,
- setF3,
- getF3,
- }"
- >
- <img src="../assets/img/car/f3.png" alt="" />
- </div>
- <div
- id="F4"
- v-drag="{
- go,
- setPan,
- getPan,
- setTou,
- getTou,
- setAi,
- getAi,
- setScrean,
- getScrean,
- setlightWhite,
- getlightWhite,
- setlightBlue,
- getlightBlue,
- setf1White,
- getf1White,
- setF4,
- getF4,
- setF2,
- getF2,
- setLight,
- getLight,
- setwheelWhite,
- getwheelWhite,
- setwheelBlack,
- getwheelBlack,
- setF3,
- getF3,
- }"
- >
- <img src="../assets/img/car/f4.png" alt="" />
- </div>
- <div
- id="F2"
- v-drag="{
- go,
- setPan,
- getPan,
- setTou,
- getTou,
- setAi,
- getAi,
- setScrean,
- getScrean,
- setlightWhite,
- getlightWhite,
- setlightBlue,
- getlightBlue,
- setf1White,
- getf1White,
- setF4,
- getF4,
- setF2,
- getF2,
- setLight,
- getLight,
- setwheelWhite,
- getwheelWhite,
- setwheelBlack,
- getwheelBlack,
- setF3,
- getF3,
- }"
- >
- <img src="../assets/img/car/f2.png" alt="" />
- </div>
- <div
- id="f1White"
- v-drag="{
- go,
- setPan,
- getPan,
- setTou,
- getTou,
- setAi,
- getAi,
- setScrean,
- getScrean,
- setlightWhite,
- getlightWhite,
- setlightBlue,
- getlightBlue,
- setf1White,
- getf1White,
- setF4,
- getF4,
- setF2,
- getF2,
- setLight,
- getLight,
- setwheelWhite,
- getwheelWhite,
- setwheelBlack,
- getwheelBlack,
- setF3,
- getF3,
- }"
- >
- <img src="../assets/img/car/f1White.png" alt="" />
- </div>
- <div
- id="f1Blue"
- v-drag="{
- go,
- setPan,
- getPan,
- setTou,
- getTou,
- setAi,
- getAi,
- setScrean,
- getScrean,
- setlightWhite,
- getlightWhite,
- setlightBlue,
- getlightBlue,
- setf1White,
- getf1White,
- setF4,
- getF4,
- setF2,
- getF2,
- setLight,
- getLight,
- setwheelWhite,
- getwheelWhite,
- setwheelBlack,
- getwheelBlack,
- setF3,
- getF3,
- }"
- >
- <img src="../assets/img/car/f1Blue.png" alt="" />
- </div>
- <div
- id="wheelWhite"
- v-drag="{
- go,
- setPan,
- getPan,
- setTou,
- getTou,
- setAi,
- getAi,
- setScrean,
- getScrean,
- setlightWhite,
- getlightWhite,
- setlightBlue,
- getlightBlue,
- setf1White,
- getf1White,
- setF4,
- getF4,
- setF2,
- getF2,
- setLight,
- getLight,
- setwheelWhite,
- getwheelWhite,
- setwheelBlack,
- getwheelBlack,
- setF3,
- getF3,
- }"
- >
- <img src="../assets/img/car/wheelWhite.png" alt="" />
- </div>
- <div
- id="wheelBlack"
- v-drag="{
- go,
- setPan,
- getPan,
- setTou,
- getTou,
- setAi,
- getAi,
- setScrean,
- getScrean,
- setlightWhite,
- getlightWhite,
- setlightBlue,
- getlightBlue,
- setf1White,
- getf1White,
- setF4,
- getF4,
- setF2,
- getF2,
- setLight,
- getLight,
- setwheelWhite,
- getwheelWhite,
- setwheelBlack,
- getwheelBlack,
- setF3,
- getF3,
- }"
- >
- <img src="../assets/img/car/wheelBlack.png" alt="" />
- </div>
- <div
- id="light"
- v-drag="{
- go,
- setPan,
- getPan,
- setTou,
- getTou,
- setAi,
- getAi,
- setScrean,
- getScrean,
- setlightWhite,
- getlightWhite,
- setlightBlue,
- getlightBlue,
- setf1White,
- getf1White,
- setF4,
- getF4,
- setF2,
- getF2,
- setLight,
- getLight,
- setwheelWhite,
- getwheelWhite,
- setwheelBlack,
- getwheelBlack,
- setF3,
- getF3,
- }"
- >
- <img src="../assets/img/car/light.png" alt="" />
- </div>
- <div
- v-show="f3 == 1"
- id="line"
- v-drag="{
- go,
- setPan,
- getPan,
- setTou,
- getTou,
- setAi,
- getAi,
- setScrean,
- getScrean,
- setlightWhite,
- getlightWhite,
- setlightBlue,
- getlightBlue,
- setf1White,
- getf1White,
- setF4,
- getF4,
- setF2,
- getF2,
- setLight,
- getLight,
- setwheelWhite,
- getwheelWhite,
- setwheelBlack,
- getwheelBlack,
- setF3,
- getF3,
- }"
- >
- <img src="../assets/img/car/line.png" alt="" />
- </div>
- </div>
- <div class="right"><img src="../assets/img/right.png" alt="" /></div>
- <div class="button">进入CocoBlockly编程平台</div>
- <video
- id="musicC"
- :src="require('../assets/music/click.mp3')"
- v-show="false"
- ></video>
- </div>
- </template>
- <script>
- export default {
- data() {
- return {
- panThing: "",
- tou: "",
- ai: "",
- screan: "",
- lightWhite: "",
- lightBlue: "",
- f1White: "",
- f4: "",
- f2: "",
- light: "",
- wheelWhite: "",
- wheelBlack: "",
- f3: "",
- };
- },
- directives: {
- drag: {
- // 指令的定义
- inserted: function (el, binding) {
- // el.drag();
- console.log(el);
- //获取元素
- // var dv = document.getElementById("dv");
- let x = 0;
- let y = 0;
- let l = 0;
- let t = 0;
- let isDown = false;
- var _screan = document.getElementById("screan");
- var _tou = document.getElementById("tou");
- var _ai = document.getElementById("ai");
- var _lightBlue = document.getElementById("lightBlue");
- var _lightWhite = document.getElementById("lightWhite");
- var _F3 = document.getElementById("F3");
- var _F4 = document.getElementById("F4");
- var _F2 = document.getElementById("F2");
- var _f1White = document.getElementById("f1White");
- var _f1Blue = document.getElementById("f1Blue");
- var _wheelWhite = document.getElementById("wheelWhite");
- var _wheelBlack = document.getElementById("wheelBlack");
- var _light = document.getElementById("light");
- var _line = document.getElementById("line");
- var musicC = document.getElementById("musicC");
- //鼠标按下事件
- el.onmousedown = function (e) {
- //获取x坐标和y坐标
- e.preventDefault();
- x = e.clientX;
- y = e.clientY;
- //获取左部和顶部的偏移量
- l = el.offsetLeft;
- t = el.offsetTop;
- //开关打开
- isDown = true;
- //设置样式
- el.style.cursor = "move";
- subiao(el);
- };
- function subiao(cdiv) {
- document.onmousemove = function (e) {
- if (isDown == false) {
- return;
- }
- //获取x和y
- var nx = e.clientX;
- var ny = e.clientY;
- //计算移动后的左偏移量和顶部的偏移量
- var nl = nx - (x - l);
- var nt = ny - (y - t);
- cdiv.style.left = nl + "px";
- cdiv.style.top = nt + "px";
- if (el.id == "screan") {
- binding.value.setPan("screan");
- moveP(nl, nt, "screan");
- }
- if (el.id == "tou") {
- binding.value.setPan("tou");
- moveP(nl, nt, "tou");
- }
- if (el.id == "ai") {
- binding.value.setPan("ai");
- moveP(nl, nt, "ai");
- }
- if (el.id == "lightBlue") {
- binding.value.setPan("lightBlue");
- moveP(nl, nt, "lightBlue");
- }
- if (el.id == "lightWhite") {
- binding.value.setPan("lightWhite");
- moveP(nl, nt, "lightWhite");
- }
- if (el.id == "F3") {
- binding.value.setPan("F3");
- moveP(nl, nt, "F3");
- }
- if (el.id == "F4") {
- binding.value.setPan("F4");
- moveP(nl, nt, "F4");
- }
- if (el.id == "F2") {
- binding.value.setPan("F2");
- moveP(nl, nt, "F2");
- }
- if (el.id == "f1White") {
- binding.value.setPan("f1White");
- moveP(nl, nt, "f1White");
- }
- if (el.id == "f1Blue") {
- binding.value.setPan("f1Blue");
- moveP(nl, nt, "f1Blue");
- }
- if (el.id == "wheelWhite") {
- binding.value.setPan("wheelWhite");
- moveP(nl, nt, "wheelWhite");
- }
- if (el.id == "wheelBlack") {
- binding.value.setPan("wheelBlack");
- moveP(nl, nt, "wheelBlack");
- }
- if (el.id == "light") {
- binding.value.setPan("light");
- moveP(nl, nt, "light");
- }
- };
- }
- //鼠标抬起事件
- el.onmouseup = function (e) {
- //开关关闭
- isDown = false;
- el.style.cursor = "default";
- document.onmousemove = null;
- var nx = e.clientX;
- var ny = e.clientY;
- var nl = nx - (x - l);
- var nt = ny - (y - t);
- if (binding.value.getPan() == "screan") {
- st(nl, nt, "screan");
- }
- if (binding.value.getPan() == "tou") {
- st(nl, nt, "tou");
- }
- if (binding.value.getPan() == "ai") {
- st(nl, nt, "ai");
- }
- if (binding.value.getPan() == "lightBlue") {
- st(nl, nt, "lightBlue");
- }
- if (binding.value.getPan() == "lightWhite") {
- st(nl, nt, "lightWhite");
- }
- if (binding.value.getPan() == "F3") {
- st(nl, nt, "F3");
- }
- if (binding.value.getPan() == "F4") {
- st(nl, nt, "F4");
- }
- if (binding.value.getPan() == "F2") {
- st(nl, nt, "F2");
- }
- if (binding.value.getPan() == "f1White") {
- st(nl, nt, "f1White");
- }
- if (binding.value.getPan() == "f1Blue") {
- st(nl, nt, "f1Blue");
- }
- if (binding.value.getPan() == "wheelWhite") {
- st(nl, nt, "wheelWhite");
- }
- if (binding.value.getPan() == "wheelBlack") {
- st(nl, nt, "wheelBlack");
- }
- if (binding.value.getPan() == "light") {
- st(nl, nt, "light");
- }
- pan();
- };
- function pan() {
- var btn = document.getElementsByClassName("button")[0];
- var right = document.getElementsByClassName("right")[0];
- var policeL = _wheelWhite.offsetLeft;
- var policeT = _wheelWhite.offsetTop;
- if (binding.value.getlightWhite() == 1 &&
- binding.value.getlightBlue() == 1 &&
- binding.value.getf1White() == 1 &&
- binding.value.getF4() == 1 &&
- binding.value.getF2() == 1 &&
- binding.value.getLight() == 1 &&
- binding.value.getwheelWhite() == 1 &&
- binding.value.getwheelBlack() == 1 &&
- binding.value.getF3() == 1) {
- btn.className = "button dark";
- btn.onclick = function () {
- binding.value.go();
- };
- right.style.display = "block";
- right.style.left = policeL + 535 + "px";
- right.style.top = policeT + 65 + "px";
- } else {
- btn.className = "button";
- btn.onclick = null;
- right.style.display = "none";
- }
- }
- function st(nl, nt, type) {
- var screanL = _screan.offsetLeft;
- var screanT = _screan.offsetTop;
- var touL = _tou.offsetLeft;
- var touT = _tou.offsetTop;
- var aiL = _ai.offsetLeft;
- var aiT = _ai.offsetTop;
- var lightBlueL = _lightBlue.offsetLeft;
- var lightBlueT = _lightBlue.offsetTop;
- var lightWhiteL = _lightWhite.offsetLeft;
- var lightWhiteT = _lightWhite.offsetTop;
- var f3L = _F3.offsetLeft;
- var f3T = _F3.offsetTop;
- var f4L = _F4.offsetLeft;
- var f4T = _F4.offsetTop;
- var f2L = _F2.offsetLeft;
- var f2T = _F2.offsetTop;
- var f1WhiteL = _f1White.offsetLeft;
- var f1WhiteT = _f1White.offsetTop;
- var f1BlueL = _f1Blue.offsetLeft;
- var f1BlueT = _f1Blue.offsetTop;
- var wheelWhiteL = _wheelWhite.offsetLeft;
- var wheelWhiteT = _wheelWhite.offsetTop;
- var wheelBlackL = _wheelBlack.offsetLeft;
- var wheelBlackT = _wheelBlack.offsetTop;
- var lightL = _light.offsetLeft;
- var lightT = _light.offsetTop;
- var lineL = _line.offsetLeft;
- var lineT = _line.offsetTop;
- var firstL = screanL - touL;
- var firstT = screanT - touT;
- var secondL = f3L - aiL;
- var secondT = f3T - aiT;
- var thirdL = f3L - screanL;
- var thirdT = f3T - screanT;
- var fourthL = f1WhiteL - lightWhiteL;
- var fourthT = f1WhiteT - lightWhiteT;
- var fivethL = f1BlueL - lightBlueL;
- var fivethT = f1BlueT - lightBlueT;
- var sixthL = f1BlueL - f1WhiteL;
- var sixthT = f1BlueT - f1WhiteT;
- var seventhL = f1WhiteL - f4L;
- var seventhT = f1WhiteT - f4T;
- var eighthL = f1WhiteL - f2L;
- var eighthT = f1WhiteT - f2T;
- var nighthL = f2L - lightL;
- var nighthT = f2T - lightT;
- var tenthL = f1WhiteL - wheelWhiteL;
- var tenthT = f1WhiteT - wheelWhiteT;
- var eleventhL = f1WhiteL - wheelBlackL;
- var eleventhT = f1WhiteT - wheelBlackT;
-
- var twlevethL = f1WhiteL - f3L;
- var twlevethT = f1WhiteT - f3T;
- if (
- -70 < firstL &&
- firstL < -15 &&
- 33 < firstT &&
- firstT < 106 &&
- type == "tou"
- ) {
- _tou.style.left = screanL + 40 + "px";
- _tou.style.top = screanT - 81 + "px";
- binding.value.setTou(1);
- playMusic();
- } else if (type == "tou") {
- binding.value.setTou(0);
- }
- if (
- -170 < secondL &&
- secondL < 42 &&
- -98 < secondT &&
- secondT < 99 &&
- type == "ai"
- ) {
- _ai.style.left = f3L + 71 + "px";
- _ai.style.top = f3T - 3 + "px";
- binding.value.setAi(1);
- playMusic();
- } else if (type == "ai") {
- binding.value.setAi(0);
- }
- if (
- -170 < thirdL &&
- thirdL < 32 &&
- -103 < thirdT &&
- thirdT < 115 &&
- type == "screan"
- ) {
- _screan.style.left = f3L + 70 + "px";
- _screan.style.top = f3T - 2 + "px";
- if (binding.value.getTou() == 1) {
- _tou.style.left = f3L + 70 + 40 + "px";
- _tou.style.top = f3T - 2 - 81 + "px";
- }
- binding.value.setScrean(1);
- playMusic();
- } else if (type == "screan") {
- binding.value.setScrean(0);
- }
- if (
- -175 < fourthL &&
- fourthL < -11 &&
- -76 < fourthT &&
- fourthT < 14 &&
- type == "lightWhite"
- ) {
- _lightWhite.style.left = f1WhiteL + 42 + "px";
- _lightWhite.style.top = f1WhiteT + 28 + "px";
- binding.value.setlightWhite(1);
- playMusic();
- } else if (type == "lightWhite") {
- binding.value.setlightWhite(0);
- }
- if (
- -174 < fivethL &&
- fivethL < 68 &&
- -72 < fivethT &&
- fivethT < 14 &&
- type == "lightBlue"
- ) {
- _lightBlue.style.left = f1BlueL + 42 + "px";
- _lightBlue.style.top = f1BlueT + 23 + "px";
- binding.value.setlightBlue(1);
- playMusic();
- } else if (type == "lightBlue") {
- binding.value.setlightBlue(0);
- }
- if (
- -244 < sixthL &&
- sixthL < 310 &&
- -93 < sixthT &&
- sixthT < 121 &&
- binding.value.getlightWhite() == 1 &&
- binding.value.getlightBlue() == 1 &&
- type == "f1White"
- ) {
- _f1White.style.left = f1BlueL + 0 + "px";
- _f1White.style.top = f1BlueT + 0 + "px";
- binding.value.setf1White(1);
- playMusic();
- } else if (type == "f1White") {
- binding.value.setf1White(0);
- }
- if (
- -21 < seventhL &&
- seventhL < -3 &&
- -72 < seventhT &&
- seventhT < 126 &&
- binding.value.getlightWhite() == 1 &&
- binding.value.getlightBlue() == 1 &&
- type == "F4"
- ) {
- _F4.style.left = f1WhiteL + 12 + "px";
- _F4.style.top = f1WhiteT - 4 + "px";
- binding.value.setF4(1);
- playMusic();
- } else if (type == "F4") {
- binding.value.setF4(0);
- }
- if (
- -250 < eighthL &&
- eighthL < 238 &&
- -88 < eighthT &&
- eighthT < -56 &&
- binding.value.getlightWhite() == 1 &&
- binding.value.getlightBlue() == 1 &&
- binding.value.getF4() == 1 &&
- type == "F2"
- ) {
- _F2.style.left = f1WhiteL - 2 + "px";
- _F2.style.top = f1WhiteT + 67 + "px";
- binding.value.setF2(1);
- playMusic();
- } else if (type == "F2") {
- binding.value.setF2(0);
- }
- if (
- -393 < nighthL &&
- nighthL < -302 &&
- -113 < nighthT &&
- nighthT < -27 &&
- binding.value.getlightWhite() == 1 &&
- binding.value.getlightBlue() == 1 &&
- binding.value.getF4() == 1 &&
- binding.value.getF2() == 1 &&
- type == "light"
- ) {
- _light.style.left = f2L + 354 + "px";
- _light.style.top = f2T + 23 + "px";
- binding.value.setLight(1);
- playMusic();
- } else if (type == "light") {
- binding.value.setLight(0);
- }
- if (
- -5 < tenthL &&
- tenthL < 28 &&
- -42 < tenthT &&
- tenthT < -9 &&
- binding.value.getlightWhite() == 1 &&
- binding.value.getlightBlue() == 1 &&
- binding.value.getF4() == 1 &&
- binding.value.getF2() == 1 &&
- binding.value.getLight() == 1 &&
- type == "wheelWhite"
- ) {
- _wheelWhite.style.left = f1WhiteL - 11 + "px";
- _wheelWhite.style.top = f1WhiteT + 23 + "px";
- binding.value.setwheelWhite(1);
- playMusic();
- } else if (type == "wheelWhite") {
- binding.value.setwheelWhite(0);
- }
- if (
- -5 < eleventhL &&
- eleventhL < 28 &&
- -42 < eleventhT &&
- eleventhT < -9 &&
- binding.value.getlightWhite() == 1 &&
- binding.value.getlightBlue() == 1 &&
- binding.value.getF4() == 1 &&
- binding.value.getF2() == 1 &&
- binding.value.getLight() == 1 &&
- binding.value.getwheelWhite() == 1 &&
- type == "wheelBlack"
- ) {
- _wheelBlack.style.left = f1WhiteL - 11 + "px";
- _wheelBlack.style.top = f1WhiteT + 23 + "px";
- binding.value.setwheelBlack(1);
- playMusic();
- } else if (type == "wheelBlack") {
- binding.value.setwheelBlack(0);
- }
- if (
- -436 < twlevethL &&
- twlevethL < -152 &&
- -136 < twlevethT &&
- twlevethT < 10 &&
- binding.value.getlightWhite() == 1 &&
- binding.value.getlightBlue() == 1 &&
- binding.value.getF4() == 1 &&
- binding.value.getF2() == 1 &&
- binding.value.getLight() == 1 &&
- binding.value.getwheelWhite() == 1 &&
- binding.value.getwheelBlack() == 1 &&
- binding.value.getScrean() == 1 &&
- binding.value.getAi() == 1 &&
- binding.value.getTou() == 1 &&
- type == "F3"
- ) {
- binding.value.setF3(1);
- _line.style.left = f1WhiteL + 73 + "px";
- _line.style.top = f1WhiteT - 22 + "px";
- playMusic();
- } else if (type == "F3") {
- binding.value.setF3(0);
- }
- }
- function playMusic() {
- musicC.play();
- }
- function moveP(nl, nt, type) {
- if (binding.value.getTou() == 1 && type == "screan") {
- _tou.style.left = nl + 40 + "px";
- _tou.style.top = nt - 81 + "px";
- }
- if (binding.value.getAi() == 1 && type == "F3") {
- _ai.style.left = nl + 71 + "px";
- _ai.style.top = nt - 3 + "px";
- }
- if (
- binding.value.getScrean() == 1 &&
- binding.value.getTou() == 1 &&
- type == "F3"
- ) {
- _screan.style.left = nl + 70 + "px";
- _screan.style.top = nt - 2 + "px";
- _tou.style.left = nl + 110 + "px";
- _tou.style.top = nt - 83 + "px";
- }
- if (binding.value.getlightWhite() == 1 && type == "f1White") {
- _lightWhite.style.left = nl + 42 + "px";
- _lightWhite.style.top = nt + 28 + "px";
- }
- if (binding.value.getlightBlue() == 1 && type == "f1Blue") {
- _lightBlue.style.left = nl + 42 + "px";
- _lightBlue.style.top = nt + 23 + "px";
- }
- if (
- binding.value.getlightWhite() == 1 &&
- binding.value.getlightBlue() == 1 &&
- binding.value.getf1White() == 1 &&
- type == "f1White"
- ) {
- _lightWhite.style.left = nl + 42 + "px";
- _lightWhite.style.top = nt + 28 + "px";
- _lightBlue.style.left = nl + 42 + "px";
- _lightBlue.style.top = nt + 23 + "px";
- _f1Blue.style.left = nl + 0 + "px";
- _f1Blue.style.top = nt + 0 + "px";
- }
- if (
- binding.value.getlightWhite() == 1 &&
- binding.value.getlightBlue() == 1 &&
- binding.value.getf1White() == 1 &&
- binding.value.getF4() == 1 &&
- type == "f1White"
- ) {
- _lightWhite.style.left = nl + 42 + "px";
- _lightWhite.style.top = nt + 28 + "px";
- _lightBlue.style.left = nl + 42 + "px";
- _lightBlue.style.top = nt + 23 + "px";
- _f1Blue.style.left = nl + 0 + "px";
- _f1Blue.style.top = nt + 0 + "px";
- _F4.style.left = nl + 12 + "px";
- _F4.style.top = nt - 4 + "px";
- }
- if (
- binding.value.getlightWhite() == 1 &&
- binding.value.getlightBlue() == 1 &&
- binding.value.getf1White() == 1 &&
- binding.value.getF4() == 1 &&
- binding.value.getF2() == 1 &&
- type == "f1White"
- ) {
- _lightWhite.style.left = nl + 42 + "px";
- _lightWhite.style.top = nt + 28 + "px";
- _lightBlue.style.left = nl + 42 + "px";
- _lightBlue.style.top = nt + 23 + "px";
- _f1Blue.style.left = nl + 0 + "px";
- _f1Blue.style.top = nt + 0 + "px";
- _F4.style.left = nl + 12 + "px";
- _F4.style.top = nt - 4 + "px";
- _F2.style.left = nl - 2 + "px";
- _F2.style.top = nt + 67 + "px";
- }
- if (
- binding.value.getlightWhite() == 1 &&
- binding.value.getlightBlue() == 1 &&
- binding.value.getf1White() == 1 &&
- binding.value.getF4() == 1 &&
- binding.value.getF2() == 1 &&
- binding.value.getLight() == 1 &&
- type == "f1White"
- ) {
- _lightWhite.style.left = nl + 42 + "px";
- _lightWhite.style.top = nt + 28 + "px";
- _lightBlue.style.left = nl + 42 + "px";
- _lightBlue.style.top = nt + 23 + "px";
- _f1Blue.style.left = nl + 0 + "px";
- _f1Blue.style.top = nt + 0 + "px";
- _F4.style.left = nl + 12 + "px";
- _F4.style.top = nt - 4 + "px";
- _F2.style.left = nl - 2 + "px";
- _F2.style.top = nt + 67 + "px";
- _light.style.left = nl + 352 + "px";
- _light.style.top = nt + 90 + "px";
- }
- if (
- binding.value.getlightWhite() == 1 &&
- binding.value.getlightBlue() == 1 &&
- binding.value.getf1White() == 1 &&
- binding.value.getF4() == 1 &&
- binding.value.getF2() == 1 &&
- binding.value.getLight() == 1 &&
- binding.value.getwheelWhite() == 1 &&
- type == "f1White"
- ) {
- _lightWhite.style.left = nl + 42 + "px";
- _lightWhite.style.top = nt + 28 + "px";
- _lightBlue.style.left = nl + 42 + "px";
- _lightBlue.style.top = nt + 23 + "px";
- _f1Blue.style.left = nl + 0 + "px";
- _f1Blue.style.top = nt + 0 + "px";
- _F4.style.left = nl + 12 + "px";
- _F4.style.top = nt - 4 + "px";
- _F2.style.left = nl - 2 + "px";
- _F2.style.top = nt + 67 + "px";
- _light.style.left = nl + 352 + "px";
- _light.style.top = nt + 90 + "px";
- _wheelWhite.style.left = nl - 11 + "px";
- _wheelWhite.style.top = nt + 23 + "px";
- }
- if (
- binding.value.getlightWhite() == 1 &&
- binding.value.getlightBlue() == 1 &&
- binding.value.getf1White() == 1 &&
- binding.value.getF4() == 1 &&
- binding.value.getF2() == 1 &&
- binding.value.getLight() == 1 &&
- binding.value.getwheelWhite() == 1 &&
- binding.value.getwheelBlack() == 1 &&
- type == "f1White"
- ) {
- _lightWhite.style.left = nl + 42 + "px";
- _lightWhite.style.top = nt + 28 + "px";
- _lightBlue.style.left = nl + 42 + "px";
- _lightBlue.style.top = nt + 23 + "px";
- _f1Blue.style.left = nl + 0 + "px";
- _f1Blue.style.top = nt + 0 + "px";
- _F4.style.left = nl + 12 + "px";
- _F4.style.top = nt - 4 + "px";
- _F2.style.left = nl - 2 + "px";
- _F2.style.top = nt + 67 + "px";
- _light.style.left = nl + 352 + "px";
- _light.style.top = nt + 90 + "px";
- _wheelWhite.style.left = nl - 11 + "px";
- _wheelWhite.style.top = nt + 23 + "px";
- _wheelBlack.style.left = nl - 11 + "px";
- _wheelBlack.style.top = nt + 23 + "px";
- }
- if (
- binding.value.getlightWhite() == 1 &&
- binding.value.getlightBlue() == 1 &&
- binding.value.getf1White() == 1 &&
- binding.value.getF4() == 1 &&
- binding.value.getF2() == 1 &&
- binding.value.getLight() == 1 &&
- binding.value.getwheelWhite() == 1 &&
- binding.value.getwheelBlack() == 1 &&
- binding.value.getF3() == 1 &&
- type == "f1White"
- ) {
- _lightWhite.style.left = nl + 42 + "px";
- _lightWhite.style.top = nt + 28 + "px";
- _lightBlue.style.left = nl + 42 + "px";
- _lightBlue.style.top = nt + 23 + "px";
- _f1Blue.style.left = nl + 0 + "px";
- _f1Blue.style.top = nt + 0 + "px";
- _F4.style.left = nl + 12 + "px";
- _F4.style.top = nt - 4 + "px";
- _F2.style.left = nl - 2 + "px";
- _F2.style.top = nt + 67 + "px";
- _light.style.left = nl + 352 + "px";
- _light.style.top = nt + 90 + "px";
- _wheelWhite.style.left = nl - 11 + "px";
- _wheelWhite.style.top = nt + 23 + "px";
- _wheelBlack.style.left = nl - 11 + "px";
- _wheelBlack.style.top = nt + 23 + "px";
- _line.style.left = nl + 73 + "px";
- _line.style.top = nt -22 + "px";
- }
- }
- },
- },
- },
- methods: {
- go() {
- this.$router.push("/blockly");
- },
- setPan(value) {
- this.panThing = value;
- },
- getPan() {
- return this.panThing;
- },
- setTou(value) {
- this.tou = value;
- },
- getTou() {
- return this.tou;
- },
- setAi(value) {
- this.ai = value;
- },
- getAi() {
- return this.ai;
- },
- setScrean(value) {
- this.screan = value;
- },
- getScrean() {
- return this.screan;
- },
- setlightWhite(value) {
- this.lightWhite = value;
- },
- getlightWhite() {
- return this.lightWhite;
- },
- setlightBlue(value) {
- this.lightBlue = value;
- },
- getlightBlue() {
- return this.lightBlue;
- },
- setf1White(value) {
- this.f1White = value;
- },
- getf1White() {
- return this.f1White;
- },
- setF4(value) {
- this.f4 = value;
- },
- getF4() {
- return this.f4;
- },
- setF2(value) {
- this.f2 = value;
- },
- getF2() {
- return this.f2;
- },
- setLight(value) {
- this.light = value;
- },
- getLight() {
- return this.light;
- },
- setwheelWhite(value) {
- this.wheelWhite = value;
- },
- getwheelWhite() {
- return this.wheelWhite;
- },
- setwheelBlack(value) {
- this.wheelBlack = value;
- },
- getwheelBlack() {
- return this.wheelBlack;
- },
- setF3(value) {
- this.f3 = value;
- },
- getF3() {
- return this.f3;
- },
- },
- };
- </script>
- <style scoped>
- html,
- body {
- margin: 0;
- padding: 0;
- width: 100%;
- }
- .tip {
- margin: 25px 0 30px 20px;
- }
- #screan > img,
- #tou > img,
- #ai > img,
- #lightBlue > img,
- #lightWhite > img,
- #F3 > img,
- #F4 > img,
- #F2 > img,
- #f1White > img,
- #f1Blue > img,
- #wheelWhite > img,
- #wheelBlack > img,
- #line>img,
- #light > img,
- .right > img {
- width: 100%;
- height: 100%;
- user-select: none;
- }
- .img {
- display: flex;
- flex-direction: row;
- justify-content: flex-end;
- margin: auto;
- width: 70%;
- /* position: relative; */
- }
- #screan {
- width: 150px;
- position: absolute;
- left: 10%;
- top: 50%;
- transform: translateY(-50%);
- z-index: 11;
- }
- #ai {
- width: 150px;
- position: absolute;
- top: 68%;
- left: 10%;
- transform: translateY(-50%);
- z-index: 9;
- }
- #lightBlue {
- width: 240px;
- position: absolute;
- top: 37%;
- left: 23%;
- transform: translateY(-50%);
- z-index: 4;
- }
- #lightWhite {
- width: 240px;
- position: absolute;
- top: 48%;
- left: 23%;
- transform: translateY(-50%);
- z-index: 3;
- }
- #F3 {
- width: 300px;
- position: absolute;
- top: 68%;
- left: 21%;
- transform: translateY(-50%);
- z-index: 8;
- }
- #F4 {
- width: 25px;
- position: absolute;
- top: 68%;
- left: 40%;
- transform: translateY(-50%);
- z-index: 6;
- }
- #F2 {
- width: 480px;
- position: absolute;
- top: 27%;
- left: 41%;
- transform: translateY(-50%);
- z-index: 6;
- }
- #f1White {
- width: 480px;
- position: absolute;
- top: 42%;
- left: 42%;
- transform: translateY(-50%);
- z-index: 5;
- }
- #f1Blue {
- width: 480px;
- position: absolute;
- top: 65%;
- left: 42%;
- transform: translateY(-50%);
- z-index: 3;
- }
- #wheelWhite {
- width: 200px;
- position: absolute;
- top: 37%;
- left: 71%;
- transform: translateY(-50%);
- z-index: 6;
- }
- #wheelBlack {
- width: 200px;
- position: absolute;
- top: 58%;
- left: 71%;
- transform: translateY(-50%);
- z-index: 7;
- }
- #light {
- width: 65px;
- position: absolute;
- top: 72%;
- left: 75%;
- transform: translateY(-50%);
- z-index: 6;
- }
- #tou {
- width: 65px;
- position: absolute;
- top: 37%;
- left: 12%;
- transform: translateY(-50%);
- z-index: 10;
- }
- #line {
- width: 450px;
- position: absolute;
- top: 37%;
- left: 71%;
- transform: translateY(-50%);
- z-index: 3;
- }
- .button {
- color: #fff;
- background: #8ca1de;
- width: 550px;
- height: 55px;
- font-size: 20px;
- text-align: center;
- line-height: 55px;
- position: absolute;
- bottom: 10%;
- left: 50%;
- transform: translateX(-50%);
- user-select: none;
- }
- .right {
- width: 40px;
- position: absolute;
- left: 55%;
- top: 70%;
- display: none;
- }
- .dark {
- background: #5b79d0;
- cursor: pointer;
- }
- </style>
|