summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorraylu <raylu@mixpanel.com>2011-11-05 03:14:50 -0700
committerraylu <raylu@mixpanel.com>2011-11-05 03:14:50 -0700
commitc29b485df3475e251dce77e68d61462e2619ba9e (patch)
treeb929fa55133c19f2873da899b769fffa6f6c3e30
parenta5e930a4e59cb0776cb4ee5826e2e9e3624c9f2a (diff)
downloadpathery-c29b485df3475e251dce77e68d61462e2619ba9e.tar.xz
fix async font/js loading issues
-rw-r--r--css/page.css8
-rw-r--r--includes/header.php27
-rw-r--r--pages/home.php2
3 files changed, 26 insertions, 11 deletions
diff --git a/css/page.css b/css/page.css
index 2689aec..d38a21b 100644
--- a/css/page.css
+++ b/css/page.css
@@ -1,6 +1,12 @@
+html {
+ font-family: Helvetica, sans-serif;
+}
+html.wf-active {
+ font-family: Cantarell, Helvetica, sans-serif;
+}
+
body {
font-size: 16px;
- font-family: helvetica, sans-serif;
text-shadow: rgba(0,0,0,.01) 0 0 1px; /* this is definitely not a webkit-specific hack to fix font aliasing */
background-color: #121212;
color: #ddd;
diff --git a/includes/header.php b/includes/header.php
index 1e24e8c..9340c3f 100644
--- a/includes/header.php
+++ b/includes/header.php
@@ -28,17 +28,26 @@ function htmlFooter() {
_gaq.push(['_setAccount', 'UA-371072-3']);
_gaq.push(['_trackPageview']);
+ WebFontConfig = {
+ google: {
+ families: ['Cantarell:400,700:latin']
+ }
+ };
+
(function() {
- var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
- ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
- var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+ var proto = document.location.protocol;
+ var ga = document.createElement('script');
+ ga.type = 'text/javascript';
+ ga.async = true;
+ ga.src = ('https:' == proto ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0];
+ s.parentNode.appendChild(ga, s);
- var fo = document.createElement('link');
- fo.rel = 'stylesheet';
- fo.type = 'text/css';
- fo.href = "http://fonts.googleapis.com/css?family=Cantarell:400,700";
- var l = document.getElementsByTagName('link')[0]; l.parentNode.appendChild(fo);
- document.getElementsByTagName('body')[0].style.fontFamily = 'cantarell, helvetica, sans-serif';
+ var wf = document.createElement('script');
+ wf.src = ('https:' == proto ? 'https' : 'http') + '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
+ wf.type = 'text/javascript';
+ wf.async = 'true';
+ s.parentNode.appendChild(wf, s);
})();
</script>
diff --git a/pages/home.php b/pages/home.php
index 044fc5f..869c4d1 100644
--- a/pages/home.php
+++ b/pages/home.php
@@ -112,7 +112,7 @@ $mergesolution = $map;
Copyright &copy; 2011 pathery.com
</div>
-<script src="sounds/script/soundmanager.js" async="async"></script>
+<script src="sounds/script/soundmanager.js"></script>
<script type="text/javascript">soundManagerInit();</script>
<?php