diff --git a/lib/controllers/room.coffee b/lib/controllers/room.coffee index c93d503..8018029 100644 --- a/lib/controllers/room.coffee +++ b/lib/controllers/room.coffee @@ -1,6 +1,6 @@ module.exports = (app, nowjs) -> - app.get '/:roomId', (req, res) -> + app.get '/alpha/:roomId', (req, res) -> res.render 'writeboard', { title: 'Writeboard!', roomId: req.params.roomId } everyone = nowjs.initialize app, socketio: 'log level': 2 diff --git a/lib/controllers/writeboard.coffee b/lib/controllers/writeboard.coffee index 1551c52..0b17fee 100644 --- a/lib/controllers/writeboard.coffee +++ b/lib/controllers/writeboard.coffee @@ -1,6 +1,8 @@ module.exports = (app, nowjs) -> - app.get '/', (req, res) -> res.redirect "/#{Date.now()}" + app.get '/', (req, res) -> res.render 'index', layout: false + + app.get '/alpha/', (req, res) -> res.redirect "/alpha/#{Date.now()}" app.get '/about', (req, res) -> parameters = @@ -9,3 +11,10 @@ module.exports = (app, nowjs) -> else layout: true, locals: title: 'Writeboard - About it!' res.render 'about', parameters + CouchClient = require 'couch-client' + DEV_COUCH_URL = '/writeboard' + interested = CouchClient(process.env.IRIS_COUCH_URL or DEV_COUCH_URL) + app.post '/interested', (req, res) -> + interested.save email: req.body.email, (error, doc) -> + if error then res.send false, 500 else res.send true, 200 + diff --git a/lib/public/images/index.marker.png b/lib/public/images/index.marker.png new file mode 100644 index 0000000..2be051d Binary files /dev/null and b/lib/public/images/index.marker.png differ diff --git a/lib/public/images/index.texture.png b/lib/public/images/index.texture.png new file mode 100644 index 0000000..d667645 Binary files /dev/null and b/lib/public/images/index.texture.png differ diff --git a/lib/public/stylesheets/GTramontina.ttf b/lib/public/stylesheets/GTramontina.ttf new file mode 100644 index 0000000..940b1aa Binary files /dev/null and b/lib/public/stylesheets/GTramontina.ttf differ diff --git a/lib/public/stylesheets/index.styl b/lib/public/stylesheets/index.styl new file mode 100644 index 0000000..fa882aa --- /dev/null +++ b/lib/public/stylesheets/index.styl @@ -0,0 +1,50 @@ +@import 'nib' + +@font-face + font-family 'GTramontina' + src url('GTramontina.ttf') + +body + background-image url('../images/index.texture.png') + font-family 'GTramontina' + font-size 1.8em + +a + text-decoration none + color blue + +#info + background-image url('../images/grid.gif') + background-color white + display block + margin-left auto + margin-right auto + width 600px + border rgba(0, 0, 0, 0.8) solid 1px + padding 15px + box-shadow 0 0 10px rgba(0, 0, 0, 0.9) + +h1 + text-align center + +form + text-align right + input + font-family "lucida grande", sans-serif + font-size 11px + border rgba(0, 0, 0, 0.5) solid 1px + +#submit + download-button(green) + +#footer + text-align right + font-family "lucida grande", sans-serif + font-size 11px + +#marker + position absolute + top 470px + background-image url('../images/index.marker.png') + width 333px + height 130px \ No newline at end of file diff --git a/lib/views/index.jade b/lib/views/index.jade new file mode 100644 index 0000000..ec95941 --- /dev/null +++ b/lib/views/index.jade @@ -0,0 +1,54 @@ +!!! 5 +html + head + title Writeboard.me + link(rel='stylesheet', href='/stylesheets/index.css') + script(src='/javascripts/lib/google.analytics.js') + script(src='http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js') + + body + a(href='http://github.com/gtramontina/Writeboard') + img(style='position: absolute; top: 0; right: 0; border: 0;', src='https://a248.e.akamai.net/assets.github.com/img/30f550e0d38ceb6ef5b81500c64d970b7fb0f028/687474703a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6f72616e67655f6666373630302e706e67', alt='Fork me on GitHub') + + #info + #marker + + h1 Writeboard.me + span + p + | Access the + a(href='/alpha/') alpha version + | and give it a try! Share the room URL with your friends/co-workers and let the huddle begin. + p + | Please feel free to suggest features, improvements or file bugs + a(href='https://github.com/gtramontina/Writeboard/issues') here + | . + p + | Writeboard.me is an open-source project, so if you are a developer willing to contribute, + a(href='http://github.com/gtramontina/Writeboard') fork it on GitHub + | ! + p + | To be informed when Writeboard.me is born, enter your email below and we'll let you know. + + form(method='POST', id='interested', onsubmit='return submitForm()') + input(name='email', placeholder='e-mail') + #submit(onclick='submitForm()') ✓ Keep me Posted + + script + function submitForm() { + var form = document.forms.interested; + if (!(/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i).test(form.email.value)) { + alert('Invalid email format.'); + return false; + } + $.post('/interested', {email: form.email.value}, function(success) { + if (success) { + $('#interested').text("Thanks! We'll keep you posted!"); + } + }) + } + + span#footer + p + | Brought to you by + a(href='http://twitter.com/gtramontina')@gtramontina \ No newline at end of file diff --git a/package.json b/package.json index 87f541d..5167728 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,8 @@ "now" : ">=0.7.0", "jade" : ">=0.11.0", "stylus" : ">=0.13.0", - "nib" : ">=0.0.7" + "nib" : ">=0.0.7", + "couch-client" : ">=0.0.4" }, "devDependencies" : { "jessie" : ">=0.3.7",