diff --git a/_includes/footer.html b/_includes/footer.html index 1785df8..8afbd1b 100644 --- a/_includes/footer.html +++ b/_includes/footer.html @@ -1,4 +1,4 @@ diff --git a/assets/css/style-reduced.css b/assets/css/style-reduced.css index 1f5cf08..9ab47a3 100644 --- a/assets/css/style-reduced.css +++ b/assets/css/style-reduced.css @@ -24,10 +24,17 @@ a.navlink { font-size: 15pt; margin: 6pt; } -header, nav { /* N/A on IE6 */ - padding-bottom: 20pt; +nav { /* requires JS on IE6 */ + display: table-cell; + height: 70px; + vertical-align: middle; } -div#footer { +main { /* requires JS on IE6 */ + display: block; + padding: 5pt 0pt; +} +footer { /* requires JS on IE6 */ + display: block; background-color: #2b496f; text-align: center; color: #8c9dbb; @@ -68,7 +75,7 @@ div#socialnew { img.heading, img.image { text-align: center; max-width: 100%; /* N/A on IE6 */ - width: expression((getNaturalWidth(this) >= (document.body.clientWidth - 16)) ? "100%" : "auto"); + width: expression((getNaturalWidth(this) >= (document.body.clientWidth - 16)) ? "100%" : "auto"); /* requires JS */ display: block; margin-top: 10pt; margin-bottom: 5pt; diff --git a/assets/images/blank.gif b/assets/images/blank.gif new file mode 100644 index 0000000..75b945d Binary files /dev/null and b/assets/images/blank.gif differ diff --git a/assets/js/style-reduced.js b/assets/js/style-reduced.js index 4de50d6..3737aa3 100644 --- a/assets/js/style-reduced.js +++ b/assets/js/style-reduced.js @@ -1,9 +1,12 @@ -var imgCache = {}; +/* Helper script for the retro-reduced stylesheet. */ +/* Get an image's real width. Used by the auto-sizing CSS expression. */ +var imgCache = {}; function getNaturalWidth(img) { if (img.naturalWidth) { return img.naturalWidth; } else { + /* Cache images through src to avoid memory waste. */ var img2 = imgCache[img.src]; if (!img2) { img2 = new Image(); @@ -13,3 +16,27 @@ function getNaturalWidth(img) { return img2.width; } } + +/* Allow HTML5 elements to be styled. */ +document.createElement('nav'); +document.createElement('main'); +document.createElement('footer'); + +window.onload = function() { + /* Make the logo transparent on IE6. Doing this on more + images interferes with the auto-sizing CSS expression. */ + if (document.all && /MSIE (5\.5|6)/.test(navigator.userAgent)) { + for (var i = 0; i < Math.min(2, document.images.length); i++) { + var img = document.images[i]; + img.style.paddingRight = 0; /* padding counts as space for AlphaImageLoader so swap it for margin */ + var oldsrc = img.src; + var oldw = img.clientWidth; + var oldh = img.clientHeight; + img.src = '/assets/images/blank.gif'; + img.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + oldsrc + "', sizingMethod='scale')"; + img.style.width = oldw + 'px'; + img.style.height = oldh + 'px'; + img.style.marginRight = '20pt'; + } + } +};