Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: johanbrook/systemet
base: 1620c93353
...
head fork: johanbrook/systemet
compare: d1a28b75d2
Checking mergeability… Don't worry, you can still create the pull request.
  • 5 commits
  • 8 files changed
  • 0 commit comments
  • 1 contributor
View
1  .gitignore
@@ -1,2 +1,3 @@
node_modules
.DS_Store
+.sass-cache
View
7 build/public/javascripts/client.js
@@ -1,5 +1,5 @@
(function() {
- var capitalize, error, getClosestStore, handler, render;
+ var capitalize, error, handler, render, showClosestStore;
render = function(template, data) {
var key, val;
@@ -26,12 +26,12 @@
lon: longitude
},
dataType: "json",
- success: getClosestStore,
+ success: showClosestStore,
error: error
});
};
- getClosestStore = function(json) {
+ showClosestStore = function(json) {
var closes, data, is_open, obj, opens, text;
if (!json) return;
obj = json[0];
@@ -42,6 +42,7 @@
data = {
opens: opens.toFormat("HH24:MI"),
closes: closes.toFormat("HH24:MI"),
+ now: new Date().toFormat("HH24:MI"),
store: obj.address,
postal_code: obj.postal_code,
locality: capitalize(obj.locality),
View
16 build/public/scss/_settings.scss
@@ -0,0 +1,16 @@
+// Colors
+
+$accent: green;
+$bodycolor: #000;
+$comp: #E0F3F5; // Blue
+
+// Typography
+
+$sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
+$serif: Georgia, serif;
+
+$size: 16;
+$leading: 24;
+
+$fontsize: $size/16 * 1em;
+$lineheight: ($leading/$size) * 1em;
View
30 build/public/stylesheets/style.css → build/public/scss/master.scss
@@ -1,3 +1,6 @@
+@import "compass/css3";
+@import "settings";
+
* {
margin: 0;
padding: 0;
@@ -5,8 +8,8 @@
body {
margin: 1.5em 5%;
- font: 1em/1.5 Georgia, serif;
- color: #000;
+ font: #{$fontsize}/#{($leading/$size)} $serif;
+ color: $bodycolor;
text-align: center;
-webkit-tap-highlight-color: #fff;
}
@@ -28,7 +31,11 @@ h2 {
}
a {
- color: green;
+ color: $accent;
+
+ &:hover {
+ background-color: rgba(lighten($accent, 50%), .1);
+ }
}
a.block {
@@ -39,7 +46,7 @@ a.block {
strong {
- font-family: "Helvetica Neue", sans-serif;
+ font-family: $sans;
}
.loading-text {
@@ -52,19 +59,16 @@ strong {
}
.details {
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
- border-radius: 4px;
- background-color: #E0F3F5;
- border: 1px solid #CEDFE0;
+ @include border-radius(4px);
+ background-color: $comp;
+ border: 1px solid darken($comp, 15%);
padding: .5em 2%;
margin-bottom: 1.5em;
}
.details strong {
- background-color: #C3E0E3;
+ background-color: darken($comp, 10%);
padding: 1px 2px;
- -webkit-border-radius: 2px;
- -moz-border-radius: 2px;
- border-radius: 2px;
+ @include border-radius(2px);
+ color: desaturate(darken($comp, 70%), 30%);
}
View
1  build/public/stylesheets/master.css
@@ -0,0 +1 @@
+*{margin:0;padding:0}body{margin:1.5em 5%;font:1em/1.5 Georgia,serif;color:#000;text-align:center;-webkit-tap-highlight-color:#fff}h1{font-size:1.6em;font-weight:normal}h2{font-weight:normal;font-size:1.2em;margin-bottom:1em}.huge{font-size:5em;letter-spacing:-0.03em}a{color:green}a:hover{background-color:rgba(128,255,128,0.1)}a.block{display:block;text-decoration:none;color:#000}strong{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif}.loading-text{position:absolute;top:4em;right:0;left:0;text-align:center;color:#777}.details{-moz-border-radius:4px;-webkit-border-radius:4px;-o-border-radius:4px;-ms-border-radius:4px;-khtml-border-radius:4px;border-radius:4px;background-color:#e0f3f5;border:1px solid #a6dde2;padding:.5em 2%;margin-bottom:1.5em}.details strong{background-color:#b9e4e9;padding:1px 2px;-moz-border-radius:2px;-webkit-border-radius:2px;-o-border-radius:2px;-ms-border-radius:2px;-khtml-border-radius:2px;border-radius:2px;color:#2c4244}
View
6 build/views/layout.ejs
@@ -3,9 +3,11 @@
<head>
<title>Är Systembolaget öppet?</title>
<meta charset="utf-8" />
- <link rel="stylesheet" href="/stylesheets/style.css" type="text/css" />
+ <link rel="stylesheet" href="/stylesheets/master.css" type="text/css" />
+ <meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
+ <meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="author" content="Johan Brook" />
</head>
<body>
@@ -21,7 +23,7 @@
<h2><a href="http://maps.google.se?q={query_url}">{store}</a> ({locality})</h2>
- <p>Öppnar <strong>{opens}</strong> och stänger <strong>{closes}</strong></p>
+ <p>Öppnar <strong>{opens}</strong> och stänger <strong>{closes}</strong>. Klockan är just nu {now}</p>
</div>
<a href="tel:{phone}" class="details block">
View
24 config.rb
@@ -0,0 +1,24 @@
+# Require any additional compass plugins here.
+
+# Set this to the root of your project when deployed:
+http_path = "/"
+css_dir = "build/public/stylesheets"
+sass_dir = "build/public/scss"
+images_dir = "build/public/images"
+javascripts_dir = "build/public/javascripts"
+
+# You can select your preferred output style here (can be overridden via the command line):
+output_style = :compressed
+
+# To enable relative paths to assets via compass helper functions. Uncomment:
+relative_assets = true
+
+# To disable debugging comments that display the original location of your selectors. Uncomment:
+line_comments = false
+
+
+# If you prefer the indented syntax, you might want to regenerate this
+# project again passing --syntax sass, or you can uncomment this:
+# preferred_syntax = :sass
+# and then run:
+# sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass
View
6 src/public/javascripts/client.coffee
@@ -8,6 +8,7 @@ render = (template, data) ->
capitalize = (string) ->
string.charAt(0).toUpperCase() + string.slice(1).toLowerCase()
+
handler = (position) ->
console.log position.coords.latitude + " " + position.coords.longitude
latitude = position.coords.latitude
@@ -17,11 +18,11 @@ handler = (position) ->
url: "/stores"
data: lat: latitude, lon: longitude
dataType: "json"
- success: getClosestStore
+ success: showClosestStore
error: error
-getClosestStore = (json) ->
+showClosestStore = (json) ->
return if !json
obj = json[0]
@@ -34,6 +35,7 @@ getClosestStore = (json) ->
data =
opens: opens.toFormat "HH24:MI"
closes: closes.toFormat "HH24:MI"
+ now: new Date().toFormat "HH24:MI"
store: obj.address
postal_code: obj.postal_code
locality: capitalize obj.locality

No commit comments for this range

Something went wrong with that request. Please try again.