Skip to content

Commit 04bd20f

Browse files
committed
started getting specs working
1 parent 30cb62e commit 04bd20f

16 files changed

+330
-35
lines changed

README.md

Whitespace-only changes.

css/app.css

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,38 @@
22

33
/* =BASE
44
====================================================== */
5-
html, body { background: #ddd; }
5+
html, body { background: #d9d9d9 url(../img/noisebg.png); color: #444;
6+
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);
7+
}
68
body { font-size: 16px; font-family: 'Helvetica Neue', Helvetica, Arial; padding: 0; margin: 0; }
79

10+
a { color: #000; }
11+
12+
ul, ol, form { margin: 0; padding: 0; }
13+
14+
ul, ol { list-style-type: none; }
15+
816
/* =LAYOUT
917
====================================================== */
1018
#header { background: #000; }
1119

1220
.canvas { background: url(../img/blueprintbg.png); padding: 60px;
13-
box-shadow: inset 0 -2px 10px rgba(0, 0, 0, 0.2);
21+
box-shadow: inset 0 -2px 10px rgba(0, 0, 0, 0.2), 0 75px 200px #fff;
22+
border-bottom: 1px solid #fff;
1423
}
1524

16-
.configuration { width: 800px; margin: auto; }
25+
#content { width: 800px; margin: auto; padding: 40px; overflow: hidden; }
1726

18-
#footer { text-align: center; margin-top: 20px; font-size: 11px; color: #888; }
27+
#footer { text-align: center; margin-top: 20px; font-size: 11px; color: #888;
28+
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.4);
29+
}
30+
31+
/* =MODULES
32+
====================================================== */
33+
.configuration { float: left; width: 300px; }
34+
35+
.result_code { padding: 10px; float: right; width: 400px; font-size: 14px; font-family: 'Courier new'; font-weight: bold;
36+
background: rgba(0, 0, 0, 0.15);
37+
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
38+
border-radius: 4px;
39+
}

css/arrow.css

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
box-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
44
}
55

6-
.arrow_box { color: #fff; background: #ff9600; border-color: #ffd163; position: relative;
6+
.arrow_box { color: #fff; position: relative;
7+
background: rgba(255, 255, 255, 0.3);
8+
border-color: rgba(255, 255, 255, 0.5);
79
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
810
}
911

@@ -18,14 +20,14 @@
1820

1921
.arrow_box.top:after {
2022
border-width: 12px;
21-
border-bottom-color: #ff9600;
23+
border-bottom-color: #7297e7;
2224
left: 50%;
2325
margin-left: -12px;
2426
}
2527

2628
.arrow_box.top:before {
2729
border-width: 14px;
28-
border-bottom-color: #ffd163;
30+
border-bottom-color: rgba(255, 255, 255, 0.5);
2931
left: 50%;
3032
margin-left: -14px;
3133
}

img/noisebg.png

47.8 KB
Loading

index.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818

1919
</div>
2020

21-
<div class='configuration'>
21+
<div id='content'>
2222

23-
<form>
23+
<form class='configuration'>
2424
<ol>
2525
<li>
2626
<label>arrow position</label>
@@ -49,5 +49,7 @@
4949
Follow me on twitter: <a href='https://twitter.com/shojberg'>@shojberg</a>
5050
</footer>
5151

52+
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js'></script>
53+
<script src='js/lib/app.js'></script>
5254
</body>
5355
</html>

js/lib/app.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
// create global InpaySupport if it doesn't exist
2-
if (!('InpaySupport' in window)) window.InpaySupport = {};
1+
// create global CSSArrowPlease if it doesn't exist
2+
if (!('CSSArrowPlease' in window)) window.CSSArrowPlease = {};
33

4-
(function (I) {
4+
(function (G) {
55

66
// ----- Application ----- //
77

@@ -36,7 +36,7 @@ if (!('InpaySupport' in window)) window.InpaySupport = {};
3636
var view = this.currentView;
3737

3838
if (view === 'SearchView') {
39-
new I.SearchView({
39+
new G.SearchView({
4040
container: $('.search')
4141
});
4242
}
@@ -45,6 +45,6 @@ if (!('InpaySupport' in window)) window.InpaySupport = {};
4545
};
4646

4747
// Expose
48-
I.App = App;
48+
G.App = App;
4949

50-
}(window.InpaySupport));
50+
}(window.CSSArrowPlease));

js/lib/models/arrow.js

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
// create global CSSArrowPlease if it doesn't exist
2+
if (!('CSSArrowPlease' in window)) window.CSSArrowPlease = {};
3+
4+
(function (G) {
5+
6+
/**
7+
@class Arrow
8+
@constructor
9+
**/
10+
var Arrow = function () {
11+
this.init.apply(this, arguments);
12+
};
13+
14+
Arrow.prototype = {
15+
16+
init: function () {
17+
// jquerify this
18+
this._$self = $(this);
19+
20+
this._addAttrs();
21+
},
22+
23+
_addAttrs: function () {
24+
var ATTRS = Arrow.ATTRS,
25+
attributes = {};
26+
27+
$.each(ATTRS, function (attr, value) {
28+
attributes[attr] = value;
29+
});
30+
31+
this._attributes = attributes;
32+
},
33+
34+
get: function (attr) {
35+
attr = this._attributes[attr];
36+
return attr;
37+
},
38+
39+
set: function (attr, val) {
40+
if (!(attr in this._attributes)) return;
41+
42+
this._attributes[attr] = 'val';
43+
this.fire('change');
44+
},
45+
46+
on: function (evType, callback, context) {
47+
var $self = this._$self;
48+
49+
$self.on(
50+
evType,
51+
$.proxy(callback, context || this)
52+
);
53+
},
54+
55+
fire: function (evType) {
56+
var $self = this._$self;
57+
58+
$self.trigger(evType);
59+
},
60+
61+
toCSS: function () {
62+
return 'WOOT';
63+
}
64+
65+
};
66+
67+
Arrow.ATTRS = {
68+
position: 'top',
69+
color: '#fff',
70+
border: {color: '#000', thickness: '2px'}
71+
};
72+
73+
// Expose
74+
G.Arrow = Arrow;
75+
76+
}(window.CSSArrowPlease));
77+

js/lib/views/arrow_configuration_view.js

Whitespace-only changes.

js/lib/views/arrow_css_view.js

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// create global CSSArrowPlease if it doesn't exist
2+
if (!('CSSArrowPlease' in window)) window.CSSArrowPlease = {};
3+
4+
(function (G) {
5+
6+
/**
7+
@class ArrowCSSView
8+
@constructor
9+
**/
10+
var ArrowCSSView = function () {
11+
this.init.apply(this, arguments);
12+
};
13+
14+
ArrowCSSView.prototype = {
15+
16+
init: function (options) {
17+
this.container = options.container;
18+
this.model = options.model;
19+
20+
this.model.on('change', this._handleChange, this);
21+
},
22+
23+
/**
24+
@method _handleChange
25+
@description handles changes to the model
26+
@chainable
27+
**/
28+
_handleChange: function () {
29+
this.render();
30+
},
31+
32+
/**
33+
@method render
34+
@description renders the model's css
35+
@chainable
36+
**/
37+
render: function () {
38+
this.container.html(this.model.toCSS());
39+
return this;
40+
}
41+
42+
};
43+
44+
// Expose public api
45+
G.ArrowCSSView = ArrowCSSView;
46+
47+
}(window.CSSArrowPlease));
48+
49+

js/lib/views/arrow_preview_view.js

Whitespace-only changes.

0 commit comments

Comments
 (0)