DIR : /home/kozerus/public_html/pn/uize/site-source/examples/~EXPERIMENTAL-pixelated-fade-into-focus.html
/home/kozerus/public_html/pn/uize/site-source/examples
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Pixelated Fade Into Focus | JavaScript Examples | UIZE JavaScript Framework</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="keywords" content="animation Uize.Fade"/>
<link rel="alternate" type="application/rss+xml" title="UIZE JavaScript Framework - Latest News" href="http://www.uize.com/latest-news.rss"/>
<link rel="stylesheet" href="../css/page.css"/>
<link rel="stylesheet" href="../css/page.example.css"/>
<style type="text/css">
.animationShell {
margin:auto;
position:relative;
}
.animationShell, .animationShell img {
width:400px;
height:400px;
}
.animationShell img {
position:absolute;
background:#000;
opacity:0;
filter:alpha(opacity=0);
}
</style>
</head>
<body>
<script type="text/javascript" src="../js/Uize.js"></script>
<h1 class="header">
<a id="page-homeLink" href="../index.html" title="UIZE JavaScript Framework home"></a>
<a href="../index.html" class="homeLinkText" title="UIZE JavaScript Framework home">UIZE JavaScript Framework</a>
</h1>
<div class="main">
<h1 class="document-title">
<a href="../javascript-examples.html" class="breadcrumb breadcrumbWithArrow">JAVASCRIPT EXAMPLES</a>
Pixelated Fade Into Focus
<div class="pageActionsShell">
<div id="page-actions" class="pageActions"><a href="source-code/pixelated-fade-into-focus.html" class="buttonLink">SOURCE</a></div>
</div>
</h1>
<!-- explanation copy -->
<div class="explanation">
<p>In this example, ...</p>
</div>
<div class="animationShell">
<img id="page-frame0" src="../images/uize-6x6.gif" alt=""/>
<img id="page-frame1" src="../images/uize-12x12.gif" alt=""/>
<img id="page-frame2" src="../images/uize-25x25.gif" alt=""/>
<img id="page-frame3" src="../images/uize-50x50.gif" alt=""/>
<img id="page-frame4" src="../images/uize-400x400.gif" alt=""/>
</div>
</div>
<!-- JavaScript code to make the static HTML "come alive" -->
<script type="text/javascript">
Uize.require (
[
'UizeSite.Page.Example.library',
'UizeSite.Page.Example',
'Uize.Fade'
],
function () {
'use strict';
/*** create the example page widget ***/
var page = window.page = UizeSite.Page.Example ();
/*** wire up the page widget ***/
page.wireUi ();
page.wireNode (
window,
'load',
function () {
setTimeout (
function () {
var
fade = Uize.Fade ({duration:4000,curve:Uize.Fade.celeration (0,1),maxValue:500}),
framesLength = 5,
framesLengthMinus1 = framesLength - 1,
frameInterval = 1 / framesLengthMinus1
;
fade.wire (
'Changed.value',
function () {
var
progress = fade.get ('progress'),
tweenPosition = framesLengthMinus1 * fade.get ('progress'),
tweenFrameA = Math.floor (tweenPosition),
tweenFrameB = Math.min (tweenFrameA + 1,framesLengthMinus1)
;
for (var frameNo = -1; ++frameNo < framesLength;) {
var opacity = frameNo == tweenFrameA
? 1
: (frameNo == tweenFrameB ? (progress - tweenFrameA * frameInterval) / frameInterval : 0)
;
page.setNodeOpacity ('frame' + frameNo,opacity);
}
}
);
fade.start ();
},
2000
);
}
);
}
);
</script>
</body>
</html>
//
koh5_pano
Drag mouse to navigate.
Navigation
- Left/Right Mouse drag: Changes camera heading.
- Up/Sown Mouse drag: Changes camera pitch.
- Scroll wheel: Changes camera field of view.
- I-Key: Displays Info panel with canvas size, image size and FPS.
17.Aug.2010, Martin Wengenmayer