Skip to content

Commit

Permalink
Add browser compatibility page and implement IE10+ support.
Browse files Browse the repository at this point in the history
  • Loading branch information
kelyvin committed Mar 7, 2016
1 parent 64f20b8 commit ff6698a
Show file tree
Hide file tree
Showing 11 changed files with 89 additions and 16 deletions.
2 changes: 1 addition & 1 deletion assets/css/caffeine-theme.css

Large diffs are not rendered by default.

Binary file added assets/img/backgrounds/browser-compatibility.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions assets/js/caffeine-theme.js

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions assets/js/src/__init.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ $(function() {
openHash = "#open";

window.CaffeineTheme = CaffeineTheme = {
version: "2.2.2",
version: "2.3.0",
search: {
container: function() {
return $("#results");
Expand All @@ -27,7 +27,12 @@ $(function() {
return document.body;
})(),
is: function(property, value) {
return this.app.dataset[property] === value;
if (this.app.dataset) {
return this.app.dataset[property] === value;
} else {
return this.app.getAttribute("data-" + property) === value;
}

},
isOpen: function () {
return location.hash === openHash;
Expand Down
14 changes: 12 additions & 2 deletions assets/js/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,16 @@ $(function() {
el;

el = CaffeineTheme.app;
el.dataset.page = CaffeineTheme.context();
el.dataset.device = CaffeineTheme.device();

if (el.dataset) {
el.dataset.page = CaffeineTheme.context();
el.dataset.device = CaffeineTheme.device();
} else {
$(el)
.attr("data-page", CaffeineTheme.context())
.attr("data-device", CaffeineTheme.device());
}

CaffeineTheme.readTime();

if (window.profile_title) {
Expand Down Expand Up @@ -49,6 +57,8 @@ $(function() {
// Sets up scroll reveal effects
if (window.ScrollReveal && $(cardName).length > 0) {
window.sr = window.ScrollReveal().reveal(cardName);
} else {
$posts.css("visibility", "visible");
}
}
});
Expand Down
8 changes: 8 additions & 0 deletions assets/scss/components/_media-queries.scss
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,14 @@
}
}
}

body {
.page-browser-compatibility {
.error-body {
margin-top: 20px;
}
}
}
}

// ------------------------------
Expand Down
16 changes: 15 additions & 1 deletion assets/scss/components/_page-error.scss
Original file line number Diff line number Diff line change
@@ -1,18 +1,32 @@
body {
&.page-browser-compatibility,
&.page-error {
width: 100%;
height: 100%;
font-size: 16px;
font-weight: normal;
line-height: 25px;
text-align: center;
background: url("/assets/img/backgrounds/404_error_background.jpg") center/cover no-repeat;
}

&.page-error {
background: url("/assets/img/backgrounds/404_error_background.jpg") center/cover no-repeat;
> article {
@include center-absolute;
}
}

&.page-browser-compatibility {
@include background-filter;
background: url("/assets/img/backgrounds/browser-compatibility.jpg") center/cover no-repeat;

.error-body {
text-align: left;
margin: 100px 20px 20px;
padding: 20px;
background-color: rgba(0,0,0,.2);
}
}
}

.error-body {
Expand Down
7 changes: 0 additions & 7 deletions assets/scss/modules/_effects.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
vertical-align: middle;
transform: translateZ(0);
box-shadow: 0 0 1px rgba(0, 0, 0, 0);
backface-visibility: hidden;
-moz-osx-font-smoothing: grayscale;
transition-duration: 0.3s;
transition-property: transform;
Expand All @@ -48,8 +47,6 @@
-webkit-transform: translateZ(0);
transform: translateZ(0);
box-shadow: 0 0 1px rgba(0, 0, 0, 0);
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
-moz-osx-font-smoothing: grayscale;
-webkit-transition-duration: 0.3s;
transition-duration: 0.3s;
Expand All @@ -76,8 +73,6 @@
transform: translateZ(0);
vertical-align: middle;
box-shadow: 0 0 1px rgba(0, 0, 0, 0);
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
}

.hvr-grow-rotate:hover,
Expand Down Expand Up @@ -183,8 +178,6 @@
transform: translateZ(0);
vertical-align: middle;
box-shadow: 0 0 1px rgba(0, 0, 0, 0);
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
}

.hvr-buzz-out:hover,
Expand Down
5 changes: 5 additions & 0 deletions default.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<!--[if IE 9]>
<script type="text/javascript">
window.location = "/browser-compatibility";
</script>
<![endif]-->
<title>{{meta_title}}</title>
{{> meta}}
<link rel="stylesheet" type="text/css" href="{{asset "css/caffeine-theme.css"}}" />
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "caffeine-theme",
"description": "Minimalist and Elegant theme for Ghost",
"homepage": "https://github.com/kelyvin/caffeine-theme",
"version": "2.2.2",
"version": "2.3.0",
"author": {
"name": "Kelyvin",
"url": "https://github.com/kelyvin"
Expand Down
38 changes: 38 additions & 0 deletions page-browser-compatibility.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Browser Compatibility Error</title>
{{> meta}}
<link rel="stylesheet" type="text/css" href="{{asset "css/caffeine-theme.css"}}" />
{{ghost_head}}
</head>
<body class="page-browser-compatibility">
<article>
<section>
<div class="error-body">
<h1>
Looks like your coffee's gone stale. It's time for a new cup!
</h1>
<hr class="divider short">
<h2>
Caffeine Coding runs on the latest Chrome, Firefox, Safari, and IE10+. Your browser is outdated and it may be time to upgrade.
</h2>
<div class="call-to-action-container">
<nav class="navigation left">
<ul class="links">
<li class="nav-blog expanded">
<a href="http://browsehappy.com/" title="Browse Happy">Click here to find out more!</a>
</li>
</ul>
</nav>
</div>
</div>
</section>
</article>
{{ghost_foot}}
<script type="text/javascript" src="{{asset "js/caffeine-theme.js"}}"></script>
{{> google-analytics}}
</body>
</html>

0 comments on commit ff6698a

Please sign in to comment.