-
Notifications
You must be signed in to change notification settings - Fork 82
/
Copy pathindex.html
213 lines (152 loc) · 7.29 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
<!DOCTYPE html>
<html>
<head>
<title>TremulaJS</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui">
<link rel="stylesheet" href="dist/Tremula.min.css">
<link rel="stylesheet" href="gh-pages-demo/demo.css">
<style type="text/css">
</style>
<script src="libs/jquery-min.js"></script>
<script src="libs/hammer.js"></script>
<script src="libs/jsBezier-0.6.js"></script>
<script src="libs/raf_shim.js"></script>
<script src="libs/jquery.ba-throttle-debounce.min.js"></script>
<script src="gh-pages-demo/tremulaAdapters.js"></script>
<script src="gh-pages-demo/tremulaConfig.js"></script>
<script src="gh-pages-demo/tremulaControls.js"></script>
<script src="gh-pages-demo/tremulaProjections.js"></script>
<script src="dist/Tremula.min.js"></script>
<script type="text/javascript">
$().ready(function(){
console.log('tremulajs demo gh-pages')
setTimeout(function(){
var tremula = tremulaInit();
//tremula.Grid.updateConfig({itemConstraint:200,itemMargins:[20,20]});
attachDemoControls(tremula);
window.tremula=tremula;//does not need to be on the window -- implemented here for convienience.
$('body').removeClass('doReflect');
//toggleDebug();
},1000);
});
function tremulaInit(){
console.log('starting tremula');
$tremulaContainer = $('.tremulaContainer');
var tremula = new Tremula();
var config = tremulaConfigs.default.call(tremula);
tremula.init($tremulaContainer,config,this);
var doScrollEvents = function(o){
if(debugLoop)debugLoop(o);
if(o.scrollProgress>.7){
if(!tremula.cache.endOfScrollFlag){
tremula.cache.endOfScrollFlag = true;
console.log('END OF SCROLL!')
}
}
}//doScrollEvents()
tremula.setOnChangePub(doScrollEvents);
return tremula;
}
</script>
</head>
<body class="doReflect">
<h1><a href="http://tremulajs.org/">TremulaJS</a></h1>
<a class="viewOnGithub" href="https://github.com/garris/TremulaJS">
<span class="ribbonTopRight">View on Github!</span>
</a>
<div class="tab">CONFIG IT<span style="font-size: 20px;display: block;line-height: 0.3em;">IF YOU DIG IT</span></div>
<div class="tremulaContainer main"></div>
<div class="debug"></div>
<div class="controls">
<div class="buttons" >
<ul class="group main presets"><li class="streamHorizontal">streamHorizontal</li><li class="pinterest">pinterest</li><li class="btnL2">turntable</li><li class="mountain">mountain</li><li class="btnL3">enterTheDragon</li><li class="xy">xyPlain (toggle)</li></ul>
<ul class="group main">
<li class="more">Experimental stuff...</li>
</ul>
<ul class="group">
<li class="autoSize">autoSize</li>
<li class="autoCount">autoCount</li>
<li class="autoDisable">autoDisable</li>
</ul>
<ul class="group">
<li class="btn1">1 Axis</li>
<li class="btn2">2 Axes</li>
<li class="btn3">3 Axes</li>
</ul>
<ul class="group">
<li class="size1">sm size</li>
<li class="size2">med size</li>
<li class="size3">lg size</li>
</ul>
<ul class="group">
<li class="margin1">margin sm</li>
<li class="margin2">margin med</li>
<li class="margin3">margin lg</li>
</ul>
<ul class="group">
<li class="toggleReflect">toggle reflect</li>
<li class="toggleItemEase">toggle ease</li>
<li class="toggleIsLooping">toggle looping</li>
<!-- <li class="toggleScrollAxis">toggle axis</li> -->
</ul>
<ul class="group">
<li class="headScroll">head scroll</li>
<li class="tailScroll">tail scroll</li>
</ul>
<ul class="group">
<li class="loadArtDotCom">loadArtDotCom</li>
<li class="loadFlickr">loadFlickr</li>
<li class="toggleRefreshData">toggle refresh</li>
</ul>
<ul class="group">
<li class="showCtrlData">showCtrlData</li>
</ul>
</div>
</div>
</body>
</html>
<script type="text/javascript">
showControlData = function(o){
if(!this.$debug)this.$debug = $('.debug');
this.$debug.html(
'<ul>'
// + '<li>jsHeapSizeLimit: ' + performance.memory.jsHeapSizeLimit + '<span>total available memory</span></li>'
// + '<li>totalJSHeapSize: ' + performance.memory.totalJSHeapSize + '<span>total used memory</span></li>'
// + '<li>usedJSHeapSize: ' + performance.memory.usedJSHeapSize + '<span>current used memory</span></li>'
+ '<li>scrollAxis: ' + o.sa + ' [sx]--> ' + o.sx + '<span>Direction of scroll</span></li>'
+ '<li>this.frameRate: ' + o.frameRate + '<span>frameRate</span></li>'
+ '<li>this.physicsLoopRAF: ' + o.physicsLoopRAF + '<span>RAF FRAME ID</span></li>'
+ '<li>isTouching: ' + o.isTouching + '<span></span></li>'
+ '<li>absScrollPos: ' + o.absScrollPos + '<span>The scroll position of the content head in relation to the visible leading border.</span></li>'
+ '<li>scrollPos: ' + o.scrollPos + '<span></span></li>'
+ '<li>scrollProgress: ' + o.scrollProgress + '<span></span></li>'
+ '<li>marginScrollWarp: ' + o.marginScrollWarp + '<span></span></li>'
+ '<li>isInHeadMargin: ' + o.isInHeadMargin + '<span></span></li>'
+ '<li>isInTailMargin: ' + o.isInTailMargin + '<span></span></li>'
+ '<li>scrollAxisOffset: ' + o.scrollAxisOffset + '<span>The margin added before and after the content -- this creates a blank offset area on either side of the content -- IOW: this offsets the content position.</span></li>'
+ '<li>scrollMargin: ' + o.scrollMargin + '<span>The scrollable area added before and after the content. NOTE: this does not offset the content.</span></li>'
+ '<li>firstItemPos: ' + o.firstItemPos + '<span>The head edge position of the first item.</span></li>'
+ '<li>bounceMargin: ' + o.bounceMargin + '<span></span></li>'
+ '<li>trailingEdgeScrollPos: ' + o.trailingEdgeScrollPos + '<span></span></li>'
+ '<li>absTrailingEdgeScrollPos: ' + o.absTrailingEdgeScrollPos + '<span>The value of absScrollPos when content is scrolled completely to the tail position (exclude rubber band effect).</span></li>'
+ '<li>currentGridContentDims: ' + o.currentGridContentDims + '<span>?</span></li>'
+ '<li>boxAxisLengths: ' + o.boxAxisLengths + '<span>A mysterious number which starts as the contentDims but gets transformed in ways that are no longer clear.</span></li>'
+ '<li>contentDims: ' + o.contentDims + '<span>Content bounding box dims.</span></li>'
+ '<li>gridDims: ' + o.gridDims + '<span></span></li>'
+ '<li>hasShortGridDimsSi: ' + o.hasShortGridDimsSi + '<span></span></li>'
+ '<li>hasMediumGridDimsSi: ' + o.hasMediumGridDimsSi + '<span></span></li>'
+'</ul>'
);
}
debugLoop = null;
toggleDebug = function toggleDebug(){
if(debugLoop){
debugLoop = null;
$('.debug').removeClass('show');
}else{
debugLoop = showControlData;
$('.debug').addClass('show');
showControlData({});
}
}
</script>