| 9 | | // The following code was derived from, |
|---|
| 10 | | // **************************************************** |
|---|
| 11 | | // a binary Unix time clock |
|---|
| 12 | | // copyright 2004 Steve Pomeroy steve@staticfree.info |
|---|
| 13 | | // This software released under the GNU GPL |
|---|
| 14 | | // **************************************************** |
|---|
| 15 | | // and modified by M. David Peterson (m.david@xmlhacker.com) to countdown the number of seconds |
|---|
| 16 | | // between when the page first loads and January 1st, 2008 @ 00:00:00 (based on the local time of the requesting browser). |
|---|
| 17 | | |
|---|
| 18 | | // x is the decimal value, pad is the number of digits to pad up to |
|---|
| 19 | | function toBinary(x,pad){ |
|---|
| 20 | | var y = ""; |
|---|
| 21 | | while(pad){ |
|---|
| 22 | | if( x >= 1 ){ |
|---|
| 23 | | y = (x % 2) + y; |
|---|
| 24 | | x = x / 2; |
|---|
| 25 | | x = Math.floor(x); |
|---|
| 26 | | }else{ |
|---|
| 27 | | y = "0" + y; |
|---|
| | 6 | // The following code was derived from, |
|---|
| | 7 | // **************************************************** |
|---|
| | 8 | // a binary Unix time clock |
|---|
| | 9 | // copyright 2004 Steve Pomeroy steve@staticfree.info |
|---|
| | 10 | // This software released under the GNU GPL |
|---|
| | 11 | // **************************************************** |
|---|
| | 12 | // and modified by M. David Peterson (m.david@xmlhacker.com) to countdown the number of seconds |
|---|
| | 13 | // between when the page first loads and January 1st, 2008 @ 00:00:00 (based on the local time of the requesting browser). |
|---|
| | 14 | |
|---|
| | 15 | // x is the decimal value, pad is the number of digits to pad up to |
|---|
| | 16 | function toBinary(x,pad){ |
|---|
| | 17 | var y = ""; |
|---|
| | 18 | while(pad){ |
|---|
| | 19 | if( x >= 1 ){ |
|---|
| | 20 | y = (x % 2) + y; |
|---|
| | 21 | x = x / 2; |
|---|
| | 22 | x = Math.floor(x); |
|---|
| | 23 | }else{ |
|---|
| | 24 | y = "0" + y; |
|---|
| | 25 | } |
|---|
| | 26 | pad--; |
|---|
| 29 | | pad--; |
|---|
| 30 | | } |
|---|
| 31 | | return y; |
|---|
| 32 | | } |
|---|
| 33 | | // sets the text of the element with the id 'countdowndisp' to |
|---|
| 34 | | // the clock and endlessly loops |
|---|
| 35 | | function updateTime(){ |
|---|
| 36 | | var x = new Date(); |
|---|
| 37 | | var jan12008000000 = Date.parse('January, 1 2008 00:00:00'); |
|---|
| 38 | | var display = toBinary(Math.floor(jan12008000000/1000 - x.valueOf()/1000), 32); |
|---|
| 39 | | document.getElementById('countdowndisp').innerHTML = display; |
|---|
| 40 | | document.title = display.concat(' seconds until 11111011000 and the amp.fm limited public beta'); |
|---|
| 41 | | setTimeout( updateTime, 1000 ); |
|---|
| 42 | | } |
|---|
| 43 | | </script> |
|---|
| | 28 | return y; |
|---|
| | 29 | } |
|---|
| | 30 | // sets the text of the element with the id 'countdowndisp' to |
|---|
| | 31 | // the clock and endlessly loops |
|---|
| | 32 | function updateTime(){ |
|---|
| | 33 | var x = new Date(); |
|---|
| | 34 | var timeinseconds = x.valueOf()/1000; |
|---|
| | 35 | var jan12008000000 = Date.parse('January, 1 2008 00:00:00')/1000; |
|---|
| | 36 | var timeleftinseconds = Math.floor(jan12008000000 - timeinseconds); |
|---|
| | 37 | var display = toBinary(timeleftinseconds, 32); |
|---|
| | 38 | document.getElementById('countdowndisp').innerHTML = display; |
|---|
| | 39 | document.title = display.concat(' seconds until 11111011000 and the amp.fm limited public beta'); |
|---|
| | 40 | if(timeleftinseconds < 45){ |
|---|
| | 41 | startTransition(); |
|---|
| | 42 | } |
|---|
| | 43 | setTimeout( updateTime, 1000 ); |
|---|
| | 44 | } |
|---|
| | 45 | var transitionStarted = false; |
|---|
| | 46 | var redirectCount = 0; |
|---|
| | 47 | function startTransition() { |
|---|
| | 48 | if(redirectCount < 60) { |
|---|
| | 49 | if(redirectCount == 40) { |
|---|
| | 50 | opacity('ampfmlogo', 0, 100, 20000); |
|---|
| | 51 | } |
|---|
| | 52 | if(redirectCount == 45) { |
|---|
| | 53 | opacity('get-plugged-in', 0, 100, 5000); |
|---|
| | 54 | } |
|---|
| | 55 | if(redirectCount == 45) { |
|---|
| | 56 | opacity('happy-new-year', 0, 100, 5000); |
|---|
| | 57 | } |
|---|
| | 58 | if(transitionStarted == false){ |
|---|
| | 59 | opacity('countdowndisp', 100, 15, 5000); |
|---|
| | 60 | opacity('content', 100, 0, 30000); |
|---|
| | 61 | opacity('container', 100, 0, 45000); |
|---|
| | 62 | |
|---|
| | 63 | transitionStarted = true; |
|---|
| | 64 | } |
|---|
| | 65 | redirectCount++; |
|---|
| | 66 | } |
|---|
| | 67 | else { |
|---|
| | 68 | window.location.replace('http://blog.amp.fm/'); |
|---|
| | 69 | } |
|---|
| | 70 | } |
|---|
| | 71 | </script> |
|---|
| 60 | | <h1 id="countdowndisp">If this is displayed, your browser doesn't support Javascript. Sorry.</h1> |
|---|
| 61 | | <script type="text/javascript">updateTime()</script> |
|---|
| | 156 | <div id="ampfmlogo"> |
|---|
| | 157 | <img src="http://amp.fm/images/amplogo5.png"/> |
|---|
| | 158 | <div id="get-plugged-in"> |
|---|
| | 159 | <h1>Get Plugged Into 11111011000</h1> |
|---|
| | 160 | </div> |
|---|
| | 161 | <div id="happy-new-year"> |
|---|
| | 162 | <h2>Happy New Year, Everyone!</h2> |
|---|
| | 163 | </div> |
|---|
| | 164 | </div> |
|---|
| | 165 | <div id="container"> |
|---|
| | 166 | <div class="bodycontent"> |
|---|
| | 167 | <div id="countdowndisp">11111011000</div> |
|---|
| | 168 | <script language="javascript" type="text/javascript">updateTime()</script> |
|---|
| | 169 | </div> |
|---|
| | 170 | <script language="javascript" src="/js/matrix.js"></script> |
|---|
| | 171 | </div> |
|---|