-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
493 lines (468 loc) · 24.9 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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Web Demos - Julian Dymer</title>
<link href="images/favicon.png" rel="icon" />
<link href="https://fonts.googleapis.com/css?family=Droid+Sans|Raleway:100" rel="stylesheet">
<meta property="og:title" content="Web Demos - Julian Dymer">
<meta property="og:description" content="A collection of small demonstrations exploring interesting and novel uses of modern web technology.">
<meta property="og:image" content="https://saberpeep.github.io/web-demos/images/sitepreview.jpg">
<meta property="og:url" content="https://saberpeep.github.io/web-demos/">
<meta name="twitter:card" content="summary">
<style>
html{
min-height: 100%;
}
body{
background-color:black;
color: #f4f4f4;
font-family: 'Droid Sans', sans-serif;
min-height: 100%;
}
#outer-wrap{
background-color:#1a1a1a;
margin:3%;
margin-bottom:1%;
margin-top:2%;
min-height: 90vh;
min-width: 640px;
position:relative;
}
header{
background-color:#282828;
color:#fff;
padding:5px;
margin-bottom:3px;
font-family: 'Raleway', sans-serif;
font-size: 130%;
text-align: center;
}
header h1, header h5{
margin: 5px;
}
.slashes{
font-size: 250%;
font-weight: 100;
letter-spacing: -37px;
margin-right: 30px;
margin-left: -10px;
vertical-align: middle;
}
#content-wrap{
position: absolute;
top: 128px;
bottom: 0;
left: 0;
right: 0;
min-height: 510px;
background-image: url("images/codebg.jpg");
background-size: cover;
background-repeat: no-repeat;
background-position: right;
}
.content{
background-color:#282828;
}
.content.left{
float: left;
width: 50%;
height: 100%;
box-sizing: border-box;
display: flex;
flex-direction: column;
justify-content: space-between;
background-color:#212121;
position: relative;
z-index: 2;
}
.content.right{
float: right;
width: 50%;
box-sizing: border-box;
padding:10px;
padding-left: 30px;
max-height:100%;
overflow-y: auto;
background-color:#212121;
-webkit-box-shadow: inset 200px -7px 296px -58px rgba(0,0,0,0.1);
-moz-box-shadow: inset 200px -7px 296px -58px rgba(0,0,0,0.1);
box-shadow: inset 200px -7px 296px -58px rgba(0,0,0,0.1);
position: relative;
left:-50%;
transition: left 0.3s;
}
.content.right .description a {
padding: 2px;
margin: 0.1em 0px;
font-size: 0.9em;
border: 1px dotted #a0a0a0;
}
.content.right .description a:hover {
border-style: solid;
border-color: white;
}
.content.right {
color: black;
transition: none;
}
.content.right.expand {
left:0;
color: inherit;
transition: left 0.3s, color 1s;
}
.content.right::-webkit-scrollbar-track{
box-shadow: inset 0 0 6px black;
background-color:#333333;
border-top: 15px solid #151515;
border-bottom: 5px solid #151515;
}
.content.right::-webkit-scrollbar{
width: 10px;
}
.content.right::-webkit-scrollbar-thumb{
background-color: #151515;
}
a{
display: inline-block;
color: #f4f4f4;
padding: 10px;
margin-bottom: 10px;
text-decoration: none;
}
a:hover{
background-color:white;
color:black;
}
.link{
color: #2a2a2a;
padding: 10px;
background-color: #f4f4f4;
text-decoration: none;
border-left-style: solid;
border-left-width: 0;
margin-left: 5px;
transition: all 0.25s;
}
.link:hover{
background-color:white;
color:black;
border-left-width: 5px;
margin-left: 0px;
transition: all 0.1s;
}
.demo:hover{
transition: all 0.1s;
}
.demo{
color: #2a2a2a;
padding: 10px;
background-color: #f4f4f4;
text-decoration: none;
transition: all 0.25s;
position: relative;
display: block;
margin-bottom: 15px;
font-size: 110%;
box-sizing: border-box;
border-left: 5px solid black;
cursor: pointer;
}
.demo:nth-last-child(2){
margin-bottom: 50px;
}
.data{
display:none;
}
.arrow{
float: right;
font-weight: bold;
}
.description{
padding-right:25%;
}
.content.right h4{
margin-top:40px;
margin-bottom: 0;
}
#icon{
/*font-family: "serif";*/
font-family: DejaVu Sans, Symbola, Everson Mono, Dingbats, Segoe UI Symbol, Quivira, SunExt-A, FreeSerif, Universali, unifont;
position: absolute;
top: 0;
right: 0;
bottom: 0;
width: 50%;
overflow: hidden;
display: inline-block;
font-size: 3000%;
color:#b4b4b4;
opacity: 0.1;
text-align: center;
line-height: 1;
}
#slider{
position: absolute;
transition: none;
background-color: transparent;
box-sizing: border-box;
pointer-events: none;
}
footer{
color: #424242;
font-size: 90%;
}
footer p{
margin: 0;
padding: 10px;
}
</style>
<noscript>
<style>
/*Javascript Message*/
body:before {
content:"This Site And The Demos On It Require Javascript. You\0027re Missing Out!";
position:fixed;
top:0;
left:0;
right:0;
height:20px;
color:white;
background-color:red;
font-size:15px;
z-index:999;
text-align:center;
}
</style>
</noscript>
</head>
<body>
<div id="outer-wrap">
<header>
<h1>Web Demos</h1>
<h5>By Julian Dymer <span class="slashes">//</span> Saberpeep</h5>
</header>
<div id="content-wrap">
<div id="icon"></div>
<div class="content left">
<div id="demos-wrap">
<div class="demo" href="javascript:void(0)">
Daft Cubes
<code class="data">
<h3 class="title">Daft Cubes</h3>
<code class="data color icon" style="color: #c43c3c">◇</code>
<p class="description">My first web demo on the site. 3D blocks in a qbert-like arrangement, with text that crawls along thier surfaces. The lyrics to Daft Punk's "Technologic" are used as an example, a text box allows you to run your own text across. Relies heavily on precise timing, but created the basis for future 3D DOM-based fun.</p>
<p><code class="compatibility">Chromium-based browsers, Firefox 57+</code></p>
<h4><a class="link" href="isometricdemo/">Launch Demo ></a></h4>
</code>
<span class="arrow">></span>
</div>
<div class="demo" href="javascript:void(0)">
Tiny House
<code class="data">
<h3 class="title">Tiny House</h3>
<code class="data color icon" style="color: #48c43c">⌂</code>
<p class="description">Further expanding on the DOM-based 3D cubes, this demo was an exercise to see if it was possible to create complex shapes using the same basic system. Dragging or swiping left and right allow you to rotate the house as smoke puffs billow from the chimney.</p>
<p><code class="compatibility">Chromium-based browsers, Firefox 55+</code></p>
<p><code class="touch">[Touchscreen Support ✔]</code></p>
<h4><a class="link" href="housedemo/">Launch Demo ></a></h4>
</code>
<span class="arrow">></span>
</div>
<div class="demo" href="javascript:void(0)">
Holo Cube Navigation
<code class="data">
<h3 class="title">Holo Cube Navigation</h3>
<code class="data color icon" style="color: #f26d0e">◙</code>
<p class="description">Utilizing the same DOM-based 3d cubes as the previous demos, but used for a more practical application. Scroll, Drag or Swipe to navigate the different options. Note that the links are placeholders.</p>
<p><code class="compatibility">Chromium-based browsers, Firefox (partial), Edge (EdgeHTML)</code></p>
<p><code class="touch">[Touchscreen Support ✔]</code></p>
<h4><a class="link" href="holodemo/">Launch Demo ></a></h4>
</code>
<span class="arrow">></span>
</div>
<div class="demo" href="javascript:void(0)">
3D Flip Marquee
<code class="data">
<h3 class="title">3D Flip Marquee</h3>
<code class="data color icon" style="color: #c43cb4">▦</code>
<p class="description">Inspired by an Ok Go music video, this demo provides an interactive flip marquee. Enter text in the box to display it on the marquee, or click on the tiles to flip them manually. Features a few random animations for displaying text. Supports all the main ASCII characters, and yes, I did have to manually define my own characters.</p>
<p><code class="compatibility">Chromium-based browsers, Firefox (partial), Edge (EdgeHTML partial)</code></p>
<h4><a class="link" href="flipdemo/">Launch Demo ></a></h4>
</code>
<span class="arrow">></span>
</div>
<div class="demo" href="javascript:void(0)">
Traincar Navigation
<code class="data">
<h3 class="title">Traincar Navigation</h3>
<code class="data color icon" style="color: #fc981e">🛲</code>
<p class="description">In an attempt to combine the technology of the Tiny House demo and the functionality of the Holo Cube demo, this demo attempts to create complex shapes with the same DOM-based 3D cubes and use them to create a novel landing page for a website. I hope you like trains.</p>
<p><code class="compatibility">Chromium-based browsers, Firefox, Edge (EdgeHTML partial)</code></p>
<p><code class="touch">[Touchscreen Support ✔]</code></p>
<h4><a class="link" href="traindemo/">Launch Demo ></a></h4>
</code>
<span class="arrow">></span>
</div>
<div class="demo" href="javascript:void(0)">
Parallax Background
<code class="data">
<h3 class="title">Parallax Background</h3>
<code class="data color icon" style="color: #5e67d9">△</code>
<p class="description">After seeing a site with a novel 3D parallax effect, I couldn't resist but try my hand at it using the same 3D approach I've become familiar with. Mostly CSS, just a few lines of js.</p>
<p><code class="compatibility">Chromium-based browsers, Firefox, Edge (EdgeHTML partial)</code></p>
<h4><a class="link" href="parallaxdemo/">Launch Demo ></a></h4>
</code>
<span class="arrow">></span>
</div>
<div class="demo" href="javascript:void(0)">
Jump'N'Shoot
<code class="data">
<h3 class="title">Jump'N'Shoot</h3>
<code class="data color icon" style="color: #f90e45">⁍</code>
<p class="description">By far the most fun and challenging demo to develop, Jump'N'Shoot is a bookmarklet that allows you to load a little spaceman into any page. Equipped with a laser blaster and a space suit, turn any webpage into a side-scrolling destruction fest by running across, jumping on, and shooting page elements. The physics, movement, collisions, etc. were written entirely by hand!</p>
<p><code class="compatibility">Chromium-based browsers, Firefox, Edge (EdgeHTML), IE11</code></p>
<h4><a class="link" href="jumpnshoot/demopage/">Launch Demo ></a></h4>
</code>
<span class="arrow">></span>
</div>
<div class="demo" href="javascript:void(0)">
Breakdown!
<code class="data">
<h3 class="title">Breakdown!</h3>
<code class="data color icon" style="color: #ffda00">⧉</code>
<p class="description">A fun little bookmarklet that causes the current page to fall apart when activated. Uses <a href="https://brm.io/matter-js/" target="_blank">Matter.js</a> for physics.</p>
<p><code class="compatibility">Chromium-based browsers, Firefox</code></p>
<h4><a class="link" href="breakdowndemo/instructions.html">Launch Demo ></a></h4>
</code>
<span class="arrow">></span>
</div>
<div class="demo credits" href="javascript:void(0)">
Credits
<code class="data">
<h3 class="title">Credits</h3>
<code class="data color icon" style="color: #9a9a9a">≔</code>
<p>
<a href="https://jquery.com/" >jQuery by jQuery Foundation and other contributors</a><br />
<a href="https://brm.io/matter-js/" >Matter.js by BRM.io</a><br />
<a href="https://closure-compiler.appspot.com/" >Some code minified using the Google Closure Compiler Service</a><br />
<a href="https://mrcoles.com/bookmarklet/" >Bookmarklet creator by Peter Coles at mrcoles.com</a><br />
</p>
<h4 class="title">Tips And Tricks</h4>
<p>
<a href="https://css-tricks.com/almanac/properties/p/perspective/" >DOM-based 3D based on code by Chris Coyier at css-tricks.com</a><br />
<a href="https://stackoverflow.com/a/22050162">3D drag and rotate based on code by Vals on stackoverflow.com</a><br />
<a href="https://tutorialzine.com/2017/03/css-triangles-without-hacks">CSS triangles based on code by Danny Markov at tutorialzine.com</a><br />
<a href="https://stackoverflow.com/a/33826947">Firefox clip-path workaround by Cyril Mestrom on stackoverflow.com</a><br />
<a href="https://stackoverflow.com/a/7880918">Method to access object properties by index by 0x499602D2 on stackoverflow.com</a><br />
<a href="https://gist.github.com/conorbuck/2606166">Code to find the angle between two points by conorbuck on github.com</a><br />
<a href="https://stackoverflow.com/a/1821603">Code to get the slope from one point and an angle in degrees by BenAlabaster on stackoverflow.com</a><br /> <a href="https://stackoverflow.com/a/10113434">Script to dynamically load jQuery based on code by Anders Tornblad on stackoverflow.com</a><br />
<a href="https://appendto.com/2010/10/how-good-c-habits-can-encourage-bad-javascript-habits-part-1">Code for js object with public and private functions based on code by Kyle Pennell at appendto.com</a><br />
<a href="https://stackoverflow.com/a/44576137">IE11 Math.trunc() workaround by NTL on stackoverflow.com</a>
</p>
</code>
<span class="arrow">></span>
</div>
</div>
<footer>
<p>© Julian Dymer 2017</p>
</footer>
</div>
<div class="content right">
<h3 class="title"></h3>
<p class="description"></p>
<p><code class="compatibility"></code></p>
<p><code class="touch"></code></p>
<h4><a class="link" href="#">Launch Demo ></a></h4>
</div>
<div id="slider"></div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(function(){
var $demo = $(".demo"),
$demosWrap = $("#demos-wrap"),
$rightPanel = $(".content.right"),
$leftPanel = $(".content.left"),
$slider = $("#slider"),
$icon = $("#icon");
//give colored stripes to each left panel button
for(var i = 0, dataEl, color; i < $demo.length; i++){
dataEl = $demo.eq(i).children(".data");
color = dataEl.children(".color")[0].style.color;
$demo.eq(i).css("border-left", "5px solid " + color);
dataEl.find(".link").css("border-left-color", color);
}
$demo.click(function(){
var $this = $(this),
dataEl = $this.children(".data")
color = dataEl.children(".color")[0].style.color;
$demo.removeClass("active");
$this.addClass("active");
$demo.trigger("mouseleave");
$rightPanel.removeClass("expand");
//slider animation
//slider stage 1
$slider.css({
"width": "0px",
"height": $this.outerHeight() + "px",
"top": $this.position().top + "px",
"left": $this.position().left + $this.outerWidth() + "px",
"border-left": "none",
"border-top": $this.outerHeight() + "px solid " + color
});
setTimeout(function(){
//slider stage 2
$slider.css("transition", "width 0.2s, height 0.2s, top 0.2s, border-top 0.2s");
$rightPanel.addClass("expand");
$slider.css({
"width": $rightPanel.outerWidth() + "px",
"height": $this.outerHeight() + "px",
"border-left": "5px solid " + color
});
setTimeout(function(){
//slider stage 3
$slider.css({
"top": "0px",
"height": $this.position().top + $this.outerHeight() - $this.parent().position().top + "px",
"border-top": "10px solid " + color,
});
setTimeout(function(){
$slider.css("transition", "none");
},200);
},250);
},250);
//load data into right panel
$rightPanel.html(dataEl.html());
});
$demo.mouseenter(function(){
var icon = $(this).children(".data").children(".icon").text(),
color = $(this).children(".data").children(".color")[0].style.color;
if (!$demo.hasClass("active")){
$icon.text(icon);
$icon.fadeIn(250);
}
$(this).css({"background-color": color,
"color": "white"});
});
$demo.mouseleave(function(){
if (!$(this).hasClass("active")){
$(this).css({"background-color": "#f4f4f4",
"color": "#2a2a2a"});
}
});
$demosWrap.mouseleave(function(){
$icon.fadeOut(250,function(){
$icon.text("");
});
});
window.addEventListener('resize', function(e){
$slider.css("width", $rightPanel.outerWidth() + "px");
if ($demo.hasClass("active"))
$slider.css("left", $demo.position().left + $demo.outerWidth() + "px");
}, true);
});
</script>
</body>
</html>