SHOW:
|
|
- or go back to the newest paste.
| 1 | <html> | |
| 2 | <body> | |
| 3 | <style type="text/css"> /* I got some /style/ */ | |
| 4 | body {background-color:#BACAFE;} /* Do I need to explain this one? */
| |
| 5 | p {color:#010101; /* Well I can't just leave BACAFE by itself, now can I? */
| |
| 6 | text-align:center; /* This aligns the text in the center of whatever box it is in. */ | |
| 7 | } | |
| 8 | #splanet_block | |
| 9 | { /* This is the CSS for the Starter Planet Clock. */
| |
| 10 | width:200px; | |
| 11 | border:4px solid #FFC000; /* Attempt at making a shade of gold */ | |
| 12 | margin:auto; /* This centers the block in the screen, might change this later. */ | |
| 13 | background-color:#DCC57F; /* Halfway Blend between gold and BACAFE. */ | |
| 14 | } | |
| 15 | #splanet_village | |
| 16 | {
| |
| 17 | text-align:left | |
| 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 | ||
| 34 | </style> | |
| 35 | <script> | |
| 36 | var myVar=setInterval(function(){univeral_loop()},1000); // It actually would check every millisecond if that 1000 was not there. //
| |
| 37 | ||
| 38 | function univeral_loop() | |
| 39 | {
| |
| 40 | var unix = Math.round(+new Date() / 1000); | |
| 41 | var splanet_year = Math.floor((unix-1387670400)/38750400); // splanet stands for Starter Planet, obviously. // | |
| 42 | var splanet_yrem = ((unix-1387670400) % 38750400); | |
| 43 | var splanet_day = Math.floor(splanet_yrem / 93600); | |
| 44 | var splanet_drem = splanet_yrem % 93600; | |
| 45 | var splanet_hour = Math.floor(splanet_drem / 3600); | |
| 46 | var splanet_hrem = splanet_drem % 3600; | |
| 47 | var splanet_min = Math.floor(splanet_hrem / 60); | |
| 48 | var splanet_sec = splanet_hrem % 60; | |
| 49 | if (splanet_sec<10) | |
| 50 | {
| |
| 51 | splanet_secmin=":0"; | |
| 52 | } | |
| 53 | else | |
| 54 | {
| |
| 55 | splanet_secmin=":"; | |
| 56 | } | |
| 57 | ||
| 58 | if (splanet_min<10) | |
| 59 | {
| |
| 60 | splanet_hourmin=":0"; | |
| 61 | } | |
| 62 | else | |
| 63 | {
| |
| 64 | splanet_hourmin=":"; | |
| 65 | } | |
| 66 | - | document.getElementById('splanet_dayname').innerHTML = "Day " + splanet_day + " of Year " + splanet_year;
|
| 66 | + | |
| 67 | if (splanet_day>13) //if the day amount is larger than 13 | |
| 68 | {var dcal=splanet_day%10 }//modulo by 10 to get a base number
| |
| 69 | else | |
| 70 | {var dcal=splanet_day} //if no, just keep it straight.
| |
| 71 | ||
| 72 | if (dcal==1) //if it modulo'd to 1 | |
| 73 | {var nend="st" }//it is the 1st
| |
| 74 | else if (dcal==2) | |
| 75 | {var nend="nd"}
| |
| 76 | else if (dcal==3) | |
| 77 | {var nend="rd"}
| |
| 78 | else | |
| 79 | {var nend="th"} //it works now
| |
| 80 | ||
| 81 | if (splanet_hour < 5) //if hour is smaller than 5 | |
| 82 | {var splanet_light = "really late night (go to bed >_>)"}
| |
| 83 | else if (splanet_hour == 13) | |
| 84 | {var splanet_light = "noooooon"}
| |
| 85 | else if (splanet_hour > 26) //if the our is bigger than 26 | |
| 86 | {var splanet_light = "late night"}
| |
| 87 | else if (splanet_hour == 26) | |
| 88 | {var splanet_light = "midnight (watch out for werewolves-owait that's just kimura)"}
| |
| 89 | else if (splanet_hour > 20) | |
| 90 | {var splanet_light = "night"}
| |
| 91 | else if (splanet_hour > 18) | |
| 92 | {var splanet_light = "evening"}
| |
| 93 | else if (splanet_hour > 13) | |
| 94 | {var splanet_light = "afternoon"}
| |
| 95 | else if (splanet_hour > 8) | |
| 96 | {var splanet_light = "morning (EGGS AND BACON)"}
| |
| 97 | else if (splanet_hour > 5) //if hour is larger than 5 | |
| 98 | {var splanet_light = "dawn (which sun tho)"}
| |
| 99 | else | |
| 100 | {var splanet_light = "I DON'T KNOW, OKAY?"} //if all else fails, I have no idea
| |
| 101 | //Sunrise: 6 to 7 | |
| 102 | //Noon: 13 | |
| 103 | //Sunset: 19 to 20 | |
| 104 | //Midnight: 26 | |
| 105 | ||
| 106 | document.getElementById('splanet_dayname').innerHTML = "It is currently the " + splanet_day + nend + " day of the Year " + splanet_year;
| |
| 107 | document.getElementById('splanet_clock').innerHTML = "The time is " + splanet_hour + splanet_hourmin + splanet_min + splanet_secmin + splanet_sec;
| |
| 108 | ||
| 109 | var UTCdate = new Date(); | |
| 110 | var earthdate = UTCdate.toUTCString(); | |
| 111 | document.getElementById('v0earth_gmt').innerHTML = earthdate;
| |
| 112 | ||
| 113 | ||
| 114 | ||
| 115 | var splanet_vanyear = Math.floor((unix-1387670400)/38750400); | |
| 116 | var splanet_vanyear2 = Math.floor(38750400+38750400*splanet_vanyear); | |
| 117 | var splanet_vanyear3 = Math.floor(splanet_vanyear2-(unix-1387670400)); | |
| 118 | var vanyear_day = Math.floor(splanet_vanyear3 / 86400); | |
| 119 | var vanyear_drem = splanet_vanyear3 % 86400; | |
| 120 | var vanyear_hour = Math.floor(vanyear_drem / 3600); | |
| 121 | var vanyear_hrem = vanyear_drem % 3600; | |
| 122 | var vanyear_min = Math.floor(vanyear_hrem / 60); | |
| 123 | var vanyear_sec = vanyear_hrem % 60; | |
| 124 | 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.";
| |
| 125 | document.getElementById('unix_clock').innerHTML = unix;
| |
| 126 | } | |
| 127 | ||
| 128 | </script> | |
| 129 | ||
| 130 | <!-- | |
| 131 | ||
| 132 | I used to have a method for doing 1st, 2nd, ect, but it broke so I got rid of it. Here, have it. | |
| 133 | ||
| 134 | if (day>13) | |
| 135 | {
| |
| 136 | var dcal=day%10 | |
| 137 | } | |
| 138 | else | |
| 139 | {
| |
| 140 | var dcal=day | |
| 141 | } | |
| 142 | if (dcal=1) | |
| 143 | {
| |
| 144 | var nend="st" | |
| 145 | } | |
| 146 | else if (dcal=2) | |
| 147 | {
| |
| 148 | var nend="nd" | |
| 149 | } | |
| 150 | else if (dcal=3) | |
| 151 | {
| |
| 152 | var nend="rd" | |
| 153 | } | |
| 154 | else | |
| 155 | {
| |
| 156 | var nend="th" | |
| 157 | } | |
| 158 | ||
| 159 | --> | |
| 160 | <div id=v0earth_block> | |
| 161 | <p><b>Vanilla Earth</b></p> | |
| 162 | <p id="v0earth_gmt"></p> | |
| 163 | <p id="splanet_newyear"></p> | |
| 164 | </div> | |
| 165 | <p> | |
| 166 | <div id=splanet_block> | |
| 167 | <p><b>Starter Planet</b></p> | |
| 168 | <p id="splanet_dayname"></p> | |
| 169 | <p id="splanet_clock"></p> | |
| 170 | <p id="splanet_village">Sunrise: 6 to 7<br>Noon: 13<br>Sunset: 19 to 20<br>Midnight: 26 | |
| 171 | </p> | |
| 172 | </div> | |
| 173 | <p> | |
| 174 | <div id=unix_block> | |
| 175 | <p><b>Unix Time</b></p> | |
| 176 | <p id="unix_clock"></p> | |
| 177 | </div> | |
| 178 | </body> | |
| 179 | </html> |