Skip to content
This repository
  • 3 commits
  • 8 files changed
  • 0 comments
  • 1 contributor
3  .gitignore
... ...
@@ -1,3 +1,6 @@
1 1
 node_modules
2 2
 *~
3 3
 temp
  4
+.DS_Store
  5
+public/photos/*jp*g
  6
+
35  app.coffee
... ...
@@ -1,28 +1,33 @@
1  
-express = require("express")
2  
-sys = require("sys")
3  
-fs = require("fs")
4  
-yaml = require("yaml")
  1
+express = require "express"
  2
+jade = require "jade"
  3
+http = require "http"
  4
+sys = require "sys"
  5
+fs = require "fs"
  6
+yaml = require "yaml"
5 7
 photo_file_utils = require("./photo_file_utils")
6 8
 camera_control = require("./camera_control")
7 9
 image_twiddle = require("./image_twiddler")
8  
-web = express.createServer()
  10
+
  11
+exp = express()
  12
+web = http.createServer(exp)
  13
+
9 14
 exec = require("child_process").exec
10  
-web.configure ->
11  
-  web.set "views", __dirname + "/views"
12  
-  web.set "view engine", "jade"
13  
-  web.use express.bodyParser()
14  
-  web.use express.methodOverride()
15  
-  web.use web.router
16  
-  web.use express.static(__dirname + "/public")
17 15
 
18  
-console.log()
19  
-web.get "/", (req, res) ->
  16
+exp.configure ->
  17
+  exp.set "views", __dirname + "/views"
  18
+  exp.set "view engine", "jade"
  19
+  exp.use express.bodyParser()
  20
+  exp.use express.methodOverride()
  21
+  exp.use exp.router
  22
+  exp.use express.static(__dirname + "/public")
  23
+
  24
+exp.get "/", (req, res) ->
20 25
   res.render "index",
21 26
     title: "shmile"
22 27
     extra_js: [ "camera_utils", "photo_view", "shmile" ]
23 28
     extra_css: []
24 29
 
25  
-web.get "/gallery", (req, res) ->
  30
+exp.get "/gallery", (req, res) ->
26 31
   res.render "gallery",
27 32
     title: "gallery!"
28 33
     extra_js: [ "photoswipe/klass.min", "code.photoswipe.jquery-3.0.4.min", "shmile_gallery" ]
10  image_twiddler.coffee
@@ -19,11 +19,11 @@ image_twiddle = (img_src_list, opts, cb) ->
19 19
   emitter.on "composite", ->
20 20
     convertArgs = [ "-size", TOTAL_WIDTH + "x" + TOTAL_HEIGHT, "canvas:white" ]
21 21
     utcSeconds = (new Date()).valueOf()
22  
-    IMAGE_GEOMETRY = IMAGE_WIDTH + "x" + IMAGE_HEIGHT
23  
-    OUTPUT_PATH = opts.tmp_dir + "/out.jpeg"
24  
-    OUTPUT_FILE_NAME = utcSeconds + ".jpeg"
25  
-    FINAL_OUTPUT_PATH = opts.output_dir + "/" + "gen_" + OUTPUT_FILE_NAME
26  
-    FINAL_OUTPUT_THUMB_PATH = opts.thumb_dir + "/" + "thumb_" + OUTPUT_FILE_NAME
  22
+    IMAGE_GEOMETRY = "#{IMAGE_WIDTH}x#{IMAGE_HEIGHT}"
  23
+    OUTPUT_PATH = "#{opts.tmp_dir}/out.jpeg"
  24
+    OUTPUT_FILE_NAME = "#{utcSeconds}.jpeg"
  25
+    FINAL_OUTPUT_PATH = "#{opts.output_dir}/gen_#{OUTPUT_FILE_NAME}"
  26
+    FINAL_OUTPUT_THUMB_PATH = "#{opts.thumb_dir}/thumb_#{OUTPUT_FILE_NAME}"
27 27
     GEOMETRIES = [ IMAGE_GEOMETRY + "+" + IMAGE_PADDING + "+" + IMAGE_PADDING, IMAGE_GEOMETRY + "+" + (2 * IMAGE_PADDING + IMAGE_WIDTH) + "+" + IMAGE_PADDING, IMAGE_GEOMETRY + "+" + IMAGE_PADDING + "+" + (IMAGE_HEIGHT + 2 * IMAGE_PADDING), IMAGE_GEOMETRY + "+" + (2 * IMAGE_PADDING + IMAGE_WIDTH) + "+" + (2 * IMAGE_PADDING + IMAGE_HEIGHT) ]
28 28
     i = 0
29 29
 
2  package.json
@@ -42,7 +42,7 @@
42 42
        "imagemagick": ">=0.1.2",
43 43
        "yaml": ">=0.2.3"
44 44
    },
45  
-   "engines": ["node >=0.6.2"],
  45
+   "engines": ["node >=0.6.11"],
46 46
    "directories": {
47 47
        "lib": "lib"
48 48
    }
29  public/css/shmile.css
@@ -55,34 +55,5 @@ button#start-button {
55 55
     box-shadow:0 0.3em 1em rgba(0,0,0,0.8);
56 56
     text-shadow: 0 -1px 2px rgba(0,0,0,0.2);
57 57
 }
58  
-.green.awesome, .green.awesome:visited      { background-color: #91bd09; }
59  
-.green.awesome:hover                        { background-color: #749a02; }
60  
-.blue.awesome, .blue.awesome:visited        { background-color: #2daebf; }
61  
-.blue.awesome:hover                         { background-color: #007d9a; }
62  
-.red.awesome, .red.awesome:visited          { background-color: #e33100; }
63  
-.red.awesome:hover                          { background-color: #872300; }
64  
-.magenta.awesome, .magenta.awesome:visited      { background-color: #a9014b; }
65  
-.magenta.awesome:hover                          { background-color: #630030; }
66  
-.orange.awesome, .orange.awesome:visited        { background-color: #ff5c00; }
67  
-.orange.awesome:hover                           { background-color: #d45500; }
68  
-.yellow.awesome, .yellow.awesome:visited        { background-color: #ffb515; }
69  
-.yellow.awesome:hover                           { background-color: #fc9200; }
70  
-
71 58
 .boinkyellow.awesome, .boinkyellow.awesome:visited        { background-color: #F5BE1B; }
72 59
 .boinkyellow.awesome:hover                           { background-color: #fc9200; }
73  
-
74  
-
75  
- /* 
76  
-  * Now make em glow. The green one at least.
77  
-  * http://www.zurb.com/playground/radioactive-buttons
78  
-  */
79  
-button.awesome.boinkyellow {
80  
-    -webkit-animation-name: yellowPulse;
81  
-    -webkit-animation-duration: 2s;
82  
-    -webkit-animation-iteration-count: infinite;
83  
-}
84  
-@-webkit-keyframes yellowPulse {
85  
-    from { background-color: #F5BE1B; margin-top: 0; }
86  
-    50% { background-color: #FFD000; margin-top: 10px; }
87  
-    to { background-color: #F5BE1B; margin-top: 0; }
88  
-}
18  views/gallery.jade
... ...
@@ -1,6 +1,12 @@
10  views/index.jade
... ...
@@ -1,2 +1,8 @@
1  
-section#viewport
2  
-  button#start-button.awesome.superlarge.boinkyellow Start
  1
+extends layout
  2
+
  3
+block title
  4
+  = "shmile!"
  5
+
  6
+block content
  7
+  section#viewport
  8
+    button#start-button.awesome.superlarge.boinkyellow Start
6  views/layout.jade
... ...
@@ -1,7 +1,8 @@
1 1
 !!! 5
2 2
 html
3 3
   head
4  
-    title= title
  4
+    title
  5
+      block title
5 6
     link(rel='stylesheet', href='/css/style.css')
6 7
     link(rel='stylesheet', href='/css/shmile.css')
7 8
 
@@ -21,4 +22,5 @@ html
21 22
     each js_file in extra_js
22 23
       script(type='text/javascript', src='/javascripts/' + js_file + '.js')
23 24
 
24  
-  body.nicegradient!= body
  25
+  body.nicegradient
  26
+    block content

No commit comments for this range

Something went wrong with that request. Please try again.