Permalink
Browse files

Added an ATOM feed of changes, tidied a few other bits

  • Loading branch information...
1 parent 366813d commit 9549ed7c0a0e0dcf04a9fd80863a743021a4decb @richbradshaw committed Feb 12, 2012
Showing with 270 additions and 77 deletions.
  1. +181 −72 .htaccess
  2. +2 −2 constants.php
  3. +5 −3 demos/filters-and-fades.php
  4. +80 −0 feed.xml
  5. +2 −0 index.php
View
253 .htaccess
@@ -1,4 +1,10 @@
+<Files .htaccess>
+ order allow,deny
+ deny from all
+</Files>
<IfModule mod_rewrite.c>
+Options +FollowSymlinks
+
RewriteEngine on
RewriteRule ^(demos) - [L]
@@ -7,99 +13,202 @@ RewriteRule ^favicon.ico - [L]
RewriteRule ^([A-Za-z0-9-_/\.\?]+)\/$ /?section=$1 [L]
</IfModule>
+Options -MultiViews
+
+<IfModule mod_headers.c>
+ Header set X-Author "Focal Strategy"
+ Header set X-UA-Compatible "IE=Edge,chrome=1"
+ # mod_headers can't match by content-type, but we don't want to send this header on *everything*...
+ <FilesMatch "\.(js|css|gif|png|jpe?g|pdf|xml|oga|ogg|m4a|ogv|mp4|m4v|webm|svg|svgz|eot|ttf|otf|woff|ico|webp|appcache|manifest|htc|crx|xpi|safariextz|vcf)$" >
+ Header unset X-UA-Compatible
+ Header unset X-Author
+ </FilesMatch>
+</IfModule>
+
+<FilesMatch "^feed.xml$">
+#works on Dreamhost, but not local
+SetHandler application/x-httpd-php5
+</FilesMatch>
+
+
+# ----------------------------------------------------------------------
+# Proper MIME type for all files
+# ----------------------------------------------------------------------
+
+
+# JavaScript
+# Normalize to standard type (it's sniffed in IE anyways)
+# tools.ietf.org/html/rfc4329#section-7.2
+AddType application/javascript js
+
+# Audio
+AddType audio/ogg oga ogg
+AddType audio/mp4 m4a
+
+# Video
+AddType video/ogg ogv
+AddType video/mp4 mp4 m4v
+AddType video/webm webm
+
+# SVG.
+# Required for svg webfonts on iPad
+# twitter.com/FontSquirrel/status/14855840545
+AddType image/svg+xml svg svgz
+AddEncoding gzip svgz
+
+# Webfonts
+AddType application/vnd.ms-fontobject eot
+AddType application/x-font-ttf ttf ttc
+AddType font/opentype otf
+AddType application/x-font-woff woff
+
+# Assorted types
+AddType image/x-icon ico
+AddType image/webp webp
+AddType text/cache-manifest appcache manifest
+AddType text/x-component htc
+AddType application/x-chrome-extension crx
+AddType application/x-xpinstall xpi
+AddType application/octet-stream safariextz
+AddType text/x-vcard vcf
+
+# ----------------------------------------------------------------------
+# Gzip compression
+# ----------------------------------------------------------------------
+
+<IfModule mod_deflate.c>
+
+# Force deflate for mangled headers developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/
<IfModule mod_setenvif.c>
- <IfModule mod_headers.c>
- BrowserMatch MSIE ie
- Header set X-UA-Compatible "IE=Edge,chrome=1" env=ie
- </IfModule>
+ <IfModule mod_headers.c>
+ SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
+ RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
+ </IfModule>
+</IfModule>
+
+# HTML, TXT, CSS, JavaScript, JSON, XML, HTC:
+<IfModule filter_module>
+ FilterDeclare COMPRESS
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $text/html
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $text/css
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $text/plain
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $text/xml
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $text/x-component
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $application/javascript
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $application/json
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $application/xml
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $application/xhtml+xml
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $application/rss+xml
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $application/atom+xml
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $application/vnd.ms-fontobject
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $image/svg+xml
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $application/x-font-ttf
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $font/opentype
+ FilterChain COMPRESS
+ FilterProtocol COMPRESS DEFLATE change=yes;byteranges=no
+</IfModule>
+
+<IfModule !mod_filter.c>
+ # Legacy versions of Apache
+ AddOutputFilterByType DEFLATE text/html text/plain text/css application/json
+ AddOutputFilterByType DEFLATE application/javascript
+ AddOutputFilterByType DEFLATE text/xml application/xml text/x-component
+ AddOutputFilterByType DEFLATE application/xhtml+xml application/rss+xml application/atom+xml
+ AddOutputFilterByType DEFLATE image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype
+</IfModule>
</IfModule>
+# ----------------------------------------------------------------------
+# Expires headers (for better cache control)
+# ----------------------------------------------------------------------
+
+# These are pretty far-future expires headers.
+# They assume you control versioning with cachebusting query params like
+# <script src="application.js?20100608">
+# Additionally, consider that outdated proxies may miscache
+# www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/
+
+# If you don't use filenames to version, lower the CSS and JS to something like
+# "access plus 1 week" or so.
+
<IfModule mod_expires.c>
- Header set cache-control: public
ExpiresActive on
# Perhaps better to whitelist expires rules? Perhaps.
- ExpiresDefault "access plus 1 month"
+ ExpiresDefault "access plus 60 seconds"
-# cache.manifest needs re-reqeusts in FF 3.6 (thx Remy ~Introducing HTML5)
+# cache.appcache needs re-requests in FF 3.6 (thanks Remy ~Introducing HTML5)
ExpiresByType text/cache-manifest "access plus 0 seconds"
-# your document html
- ExpiresByType text/html "access"
+# Your document html
+ ExpiresByType text/html "access plus 0 seconds"
+
+# Data
+ ExpiresByType text/xml "access plus 60 seconds"
+ ExpiresByType application/xml "access plus 60 seconds"
+ ExpiresByType application/json "access plus 0 seconds"
-# rss feed
+# Feed
ExpiresByType application/rss+xml "access plus 1 hour"
-
-# favicon (cannot be renamed)
- ExpiresByType image/vnd.microsoft.icon "access plus 1 week"
-
-# media: images, video, audio
- ExpiresByType image/gif "access plus 1 year"
- ExpiresByType image/png "access plus 1 year"
- ExpiresByType image/jpg "access plus 1 year"
- ExpiresByType image/jpeg "access plus 1 year"
- ExpiresByType video/ogg "access plus 1 year"
- ExpiresByType audio/ogg "access plus 1 year"
- ExpiresByType video/mp4 "access plus 1 year"
-
-# css3 PIE
- ExpiresByType text/x-component "access plus 1 year"
-
-# webfonts
- ExpiresByType font/ttf "access plus 1 year"
- ExpiresByType font/woff "access plus 1 year"
- ExpiresByType image/svg+xml "access plus 1 year"
+ ExpiresByType application/atom+xml "access plus 1 hour"
+
+# Favicon (cannot be renamed)
+ ExpiresByType image/x-icon "access plus 1 week"
+
+# Media: images, video, audio
+ ExpiresByType image/gif "access plus 1 month"
+ ExpiresByType image/png "access plus 1 month"
+ ExpiresByType image/jpg "access plus 1 month"
+ ExpiresByType image/jpeg "access plus 1 month"
+ ExpiresByType video/ogg "access plus 1 month"
+ ExpiresByType audio/ogg "access plus 1 month"
+ ExpiresByType video/mp4 "access plus 1 month"
+ ExpiresByType video/webm "access plus 1 month"
+
+# HTC files (css3pie)
+ ExpiresByType text/x-component "access plus 1 month"
+
+# Webfonts
+ ExpiresByType font/truetype "access plus 1 month"
+ ExpiresByType font/opentype "access plus 1 month"
+ ExpiresByType application/x-font-woff "access plus 1 month"
+ ExpiresByType image/svg+xml "access plus 1 month"
+ ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
+
+# CSS and JavaScript
+ ExpiresByType text/css "access plus 1 year"
+ ExpiresByType application/javascript "access plus 1 year"
+
+ <IfModule mod_headers.c>
+ Header append Cache-Control "public"
+ </IfModule>
-# css and javascript
- ExpiresByType text/css "access plus 1 week"
- ExpiresByType application/javascript "access plus 1 week"
- ExpiresByType text/javascript "access plus 1 week"
</IfModule>
-Header unset ETag
-FileETag None
-
-Header set X-Author "Focal Strategy"
-
-<Files .htaccess>
-order allow,deny
-deny from all
-</Files>
-
-IndexIgnore *
-Options -Indexes
-
-Options -MultiViews
-ErrorDocument 404 /errorpages/notfound.php
-<IfModule mod_deflate.c>
-# html, xml, css, and js:
- AddOutputFilterByType DEFLATE text/x-component text/html text/plain text/xml text/css application/x-javascript text/javascript application/javascript application/json
+# ----------------------------------------------------------------------
+# ETag removal
+# ----------------------------------------------------------------------
-# webfonts and svg:
- <FilesMatch "\.(ttf|otf|eot|svg)$" >
- SetOutputFilter DEFLATE
- </FilesMatch>
+# FileETag None is not enough for every server.
+<IfModule mod_headers.c>
+ Header unset ETag
</IfModule>
-# video
-AddType video/ogg ogg ogv
-AddType video/mp4 mp4
+# Since we're sending far-future expires, we don't need ETags for
+# static content.
+# developer.yahoo.com/performance/rules.html#etags
+FileETag None
-# Proper svg serving. Required for svg webfonts on iPad
-# twitter.com/FontSquirrel/status/14855840545
-AddType image/svg+xml svg svgz
+# ----------------------------------------------------------------------
+# UTF-8 encoding
+# ----------------------------------------------------------------------
-# webfonts
-AddType application/vnd.ms-fontobject eot
-AddType font/ttf ttf
-AddType font/otf otf
-AddType font/x-woff woff
+# Use UTF-8 encoding for anything served text/plain or text/html
+AddDefaultCharset utf-8
-AddType text/x-component .htc
+# Force UTF-8 for a number of file formats
+AddCharset utf-8 .html .css .js .xml .json .rss .atom
-# use utf-8 encoding for anything served text/plain or text/html
-AddDefaultCharset utf-8
-# force utf-8 for a number of file formats
-AddCharset utf-8 .html .css .js .xml .json .rss
+Options -Indexes
View
@@ -1,8 +1,8 @@
<?
$titles = array(
- "accordions" => "CSS3 Accordions | CSS3 transitions, transforms and animations | CSS3 transitions, transforms and animations",
- "animations" => "CSS3 Animations | CSS3 transitions, transforms and animations | CSS3 transitions, transforms and animations",
+ "accordions" => "CSS3 Accordions | CSS3 transitions, transforms and animations",
+ "animations" => "CSS3 Animations | CSS3 transitions, transforms and animations",
"cfimg" => "Crossfading Images | CSS3 transitions, transforms and animations",
"cfimg1" => "Crossfading Images on hover | CSS3 transitions, transforms and animations",
"cfimg2" => "Crossfading Images on button press | CSS3 transitions, transforms and animations",
@@ -53,7 +53,7 @@
filter:grayscale(1);
}
- #thumbs img:hover, #thumbs a:target img {
+ #thumbs img:hover, #thumbs a:target img, #thumbs img.active {
-webkit-filter:grayscale(0);
-moz-filter:grayscale(0);
-ms-filter:grayscale(0);
@@ -80,9 +80,11 @@
$(function(){
$("#thumbs").on("click", "img", function(e){
- e.preventDefault();
- window.location.hash = $(this).parent("a").attr("id");
+ $("#thumbs img").removeClass("active");
+ $(this).addClass("active");
+
$("#main").css("background-image","url("+$(this).attr("src")+")");
+ return false;
});
});
</script>
Oops, something went wrong.

0 comments on commit 9549ed7

Please sign in to comment.