|
8 | 8 | <title>angular-bricklayer</title> |
9 | 9 |
|
10 | 10 | <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/bricklayer/0.2.4/bricklayer.min.css"> |
11 | | - |
12 | | - <script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.3/angular.min.js"></script> |
13 | 11 | <script src="//cdnjs.cloudflare.com/ajax/libs/bricklayer/0.2.4/bricklayer.min.js"></script> |
| 12 | + <script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.3/angular.min.js"></script> |
| 13 | + |
| 14 | + <!-- |
| 15 | + <link rel="stylesheet" href="../bower_components/bricklayer/dist/bricklayer.min.css"> |
| 16 | + <script src="../bower_components/bricklayer/dist/bricklayer.min.js"></script> |
| 17 | + <script src="../bower_components/angular/angular.min.js"></script> |
| 18 | + --> |
| 19 | + |
14 | 20 |
|
15 | 21 | <script src="app.js"></script> |
16 | | - <script src="../src/angular-bricklayer.js"></script> |
| 22 | + <script src="../dist/angular-bricklayer.js"></script> |
17 | 23 |
|
18 | 24 | <style> |
19 | | - .bricklayer-column-sizer { |
20 | | - width: 10%; |
| 25 | + /* Bricklayer calculates its column sizes from the `bricklayer-column-sizer` element. You can give it some width with media queries to make it responsive */ |
| 26 | + @media screen and (min-width: 300px) { |
| 27 | + .bricklayer-column-sizer { |
| 28 | + /* If page is greater than 300px, columns will be 20% wide. */ |
| 29 | + width: 20%; |
| 30 | + } |
| 31 | + } |
| 32 | + |
| 33 | + @media screen and (min-width: 400px) { |
| 34 | + .bricklayer-column-sizer { |
| 35 | + /* If page is greater than 400px, columns will be 10% wide, which are more narrow. */ |
| 36 | + width: 10%; |
| 37 | + } |
| 38 | + } |
| 39 | + |
| 40 | + @media screen and (min-width: 700px) { |
| 41 | + .bricklayer-column-sizer { |
| 42 | + /* If page is greater than 700px, columns will be 5% wide. That means there will be lots of columns */ |
| 43 | + width: 5%; |
| 44 | + } |
21 | 45 | } |
22 | 46 |
|
23 | 47 | .box { |
|
26 | 50 | </style> |
27 | 51 |
|
28 | 52 | </head> |
29 | | -<body ng-app="app"> |
| 53 | +<body ng-app="app" ng-controller="appController"> |
30 | 54 |
|
31 | 55 | <!-- Bricklayer needs to have "bricklayer" class name. --> |
| 56 | + |
32 | 57 | <div class="bricklayer"> |
33 | 58 | <div class="box" style="background-color: red; height: 100px"></div> |
34 | 59 | <div class="box" style="background-color: green; height: 70px"></div> |
35 | 60 | <div class="box" style="background-color: blue; height: 30px"></div> |
36 | 61 | <div class="box" style="background-color: orange; height: 40px"></div> |
37 | | - <div class="box" style="background-color: red; height: 100px"></div> |
38 | | - <div class="box" style="background-color: green; height: 70px"></div> |
39 | | - <div class="box" style="background-color: blue; height: 30px"></div> |
40 | | - <div class="box" style="background-color: orange; height: 40px"></div> |
41 | | - <div class="box" style="background-color: red; height: 100px"></div> |
42 | | - <div class="box" style="background-color: green; height: 70px"></div> |
43 | | - <div class="box" style="background-color: blue; height: 30px"></div> |
44 | | - <div class="box" style="background-color: orange; height: 40px"></div> |
45 | | - <div class="box" style="background-color: red; height: 100px"></div> |
46 | | - <div class="box" style="background-color: green; height: 70px"></div> |
47 | | - <div class="box" style="background-color: blue; height: 30px"></div> |
48 | | - <div class="box" style="background-color: orange; height: 40px"></div> |
49 | | - <div class="box" style="background-color: red; height: 100px"></div> |
50 | | - <div class="box" style="background-color: green; height: 70px"></div> |
51 | | - <div class="box" style="background-color: blue; height: 30px"></div> |
52 | | - <div class="box" style="background-color: orange; height: 40px"></div> |
53 | | - <div class="box" style="background-color: red; height: 100px"></div> |
54 | | - <div class="box" style="background-color: green; height: 70px"></div> |
55 | | - <div class="box" style="background-color: blue; height: 30px"></div> |
56 | | - <div class="box" style="background-color: orange; height: 40px"></div> |
| 62 | + <div class="box" bricklayer-append style="background-color: {{item.color}}; height: {{item.height + 'px'}}" ng-repeat="item in data"></div> |
57 | 63 | </div> |
58 | 64 |
|
| 65 | + |
59 | 66 | </body> |
60 | 67 | </html> |
0 commit comments