1+ 'use strict' ;
2+
13/*window.onload = function() {
2- var mycanvas = document.getElementById("myCanvasTag");
3- var mycontext = mycanvas.getContext('2d');
4- var img=document.getElementById("bgImg");
4+ const mycanvas = document.getElementById("myCanvasTag");
5+ const mycontext = mycanvas.getContext('2d');
6+ let img=document.getElementById("bgImg");
57 mycontext.drawImage(img,10,10);
68 img = new Image();
79 img.src = 'img/玛丽场景.png';
@@ -34,20 +36,20 @@ window.onload = function() {}
3436
3537function ActionJump ( obj ) {
3638 // alert(123);
37- var rw = document . getElementById ( 'rw' ) ;
39+ let rw = document . getElementById ( 'rw' ) ;
3840 console . log ( 123 ) ;
3941 rw . style . left = '20px' ;
4042 // obj.style.left = '10px';
4143} ;
4244
4345
4446function ActionRight ( ) {
45- var rw = document . getElementById ( 'rw' ) ;
46- var rwDYM = document . getElementById ( 'rwDYM' ) ;
47- var bgRoom = document . getElementById ( 'bgRoom' ) ;
47+ let rw = document . getElementById ( 'rw' ) ;
48+ let rwDYM = document . getElementById ( 'rwDYM' ) ;
49+ let bgRoom = document . getElementById ( 'bgRoom' ) ;
4850 // directX = 1;
4951 // console.log("向前");
50- // var moveX = 0;
52+ // let moveX = 0;
5153 moveX += moveSpeed ;
5254 rw . style . left = moveX + '%' ;
5355 /*px情况用offsetleft和offsetWidth*/
@@ -68,11 +70,11 @@ function ActionRight() {
6870} ;
6971
7072function ActionRightDYM ( ) {
71- var rwDYM = document . getElementById ( 'rwDYM' ) ;
72- var bgRoom = document . getElementById ( 'bgRoom' ) ;
73+ let rwDYM = document . getElementById ( 'rwDYM' ) ;
74+ const bgRoom = document . getElementById ( 'bgRoom' ) ;
7375 // directX = 1;
7476 // console.log("向前");
75- // var moveX = 0;
77+ // const moveX = 0;
7678 moveX += moveSpeed ;
7779 rwDYM . style . left = moveX + '%' ;
7880 /*px情况用offsetleft和offsetWidth*/
@@ -94,11 +96,11 @@ function ActionRightDYM() {
9496
9597
9698function ActionTop ( ) {
97- /*var rw = document.getElementById('rw');
99+ /*let rw = document.getElementById('rw');
98100 rw.style.transitionProperty = "height";
99101 rw.transitionDuration = "2s";*/
100- var rw = document . getElementById ( 'rw' ) ;
101- var scoreRoute = rw . style . left ;
102+ let rw = document . getElementById ( 'rw' ) ;
103+ let scoreRoute = rw . style . left ;
102104
103105 function rwAtop ( ) {
104106 $ ( '#rw' ) . addClass ( 'rwAtop' ) ;
@@ -109,7 +111,7 @@ function ActionTop() {
109111 $ ( '#rw' ) . addClass ( 'rwAtopMore' ) ;
110112 setTimeout ( "$('#rw').removeClass('rwAtopMore')" , 100 ) ;
111113 }
112- //var scoreRoute = rw.offsetLeft;
114+ //let scoreRoute = rw.offsetLeft;
113115
114116 // if(scoreRoute<)
115117 // $('#rw').removeClass('rwAtop');
@@ -166,23 +168,23 @@ function speedBack() {
166168}
167169
168170function changeStyle ( ) {
169- var rwDYM = document . getElementById ( 'rwDYM' ) ;
170- var rw = document . getElementById ( 'rw' ) ;
171+ let rwDYM = document . getElementById ( 'rwDYM' ) ;
172+ let rw = document . getElementById ( 'rw' ) ;
171173 rwDYM . style . display = 'block' ;
172174 rw . style . display = 'none' ;
173175 setTimeout ( "DYMBack()" , 4000 ) ;
174176 return 0 ;
175177} ;
176178
177179function changeStyleBack ( ) {
178- var rwDYM = document . getElementById ( 'rwDYM' ) ;
179- var rw = document . getElementById ( 'rw' ) ;
180+ let rwDYM = document . getElementById ( 'rwDYM' ) ;
181+ let rw = document . getElementById ( 'rw' ) ;
180182 rwDYM . style . display = 'none' ;
181183 rw . style . display = 'block' ;
182184 return 1 ;
183185} ;
184186
185- //var isDYM = changeStyle();
187+ //let isDYM = changeStyle();
186188
187189function DYMDecreaseTime ( ) {
188190 if ( DYMtime > 15 ) {
@@ -208,8 +210,8 @@ function DYMBack() {
208210
209211function dym ( ) {
210212 setTimeout ( "changeStyle()" , 1500 ) ;
211- var rwDYM = document . getElementById ( 'rwDYM' ) ;
212- var rw = document . getElementById ( 'rw' ) ;
213+ let rwDYM = document . getElementById ( 'rwDYM' ) ;
214+ let rw = document . getElementById ( 'rw' ) ;
213215 rwDYM . style . display = 'none' ;
214216 rw . style . display = 'block' ;
215217 DYMtime += 15 ;
@@ -218,13 +220,13 @@ function dym() {
218220
219221//dym();
220222
221- var myApp = angular . module ( 'myAppp' , [ ] )
223+ const myApp = angular . module ( 'myAppp' , [ ] )
222224myApp . controller ( 'personController' , function ( $scope ) {
223225 $scope . person = {
224226 firstName : "John" ,
225227 lastName : "Doe" ,
226228 fullName : function ( ) {
227- var x = $scope . person ;
229+ const x = $scope . person ;
228230 return x . firstName + " " + x . lastName ;
229231 }
230232 } ;
@@ -243,8 +245,8 @@ myApp.controller('personController', function($scope) {
243245
244246 $scope . score = function ( ) {
245247 if ( isDYM ) {
246- var rw = document . getElementById ( 'rw' ) ;
247- var scoreRoute = rw . style . left ;
248+ const rw = document . getElementById ( 'rw' ) ;
249+ const scoreRoute = rw . style . left ;
248250
249251 function rwAtop ( ) {
250252 $ ( '#rw' ) . addClass ( 'rwAtop' ) ;
0 commit comments