ruby-trade 0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +5 -0
- data/README.md +99 -0
- data/examples/market_maker.rb +42 -0
- data/lib/Gemfile +6 -0
- data/lib/Gemfile.lock +23 -0
- data/lib/client.rb +203 -0
- data/lib/order.rb +49 -0
- data/lib/ruby-trade.rb +1 -0
- data/rubytrade.gemspec +12 -0
- data/server/Gemfile +12 -0
- data/server/Gemfile.lock +57 -0
- data/server/account.rb +39 -0
- data/server/app.rb +20 -0
- data/server/exchange.rb +59 -0
- data/server/order-book.rb +113 -0
- data/server/order.rb +60 -0
- data/server/public/app.js +51 -0
- data/server/public/dist/css/bootstrap-theme.css +459 -0
- data/server/public/dist/css/bootstrap-theme.min.css +9 -0
- data/server/public/dist/css/bootstrap.css +7098 -0
- data/server/public/dist/css/bootstrap.min.css +9 -0
- data/server/public/dist/fonts/glyphicons-halflings-regular.eot +0 -0
- data/server/public/dist/fonts/glyphicons-halflings-regular.svg +229 -0
- data/server/public/dist/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/server/public/dist/fonts/glyphicons-halflings-regular.woff +0 -0
- data/server/public/dist/js/bootstrap.js +2002 -0
- data/server/public/dist/js/bootstrap.min.js +9 -0
- data/server/public/flot/API.md +1464 -0
- data/server/public/flot/CONTRIBUTING.md +99 -0
- data/server/public/flot/FAQ.md +75 -0
- data/server/public/flot/LICENSE.txt +22 -0
- data/server/public/flot/Makefile +12 -0
- data/server/public/flot/NEWS.md +893 -0
- data/server/public/flot/PLUGINS.md +143 -0
- data/server/public/flot/README.md +110 -0
- data/server/public/flot/build.log +0 -0
- data/server/public/flot/examples/ajax/data-eu-gdp-growth-1.json +4 -0
- data/server/public/flot/examples/ajax/data-eu-gdp-growth-2.json +4 -0
- data/server/public/flot/examples/ajax/data-eu-gdp-growth-3.json +4 -0
- data/server/public/flot/examples/ajax/data-eu-gdp-growth-4.json +4 -0
- data/server/public/flot/examples/ajax/data-eu-gdp-growth-5.json +4 -0
- data/server/public/flot/examples/ajax/data-eu-gdp-growth.json +4 -0
- data/server/public/flot/examples/ajax/data-japan-gdp-growth.json +4 -0
- data/server/public/flot/examples/ajax/data-usa-gdp-growth.json +4 -0
- data/server/public/flot/examples/ajax/index.html +173 -0
- data/server/public/flot/examples/annotating/index.html +87 -0
- data/server/public/flot/examples/axes-interacting/index.html +97 -0
- data/server/public/flot/examples/axes-multiple/index.html +77 -0
- data/server/public/flot/examples/axes-time-zones/date.js +893 -0
- data/server/public/flot/examples/axes-time-zones/index.html +114 -0
- data/server/public/flot/examples/axes-time-zones/tz/africa +1181 -0
- data/server/public/flot/examples/axes-time-zones/tz/antarctica +413 -0
- data/server/public/flot/examples/axes-time-zones/tz/asia +2717 -0
- data/server/public/flot/examples/axes-time-zones/tz/australasia +1719 -0
- data/server/public/flot/examples/axes-time-zones/tz/backward +117 -0
- data/server/public/flot/examples/axes-time-zones/tz/etcetera +81 -0
- data/server/public/flot/examples/axes-time-zones/tz/europe +2856 -0
- data/server/public/flot/examples/axes-time-zones/tz/factory +10 -0
- data/server/public/flot/examples/axes-time-zones/tz/iso3166.tab +276 -0
- data/server/public/flot/examples/axes-time-zones/tz/leapseconds +100 -0
- data/server/public/flot/examples/axes-time-zones/tz/northamerica +3235 -0
- data/server/public/flot/examples/axes-time-zones/tz/pacificnew +28 -0
- data/server/public/flot/examples/axes-time-zones/tz/solar87 +390 -0
- data/server/public/flot/examples/axes-time-zones/tz/solar88 +390 -0
- data/server/public/flot/examples/axes-time-zones/tz/solar89 +395 -0
- data/server/public/flot/examples/axes-time-zones/tz/southamerica +1711 -0
- data/server/public/flot/examples/axes-time-zones/tz/systemv +38 -0
- data/server/public/flot/examples/axes-time-zones/tz/yearistype.sh +38 -0
- data/server/public/flot/examples/axes-time-zones/tz/zone.tab +441 -0
- data/server/public/flot/examples/axes-time/index.html +137 -0
- data/server/public/flot/examples/background.png +0 -0
- data/server/public/flot/examples/basic-options/index.html +91 -0
- data/server/public/flot/examples/basic-usage/index.html +57 -0
- data/server/public/flot/examples/canvas/index.html +75 -0
- data/server/public/flot/examples/categories/index.html +64 -0
- data/server/public/flot/examples/examples.css +97 -0
- data/server/public/flot/examples/image/hs-2004-27-a-large-web.jpg +0 -0
- data/server/public/flot/examples/image/index.html +69 -0
- data/server/public/flot/examples/index.html +80 -0
- data/server/public/flot/examples/interacting/index.html +130 -0
- data/server/public/flot/examples/navigate/arrow-down.gif +0 -0
- data/server/public/flot/examples/navigate/arrow-left.gif +0 -0
- data/server/public/flot/examples/navigate/arrow-right.gif +0 -0
- data/server/public/flot/examples/navigate/arrow-up.gif +0 -0
- data/server/public/flot/examples/navigate/index.html +153 -0
- data/server/public/flot/examples/percentiles/index.html +79 -0
- data/server/public/flot/examples/realtime/index.html +122 -0
- data/server/public/flot/examples/resize/index.html +76 -0
- data/server/public/flot/examples/selection/index.html +141 -0
- data/server/public/flot/examples/series-errorbars/index.html +150 -0
- data/server/public/flot/examples/series-pie/index.html +818 -0
- data/server/public/flot/examples/series-toggle/index.html +121 -0
- data/server/public/flot/examples/series-types/index.html +90 -0
- data/server/public/flot/examples/shared/jquery-ui/jquery-ui.min.css +6 -0
- data/server/public/flot/examples/shared/jquery-ui/jquery-ui.min.js +6 -0
- data/server/public/flot/examples/stacking/index.html +107 -0
- data/server/public/flot/examples/symbols/index.html +76 -0
- data/server/public/flot/examples/threshold/index.html +76 -0
- data/server/public/flot/examples/tracking/index.html +135 -0
- data/server/public/flot/examples/visitors/index.html +146 -0
- data/server/public/flot/examples/zooming/index.html +144 -0
- data/server/public/flot/excanvas.js +1428 -0
- data/server/public/flot/excanvas.min.js +1 -0
- data/server/public/flot/jquery.colorhelpers.js +179 -0
- data/server/public/flot/jquery.colorhelpers.min.js +21 -0
- data/server/public/flot/jquery.flot.canvas.js +345 -0
- data/server/public/flot/jquery.flot.canvas.min.js +28 -0
- data/server/public/flot/jquery.flot.categories.js +190 -0
- data/server/public/flot/jquery.flot.categories.min.js +44 -0
- data/server/public/flot/jquery.flot.crosshair.js +176 -0
- data/server/public/flot/jquery.flot.crosshair.min.js +59 -0
- data/server/public/flot/jquery.flot.errorbars.js +353 -0
- data/server/public/flot/jquery.flot.errorbars.min.js +63 -0
- data/server/public/flot/jquery.flot.fillbetween.js +226 -0
- data/server/public/flot/jquery.flot.fillbetween.min.js +30 -0
- data/server/public/flot/jquery.flot.image.js +241 -0
- data/server/public/flot/jquery.flot.image.min.js +53 -0
- data/server/public/flot/jquery.flot.js +3061 -0
- data/server/public/flot/jquery.flot.min.js +29 -0
- data/server/public/flot/jquery.flot.navigate.js +346 -0
- data/server/public/flot/jquery.flot.navigate.min.js +86 -0
- data/server/public/flot/jquery.flot.pie.js +817 -0
- data/server/public/flot/jquery.flot.pie.min.js +56 -0
- data/server/public/flot/jquery.flot.resize.js +60 -0
- data/server/public/flot/jquery.flot.resize.min.js +19 -0
- data/server/public/flot/jquery.flot.selection.js +360 -0
- data/server/public/flot/jquery.flot.selection.min.js +79 -0
- data/server/public/flot/jquery.flot.stack.js +188 -0
- data/server/public/flot/jquery.flot.stack.min.js +36 -0
- data/server/public/flot/jquery.flot.symbol.js +71 -0
- data/server/public/flot/jquery.flot.symbol.min.js +14 -0
- data/server/public/flot/jquery.flot.threshold.js +142 -0
- data/server/public/flot/jquery.flot.threshold.min.js +43 -0
- data/server/public/flot/jquery.flot.time.js +431 -0
- data/server/public/flot/jquery.flot.time.min.js +9 -0
- data/server/public/flot/jquery.js +9472 -0
- data/server/public/flot/jquery.min.js +2 -0
- data/server/public/index.html +53 -0
- data/server/public/jquery-2.0.3.min.js +6 -0
- data/server/public/sockjs-0.2.1.min.js +27 -0
- data/server/server.rb +156 -0
- data/server/test/test_order_book.rb +118 -0
- data/server/web_server.rb +110 -0
- metadata +188 -0
data/server/Gemfile
ADDED
data/server/Gemfile.lock
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
GEM
|
2
|
+
remote: https://rubygems.org/
|
3
|
+
specs:
|
4
|
+
addressable (2.3.5)
|
5
|
+
algorithms (0.6.1)
|
6
|
+
daemons (1.1.9)
|
7
|
+
diff-lcs (1.2.4)
|
8
|
+
em-websocket (0.3.8)
|
9
|
+
addressable (>= 2.1.1)
|
10
|
+
eventmachine (>= 0.12.9)
|
11
|
+
em-zeromq (0.4.2)
|
12
|
+
eventmachine (>= 1.0.0)
|
13
|
+
ffi (>= 1.0.0)
|
14
|
+
ffi-rzmq (~> 1.0.1)
|
15
|
+
eventmachine (1.0.3)
|
16
|
+
ffi (1.9.3)
|
17
|
+
ffi-rzmq (1.0.3)
|
18
|
+
ffi
|
19
|
+
json (1.8.1)
|
20
|
+
rack (1.5.2)
|
21
|
+
rack-protection (1.5.1)
|
22
|
+
rack
|
23
|
+
rspec (2.14.1)
|
24
|
+
rspec-core (~> 2.14.0)
|
25
|
+
rspec-expectations (~> 2.14.0)
|
26
|
+
rspec-mocks (~> 2.14.0)
|
27
|
+
rspec-core (2.14.7)
|
28
|
+
rspec-expectations (2.14.3)
|
29
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
30
|
+
rspec-mocks (2.14.4)
|
31
|
+
sinatra (1.4.4)
|
32
|
+
rack (~> 1.4)
|
33
|
+
rack-protection (~> 1.4)
|
34
|
+
tilt (~> 1.3, >= 1.3.4)
|
35
|
+
sinatra-websocket (0.3.0)
|
36
|
+
em-websocket (~> 0.3.6)
|
37
|
+
eventmachine
|
38
|
+
thin (>= 1.3.1)
|
39
|
+
thin (1.6.1)
|
40
|
+
daemons (>= 1.0.9)
|
41
|
+
eventmachine (>= 1.0.0)
|
42
|
+
rack (>= 1.0.0)
|
43
|
+
tilt (1.4.1)
|
44
|
+
zmq (2.1.4)
|
45
|
+
|
46
|
+
PLATFORMS
|
47
|
+
ruby
|
48
|
+
|
49
|
+
DEPENDENCIES
|
50
|
+
algorithms
|
51
|
+
em-zeromq
|
52
|
+
json
|
53
|
+
rspec
|
54
|
+
sinatra
|
55
|
+
sinatra-websocket
|
56
|
+
thin
|
57
|
+
zmq
|
data/server/account.rb
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'observer'
|
2
|
+
|
3
|
+
class Account
|
4
|
+
include Observable
|
5
|
+
|
6
|
+
attr_reader :id, :stock, :cash, :name
|
7
|
+
attr_accessor :ai
|
8
|
+
|
9
|
+
def initialize id, name, stock, cash
|
10
|
+
@id, @name, @stock, @cash = id, name, stock, cash
|
11
|
+
@ai = false
|
12
|
+
end
|
13
|
+
|
14
|
+
def update_name name
|
15
|
+
if @name != name
|
16
|
+
@name = name
|
17
|
+
changed
|
18
|
+
notify_observers
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def on_trade order, amount
|
23
|
+
if order.side == :buy
|
24
|
+
@stock += amount
|
25
|
+
@cash -= order.price * amount
|
26
|
+
else
|
27
|
+
@stock -= amount
|
28
|
+
@cash += order.price * amount
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def net_value current_price
|
33
|
+
@cash + @stock * current_price
|
34
|
+
end
|
35
|
+
|
36
|
+
def ai?
|
37
|
+
@ai
|
38
|
+
end
|
39
|
+
end
|
data/server/app.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
require_relative 'server'
|
2
|
+
|
3
|
+
DEFAULT_WEBSERVER_PORT = 8080
|
4
|
+
DEFAULT_FEED_PORT = 9000
|
5
|
+
DEFAULT_ORDER_PORT = 9001
|
6
|
+
|
7
|
+
class App
|
8
|
+
def initialize
|
9
|
+
@server = Server.new
|
10
|
+
end
|
11
|
+
|
12
|
+
def start
|
13
|
+
@server.start order_port: DEFAULT_ORDER_PORT,
|
14
|
+
feed_port: DEFAULT_FEED_PORT,
|
15
|
+
webserver_port: DEFAULT_WEBSERVER_PORT
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
app = App.new
|
20
|
+
app.start
|
data/server/exchange.rb
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
require_relative 'account'
|
2
|
+
require_relative 'order-book'
|
3
|
+
require_relative 'order'
|
4
|
+
require_relative 'server'
|
5
|
+
|
6
|
+
STARTING_EQUITY = 0
|
7
|
+
STARTING_CASH = 10_000
|
8
|
+
|
9
|
+
class Exchange
|
10
|
+
def initialize
|
11
|
+
@accounts = {}
|
12
|
+
@orders = {}
|
13
|
+
@order_no = 0
|
14
|
+
@book = OrderBook.new
|
15
|
+
end
|
16
|
+
|
17
|
+
def identify data
|
18
|
+
account = @accounts[data["peer_name"]] || Account.new(data["peer_name"], data["name"], STARTING_EQUITY, STARTING_CASH)
|
19
|
+
|
20
|
+
account.ai = data["ai"]
|
21
|
+
account.update_name data["name"]
|
22
|
+
|
23
|
+
@accounts[account.name] = account
|
24
|
+
|
25
|
+
account
|
26
|
+
end
|
27
|
+
|
28
|
+
def new_order account, data
|
29
|
+
id = @order_no += 1
|
30
|
+
order = Order.new id, data["local_id"], data["side"], data["price"],
|
31
|
+
data["size"], account.id
|
32
|
+
|
33
|
+
if not order.valid?
|
34
|
+
return order.errors, order
|
35
|
+
else
|
36
|
+
@orders[id] = order
|
37
|
+
return nil, order
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
# Send an order
|
42
|
+
def send_order order
|
43
|
+
order.status = :accepted
|
44
|
+
@book.send_order order
|
45
|
+
end
|
46
|
+
|
47
|
+
def level1
|
48
|
+
{
|
49
|
+
bid: @book.bid,
|
50
|
+
ask: @book.ask,
|
51
|
+
last: @book.last
|
52
|
+
}
|
53
|
+
end
|
54
|
+
|
55
|
+
def cancel_order order_id
|
56
|
+
order = @orders[order_id]
|
57
|
+
@book.cancel_order order if order
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,113 @@
|
|
1
|
+
require 'observer'
|
2
|
+
require 'algorithms'
|
3
|
+
|
4
|
+
class OrderBook
|
5
|
+
include Observable
|
6
|
+
|
7
|
+
attr_reader :last
|
8
|
+
|
9
|
+
def initialize
|
10
|
+
@buy_orders = Containers::MaxHeap.new
|
11
|
+
@sell_orders = Containers::MinHeap.new
|
12
|
+
@last = 0.0
|
13
|
+
end
|
14
|
+
|
15
|
+
def send_order order
|
16
|
+
changed
|
17
|
+
notify_observers :new, order
|
18
|
+
|
19
|
+
if order.side.to_s == "buy"
|
20
|
+
handle_buy_order order
|
21
|
+
else
|
22
|
+
handle_sell_order order
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def cancel_order order
|
27
|
+
changed
|
28
|
+
notify_observers :cancel, order
|
29
|
+
|
30
|
+
if order.side.to_s == "buy"
|
31
|
+
@buy_orders.delete order
|
32
|
+
else
|
33
|
+
@sell_orders.delete order
|
34
|
+
end
|
35
|
+
|
36
|
+
order.cancel!
|
37
|
+
end
|
38
|
+
|
39
|
+
def bid
|
40
|
+
@buy_orders.empty? ? 0.0 : @buy_orders.next.price
|
41
|
+
end
|
42
|
+
|
43
|
+
def ask
|
44
|
+
@sell_orders.empty? ? 0.0 : @sell_orders.next.price
|
45
|
+
end
|
46
|
+
|
47
|
+
def side_size heap
|
48
|
+
# TODO: This is not accurate since if there are multiple orders at the
|
49
|
+
# same price this will not add them up
|
50
|
+
# However that requires a Heap#each, which does not exist yet
|
51
|
+
heap.next ? heap.next.size : 0
|
52
|
+
end
|
53
|
+
|
54
|
+
def bid_size
|
55
|
+
side_size @buy_orders
|
56
|
+
end
|
57
|
+
|
58
|
+
def ask_size
|
59
|
+
side_size @sell_orders
|
60
|
+
end
|
61
|
+
|
62
|
+
private
|
63
|
+
|
64
|
+
def handle_buy_order order
|
65
|
+
while not @sell_orders.empty? and order.price >= (next_order = @sell_orders.next).price
|
66
|
+
# buy order is at least equal to the ask, at least one trade will trigger
|
67
|
+
if order.size > next_order.size
|
68
|
+
# Took out the entire order, keep going
|
69
|
+
next_order.fill! next_order.price, next_order.size
|
70
|
+
order.fill! next_order.price, next_order.size
|
71
|
+
@sell_orders.pop
|
72
|
+
@last = next_order.price
|
73
|
+
else
|
74
|
+
# This one is enough to fill the sent one, no need to add it
|
75
|
+
next_order.fill! next_order.price, order.size
|
76
|
+
order.fill! next_order.price, order.size
|
77
|
+
@sell_orders.pop if next_order.size == order.size
|
78
|
+
@last = next_order.price
|
79
|
+
break
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
# if we still have size, add it to the book
|
84
|
+
if order.size > 0
|
85
|
+
@buy_orders.push order
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
def handle_sell_order order
|
90
|
+
while not @buy_orders.empty? and order.price <= (next_order = @buy_orders.next).price
|
91
|
+
if order.size > next_order.size
|
92
|
+
# Took out the entire order, keep going
|
93
|
+
next_order.fill! next_order.price, next_order.size
|
94
|
+
order.fill! next_order.price, next_order.size
|
95
|
+
@buy_orders.pop
|
96
|
+
@last = next_order.price
|
97
|
+
else
|
98
|
+
# This one is enough to fill the sent one, no need to add it
|
99
|
+
next_order.fill! next_order.price, order.size
|
100
|
+
order.fill! next_order.price, order.size
|
101
|
+
|
102
|
+
@last = next_order.price
|
103
|
+
@buy_orders.pop if next_order.size == order.size
|
104
|
+
break
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
# if we still have size, add it to the book
|
109
|
+
if order.size > 0
|
110
|
+
@sell_orders.push order
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
data/server/order.rb
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
require 'observer'
|
2
|
+
|
3
|
+
class Order
|
4
|
+
include Observable
|
5
|
+
|
6
|
+
attr_reader :id, :local_id, :side, :price, :size, :owner, :sent_at,
|
7
|
+
:initial_size, :status
|
8
|
+
|
9
|
+
def initialize id, local_id, side, price, size, owner
|
10
|
+
@id, @local_id, @side, @price, @size, @owner = id, local_id, side, price, size, owner
|
11
|
+
@initial_size = @size
|
12
|
+
@sent_at = Time.now
|
13
|
+
@status = :pending_accept
|
14
|
+
end
|
15
|
+
|
16
|
+
def <=> order
|
17
|
+
if order.price == price
|
18
|
+
@sent_at <=> order.sent_at
|
19
|
+
else
|
20
|
+
price <=> order.price
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def fill! price, amount
|
25
|
+
changed
|
26
|
+
|
27
|
+
status = :fill
|
28
|
+
status = :partial_fill if amount < @size
|
29
|
+
|
30
|
+
@size -= amount
|
31
|
+
@status = status
|
32
|
+
|
33
|
+
notify_observers status, self, price, amount
|
34
|
+
end
|
35
|
+
|
36
|
+
def cancel!
|
37
|
+
@status = :cancelled
|
38
|
+
changed
|
39
|
+
notify_observers :cancel, self
|
40
|
+
end
|
41
|
+
|
42
|
+
def valid?
|
43
|
+
errors.length > 0
|
44
|
+
end
|
45
|
+
|
46
|
+
def status= new_status
|
47
|
+
@status = new_status
|
48
|
+
end
|
49
|
+
|
50
|
+
def errors
|
51
|
+
errors = []
|
52
|
+
|
53
|
+
errors << "Price must be a number" unless @price.is_a? Integer
|
54
|
+
errors << "Price must be strictly positive" unless @price > 0
|
55
|
+
errors << "Unknown side '#{@side}'" unless ["buy", "sell"].include? @side
|
56
|
+
errors << "Size must be strictly positive" unless @size > 0
|
57
|
+
|
58
|
+
errors
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
/*jslint browser: true, indent: 2, nomen: true, plusplus: true, newcap: true, regexp: true, sloppy: true */
|
2
|
+
/*global $, SockJS, console, WebSocket*/
|
3
|
+
$(function () {
|
4
|
+
var plot,
|
5
|
+
sock = new WebSocket("ws://" + window.location.host + "/ws"),
|
6
|
+
time = 0,
|
7
|
+
ticks = [[], [], []],
|
8
|
+
level1 = 0.0;
|
9
|
+
|
10
|
+
sock.onopen = function () {
|
11
|
+
console.log("Connected to WS server.");
|
12
|
+
};
|
13
|
+
|
14
|
+
sock.onmessage = function (data) {
|
15
|
+
data = JSON.parse(data.data);
|
16
|
+
switch (data.action) {
|
17
|
+
case "level1":
|
18
|
+
level1 = data.level1;
|
19
|
+
$(".bid").html(data.level1.bid.toFixed(2));
|
20
|
+
$(".ask").html(data.level1.ask.toFixed(2));
|
21
|
+
$(".last").html(data.level1.last.toFixed(2));
|
22
|
+
break;
|
23
|
+
}
|
24
|
+
};
|
25
|
+
|
26
|
+
sock.onclose = function () {
|
27
|
+
console.log("Disconnected from WS server.");
|
28
|
+
};
|
29
|
+
|
30
|
+
plot = $.plot("#price-chart", ticks, {
|
31
|
+
series: {
|
32
|
+
shadowSize: 0
|
33
|
+
},
|
34
|
+
yaxis: {
|
35
|
+
min: 0
|
36
|
+
},
|
37
|
+
xaxis: {
|
38
|
+
show: false
|
39
|
+
}
|
40
|
+
});
|
41
|
+
|
42
|
+
// Push last, update graph
|
43
|
+
setInterval(function () {
|
44
|
+
time++;
|
45
|
+
ticks[0].push([time, level1.bid]);
|
46
|
+
ticks[1].push([time, level1.ask]);
|
47
|
+
ticks[2].push([time, level1.last]);
|
48
|
+
plot.setData(ticks);
|
49
|
+
plot.draw();
|
50
|
+
}, 1000);
|
51
|
+
});
|
@@ -0,0 +1,459 @@
|
|
1
|
+
/*!
|
2
|
+
* Bootstrap v3.0.2 by @fat and @mdo
|
3
|
+
* Copyright 2013 Twitter, Inc.
|
4
|
+
* Licensed under http://www.apache.org/licenses/LICENSE-2.0
|
5
|
+
*
|
6
|
+
* Designed and built with all the love in the world by @mdo and @fat.
|
7
|
+
*/
|
8
|
+
|
9
|
+
.btn-default,
|
10
|
+
.btn-primary,
|
11
|
+
.btn-success,
|
12
|
+
.btn-info,
|
13
|
+
.btn-warning,
|
14
|
+
.btn-danger {
|
15
|
+
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2);
|
16
|
+
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 1px rgba(0, 0, 0, 0.075);
|
17
|
+
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 1px rgba(0, 0, 0, 0.075);
|
18
|
+
}
|
19
|
+
|
20
|
+
.btn-default:active,
|
21
|
+
.btn-primary:active,
|
22
|
+
.btn-success:active,
|
23
|
+
.btn-info:active,
|
24
|
+
.btn-warning:active,
|
25
|
+
.btn-danger:active,
|
26
|
+
.btn-default.active,
|
27
|
+
.btn-primary.active,
|
28
|
+
.btn-success.active,
|
29
|
+
.btn-info.active,
|
30
|
+
.btn-warning.active,
|
31
|
+
.btn-danger.active {
|
32
|
+
-webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
33
|
+
box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
34
|
+
}
|
35
|
+
|
36
|
+
.btn:active,
|
37
|
+
.btn.active {
|
38
|
+
background-image: none;
|
39
|
+
}
|
40
|
+
|
41
|
+
.btn-default {
|
42
|
+
text-shadow: 0 1px 0 #fff;
|
43
|
+
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#ffffff), to(#e0e0e0));
|
44
|
+
background-image: -webkit-linear-gradient(top, #ffffff 0%, #e0e0e0 100%);
|
45
|
+
background-image: -moz-linear-gradient(top, #ffffff 0%, #e0e0e0 100%);
|
46
|
+
background-image: linear-gradient(to bottom, #ffffff 0%, #e0e0e0 100%);
|
47
|
+
background-repeat: repeat-x;
|
48
|
+
border-color: #dbdbdb;
|
49
|
+
border-color: #ccc;
|
50
|
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe0e0e0', GradientType=0);
|
51
|
+
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
|
52
|
+
}
|
53
|
+
|
54
|
+
.btn-default:hover,
|
55
|
+
.btn-default:focus {
|
56
|
+
background-color: #e0e0e0;
|
57
|
+
background-position: 0 -15px;
|
58
|
+
}
|
59
|
+
|
60
|
+
.btn-default:active,
|
61
|
+
.btn-default.active {
|
62
|
+
background-color: #e0e0e0;
|
63
|
+
border-color: #dbdbdb;
|
64
|
+
}
|
65
|
+
|
66
|
+
.btn-primary {
|
67
|
+
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#428bca), to(#2d6ca2));
|
68
|
+
background-image: -webkit-linear-gradient(top, #428bca 0%, #2d6ca2 100%);
|
69
|
+
background-image: -moz-linear-gradient(top, #428bca 0%, #2d6ca2 100%);
|
70
|
+
background-image: linear-gradient(to bottom, #428bca 0%, #2d6ca2 100%);
|
71
|
+
background-repeat: repeat-x;
|
72
|
+
border-color: #2b669a;
|
73
|
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff2d6ca2', GradientType=0);
|
74
|
+
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
|
75
|
+
}
|
76
|
+
|
77
|
+
.btn-primary:hover,
|
78
|
+
.btn-primary:focus {
|
79
|
+
background-color: #2d6ca2;
|
80
|
+
background-position: 0 -15px;
|
81
|
+
}
|
82
|
+
|
83
|
+
.btn-primary:active,
|
84
|
+
.btn-primary.active {
|
85
|
+
background-color: #2d6ca2;
|
86
|
+
border-color: #2b669a;
|
87
|
+
}
|
88
|
+
|
89
|
+
.btn-success {
|
90
|
+
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#5cb85c), to(#419641));
|
91
|
+
background-image: -webkit-linear-gradient(top, #5cb85c 0%, #419641 100%);
|
92
|
+
background-image: -moz-linear-gradient(top, #5cb85c 0%, #419641 100%);
|
93
|
+
background-image: linear-gradient(to bottom, #5cb85c 0%, #419641 100%);
|
94
|
+
background-repeat: repeat-x;
|
95
|
+
border-color: #3e8f3e;
|
96
|
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff419641', GradientType=0);
|
97
|
+
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
|
98
|
+
}
|
99
|
+
|
100
|
+
.btn-success:hover,
|
101
|
+
.btn-success:focus {
|
102
|
+
background-color: #419641;
|
103
|
+
background-position: 0 -15px;
|
104
|
+
}
|
105
|
+
|
106
|
+
.btn-success:active,
|
107
|
+
.btn-success.active {
|
108
|
+
background-color: #419641;
|
109
|
+
border-color: #3e8f3e;
|
110
|
+
}
|
111
|
+
|
112
|
+
.btn-warning {
|
113
|
+
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#f0ad4e), to(#eb9316));
|
114
|
+
background-image: -webkit-linear-gradient(top, #f0ad4e 0%, #eb9316 100%);
|
115
|
+
background-image: -moz-linear-gradient(top, #f0ad4e 0%, #eb9316 100%);
|
116
|
+
background-image: linear-gradient(to bottom, #f0ad4e 0%, #eb9316 100%);
|
117
|
+
background-repeat: repeat-x;
|
118
|
+
border-color: #e38d13;
|
119
|
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffeb9316', GradientType=0);
|
120
|
+
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
|
121
|
+
}
|
122
|
+
|
123
|
+
.btn-warning:hover,
|
124
|
+
.btn-warning:focus {
|
125
|
+
background-color: #eb9316;
|
126
|
+
background-position: 0 -15px;
|
127
|
+
}
|
128
|
+
|
129
|
+
.btn-warning:active,
|
130
|
+
.btn-warning.active {
|
131
|
+
background-color: #eb9316;
|
132
|
+
border-color: #e38d13;
|
133
|
+
}
|
134
|
+
|
135
|
+
.btn-danger {
|
136
|
+
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#d9534f), to(#c12e2a));
|
137
|
+
background-image: -webkit-linear-gradient(top, #d9534f 0%, #c12e2a 100%);
|
138
|
+
background-image: -moz-linear-gradient(top, #d9534f 0%, #c12e2a 100%);
|
139
|
+
background-image: linear-gradient(to bottom, #d9534f 0%, #c12e2a 100%);
|
140
|
+
background-repeat: repeat-x;
|
141
|
+
border-color: #b92c28;
|
142
|
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc12e2a', GradientType=0);
|
143
|
+
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
|
144
|
+
}
|
145
|
+
|
146
|
+
.btn-danger:hover,
|
147
|
+
.btn-danger:focus {
|
148
|
+
background-color: #c12e2a;
|
149
|
+
background-position: 0 -15px;
|
150
|
+
}
|
151
|
+
|
152
|
+
.btn-danger:active,
|
153
|
+
.btn-danger.active {
|
154
|
+
background-color: #c12e2a;
|
155
|
+
border-color: #b92c28;
|
156
|
+
}
|
157
|
+
|
158
|
+
.btn-info {
|
159
|
+
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#5bc0de), to(#2aabd2));
|
160
|
+
background-image: -webkit-linear-gradient(top, #5bc0de 0%, #2aabd2 100%);
|
161
|
+
background-image: -moz-linear-gradient(top, #5bc0de 0%, #2aabd2 100%);
|
162
|
+
background-image: linear-gradient(to bottom, #5bc0de 0%, #2aabd2 100%);
|
163
|
+
background-repeat: repeat-x;
|
164
|
+
border-color: #28a4c9;
|
165
|
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2aabd2', GradientType=0);
|
166
|
+
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
|
167
|
+
}
|
168
|
+
|
169
|
+
.btn-info:hover,
|
170
|
+
.btn-info:focus {
|
171
|
+
background-color: #2aabd2;
|
172
|
+
background-position: 0 -15px;
|
173
|
+
}
|
174
|
+
|
175
|
+
.btn-info:active,
|
176
|
+
.btn-info.active {
|
177
|
+
background-color: #2aabd2;
|
178
|
+
border-color: #28a4c9;
|
179
|
+
}
|
180
|
+
|
181
|
+
.thumbnail,
|
182
|
+
.img-thumbnail {
|
183
|
+
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075);
|
184
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075);
|
185
|
+
}
|
186
|
+
|
187
|
+
.dropdown-menu > li > a:hover,
|
188
|
+
.dropdown-menu > li > a:focus {
|
189
|
+
background-color: #e8e8e8;
|
190
|
+
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#f5f5f5), to(#e8e8e8));
|
191
|
+
background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);
|
192
|
+
background-image: -moz-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);
|
193
|
+
background-image: linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%);
|
194
|
+
background-repeat: repeat-x;
|
195
|
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);
|
196
|
+
}
|
197
|
+
|
198
|
+
.dropdown-menu > .active > a,
|
199
|
+
.dropdown-menu > .active > a:hover,
|
200
|
+
.dropdown-menu > .active > a:focus {
|
201
|
+
background-color: #357ebd;
|
202
|
+
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#428bca), to(#357ebd));
|
203
|
+
background-image: -webkit-linear-gradient(top, #428bca 0%, #357ebd 100%);
|
204
|
+
background-image: -moz-linear-gradient(top, #428bca 0%, #357ebd 100%);
|
205
|
+
background-image: linear-gradient(to bottom, #428bca 0%, #357ebd 100%);
|
206
|
+
background-repeat: repeat-x;
|
207
|
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0);
|
208
|
+
}
|
209
|
+
|
210
|
+
.navbar-default {
|
211
|
+
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#ffffff), to(#f8f8f8));
|
212
|
+
background-image: -webkit-linear-gradient(top, #ffffff 0%, #f8f8f8 100%);
|
213
|
+
background-image: -moz-linear-gradient(top, #ffffff 0%, #f8f8f8 100%);
|
214
|
+
background-image: linear-gradient(to bottom, #ffffff 0%, #f8f8f8 100%);
|
215
|
+
background-repeat: repeat-x;
|
216
|
+
border-radius: 4px;
|
217
|
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0);
|
218
|
+
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
|
219
|
+
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 5px rgba(0, 0, 0, 0.075);
|
220
|
+
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 5px rgba(0, 0, 0, 0.075);
|
221
|
+
}
|
222
|
+
|
223
|
+
.navbar-default .navbar-nav > .active > a {
|
224
|
+
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#ebebeb), to(#f3f3f3));
|
225
|
+
background-image: -webkit-linear-gradient(top, #ebebeb 0%, #f3f3f3 100%);
|
226
|
+
background-image: -moz-linear-gradient(top, #ebebeb 0%, #f3f3f3 100%);
|
227
|
+
background-image: linear-gradient(to bottom, #ebebeb 0%, #f3f3f3 100%);
|
228
|
+
background-repeat: repeat-x;
|
229
|
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff3f3f3', GradientType=0);
|
230
|
+
-webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.075);
|
231
|
+
box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.075);
|
232
|
+
}
|
233
|
+
|
234
|
+
.navbar-brand,
|
235
|
+
.navbar-nav > li > a {
|
236
|
+
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
|
237
|
+
}
|
238
|
+
|
239
|
+
.navbar-inverse {
|
240
|
+
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#3c3c3c), to(#222222));
|
241
|
+
background-image: -webkit-linear-gradient(top, #3c3c3c 0%, #222222 100%);
|
242
|
+
background-image: -moz-linear-gradient(top, #3c3c3c 0%, #222222 100%);
|
243
|
+
background-image: linear-gradient(to bottom, #3c3c3c 0%, #222222 100%);
|
244
|
+
background-repeat: repeat-x;
|
245
|
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0);
|
246
|
+
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
|
247
|
+
}
|
248
|
+
|
249
|
+
.navbar-inverse .navbar-nav > .active > a {
|
250
|
+
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#222222), to(#282828));
|
251
|
+
background-image: -webkit-linear-gradient(top, #222222 0%, #282828 100%);
|
252
|
+
background-image: -moz-linear-gradient(top, #222222 0%, #282828 100%);
|
253
|
+
background-image: linear-gradient(to bottom, #222222 0%, #282828 100%);
|
254
|
+
background-repeat: repeat-x;
|
255
|
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222', endColorstr='#ff282828', GradientType=0);
|
256
|
+
-webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.25);
|
257
|
+
box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.25);
|
258
|
+
}
|
259
|
+
|
260
|
+
.navbar-inverse .navbar-brand,
|
261
|
+
.navbar-inverse .navbar-nav > li > a {
|
262
|
+
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
|
263
|
+
}
|
264
|
+
|
265
|
+
.navbar-static-top,
|
266
|
+
.navbar-fixed-top,
|
267
|
+
.navbar-fixed-bottom {
|
268
|
+
border-radius: 0;
|
269
|
+
}
|
270
|
+
|
271
|
+
.alert {
|
272
|
+
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2);
|
273
|
+
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05);
|
274
|
+
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05);
|
275
|
+
}
|
276
|
+
|
277
|
+
.alert-success {
|
278
|
+
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#dff0d8), to(#c8e5bc));
|
279
|
+
background-image: -webkit-linear-gradient(top, #dff0d8 0%, #c8e5bc 100%);
|
280
|
+
background-image: -moz-linear-gradient(top, #dff0d8 0%, #c8e5bc 100%);
|
281
|
+
background-image: linear-gradient(to bottom, #dff0d8 0%, #c8e5bc 100%);
|
282
|
+
background-repeat: repeat-x;
|
283
|
+
border-color: #b2dba1;
|
284
|
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffc8e5bc', GradientType=0);
|
285
|
+
}
|
286
|
+
|
287
|
+
.alert-info {
|
288
|
+
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#d9edf7), to(#b9def0));
|
289
|
+
background-image: -webkit-linear-gradient(top, #d9edf7 0%, #b9def0 100%);
|
290
|
+
background-image: -moz-linear-gradient(top, #d9edf7 0%, #b9def0 100%);
|
291
|
+
background-image: linear-gradient(to bottom, #d9edf7 0%, #b9def0 100%);
|
292
|
+
background-repeat: repeat-x;
|
293
|
+
border-color: #9acfea;
|
294
|
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffb9def0', GradientType=0);
|
295
|
+
}
|
296
|
+
|
297
|
+
.alert-warning {
|
298
|
+
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#fcf8e3), to(#f8efc0));
|
299
|
+
background-image: -webkit-linear-gradient(top, #fcf8e3 0%, #f8efc0 100%);
|
300
|
+
background-image: -moz-linear-gradient(top, #fcf8e3 0%, #f8efc0 100%);
|
301
|
+
background-image: linear-gradient(to bottom, #fcf8e3 0%, #f8efc0 100%);
|
302
|
+
background-repeat: repeat-x;
|
303
|
+
border-color: #f5e79e;
|
304
|
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fff8efc0', GradientType=0);
|
305
|
+
}
|
306
|
+
|
307
|
+
.alert-danger {
|
308
|
+
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#f2dede), to(#e7c3c3));
|
309
|
+
background-image: -webkit-linear-gradient(top, #f2dede 0%, #e7c3c3 100%);
|
310
|
+
background-image: -moz-linear-gradient(top, #f2dede 0%, #e7c3c3 100%);
|
311
|
+
background-image: linear-gradient(to bottom, #f2dede 0%, #e7c3c3 100%);
|
312
|
+
background-repeat: repeat-x;
|
313
|
+
border-color: #dca7a7;
|
314
|
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffe7c3c3', GradientType=0);
|
315
|
+
}
|
316
|
+
|
317
|
+
.progress {
|
318
|
+
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#ebebeb), to(#f5f5f5));
|
319
|
+
background-image: -webkit-linear-gradient(top, #ebebeb 0%, #f5f5f5 100%);
|
320
|
+
background-image: -moz-linear-gradient(top, #ebebeb 0%, #f5f5f5 100%);
|
321
|
+
background-image: linear-gradient(to bottom, #ebebeb 0%, #f5f5f5 100%);
|
322
|
+
background-repeat: repeat-x;
|
323
|
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff5f5f5', GradientType=0);
|
324
|
+
}
|
325
|
+
|
326
|
+
.progress-bar {
|
327
|
+
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#428bca), to(#3071a9));
|
328
|
+
background-image: -webkit-linear-gradient(top, #428bca 0%, #3071a9 100%);
|
329
|
+
background-image: -moz-linear-gradient(top, #428bca 0%, #3071a9 100%);
|
330
|
+
background-image: linear-gradient(to bottom, #428bca 0%, #3071a9 100%);
|
331
|
+
background-repeat: repeat-x;
|
332
|
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3071a9', GradientType=0);
|
333
|
+
}
|
334
|
+
|
335
|
+
.progress-bar-success {
|
336
|
+
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#5cb85c), to(#449d44));
|
337
|
+
background-image: -webkit-linear-gradient(top, #5cb85c 0%, #449d44 100%);
|
338
|
+
background-image: -moz-linear-gradient(top, #5cb85c 0%, #449d44 100%);
|
339
|
+
background-image: linear-gradient(to bottom, #5cb85c 0%, #449d44 100%);
|
340
|
+
background-repeat: repeat-x;
|
341
|
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0);
|
342
|
+
}
|
343
|
+
|
344
|
+
.progress-bar-info {
|
345
|
+
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#5bc0de), to(#31b0d5));
|
346
|
+
background-image: -webkit-linear-gradient(top, #5bc0de 0%, #31b0d5 100%);
|
347
|
+
background-image: -moz-linear-gradient(top, #5bc0de 0%, #31b0d5 100%);
|
348
|
+
background-image: linear-gradient(to bottom, #5bc0de 0%, #31b0d5 100%);
|
349
|
+
background-repeat: repeat-x;
|
350
|
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0);
|
351
|
+
}
|
352
|
+
|
353
|
+
.progress-bar-warning {
|
354
|
+
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#f0ad4e), to(#ec971f));
|
355
|
+
background-image: -webkit-linear-gradient(top, #f0ad4e 0%, #ec971f 100%);
|
356
|
+
background-image: -moz-linear-gradient(top, #f0ad4e 0%, #ec971f 100%);
|
357
|
+
background-image: linear-gradient(to bottom, #f0ad4e 0%, #ec971f 100%);
|
358
|
+
background-repeat: repeat-x;
|
359
|
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0);
|
360
|
+
}
|
361
|
+
|
362
|
+
.progress-bar-danger {
|
363
|
+
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#d9534f), to(#c9302c));
|
364
|
+
background-image: -webkit-linear-gradient(top, #d9534f 0%, #c9302c 100%);
|
365
|
+
background-image: -moz-linear-gradient(top, #d9534f 0%, #c9302c 100%);
|
366
|
+
background-image: linear-gradient(to bottom, #d9534f 0%, #c9302c 100%);
|
367
|
+
background-repeat: repeat-x;
|
368
|
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0);
|
369
|
+
}
|
370
|
+
|
371
|
+
.list-group {
|
372
|
+
border-radius: 4px;
|
373
|
+
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075);
|
374
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075);
|
375
|
+
}
|
376
|
+
|
377
|
+
.list-group-item.active,
|
378
|
+
.list-group-item.active:hover,
|
379
|
+
.list-group-item.active:focus {
|
380
|
+
text-shadow: 0 -1px 0 #3071a9;
|
381
|
+
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#428bca), to(#3278b3));
|
382
|
+
background-image: -webkit-linear-gradient(top, #428bca 0%, #3278b3 100%);
|
383
|
+
background-image: -moz-linear-gradient(top, #428bca 0%, #3278b3 100%);
|
384
|
+
background-image: linear-gradient(to bottom, #428bca 0%, #3278b3 100%);
|
385
|
+
background-repeat: repeat-x;
|
386
|
+
border-color: #3278b3;
|
387
|
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3278b3', GradientType=0);
|
388
|
+
}
|
389
|
+
|
390
|
+
.panel {
|
391
|
+
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
|
392
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
|
393
|
+
}
|
394
|
+
|
395
|
+
.panel-default > .panel-heading {
|
396
|
+
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#f5f5f5), to(#e8e8e8));
|
397
|
+
background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);
|
398
|
+
background-image: -moz-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);
|
399
|
+
background-image: linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%);
|
400
|
+
background-repeat: repeat-x;
|
401
|
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);
|
402
|
+
}
|
403
|
+
|
404
|
+
.panel-primary > .panel-heading {
|
405
|
+
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#428bca), to(#357ebd));
|
406
|
+
background-image: -webkit-linear-gradient(top, #428bca 0%, #357ebd 100%);
|
407
|
+
background-image: -moz-linear-gradient(top, #428bca 0%, #357ebd 100%);
|
408
|
+
background-image: linear-gradient(to bottom, #428bca 0%, #357ebd 100%);
|
409
|
+
background-repeat: repeat-x;
|
410
|
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0);
|
411
|
+
}
|
412
|
+
|
413
|
+
.panel-success > .panel-heading {
|
414
|
+
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#dff0d8), to(#d0e9c6));
|
415
|
+
background-image: -webkit-linear-gradient(top, #dff0d8 0%, #d0e9c6 100%);
|
416
|
+
background-image: -moz-linear-gradient(top, #dff0d8 0%, #d0e9c6 100%);
|
417
|
+
background-image: linear-gradient(to bottom, #dff0d8 0%, #d0e9c6 100%);
|
418
|
+
background-repeat: repeat-x;
|
419
|
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffd0e9c6', GradientType=0);
|
420
|
+
}
|
421
|
+
|
422
|
+
.panel-info > .panel-heading {
|
423
|
+
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#d9edf7), to(#c4e3f3));
|
424
|
+
background-image: -webkit-linear-gradient(top, #d9edf7 0%, #c4e3f3 100%);
|
425
|
+
background-image: -moz-linear-gradient(top, #d9edf7 0%, #c4e3f3 100%);
|
426
|
+
background-image: linear-gradient(to bottom, #d9edf7 0%, #c4e3f3 100%);
|
427
|
+
background-repeat: repeat-x;
|
428
|
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffc4e3f3', GradientType=0);
|
429
|
+
}
|
430
|
+
|
431
|
+
.panel-warning > .panel-heading {
|
432
|
+
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#fcf8e3), to(#faf2cc));
|
433
|
+
background-image: -webkit-linear-gradient(top, #fcf8e3 0%, #faf2cc 100%);
|
434
|
+
background-image: -moz-linear-gradient(top, #fcf8e3 0%, #faf2cc 100%);
|
435
|
+
background-image: linear-gradient(to bottom, #fcf8e3 0%, #faf2cc 100%);
|
436
|
+
background-repeat: repeat-x;
|
437
|
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fffaf2cc', GradientType=0);
|
438
|
+
}
|
439
|
+
|
440
|
+
.panel-danger > .panel-heading {
|
441
|
+
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#f2dede), to(#ebcccc));
|
442
|
+
background-image: -webkit-linear-gradient(top, #f2dede 0%, #ebcccc 100%);
|
443
|
+
background-image: -moz-linear-gradient(top, #f2dede 0%, #ebcccc 100%);
|
444
|
+
background-image: linear-gradient(to bottom, #f2dede 0%, #ebcccc 100%);
|
445
|
+
background-repeat: repeat-x;
|
446
|
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffebcccc', GradientType=0);
|
447
|
+
}
|
448
|
+
|
449
|
+
.well {
|
450
|
+
background-image: -webkit-gradient(linear, left 0%, left 100%, from(#e8e8e8), to(#f5f5f5));
|
451
|
+
background-image: -webkit-linear-gradient(top, #e8e8e8 0%, #f5f5f5 100%);
|
452
|
+
background-image: -moz-linear-gradient(top, #e8e8e8 0%, #f5f5f5 100%);
|
453
|
+
background-image: linear-gradient(to bottom, #e8e8e8 0%, #f5f5f5 100%);
|
454
|
+
background-repeat: repeat-x;
|
455
|
+
border-color: #dcdcdc;
|
456
|
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8', endColorstr='#fff5f5f5', GradientType=0);
|
457
|
+
-webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 0 rgba(255, 255, 255, 0.1);
|
458
|
+
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 0 rgba(255, 255, 255, 0.1);
|
459
|
+
}
|