Skip to content
Browse files

title and argyle button

  • Loading branch information...
1 parent 1f5651d commit 457c292dc0d60697cc9a5e96571183aa9b234b78 @roblourens committed
Showing with 36 additions and 16 deletions.
  1. +4 −1 Conf.js
  2. +13 −0 U.js
  3. +4 −1 conf/iastate.json
  4. +1 −0 conf/uiowa.json
  5. +1 −0 conf/uni.json
  6. +13 −14 index.php
View
5 Conf.js
@@ -10,6 +10,7 @@ Conf.init = function(confJson)
this.detailColor = confJson['color3']; // % and school days
this.timelinePast = confJson['timelinePast'];
this.timelineFuture = confJson['timelineFuture'];
+ this.name = confJson['name'];
/* Old browsers */
$('body').css('background', this.primaryColor);
@@ -32,8 +33,10 @@ Conf.init = function(confJson)
$('body').css('color', this.secondaryColor);
$('body').css('text-shadow', '1px 1px 0px '+this.shadowColor);
-
$('.detailsButton').css('color', this.secondaryColor);
+
+ $('#title').html(this.name);
+ $('#title').css('color', this.detailColor);
}
// stuff that directly affects dynamic elements
View
13 U.js
@@ -5,6 +5,7 @@ U.init = function(d)
this.data = d;
this.events = d['events'];
this.detailLevel = 4;
+ this.isArgyled = false;
// timeline canvas props
this.w = 800;
@@ -261,3 +262,15 @@ U.zeroFill = function(number, d)
return number;
}
+
+U.argyle = function()
+{
+ var imageName = '';
+ if (this.isArgyled)
+ imageName = 'grid_noise.png';
+ else
+ imageName = 'argyle.png';
+
+ $('#main').css('background-image', 'url('+imageName+')');
+ this.isArgyled = !this.isArgyled;
+}
View
5 conf/iastate.json
@@ -1,7 +1,10 @@
{
+ 'name': 'Iowa State University',
'color1': '#ce1126',
'gradBottom': '#770a15',
'color2': '#f2bf49',
'color3': '#ecd17a',
- 'shadowColor': '#733'
+ 'shadowColor': '#733',
+ 'timelinePast': '#323232',
+ 'timelineFuture': '#000'
}
View
1 conf/uiowa.json
@@ -1,4 +1,5 @@
{
+ 'name': 'The University of Iowa',
'color1': '#000',
'gradBottom': '#000',
'color2': '#ffe100',
View
1 conf/uni.json
@@ -1,4 +1,5 @@
{
+ 'name': 'University of Northern Iowa',
'color1': '#4b116f',
'gradBottom': '#300b47',
'color2': '#ffcc00',
View
27 index.php
@@ -4,7 +4,7 @@
<meta property="og:title" content="ISU Semester Countdown" />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://iastate.semestercountdown.com" />
-<meta property="og:image" content="http://iastate.semestercountdown.com/fbimg.png" />
+<meta property="og:image" content="http://semestercountdown.com/fbimg.png" />
<meta property="og:site_name" content="ISU Semester Countdown" />
<meta property="fb:admins" content="500029869" />
<script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
@@ -20,20 +20,16 @@
<?php
date_default_timezone_set("America/Chicago");
-if (isset($_GET['argyle_mode']))
-{
- echo <<<EOL
-<style>
-#main {
- background-image: url('argyle.png');
-}
-</style>
-EOL;
-}
-
$server_name = $_SERVER['SERVER_NAME'];
-$name_parts = split('\.', $server_name);
+$name_parts = explode('\.', $server_name);
$subdomain = $name_parts[0];
+if ($subdomain == 'lolhost')
+{
+ if (isset($_GET['s']))
+ $subdomain = $_GET['s'];
+ else
+ $subdomain = 'iastate';
+}
$dataPath = 'data/'.$subdomain.'.json';
$confPath = 'conf/'.$subdomain.'.json';
@@ -82,6 +78,7 @@ function setSocialH()
$(document).ready(function() {
$('#moreDetailsButton').attr('href', 'javascript: U.moreDetails();');
$('#fewerDetailsButton').attr('href', 'javascript: U.fewerDetails();');
+ $('#argyleButton').attr('href', 'javascript: U.argyle();');
<?php echo "Conf.init($confJson);"; ?>
});
</script>
@@ -89,8 +86,10 @@ function setSocialH()
<!-- try ?argyle_mode -->
<div id="main">
<a id="fewerDetailsButton" class="detailsButton" >-</a>
-
<a id="moreDetailsButton" class="detailsButton" >+</a>
+<a id="argyleButton" class="detailsButton" style="font-size: 1em">♦</a>
+<span id="title" style="margin-left: 50px; font-weight: bold"></span>
+<span id="name"></span>
<div id="wrapper">
</div>

0 comments on commit 457c292

Please sign in to comment.
Something went wrong with that request. Please try again.