Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(563)

Side by Side Diff: screensavers/fade_in_out/index.htm

Issue 5558004: Move screensavers over from assets to chromiumos-assets as they are ChromiumOS specific atm. (Closed) Base URL: http://git.chromium.org/git/chromiumos-assets.git@master
Patch Set: Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « screensavers/default ('k') | screensavers/fade_in_out/logo.png » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1
2 <!-- saved from url=(0061)http://www.cs.virginia.edu/~kkk5z/screensavers/chromiu mOS.htm -->
3 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859 -1">
4 <script type="text/javascript">
5 var heading = null;
6 var width = window.innerWidth;
7 var height = window.innerHeight;
8
9
10 function moveText(milliseconds) {
11 window.setInterval("changePosition()", milliseconds)
12 }
13
14 function changePosition() {
15 // first
16 var x = Math.random()*(width-350);
17 var y = Math.random()*(height-150);
18
19 if(document.getElementById){
20 heading = document.getElementById("moveme");
21 }
22 else if(document.layers){
23 heading = document.layers["moveme"];
24 }
25 if(heading != null) {
26 var imageHeight = heading.height;
27 var imageWidth = heading.width;
28 heading.style.posLeft = x;
29 heading.style.posTop = y;
30 }
31
32
33 +FadeIn("moveme");
34 setTimeout("FadeOut(" + '"moveme"'+ ")",5000);
35
36
37 }
38
39 function SetOpacity(object,opacityPct)
40 {
41 // IE.
42 object.style.filter = 'alpha(opacity=' + opacityPct + ')';
43 // Old mozilla and firefox
44 object.style.MozOpacity = opacityPct/100;
45 // Everything else.
46 object.style.opacity = opacityPct/100;
47 }
48 function ChangeOpacity(id,msDuration,msStart,fromO,toO)
49 {
50 var element=document.getElementById(id);
51 element.style.visibility="visible";
52 var opacity = element.style.opacity * 100;
53 var msNow = (new Date()).getTime();
54 opacity = fromO + (toO - fromO) * (msNow - msStart) / msDuration;
55 if (opacity<0)
56 SetOpacity(element,0)
57 else if (opacity>100)
58 SetOpacity(element,100)
59 else
60 {
61 SetOpacity(element,opacity);
62 element.timer = window.setTimeout("ChangeOpacity('" + id + "'," + msDuration + "," + msStart + "," + fromO + "," + toO + ")",1);
63 }
64 }
65
66
67 function FadeIn(id)
68 {
69 var element=document.getElementById(id);
70 if (element.timer) window.clearTimeout(element.timer);
71 var startMS = (new Date()).getTime();
72 element.timer = window.setTimeout("ChangeOpacity('" + id + "',4000," + startMS + ",0,100)",1);
73 }
74
75
76 function FadeOut(id)
77 {
78 var element=document.getElementById(id);
79 if (element.timer) window.clearTimeout(element.timer);
80 var startMS = (new Date()).getTime();
81 element.timer = window.setTimeout("ChangeOpacity('" + id + "',4000," + startMS + ",100,0)",1);
82 }
83
84
85 function random(a, b) {
86 var r = Math.random();
87 if (a instanceof Array) {
88 var i = Math.floor(r*a.length);
89 return a[i];
90 } else if (b == undefined) {
91 return r*a;
92 } else {
93 return r*(a+b)-a;
94 }
95 }
96
97
98 </script>
99
100 <style type="text/css">
101 * {
102 margin: 0;
103 padding: 0;
104 }
105 html, body {
106 width: 100%;
107 background-color: #000;
108 height: 100%;
109 }
110 </style>
111
112 </head>
113 <body onload="changePosition();moveText(10000)">
114 <div id="moveme" style="position: absolute; left: 862.429px; top: 3.65261px; vis ibility: visible; opacity: 0; ">
115 <img src="logo.png">
116 </div>
117
118
119
120 </body></html>
OLDNEW
« no previous file with comments | « screensavers/default ('k') | screensavers/fade_in_out/logo.png » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698