rack-multipage 0.0.4 → 0.0.5

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 64abf673d9766bc2163093a1740462e6306df1ee
4
- data.tar.gz: 081325e23106bf763fc1bc58b8cb87cb974eee87
3
+ metadata.gz: b98abbf91288f4c9afb976fac0d230436a55dca7
4
+ data.tar.gz: 71390d5c9b1bbaa466f8b1e41c3dcbb893388da5
5
5
  SHA512:
6
- metadata.gz: 7642a00780487a3d2d2b77ce8ea165cb0b201b14d1f127d729217fe71638d51e4d6963755b44b9e33bdcac09e6b1e085bbc530f05ad707f3b6a322909763821f
7
- data.tar.gz: 5798fcdecfd1def63cf3b5a8ccbd5249c940dbcd29f52a5771d619ea30294a3f985009d642360038535c67604b32501bde1434d529e78df75448a45916945439
6
+ metadata.gz: 48f365b74f2466d985e2dc20ffb7767eaeb962efe9d784bf8282a953c18c7a805c2a39f59b7a3db4260af7bc3659733b524f9d3e92c1b7ca5a35ad58dac69306
7
+ data.tar.gz: 494cdb5aa27bf74b720d229d1d02028cbfc050924f477d67e8c4cbf68cfba8e3df5ae19c6d048580ae7ba4242394b0e7417f3f52f80559d5adb39d2cb22153fa
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  end
3
3
  class Rack::Multipage
4
- VERSION = "0.0.4"
4
+ VERSION = "0.0.5"
5
5
  end
@@ -13,11 +13,17 @@ class Rack::MultiPage
13
13
  attr_accessor :app
14
14
  attr_reader :pages_list
15
15
  attr_reader :route
16
+ attr_reader :height
17
+ attr_reader :width
16
18
 
17
19
  def initialize (app, config = {})
18
20
  @app = app
19
21
  @pages_list = config.fetch :pages, []
20
22
  @route = config.fetch :route, "/multipage"
23
+ @height = config.fetch :height, "600"
24
+ @width = config.fetch :width, "800"
25
+ @percentage = config.fetch :width, "50"
26
+
21
27
  end
22
28
 
23
29
  def call(env)
@@ -28,45 +34,49 @@ class Rack::MultiPage
28
34
  end
29
35
  end
30
36
 
37
+ def scale
38
+ (percentage / 100).to_f
39
+ end
40
+
31
41
  def css
32
42
  <<-CSS
33
43
  body {
34
44
  background-color: #eee;
35
45
  padding: 0; margin:0;
36
46
  }
47
+
37
48
  div.pageboxes {
38
49
  height: 100%;
39
50
  width: 100p%;
40
51
  }
41
52
 
42
53
  div.pageboxes .page {
43
- height: 600px;
44
- width: 800px;
54
+ height: #{height}px;
55
+ width: #{width}px;
45
56
  border: solid 1px black;
46
57
  background-color: white;
47
58
  top: 0;
48
- -webkit-transform: scale(0.5) ;
59
+ -webkit-transform: scale(#{scale}) ;
49
60
  -webkit-transform-origin: top left ;
50
61
  -webkit-box-shadow: 1px 1px 5px rgba(100,100,100,0.6)
51
62
  }
52
63
 
53
64
  div.pageboxes .box{
54
- width: 400px;
55
- height: 300px;
65
+ width: #{width * scale}px;
66
+ height: #{height * scale}px;
56
67
  margin-left: 10px;
57
68
  margin-top: 10px;
58
69
  float: left;
59
70
  }
71
+
60
72
  div.pageboxes .page iframe{
61
73
  height: 100%;
62
74
  width: 100%;
63
75
  border: solid 1px #eee;
64
76
  border-radius: 5px;
65
-
66
77
  }
67
- CSS
68
-
69
78
 
79
+ CSS
70
80
  end
71
81
 
72
82
  def template(insides)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-multipage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Graeme Worthy