frozenLake

Untitled

Apr 2nd, 2014
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <style type="text/css">                                  /* I got some /style/ */
  2. body {background-color:#BACAFE;}                         /* Do I need to explain this one? */
  3. p {color:#010101;                                        /* Well I can't just leave BACAFE by itself, now can I? */
  4. text-align:center;                                       /* This aligns the text in the center of whatever box it is in. */
  5. }
  6. #splanet_block                                          
  7. {                                                        /* This is the CSS for the Starter Planet Clock. */
  8. width:200px;
  9. border:4px solid #FFC000;                                /* Attempt at making a shade of gold */
  10. margin:auto;                                             /* This centers the block in the screen, might change this later. */
  11. background-color:#DCC57F;                                /* Halfway Blend between gold and BACAFE. */
  12. }
  13. #splanet_village                                          
  14. {
  15.    text-align:left;                     /* you forgot a semicolon :b */
  16.    margin:left;
  17.    padding: 12px;
  18. }
  19. #v0earth_block                                          
  20. {                                                        /* This is the CSS for the Earth Clock... with timing to events on other planets */
  21. width:650px;
  22. border:4px solid #0000FF;                                /* Blue. */
  23. margin:auto;                                             /* This centers the block in the screen, might change this later. */
  24. background-color:#5D65FF;                                /* Halfway Blend between Blue and BACAFE. */
  25. }
  26. #unix_block                                          
  27. {                                                        /* This is the CSS for the Unix Clock. */
  28. width:200px;
  29. border:4px solid #000000;                                /* Black. */
  30. margin:auto;                                             /* This centers the block in the screen, might change this later. */
  31. background-color:#5D657F;                                /* Halfway Blend between Black and BACAFE. */
  32. }
  33. </style>
  34. <script>var myVar=setInterval(function(){univeral_loop()},1000); // It actually would check every millisecond if that 1000 was not there. //
  35.  
  36. function univeral_loop()
  37. {
  38. var unix = Math.round(+new Date() / 1000);
  39. var splanet_year = Math.floor((unix-1387670400)/38750400);          // splanet stands for Starter Planet, obviously. //
  40. var splanet_yrem = ((unix-1387670400) % 38750400);
  41. var splanet_day  = Math.floor(splanet_yrem / 93600);
  42. var splanet_drem = splanet_yrem % 93600;
  43. var splanet_hour = Math.floor(splanet_drem / 3600);
  44. var splanet_hrem = splanet_drem % 3600;
  45. var splanet_min  = Math.floor(splanet_hrem / 60);
  46. var splanet_sec  = splanet_hrem % 60;
  47. if (splanet_sec<10)
  48.   {
  49.   splanet_secmin=":0";
  50.   }
  51. else
  52.   {
  53.   splanet_secmin=":";
  54.   }
  55.  
  56.   if (splanet_min<10)
  57.   {
  58.   splanet_hourmin=":0";
  59.   }
  60. else
  61.   {
  62.   splanet_hourmin=":";
  63.   }
  64.  
  65.   if (splanet_day>13) //if the day amount is larger than 13
  66.   {var dcal=splanet_day%10 }//modulo by 10 to get a base number
  67. else
  68.   {var dcal=splanet_day} //if no, just keep it straight.
  69.  
  70. if (dcal==1) //if it modulo'd to 1
  71.   {var nend="st" }//it is the 1st
  72. else if (dcal==2) {var nend="nd"}
  73. else if (dcal==3) {var nend="rd"}
  74. else {var nend="th"} //it works now
  75.  
  76. if (splanet_hour < 5) //if hour is smaller than 5
  77.     {var splanet_light = "really late night (go to bed >_>)"}
  78. else if (splanet_hour == 13)
  79.     {var splanet_light = "noooooon"}   
  80. else if (splanet_hour > 26) //if the our is bigger than 26
  81.     {var splanet_light = "late night"}
  82. else if (splanet_hour == 26)
  83.     {var splanet_light = "midnight (watch out for werewolves-owait that's just kimura)"}   
  84. else if (splanet_hour > 20)
  85.     {var splanet_light = "night"}  
  86. else if (splanet_hour > 18)
  87.     {var splanet_light = "evening"}
  88. else if (splanet_hour > 13)
  89.     {var splanet_light = "afternoon"}
  90. else if (splanet_hour > 8)
  91.     {var splanet_light = "morning (EGGS AND BACON)"}   
  92. else if (splanet_hour > 5) //if hour is larger than 5
  93.     {var splanet_light = "dawn (which sun tho)"}
  94. else
  95.     {var splanet_light = "I DON'T KNOW, OKAY?"} //if all else fails, I have no idea
  96.   //Sunrise: 6 to 7
  97.   //Noon: 13
  98.   //Sunset: 19 to 20
  99.   //Midnight: 26
  100.  
  101. document.getElementById('splanet_dayname').innerHTML = "It is currently the " + splanet_day + nend + " day of the Year " + splanet_year;
  102. document.getElementById('splanet_clock').innerHTML = "The time is " + splanet_hour + splanet_hourmin + splanet_min + splanet_secmin + splanet_sec + ", " + splanet_light ;
  103.  
  104. var UTCdate = new Date();
  105. var earthdate = UTCdate.toUTCString();
  106. document.getElementById('v0earth_gmt').innerHTML = earthdate;
  107.  
  108.  
  109. var splanet_vanyear  = Math.floor((unix-1387670400)/38750400);
  110. var splanet_vanyear2 = Math.floor(38750400+38750400*splanet_vanyear);
  111. var splanet_vanyear3 = Math.floor(splanet_vanyear2-(unix-1387670400));
  112. var vanyear_day  = Math.floor(splanet_vanyear3 / 86400);
  113. var vanyear_drem = splanet_vanyear3 % 86400;
  114. var vanyear_hour = Math.floor(vanyear_drem / 3600);
  115. var vanyear_hrem = vanyear_drem % 3600;
  116. var vanyear_min  = Math.floor(vanyear_hrem / 60);
  117. var vanyear_sec  = vanyear_hrem % 60;
  118. document.getElementById('splanet_newyear').innerHTML = vanyear_day + " Days, " + vanyear_hour + " Hours, " + vanyear_min + " Minutes, and " + vanyear_sec + " Seconds " + "until Year " + (splanet_year+1) + " on Starter Planet.";
  119. document.getElementById('unix_clock').innerHTML = unix;
  120. }</script>  
  121.  
  122. <!-- you're welcome -->
  123. <div id="v0earth_block">
  124. <p><b>Vanilla Earth</b></p>
  125. <p id="v0earth_gmt"></p>
  126. <p id="splanet_newyear"></p>
  127. </div>
  128. <p>
  129. </p><div id="splanet_block">
  130. <p><b>Starter Planet</b></p>
  131. <p id="splanet_dayname"></p>
  132. <p id="splanet_clock"></p>
  133. <p id="splanet_village">Quick guide:<br>Sunrise: 6 to 7<br>Noon: 13<br>Sunset: 19 to 20<br>Midnight: 26
  134. </p>
  135. </div>
  136. <p>
  137. </p><div id="unix_block">
  138. <p><b>Unix Time</b></p>
  139. <p id="unix_clock"></p>
  140. </div>
  141. </html>
Advertisement
Add Comment
Please, Sign In to add comment