Yarr The Pirate! https://w.yarrthepirate.com/phpbb3/ |
|
Leve Refresh Timer https://w.yarrthepirate.com/phpbb3/viewtopic.php?f=52&t=12416 |
Page 1 of 2 |
Author: | Ketrebu [ Sun Sep 26, 2010 5:49 am ] |
Post subject: | Leve Refresh Timer |
This website has a small Leve refresh timer over on the right. http://www.swaggerffxiv.com/ Someone figure out how it works and we can make our own (a better one!) and put it on our site. EDIT: Nevermind, I've figured it out and managed to make my own. Just need to make it pretty now. Can I get it on the site once it's done Yarr? Not sure where to put it. If I make it small enough I could just overlay it on top of the banner image? I'll mock one up once I'm done. |
Author: | Ketrebu [ Sun Sep 26, 2010 9:38 am ] |
Post subject: | |
Thinking something like this: ![]() (That "leve" up there is Kayne from the Ebony/Ivory thread photoshopped onto a leve card.) If you can think of somewhere else that's fine. |
Author: | Ketrebu [ Sun Sep 26, 2010 9:46 am ] |
Post subject: | |
For fun: ![]() |
Author: | Whisp [ Sun Sep 26, 2010 9:46 am ] |
Post subject: | |
cool |
Author: | Yarr [ Sun Sep 26, 2010 9:50 am ] |
Post subject: | |
Im sleepy. Explain this to me in game. |
Author: | Ridere [ Sun Sep 26, 2010 10:38 am ] |
Post subject: | |
lol |
Author: | Ketrebu [ Sun Sep 26, 2010 12:54 pm ] |
Post subject: | |
Finished making one, hopefully Yarr won't sit on it forever. Looks almost exactly like the photoshop mock a few posts up. Also hopefully it doesn't break on Firefox, lol. |
Author: | Dmitry [ Sun Sep 26, 2010 9:47 pm ] |
Post subject: | |
Should use photoshop to make that pic of Kayne stained glass looking, like the levequest cards. |
Author: | Ketrebu [ Mon Sep 27, 2010 6:23 am ] |
Post subject: | |
My timer is totally not here yet. |
Author: | Kayne [ Mon Sep 27, 2010 1:33 pm ] |
Post subject: | |
Still no timer irl, Yarr sucks :p |
Author: | zuldane [ Mon Sep 27, 2010 1:50 pm ] |
Post subject: | |
This site needs more options |
Author: | Kayne [ Mon Sep 27, 2010 4:07 pm ] |
Post subject: | |
omg, stealing Ket's thunder irl (actually was just bored at work and wanted to see if I could do it): script name = countdown.js Code: countdowninitialized = 0;
function formattime(time) { if(new String(time).length==1) return "0" + time; return time; } function returntime(time) { time = Math.round(time/1000); return formattime(Math.floor(time/3600)) + ":" + formattime(Math.floor((time/60)%60)) + ":" + formattime(time%60); } function initializecountdown() { countdowninitialized = 1; imgtags = document.getElementsByTagName("img"); for(i=0;i<imgtags.length;i++) if(imgtags[i].src.match(/newlogo3c.jpg/gi)) break; imgtags[i].parentNode.parentNode.style.position = "relative"; imgtags[i].parentNode.parentNode.innerHTML = imgtags[i].parentNode.parentNode.innerHTML + "<div style=\"position:absolute; left:5px; top:5px;\"><table style=\"background-color:black; border:white solid 1px; color:white; filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=40);\"><tr><td><img src=\"lq.jpg\"/></td><td style=\"vertical-align:top;\"><table style=\"color:white; font-family:arial; font-size:8pt;\"><col style=\"font-weight:bold; white-space:nowrap;\"/><col style=\"white-space:nowrap\"/><tr><td colspan=\"2\" style=\"border-bottom:white solid 1px;\">Levequest Countdown</td></tr><tr><td style=\"padding-top:2px;\">Last Reset:</td><td id=\"lastreset\" style=\"padding-top:2px;\"></td></tr><tr><td>Next Reset:</td><td id=\"nextreset\"></td></tr><tr><td>Countdown:</td><td id=\"countdown\"></td></tr></table></td></tr></table></div>"; } function countdown() { if(!countdowninitialized) initializecountdown(); starttime = new Date("9/22/2010 0:00 GMT"); while(starttime <= new Date()) starttime.setHours(starttime.getHours() + 36); document.getElementById("lastreset").innerHTML = new Date(starttime.setHours(starttime.getHours() - 36)).toLocaleString(); document.getElementById("nextreset").innerHTML = new Date(starttime.setHours(starttime.getHours() + 36)).toLocaleString(); document.getElementById("countdown").innerHTML = returntime(starttime - new Date()); setTimeout("countdown()",500); } I'm not sure if Ket had a countdown in his, so maybe he'll want to add it. |
Author: | Ultimatewarrior [ Mon Sep 27, 2010 4:23 pm ] |
Post subject: | |
I heard there there was a countdown timer here, but I can't find it |
Author: | Yarr [ Mon Sep 27, 2010 4:52 pm ] |
Post subject: | |
I'll try and get this working tonight. Just stuck at work still (2h overtime I dont get paid for) |
Author: | Ketrebu [ Mon Sep 27, 2010 4:56 pm ] |
Post subject: | |
Consider my thunder stolen. Here's mine, since it might be the only way you get to see it. Differences are I used a more complicated way of formatting the time string, which I had to look up online, but that was because it originally made it say "1 day, 3 hours, 20 minutes, 5 seconds" and then people said I should just make it compact. It also just looks for the first img tag on the page where I stupidly hardcoded the banner image so Yarr can never change it again. What it ought to do is find the src of the first image and set it as the tablecell background. Too lazy now. Code: // This is the FFXIV Server Launch Date
var BaseDate = new Date("September 22, 2010 00:00:00 GMT"); // Variables var CurrentDate, LastDate, NextDate; var i18n = {weeks: ['week', 'weeks'], days: ['day', 'days'], hours: ['hour', 'hours'], minutes: ['minute', 'minutes'], seconds: ['second', 'seconds']}; var i18c = {days: ['', ''],hours: ['', ''],minutes: ['', ''],seconds: ['', '']}; var units = {days: 24 * 60 * 60, hours: 60 * 60, minutes: 60, seconds: 1}; // This function adds the HTML to the banner, then initializes the leve timer. function setupLevePage() { var imgTag = document.getElementsByTagName('img')[0] if (!imgTag) { // Not loaded yet for some reason, add a timer and try again in a bit. setTimeout(setupLevePage, 100); } else { var tableCell = imgTag.parentNode.parentNode; var html = '<div class="LeveTrans" style="padding: 5px; margin: 5px; background-color: #04002a; border: solid 1px #FFFFFF; width: 190px;">' + '<div class="LeveText">' + '<table cellpadding="0" cellspacing="0">' + ' <tr>' + ' <td style="width:36px; height: 47px;" valign="top"><img style="position: absolute;" src="http://imgur.com/6nAow.png" width="30" height="47" border="0"></td>' + ' <td valign="top"><div style="position: absolute; width: 150px;"><div style="position: relative; top:2px;">' + ' <div class="LeveText" style="margin-bottom: 4px; font-weight: bold;">Levequest Reset Timer</div>' + ' <table cellpadding="0" cellspacing="0">' + ' <col width="65" />' + ' <tr><td class="LeveText">Last Reset:</td><td class="LeveText"><div id="TimeSince"></div></td></tr>' + ' <tr><td class="LeveText">Next Reset:</td><td class="LeveText"><div id="TimeUntil"></div></td></tr>' + ' </table>' + ' </div></div></td>' + ' </tr>' + ' </div>' + '</div>' + '<style type="text/css">' + ' .LeveText {font-family: Tahoma; font-size: 11px; color: white;}' + ' .LeveTrans {filter:alpha(opacity=50); opacity: 0.5; -moz-opacity:0.5;}' + '</style>'; tableCell.style.backgroundImage = "url('images/logo/newlogo3c.jpg')"; tableCell.style.height = "245px"; tableCell.style.cursor = "pointer"; tableCell.vAlign = "top"; tableCell.onclick = function () { window.location = "index.php"; }; tableCell.innerHTML = html; // Initialize initLeveTimes(); } } // Automatically load without fiddling with body onload stuff. setupLevePage(); // Recalculate! function initLeveTimes() { NextDate = new Date(BaseDate); var SinceDiv = document.getElementById('TimeSince'); var UntilDiv = document.getElementById('TimeUntil'); if (SinceDiv) SinceDiv.innerText = 'Calculating...'; if (UntilDiv) UntilDiv.innerText = 'Calculating...'; setTimeout(recalculateLeveTimes, 1000); } // Calculate current Leve times using a 36 hour loop function recalculateLeveTimes() { var i = 0; CurrentDate = new Date(); while (NextDate < CurrentDate) { NextDate.setHours(NextDate.getHours() + 36); } LastDate = new Date(NextDate); LastDate.setHours(NextDate.getHours() - 36); setTimeout(updateLeveTimerDivs, 1000); } // Update the divs with the calculated text. function updateLeveTimerDivs() { CurrentDate = new Date(); var TimeSince = CurrentDate - LastDate; var TimeSinceSeconds = parseInt(TimeSince / 1000); var TimeUntil = NextDate - CurrentDate; var TimeUntilSeconds = parseInt(TimeUntil / 1000); if (TimeUntilSeconds <= 0) { initLeveTimes(); } else { var SinceDiv = document.getElementById('TimeSince'); var UntilDiv = document.getElementById('TimeUntil'); if (SinceDiv) SinceDiv.innerText = getTimeStringCompact(TimeSinceSeconds); if (UntilDiv) UntilDiv.innerText = getTimeStringCompact(TimeUntilSeconds); if (SinceDiv) SinceDiv.title = LastDate; if (UntilDiv) UntilDiv.title = NextDate; setTimeout(updateLeveTimerDivs, 1000); } } // This function takes a number of seconds and turns it into a formatted string. function getTimeStringCompact(seconds) { if (seconds < 1) { return '00:00:00:00'; } var hideEmpty = false; var onlyLargestUnit = false; var returnArray = []; var value; for (unit in units) { value = units[unit]; if (seconds / value >= 1 || unit == 'seconds' || !hideEmpty) { secondsConverted = Math.floor(seconds / value); var i18cUnit = i18c[unit][secondsConverted == 1 ? 0 : 1]; returnArray.push(((secondsConverted + '').length == 2 || unit == 'weeks') ? secondsConverted : '0' + secondsConverted); seconds -= secondsConverted * value; if (onlyLargestUnit) { break; } } }; return returnArray.join(':'); } |
Author: | Kayne [ Tue Sep 28, 2010 11:43 am ] |
Post subject: | |
Yarr, make me an account and I'll post the timer for you :p |
Author: | Yarr [ Tue Sep 28, 2010 11:53 am ] |
Post subject: | |
lol i might just do that today. |
Author: | Black Cat [ Tue Sep 28, 2010 3:54 pm ] |
Post subject: | |
Won't this just return the time from the client pc and not the server? I've been trying to figure this out myself. I got it going but when the page refreshes it will reset the timer. Code: <script type = "text/javascript">
var timeInSecs; var ticker; function startTimer(secs) { timeInSecs = parseInt(secs); ticker = setInterval("tick()", 1000); } function tick( ) { var secs = timeInSecs; if (secs > 0) { timeInSecs--; } else { clearInterval(ticker); startTimer(129600); // start again } var hours= Math.floor(secs/3600); secs %= 3600; var mins = Math.floor(secs/60); secs %= 60; var pretty = ( (hours < 10 ) ? "0" : "" ) + hours + ":" + ( (mins < 10) ? "0" : "" ) + mins + ":" + ( (secs < 10) ? "0" : "" ) + secs; document.getElementById("countdown").innerHTML = pretty; } startTimer(129600); // 36 hours in seconds </script> |
Author: | zuldane [ Tue Sep 28, 2010 5:28 pm ] |
Post subject: | |
http://www.youtube.com/watch?v=9jK-NcRmVcw&ob=av3n |
Author: | Pix [ Tue Sep 28, 2010 7:03 pm ] |
Post subject: | |
http://www.thephphub.com/dbtest/cms/?ce= A site me and rushal were fucking around with. OMG THIS TIMER WILL GIVE US MORE OPTIONS ©Kayne |
Author: | Ketrebu [ Tue Sep 28, 2010 7:10 pm ] |
Post subject: | |
Every site is gonna have a timer before this one irl. |
Author: | Kayne [ Tue Sep 28, 2010 7:13 pm ] |
Post subject: | |
Copy and paste the following into notepad and save it as a .htm file if you want your own timer: Code: <html>
<head> <title></title> <script type="text/javascript"> <!-- function formattime(time) { if(new String(time).length==1) return "0" + time; return time; } function returntime(time) { time = Math.round(time/1000); return formattime(Math.floor(time/3600)) + ":" + formattime(Math.floor((time/60)%60)) + ":" + formattime(time%60); } function countdown() { for(starttime = new Date("9/22/2010 0:00 GMT"); starttime <= new Date(); starttime.setHours(starttime.getHours() + 36)); document.getElementById("lastreset").innerHTML = new Date(starttime.setHours(starttime.getHours() - 36)).toLocaleString(); document.getElementById("nextreset").innerHTML = new Date(starttime.setHours(starttime.getHours() + 36)).toLocaleString(); document.getElementById("countdown").innerHTML = returntime(starttime - new Date()); setTimeout("countdown()",500); } //--> </script> </head> <body style="background-color:gray; margin:0px;" onload="countdown();"> <div style="position:absolute; left:5px; top:5px;"><table style="background-color:black; border:white solid 1px; color:white; filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=80);"><tr><td><img src="http://imgur.com/6nAow.png" style="height:70px;"/></td><td style="vertical-align:top;"><table style="color:white; font-family:arial; font-size:8pt;"><col style="font-weight:bold; white-space:nowrap;"/><col style="white-space:nowrap"/><tr><td colspan="2" style="border-bottom:white solid 1px;">Levequest Countdown</td></tr><tr><td style="padding-top:2px;">Last Reset:</td><td id="lastreset" style="padding-top:2px;"></td></tr><tr><td>Next Reset:</td><td id="nextreset"></td></tr><tr><td>Countdown:</td><td id="countdown"></td></tr></table></td></tr></table></div> </body> </html> |
Author: | Ketrebu [ Tue Sep 28, 2010 7:21 pm ] |
Post subject: | |
Gonna end up making an iframe version on a new domain called yarrthelazypirate.com that puts this site underneath. |
Author: | Kayne [ Tue Sep 28, 2010 10:11 pm ] |
Post subject: | |
lol |
Author: | Yarr [ Tue Sep 28, 2010 10:29 pm ] |
Post subject: | |
Im not lazy. Im just expressing myself. |
Page 1 of 2 | All times are UTC - 5 hours |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |