Moe download counters ^~^ (oh and a "hide" button too)

This commit is contained in:
Vasco Lavos committed 2014-07-04 01:00:07 +01:00
1 parent e6906adc80
commit c84daaacc4
13 files changed
+24 -5

No files matched your search

+1 -1
View File
@@ -1 +1 @@
<!DOCTYPE html>␍<html>␍ <title>Downloads - Botania | vazkii.us</title> ␍ <head>␍ <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">␍ <link rel="stylesheet" href="page.css">␍ </head>␍␍ <body>␍ <?php include 'incl/header.php'; ?>␍␍ <div class="container">␍ <div class="content">␍ <?php␍ include 'dl.php';␍ ␍ $files = scandir('files/');␍ natsort($files);␍ $files = array_reverse($files);␍ $versions = parse_ini_file('versions.ini');␍ $first = true;␍ $total_dls = 0;␍ $downloads_str = '';␍ $last_version = '';␍ $old = false;␍ ␍ foreach($files as $file)␍ if(strlen($file) > 2) {␍ $dls_num = get_dls($file);␍ $total_dls += intval($dls_num);␍ $dls = number_format($dls_num);␍ $button_type = 'old-dl';␍ $cl_button_type = 'btn-sm';␍ ␍ $file_version = substr($file, strlen('Botania '));␍ $version_name = substr($file_version, 0, strlen($file_version) - strlen('.jar'));␍ $mc_version = $versions[$version_name];␍ $version_name = str_replace('.', '-', $version_name);␍ ␍ $dls_txt = 'Downloads';␍ if($dls_num == 0)␍ $dls_txt = 'Downloads :(';␍ elseif($dls_num == 1)␍ $dls_txt = 'Download';␍ ␍ if($first) {␍ $button_type = 'btn-lg';␍ $cl_button_type = '';␍ }␍ ␍ if($last_version != $mc_version && !$first)␍ $downloads_str .= "<br><font size='4'>Minecraft <b>$mc_version</b></font><br>";␍ ␍ $downloads_str .= "<a href='dl.php?file=$file' class='btn $button_type btn-success dl'><b><span class='glyphicon glyphicon-download'></span> $file</b></a> <a href='changelog.php#$version_name' class='btn $cl_button_type btn-info'><b>Changelog</b></a> <a class='btn $cl_button_type btn-danger dl-counter'>Minecraft <b>$mc_version</b></a> <a href='dl.php?file=$file' class='btn $cl_button_type btn-warning dl-counter'><b>$dls</b> $dls_txt</a>";␍ ␍ if($first) {␍ $downloads_str .= '<br><br><hr><font size="6">Old Versions</font><br>';␍ $first = false;␍ } else {␍ $downloads_str .= '<br>';␍ $last_version = $mc_version;␍ }␍ }␍ ␍ $total_dl_str = number_format($total_dls);␍ $mod_launch = strtotime('2014-02-28 17:32:22');␍ $current_time = time();␍ $days_passed = ($current_time - $mod_launch) / 86400;␍ $days_int = round($days_passed);␍ $daily_dls = round($total_dls / $days_passed, 2);␍ ␍ print("<div class='total-dls'><span class='glyphicon glyphicon-star'></span> Botania has been downloaded a total of <b>$total_dl_str</b> times over $days_int days. (About <i>$daily_dls</i> dls/day)</div>Botania is under a Creative Commons BY-NC-SA License, more info (for modpacks and other purposes) can be found in the footer.<br><span class='warning-txt'>Note that as of beta-22, Botania requires the <a href='http://www.minecraftforum.net/topic/2535073-'>Baubles API</a>. If you have Thaumcraft installed, though, this is downloaded automatically.</span><br><br><font size='5'>Latest Download</font><br>");␍ print($downloads_str);␍ ?>␍ </div>␍ </div>␍ ␍ <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>␍ <script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>␍ <script src="jquery_cookie.min.js"></script>␍ <script> $(function() { $('#header-btn-downloads').addClass('active'); }); </script>␍ <?php include 'incl/footer.php'; ?> ␍ </body>␍</html>
<!DOCTYPE html>␍<html>␍ <title>Downloads - Botania | vazkii.us</title> ␍ <head>␍ <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">␍ <link rel="stylesheet" href="page.css">␍ </head>␍␍ <body>␍ <?php include 'incl/header.php'; ?>␍␍ <div class="container">␍ <div class="content">␍ <?php␍ include 'dl.php';␍ ␍ $files = scandir('files/');␍ natsort($files);␍ $files = array_reverse($files);␍ $versions = parse_ini_file('versions.ini');␍ $first = true;␍ $total_dls = 0;␍ $downloads_str = '';␍ $last_version = '';␍ $old = false;␍ ␍ foreach($files as $file)␍ if(strlen($file) > 2) {␍ $dls_num = get_dls($file);␍ $total_dls += intval($dls_num);␍ $dls = number_format($dls_num);␍ $button_type = 'old-dl';␍ $cl_button_type = 'btn-sm';␍ ␍ $file_version = substr($file, strlen('Botania '));␍ $version_name = substr($file_version, 0, strlen($file_version) - strlen('.jar'));␍ $mc_version = $versions[$version_name];␍ $version_name = str_replace('.', '-', $version_name);␍ ␍ $dls_txt = 'Downloads';␍ if($dls_num == 0)␍ $dls_txt = 'Downloads :(';␍ elseif($dls_num == 1)␍ $dls_txt = 'Download';␍ ␍ if($first) {␍ $button_type = 'btn-lg';␍ $cl_button_type = '';␍ }␍ ␍ $div_id = 'version-' . str_replace('.', '-', $mc_version);␍ if($last_version != $mc_version && !$first)␍ $downloads_str .= "</div><br><font size='4'>Minecraft <b>$mc_version</b></font> <a class='hide-div' id='hide-$div_id'>(hide)</a><br><div id='$div_id'>";␍ ␍ $downloads_str .= "<a href='dl.php?file=$file' class='btn $button_type btn-success dl'><b><span class='glyphicon glyphicon-download'></span> $file</b></a> <a href='changelog.php#$version_name' class='btn $cl_button_type btn-info'><b>Changelog</b></a> <a class='btn $cl_button_type btn-danger dl-counter'>Minecraft <b>$mc_version</b></a> <a href='dl.php?file=$file' class='btn $cl_button_type btn-warning dl-counter'><b>$dls</b> $dls_txt</a>";␍ ␍ if($first) {␍ $downloads_str .= '<br><br><hr><font size="6">Old Versions</font><div>';␍ $first = false;␍ } else {␍ $downloads_str .= '<br>';␍ $last_version = $mc_version;␍ }␍ }␍ ␍ $total_dl_str = number_format($total_dls);␍ $mod_launch = strtotime('2014-02-28 17:32:22');␍ $current_time = time();␍ $days_passed = ($current_time - $mod_launch) / 86400;␍ $days_int = round($days_passed);␍ $daily_dls = round($total_dls / $days_passed, 2);␍ ␍ print("<div class='total-dls'><span class='glyphicon glyphicon-star moe-scroll'></span> Botania has been downloaded a total of <b class='moe-scroll'>$total_dl_str</b> times over $days_int days. (About <i>$daily_dls</i> dls/day)</div>Botania is under a Creative Commons BY-NC-SA License, more info (for modpacks and other purposes) can be found in the footer.<br><span class='warning-txt'>Note that as of beta-22, Botania requires the <a href='http://www.minecraftforum.net/topic/2535073-'>Baubles API</a>. If you have Thaumcraft installed, though, this is downloaded automatically.</span><br><br><font size='5'>Latest Download</font><br>");␍ print($downloads_str);␍ ␍ $nekos = '<br><hr><br><div id="moe-counter">';␍ foreach(str_split($total_dls) as $num)␍ $nekos .= "<img src='img/moe/$num.gif'></ing>";␍ $nekos .= '<br>.jars served, whatcha waiting for? <a class="hashlink">(back to top)</a></div>';␍ ␍ print($nekos);␍ ?>␍ </div>␍ </div>␍ ␍ <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>␍ <script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>␍ <script src="jquery_cookie.min.js"></script>␍ <script> $(function() { $('#header-btn-downloads').addClass('active'); }); </script>␍ <?php include 'incl/footer.php'; ?> ␍ </body>␍</html>
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

