forked from seajs/seajs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ba4311e
commit 7fd9db2
Showing
15 changed files
with
351 additions
and
10,971 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
docs/examples/hello-seajs/assets/sea_modules/hello-seajs/1.0.0/hello-debug.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
html, body, div, span, h1, h2, h3, h4, p, img, strong, ol, ul, li { | ||
margin: 0; | ||
padding: 0; | ||
border: 0; | ||
font-size: 100%; | ||
vertical-align: baseline; | ||
background: transparent; | ||
} | ||
|
||
body { | ||
background: #F4F4F4; | ||
} | ||
|
||
#container { | ||
position: relative; | ||
margin: 40px 120px; | ||
display: none; | ||
} | ||
|
||
#container img { | ||
position: absolute; | ||
cursor: pointer; | ||
opacity: .6; | ||
|
||
-webkit-transition-property: -webkit-transform; | ||
-moz-transition-property: -moz-transform; | ||
-o-transition-property: -o-transform; | ||
transition-property: transform; | ||
-webkit-transition-duration: 0.8s; | ||
-moz-transition-duration: 0.8s; | ||
-o-transition-duration: 0.8s; | ||
transition-duration: 0.8s; | ||
} |
81 changes: 81 additions & 0 deletions
81
docs/examples/hello-seajs/assets/sea_modules/hello-seajs/1.0.0/hello-debug.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
define("hello-seajs/1.0.0/spinning-debug", ["#jquery/1.7.2/jquery-debug"], function(require, exports, module) { | ||
|
||
var $ = require('#jquery/1.7.2/jquery-debug') | ||
|
||
var TRANSFORM = $.browser.webkit ? '-webkit-transform' : | ||
$.browser.mozilla ? '-moz-transform' : | ||
$.browser.opera ? '-o-transform' : 'transform' | ||
|
||
function random(x) { return Math.random() * x } | ||
|
||
|
||
function Spinning(container) { | ||
this.container = $(container) | ||
this.icons = this.container.children() | ||
this.spinnings = [] | ||
} | ||
|
||
Spinning.prototype.render = function() { | ||
this._init() | ||
this.container.show() | ||
this._spin() | ||
} | ||
|
||
Spinning.prototype._init = function() { | ||
var spinnings = this.spinnings | ||
|
||
$(this.icons).each(function(n) { | ||
var startDeg = random(360) | ||
var node = $(this) | ||
var timer | ||
|
||
node.css({ | ||
top: random(40), | ||
left: n * 50 + random(10), | ||
zIndex: 1000 | ||
}).hover( | ||
function() { | ||
node.fadeTo(250, 1) | ||
.css('zIndex', 1001) | ||
.css(TRANSFORM, 'rotate(0deg)') | ||
|
||
}, | ||
function() { | ||
node.fadeTo(250, .6).css('zIndex', 1000) | ||
timer && clearTimeout(timer) | ||
timer = setTimeout(spin, Math.ceil(random(10000))) | ||
} | ||
) | ||
|
||
function spin() { | ||
node.css(TRANSFORM, 'rotate(' + startDeg + 'deg)') | ||
} | ||
|
||
spinnings[n] = spin | ||
}) | ||
|
||
return this | ||
} | ||
|
||
Spinning.prototype._spin = function() { | ||
|
||
$(this.spinnings).each(function(i, fn) { | ||
setTimeout(fn, Math.ceil(random(3000))) | ||
}) | ||
|
||
return this | ||
} | ||
|
||
|
||
module.exports = Spinning | ||
}) | ||
|
||
|
||
define("hello-seajs/1.0.0/hello-debug", ["./spinning-debug", "#jquery/1.7.2/jquery-debug"], function(require) { | ||
|
||
var Spinning = require('./spinning-debug') | ||
|
||
var s = new Spinning('#container') | ||
s.render() | ||
|
||
}) |
1 change: 1 addition & 0 deletions
1
docs/examples/hello-seajs/assets/sea_modules/hello-seajs/1.0.0/hello.css
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
docs/examples/hello-seajs/assets/sea_modules/hello-seajs/1.0.0/hello.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.