Skip to content

Commit bf154bb

Browse files
committed
🛠 isRotating ↔️ isSpinning
1 parent e367a80 commit bf154bb

File tree

35 files changed

+112
-112
lines changed

35 files changed

+112
-112
lines changed

demo/bird-house/bird-house.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ var minWindowSize = Math.min( window.innerWidth - 20 , window.innerHeight - 20 )
77
var zoom = Math.floor( minWindowSize / w );
88
illoElem.setAttribute( 'width', w * zoom );
99
illoElem.setAttribute( 'height', h * zoom );
10-
var isRotating = false;
10+
var isSpinning = false;
1111
var TAU = Zdog.TAU;
1212
// colors
1313
var yellow = "#ED0";
@@ -26,7 +26,7 @@ var illo = new Zdog.Illustration({
2626
zoom: zoom,
2727
dragRotate: true,
2828
onDragStart: function() {
29-
isRotating = false;
29+
isSpinning = false;
3030
},
3131
});
3232

@@ -127,7 +127,7 @@ new Zdog.Rect({
127127
// -- animate --- //
128128

129129
function animate() {
130-
illo.rotate.y += isRotating ? +TAU/150 : 0;
130+
illo.rotate.y += isSpinning ? +TAU/150 : 0;
131131
illo.updateRenderGraph();
132132
requestAnimationFrame( animate );
133133
}

demo/boxes/boxes.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ var minWindowSize = Math.min( window.innerWidth - 20 , window.innerHeight - 20 )
77
var zoom = Math.floor( minWindowSize / w );
88
illoElem.setAttribute( 'width', w * zoom );
99
illoElem.setAttribute( 'height', h * zoom );
10-
var isRotating = true;
10+
var isSpinning = true;
1111
var TAU = Zdog.TAU;
1212
// colors
1313
// var white = 'white';
@@ -27,7 +27,7 @@ var illo = new Zdog.Illustration({
2727
rotate: initRotate,
2828
dragRotate: true,
2929
onDragStart: function() {
30-
isRotating = false;
30+
isSpinning = false;
3131
},
3232
});
3333

@@ -116,7 +116,7 @@ dot.copy({
116116
var t = 0;
117117

118118
function animate() {
119-
if ( isRotating ) {
119+
if ( isSpinning ) {
120120
var turn = Math.floor( t % 4 );
121121
var theta = Zdog.easeInOut( t%1, 3 ) * TAU;
122122
if ( turn === 0 || turn == 2 ) {

demo/castle/castle.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ illoElem.setAttribute( 'height', h * zoom );
1717

1818
var white = 'white';
1919
var black = '#333';
20-
var isRotating = true;
20+
var isSpinning = true;
2121
var TAU = Zdog.TAU;
2222
var initRotate = { y: TAU/4 };
2323

@@ -27,7 +27,7 @@ var illo = new Zdog.Illustration({
2727
rotate: initRotate,
2828
dragRotate: true,
2929
onDragStart: function() {
30-
isRotating = false;
30+
isSpinning = false;
3131
},
3232
});
3333

@@ -249,7 +249,7 @@ var keyframes = [
249249

250250
function animate() {
251251
// update
252-
if ( isRotating ) {
252+
if ( isSpinning ) {
253253
var easeT = Zdog.easeInOut( t % 1, 4 );
254254
var turnLimit = keyframes.length - 1;
255255
var turn = Math.floor( t % turnLimit );

demo/codepen-logo/codepen-logo.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ illoElem.setAttribute( 'width', w * zoom );
99
illoElem.setAttribute( 'height', h * zoom );
1010

1111
var TAU = Zdog.TAU;
12-
var isRotating = true;
12+
var isSpinning = true;
1313

1414
var illo = new Zdog.Illustration({
1515
element: illoElem,
1616
scale: 4,
1717
zoom: zoom,
1818
dragRotate: true,
1919
onDragStart: function() {
20-
isRotating = false;
20+
isSpinning = false;
2121
},
2222
});
2323

@@ -73,7 +73,7 @@ var tSpeed = 1/90;
7373

7474
function animate() {
7575
// update
76-
if ( isRotating ) {
76+
if ( isSpinning ) {
7777
var easeT = Zdog.easeInOut( t % 1, 3 );
7878
var turn = Math.floor( t );
7979
if ( turn === 0 ) {
@@ -101,5 +101,5 @@ document.querySelector('.reset-button').onclick = reset;
101101
function reset() {
102102
t = 0;
103103
illo.rotate.set({});
104-
isRotating = true;
104+
isSpinning = true;
105105
}

demo/composite-shapes-scale-svg/composite-shapes-scale-svg.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ var minWindowSize = Math.min( window.innerWidth - 20 , window.innerHeight - 20 )
66
var zoom = Math.floor( minWindowSize / sceneSize );
77
svg.setAttribute( 'width', sceneSize * zoom );
88
svg.setAttribute( 'height', sceneSize * zoom );
9-
var isRotating = true;
9+
var isSpinning = true;
1010
var TAU = Zdog.TAU;
1111

1212
var illo = new Zdog.Illustration({
@@ -15,7 +15,7 @@ var illo = new Zdog.Illustration({
1515
scale: 2,
1616
dragRotate: true,
1717
onDragStart: function() {
18-
isRotating = false;
18+
isSpinning = false;
1919
},
2020
});
2121

@@ -90,7 +90,7 @@ new Zdog.Cone({
9090
// -- animate --- //
9191

9292
function animate() {
93-
illo.rotate.y += isRotating ? +TAU/150 : 0;
93+
illo.rotate.y += isSpinning ? +TAU/150 : 0;
9494
illo.updateGraph();
9595
illo.renderGraph();
9696
requestAnimationFrame( animate );

demo/composite-shapes-scale/composite-shapes-scale.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ illoElem.setAttribute( 'width', w * zoom );
99
illoElem.setAttribute( 'height', h * zoom );
1010

1111
var TAU = Zdog.TAU;
12-
var isRotating = true;
12+
var isSpinning = true;
1313

1414
var illo = new Zdog.Illustration({
1515
element: illoElem,
1616
zoom: zoom,
1717
scale: 2,
1818
dragRotate: true,
1919
onDragStart: function() {
20-
isRotating = false;
20+
isSpinning = false;
2121
},
2222
});
2323

@@ -92,7 +92,7 @@ new Zdog.Cone({
9292
// -- animate --- //
9393

9494
function animate() {
95-
illo.rotate.y += isRotating ? +TAU/150 : 0;
95+
illo.rotate.y += isSpinning ? +TAU/150 : 0;
9696
illo.updateGraph();
9797
illo.renderGraph();
9898
requestAnimationFrame( animate );

demo/cones/cones.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ var zoom = Math.min( 10, Math.floor( minWindowSize / w ) );
88
illoElem.setAttribute( 'width', w * zoom );
99
illoElem.setAttribute( 'height', h * zoom );
1010

11-
var isRotating = true;
11+
var isSpinning = true;
1212
var TAU = Zdog.TAU;
1313

1414
var illo = new Zdog.Illustration({
1515
element: illoElem,
1616
zoom: zoom,
1717
dragRotate: true,
1818
onDragStart: function() {
19-
isRotating = false;
19+
isSpinning = false;
2020
},
2121
});
2222

@@ -134,7 +134,7 @@ animate();
134134
// -- update -- //
135135

136136
function rotate() {
137-
if ( !isRotating ) {
137+
if ( !isSpinning ) {
138138
return;
139139
}
140140
t += 1/cycleFrame;

demo/crypto-kitty/crypto-kitty.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ var zoom = Math.min( 10, Math.floor( minWindowSize / w ) );
88
illoElem.setAttribute( 'width', w * zoom );
99
illoElem.setAttribute( 'height', h * zoom );
1010

11-
var isRotating = true;
11+
var isSpinning = true;
1212
var TAU = Zdog.TAU;
1313

1414
var illo = new Zdog.Illustration({
@@ -17,7 +17,7 @@ var illo = new Zdog.Illustration({
1717
rotate: { x: -TAU/32 },
1818
dragRotate: true,
1919
onDragStart: function() {
20-
isRotating = false;
20+
isSpinning = false;
2121
},
2222
});
2323

@@ -227,7 +227,7 @@ diamondPanel.copy({
227227
// -- animate --- //
228228

229229
function animate() {
230-
illo.rotate.y += isRotating ? -TAU/150 : 0;
230+
illo.rotate.y += isSpinning ? -TAU/150 : 0;
231231
illo.updateRenderGraph();
232232
requestAnimationFrame( animate );
233233
}

demo/cylinders/cylinders.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ var zoom = Math.min( 10, Math.floor( minWindowSize / w ) );
88
illoElem.setAttribute( 'width', w * zoom );
99
illoElem.setAttribute( 'height', h * zoom );
1010

11-
var isRotating = true;
11+
var isSpinning = true;
1212
var TAU = Zdog.TAU;
1313

1414
var illo = new Zdog.Illustration({
1515
element: illoElem,
1616
zoom: zoom,
1717
dragRotate: true,
1818
onDragStart: function() {
19-
isRotating = false;
19+
isSpinning = false;
2020
},
2121
});
2222

@@ -97,7 +97,7 @@ animate();
9797
// -- update -- //
9898

9999
function rotate() {
100-
if ( !isRotating ) {
100+
if ( !isSpinning ) {
101101
return;
102102
}
103103

demo/davey-nippu/davey-nippu.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ var zoom = Math.floor( minWindowSize / w );
88
illoElem.setAttribute( 'width', w * zoom );
99
illoElem.setAttribute( 'height', h * zoom );
1010

11-
var isRotating = true;
11+
var isSpinning = true;
1212
var TAU = Zdog.TAU;
1313
var sceneStartRotation = { y: -TAU/8 };
1414

@@ -18,7 +18,7 @@ var illo = new Zdog.Illustration({
1818
rotate: sceneStartRotation,
1919
dragRotate: true,
2020
onDragStart: function() {
21-
isRotating = false;
21+
isSpinning = false;
2222
},
2323
});
2424

@@ -825,7 +825,7 @@ var tSpeed = 1/240;
825825

826826
function animate() {
827827
// update
828-
if ( isRotating ) {
828+
if ( isSpinning ) {
829829
t += tSpeed;
830830
var theta = Zdog.easeInOut( t % 1 ) * TAU;
831831
illo.rotate.y = -theta + sceneStartRotation.y;

demo/fizzy-bear/fizzy-bear.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ unibodyCanvas.width = bodyLinesCanvas.width = canvasWidth;
1717
unibodyCanvas.height = bodyLinesCanvas.height = canvasHeight;
1818

1919
var camera = new Zdog.Anchor();
20-
var isRotating = true;
20+
var isSpinning = true;
2121
var TAU = Zdog.TAU;
2222

2323
var mainIllo = new Zdog.Illustration({
2424
element: illoElem,
2525
zoom: zoom,
2626
dragRotate: camera,
2727
onDragStart: function() {
28-
isRotating = false;
28+
isSpinning = false;
2929
},
3030
});
3131

@@ -410,7 +410,7 @@ animate();
410410
// -- update -- //
411411

412412
function update() {
413-
if ( isRotating ) {
413+
if ( isSpinning ) {
414414
t += 1/180;
415415
var easeT = Zdog.easeInOut( t % 1, 3 );
416416
camera.rotate.y = easeT*TAU*2 + jumpRotation.y;

demo/gear-icon/gear-icon.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ var minWindowSize = Math.min( window.innerWidth - 20 , window.innerHeight - 20 )
77
var zoom = Math.floor( minWindowSize / w );
88
illoElem.setAttribute( 'width', w * zoom );
99
illoElem.setAttribute( 'height', h * zoom );
10-
var isRotating = true;
10+
var isSpinning = true;
1111
var TAU = Zdog.TAU;
1212

1313
var illo = new Zdog.Illustration({
@@ -16,7 +16,7 @@ var illo = new Zdog.Illustration({
1616
rotate: { x: -TAU/8 },
1717
dragRotate: true,
1818
onDragStart: function() {
19-
isRotating = false;
19+
isSpinning = false;
2020
},
2121
});
2222

@@ -103,7 +103,7 @@ gearPath.forEach( function( corner, i ) {
103103
// -- animate --- //
104104

105105
function animate() {
106-
illo.rotate.y += isRotating ? +TAU/240 : 0;
106+
illo.rotate.y += isSpinning ? +TAU/240 : 0;
107107
illo.updateRenderGraph();
108108
requestAnimationFrame( animate );
109109
}

demo/happy-town/happy-town.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ var zoom = Math.min( 6, Math.floor( minWindowSize / w ) );
1010
illoElem.setAttribute( 'width', w * zoom );
1111
illoElem.setAttribute( 'height', h * zoom );
1212

13-
var isRotating = true;
13+
var isSpinning = true;
1414
var TAU = Zdog.TAU;
1515

1616
var illo = new Zdog.Illustration({
@@ -19,7 +19,7 @@ var illo = new Zdog.Illustration({
1919
rotate: { y: TAU/8 },
2020
dragRotate: true,
2121
onDragStart: function() {
22-
isRotating = false;
22+
isSpinning = false;
2323
},
2424
});
2525

@@ -910,7 +910,7 @@ function update() {
910910
var now = new Date();
911911
var delta = now - then;
912912

913-
if ( isRotating ) {
913+
if ( isSpinning ) {
914914
t += tSpeed * delta/60;
915915
var theta = Zdog.easeInOut( t % 1 ) * TAU;
916916
var rev = 1;
@@ -955,6 +955,6 @@ function render() {
955955
// ----- inputs ----- //
956956

957957
document.querySelector('.reset-button').onclick = function() {
958-
isRotating = false;
958+
isSpinning = false;
959959
illo.rotate.set({ x: 0, y: TAU/8 });
960960
};

demo/hemisphere-ball/hemisphere-ball.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ var zoom = Math.min( 10, Math.floor( minWindowSize / w ) );
88
illoElem.setAttribute( 'width', w * zoom );
99
illoElem.setAttribute( 'height', h * zoom );
1010

11-
var isRotating = true;
11+
var isSpinning = true;
1212
var TAU = Zdog.TAU;
1313

1414
var illo = new Zdog.Illustration({
1515
element: illoElem,
1616
zoom: zoom,
1717
dragRotate: true,
1818
onDragStart: function() {
19-
isRotating = false;
19+
isSpinning = false;
2020
},
2121
});
2222

@@ -84,7 +84,7 @@ animate();
8484
// -- update -- //
8585

8686
function rotate() {
87-
if ( !isRotating ) {
87+
if ( !isSpinning ) {
8888
return;
8989
}
9090

0 commit comments

Comments
 (0)