+22 -3
View File
@@ -13,7 +13,9 @@ $(function() {
}
var hash = document.location.hash.substring(1);
$('html, body').animate({ scrollTop: $("#" + hash + "-fake").offset().top - 100 }, 1000);
var offset = $("#" + hash + "-fake").offset();
if(offset != undefined)
$('html, body').animate({ scrollTop: offset.top - 100 }, 1000);
});
$('.hide-footer-btn').click(function() {
@@ -42,16 +44,33 @@ $('.hide-footer-btn').mouseenter(function(e) {
$('.hide-footer-btn').mouseleave(function(e) {
$('#footer-tooltip').fadeOut();
})
});
$('.hide-div').click(function() {
var divname = $(this).attr('id').substring('hide-'.length);
var div = $('#' + divname);
if(div.is(':visible')) {
div.hide(300);
$(this).text('(show)');
} else {
div.show(300);
$(this).text('(hide)');
}
});
$(".hashlink").click(function() {
var hash = $(this).text();
if(hash == 'Back to top')
if(hash == 'Back to top' || hash == '(back to top)')
$('html, body').animate({ scrollTop: 0 }, 500);
else $('html, body').animate({ scrollTop: $("#" + hash + "-fake").offset().top - 100 }, 1000);
});
$(".moe-scroll").click(function() {
$('html, body').animate({ scrollTop: $("#moe-counter").offset().top - 100 }, 1000);
});
function changeCensor() {
$('.censored').each(function() {
$(this).text(randomStr($(this).text().length));
+1 -1
View File
@@ -1 +1 @@
html {␍ position: relative;␍ min-height: 100%;␍}␍␍.container {␍ margin-left: 0px;␍ width: 100%␍}␍␍.content {␍ margin-top: 100px;␍ margin-bottom: 60px;␍}␍␍.navbar {␍ background-color: #0d6214;␍ border: none;␍ box-shadow: 0px 3px 4px #000000, 0px 0px 25px #19ac46 inset;␍}␍␍.navbar-brand {␍ padding: 4px 20px;␍ height: 80px;␍}␍␍.navbar-brand-container:hover {␍ background-color: #05510e;␍}␍␍.nav {␍ margin-left: 20px;␍ margin-top: 30px;␍}␍␍.navbar-inverse .navbar-nav > .active > a,␍.navbar-inverse .navbar-nav > .active > a:hover,␍.navbar-inverse .navbar-nav > .active > a:focus {␍ background-color: #04410e;␍ box-shadow: 0px -2px 8px #04410e;␍ text-shadow: 1px 1px rgba(0, 0, 0, 0.3);␍}␍␍.header-btn:hover {␍ background-color: #05510e;␍ box-shadow: 0px -2px 8px #05510e;␍ text-shadow: 1px 1px rgba(0, 0, 0, 0.3);␍}␍␍.content {␍ margin-bottom: 40px;␍}␍␍.carousel {␍ height: 500px;␍ width: 970px;␍ margin-top: -18px;␍ left: 50%;␍ margin-left: -485px;␍}␍␍.carousel-caption {␍ z-index: 10;␍}␍ ␍.carousel .item {␍ height: 500px;␍ background-color: #777;␍}␍␍.carousel-inner {␍ outline: double;␍ box-shadow: 0px 0px 20px 8px #000000;␍}␍␍.carousel-inner > .item > img {␍ position: absolute;␍ top: 0;␍ left: 0;␍ height: 500px;␍ width: 100%;␍}␍␍.featurette-divider {␍ margin: 20px 0;␍}␍ ␍.featurette-heading {␍ font-weight: 300;␍ line-height: 1;␍ letter-spacing: -1px;␍}␍␍.featurette-image {␍ box-shadow: 0px 0px 20px 2px #000000;␍}␍␍.youtube {␍ width: 1200px;␍}␍␍.bottom-youtube {␍ margin-bottom: 60px;␍}␍␍.video-intro {␍ margin-left: 20px;␍ color: #888;␍ font-weight: bold;␍ text-shadow: 1px 1px rgba(0, 0, 0, 0.2);␍}␍␍iframe {␍ width: 290px;␍ height: 220px;␍ margin: 15px 0px 0px 10px;␍ box-shadow: -1px 0px 20px 2px #000000;␍}␍␍.total-dls {␍ text-shadow: 1px 1px rgba(0, 0, 0, 0.3);␍ font-size: 26px;␍}␍␍.dl {␍ width: 220px;␍}␍␍.dl-counter {␍ width: 150px;␍}␍␍.old-dl {␍ margin-bottom: 3px;␍}␍␍#footer {␍ position: fixed;␍ bottom: 0;␍ min-width: 650px;␍ right: 25%;␍ left: 25%;␍ text-align: center;␍ background-color: #a9e6b7;␍ padding-top: 3px;␍ box-shadow: 0px 0px 25px #19ac46 inset, 0px 0px 25px #19ac46;␍}␍␍.footer > a {␍ text-decoration:none;␍}␍␍.hide-footer-btn {␍ position: fixed;␍ bottom: 15px;␍ left: calc(75% + 2px);␍ color: #04410e;␍}␍␍.hide-footer-btn > a {␍ text-decoration:none;␍ color: #04410e;␍}␍␍.hide-footer-btn > a:hover {␍ color: #08810e;␍}␍␍#footer-tooltip {␍ display: none;␍}␍␍.padded {␍ margin-left: 20px;␍ margin-right: 20px;␍ border: none;␍}␍␍.warning-txt {␍ color: #aa0000;␍ font-weight: bold;␍ text-shadow: 1px 1px rgba(0, 0, 0, 0.3);␍}
html {␍ position: relative;␍ min-height: 100%;␍}␍␍.container {␍ margin-left: 0px;␍ width: 100%␍}␍␍.content {␍ margin-top: 100px;␍ margin-bottom: 60px;␍}␍␍.navbar {␍ background-color: #0d6214;␍ border: none;␍ box-shadow: 0px 3px 4px #000000, 0px 0px 25px #19ac46 inset;␍}␍␍.navbar-brand {␍ padding: 4px 20px;␍ height: 80px;␍}␍␍.navbar-brand-container:hover {␍ background-color: #05510e;␍}␍␍.nav {␍ margin-left: 20px;␍ margin-top: 30px;␍}␍␍.navbar-inverse .navbar-nav > .active > a,␍.navbar-inverse .navbar-nav > .active > a:hover,␍.navbar-inverse .navbar-nav > .active > a:focus {␍ background-color: #04410e;␍ box-shadow: 0px -2px 8px #04410e;␍ text-shadow: 1px 1px rgba(0, 0, 0, 0.3);␍}␍␍.header-btn:hover {␍ background-color: #05510e;␍ box-shadow: 0px -2px 8px #05510e;␍ text-shadow: 1px 1px rgba(0, 0, 0, 0.3);␍}␍␍.content {␍ margin-bottom: 40px;␍}␍␍.carousel {␍ height: 500px;␍ width: 970px;␍ margin-top: -18px;␍ left: 50%;␍ margin-left: -485px;␍}␍␍.carousel-caption {␍ z-index: 10;␍}␍ ␍.carousel .item {␍ height: 500px;␍ background-color: #777;␍}␍␍.carousel-inner {␍ outline: double;␍ box-shadow: 0px 0px 20px 8px #000000;␍}␍␍.carousel-inner > .item > img {␍ position: absolute;␍ top: 0;␍ left: 0;␍ height: 500px;␍ width: 100%;␍}␍␍.featurette-divider {␍ margin: 20px 0;␍}␍ ␍.featurette-heading {␍ font-weight: 300;␍ line-height: 1;␍ letter-spacing: -1px;␍}␍␍.featurette-image {␍ box-shadow: 0px 0px 20px 2px #000000;␍}␍␍.youtube {␍ width: 1200px;␍}␍␍.bottom-youtube {␍ margin-bottom: 60px;␍}␍␍.video-intro {␍ margin-left: 20px;␍ color: #888;␍ font-weight: bold;␍ text-shadow: 1px 1px rgba(0, 0, 0, 0.2);␍}␍␍iframe {␍ width: 290px;␍ height: 220px;␍ margin: 15px 0px 0px 10px;␍ box-shadow: -1px 0px 20px 2px #000000;␍}␍␍.total-dls {␍ text-shadow: 1px 1px rgba(0, 0, 0, 0.3);␍ font-size: 26px;␍}␍␍.dl {␍ width: 220px;␍}␍␍.dl-counter {␍ width: 150px;␍}␍␍.old-dl {␍ margin-bottom: 3px;␍}␍␍#footer {␍ position: fixed;␍ bottom: 0;␍ min-width: 650px;␍ right: 25%;␍ left: 25%;␍ text-align: center;␍ background-color: #a9e6b7;␍ padding-top: 3px;␍ box-shadow: 0px 0px 25px #19ac46 inset, 0px 0px 25px #19ac46;␍}␍␍.footer > a {␍ text-decoration:none;␍}␍␍.hide-footer-btn {␍ position: fixed;␍ bottom: 15px;␍ left: calc(75% + 2px);␍ color: #04410e;␍}␍␍.hide-footer-btn > a {␍ text-decoration:none;␍ color: #04410e;␍}␍␍.hide-footer-btn > a:hover {␍ color: #08810e;␍}␍␍#footer-tooltip {␍ display: none;␍}␍␍.padded {␍ margin-left: 20px;␍ margin-right: 20px;␍ border: none;␍}␍␍.warning-txt {␍ color: #aa0000;␍ font-weight: bold;␍ text-shadow: 1px 1px rgba(0, 0, 0, 0.3);␍}␍␍.hashlink, .moe-scroll, .hide-div{␍ cursor: pointer;␍}␍␍.moe-scroll:hover {␍ color: #080;␍}␍␍#moe-counter {␍ margin-left: -15px;␍ width: calc(100% + 30px);␍ height: 180px;␍ margin-bottom: 50px;␍ text-align: center;␍ background: linear-gradient(to bottom, rgba(52,150,30,0) 0%,rgba(89,115,83,0) 60%,rgba(97,107,95,0.19) 74%,rgba(102,102,102,0.28) 82%,rgba(102,102,102,0.33) 86%,rgba(102,102,102,0) 99%);␍}␍.moe {␍ width: 68px;␍ height: 150px;␍ z-index: -1;␍}␍