Permalink
Browse files

centre count and change title content

  • Loading branch information...
1 parent 760e179 commit 27ccec86175821526090dcbfb8b156bc49dcb393 @stevenwilkin committed Feb 28, 2012
Showing with 18 additions and 3 deletions.
  1. +1 −1 coffee_tracker.rb
  2. +17 −2 views/index.html
View
@@ -7,7 +7,7 @@ class CoffeeTracker < Sinatra::Base
get '/' do
count = $redis.hget('coffee', Time.now.strftime("%Y%m%d")) || 0
- File.read('./views/index.html') % count
+ File.read('./views/index.html').gsub(/%COUNT%/, count.to_s)
end
get '/api' do
View
@@ -2,11 +2,26 @@
<html lang="en">
<head>
<meta charset="utf-8" />
- <title>Coffee Tracker</title>
+ <title>How many coffees has Steve drank today?</title>
+ <style type="text/css">
+ h1 {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 60px;
+ line-height: 60px;
+ width: 140px;
+ height: 60px;
+ position: absolute;
+ left: 50%;
+ top: 50%;
+ margin-left: -70px;
+ margin-top: -30px;
+ text-align: center;
+ }
+ </style>
</head>
<body>
- <h1>%d</h1>
+ <h1>%COUNT%</h1>
</body>
</html>

0 comments on commit 27ccec8

Please sign in to comment.