├── LICENSE
├── README.md
├── css
├── fibonacci.css
├── reset.css
└── screen.css
├── img
├── CSSFile.png
├── HTMLFile.png
├── addhorizontal.png
├── addvertical.png
├── expand.png
├── fibonacci_icon.png
├── fibonacci_icon@2x.png
├── fibonacci_icon_blue.png
├── fibonacci_icon_blue@2x.png
├── info.png
├── options.png
├── remove.png
├── shrink.png
├── splithorizontal.png
├── splitvertical.png
└── trash.png
├── index.html
└── js
├── autoprefixer.js
├── fibonacci.js
└── jquery.js
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2014 Max Steenbergen
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | 
2 |
3 | Fibonacci
4 | =========
5 | ##Flexbox page layout composer
6 |
7 | Fibonacci is an offshoot of an internal tool created to let non-developers design page layouts using Flexbox, without having to learn HTML or CSS. Live demo [here.](http://maxsteenbergen.com/fibonacci/)
8 | Fibonacci starts with a blank ````
```` , which you can then split to your heart's content. It generates both the HTML and CSS needed to recreate the layout in your own pages.
9 |
10 | After you've made your horizontal or vertical split, you can then add a new sibling, shrink or expand, give it a fixed width/height, remove or split it again. Remember to add a unit when you enter a fixed width or height!
11 | Once you're happy with the layout, hit the export icons to copy the generated code and paste it wherever you need it in your own code.
12 |
13 | Tiny sidenote: Fibonacci is mostly a little sideproject still under development and by no means perfect or bug free. Contributions are highly welcome :)
14 |
15 | ### Notes
16 | **Q: _How is the/a Fibonacci sequence used in this tool?_**
17 | **A:** It absolutely isn’t. Nothing in the code, as you can see for yourself, uses any kind of Fibonacci sequence. Nuh-uh.
18 |
19 | **Q: _Then why is it named Fibonacci?_**
20 | **A:** There’s 1 reason, and 1 reason only. While testing the tool, I divided the main container into a Fibonacci-esque structure. That’s it. The structured reminded me of Fibonacci, I liked the ring of it, I called the tool Fibonacci. Fin.
21 |
22 | **Q: _The main ````#container```` div is 100% * 600px. What's up with that?_**
23 | **A:** The beauty of Flexbox is that it's flexible. Whatever the dimensions of your container or even the viewport, Flexbox adapts automatically. It's completely fluid. So all you need to do is to give the ````#container```` div the dimensions you need, and all child div's made with Fibonacci will resize accordingly.
24 |
25 | **Q: _Does Fibonacci only split div's in half?_**
26 | **A:** Only as a starting point. In the Options window, you'll find icons that allow you to grow or shrink each div' with increments of 50%. This is standard in the Flexbox spec.
27 |
28 | **Q: _What if I want 3 or more equal div's?_**
29 | **A:** Simple. First split the ````#container```` div either horizontally or vertically, so you get two equal div's. Then, instead of splitting each div' in half again, hit the _'Add Sibling'_ icon for as many times as you need.
30 |
31 |
32 | **Q: _Can I mix Flexbox with fixed dimensions?_**
33 | **A:** Absolutely. Once you've made a first split, you can enter a fixed dimension in the Options window. **Be sure to include a unit!** Fibonacci also allows the same method for a div's parent.
34 | Note however, that a div's parent defines what dimension you can assign a fixed width to. Fibonacci is quite opinionated and so by default stretches all div's to fill their respective parent. Small example: if you've split a column in 2, and want to give one of those 2 div's a fixed dimension, you can only enter a fixed height. For a fixed width in this example, Fibonacci provides a second input to edit the parent's dimension.
35 |
--------------------------------------------------------------------------------
/css/fibonacci.css:
--------------------------------------------------------------------------------
1 | #flexcanvas{
2 | width: 100%;
3 | height: 600px !important;
4 | }
5 |
6 | .rowParent, .columnParent{
7 | display: -webkit-box;
8 | display: -ms-flexbox;
9 | display: -webkit-flex;
10 | display: flex;
11 | -webkit-box-direction: normal;
12 | -webkit-box-orient: horizontal;
13 | -webkit-flex-direction: row;
14 | -ms-flex-direction: row;
15 | flex-direction: row;
16 | -webkit-flex-wrap: nowrap;
17 | -ms-flex-wrap: nowrap;
18 | flex-wrap: nowrap;
19 | -webkit-box-pack: start;
20 | -webkit-justify-content: flex-start;
21 | -ms-flex-pack: start;
22 | justify-content: flex-start;
23 | -webkit-align-content: stretch;
24 | -ms-flex-line-pack: stretch;
25 | align-content: stretch;
26 | -webkit-box-align: stretch;
27 | -webkit-align-items: stretch;
28 | -ms-flex-align: stretch;
29 | align-items: stretch;
30 | }
31 |
32 | .columnParent{
33 | -webkit-box-orient: vertical;
34 | -webkit-flex-direction: column;
35 | -ms-flex-direction: column;
36 | flex-direction: column;
37 | }
38 |
39 | .flexChild{
40 | -webkit-box-flex: 1;
41 | -webkit-flex: 1;
42 | -ms-flex: 1;
43 | flex: 1;
44 | -webkit-align-self: auto;
45 | -ms-flex-item-align: auto;
46 | align-self: auto;
47 | }
48 |
--------------------------------------------------------------------------------
/css/reset.css:
--------------------------------------------------------------------------------
1 | /*
2 | html5doctor.com Reset Stylesheet
3 | v1.6.1
4 | Last Updated: 2010-09-17
5 | Author: Richard Clark - http://richclarkdesign.com
6 | Twitter: @rich_clark
7 | */
8 |
9 | html, body, div, span, object, iframe,
10 | h1, h2, h3, h4, h5, h6, p, blockquote, pre,
11 | abbr, address, cite, code,
12 | del, dfn, em, img, ins, kbd, q, samp,
13 | small, strong, sub, sup, var,
14 | b, i,
15 | dl, dt, dd, ol, ul, li,
16 | fieldset, form, label, legend,
17 | table, caption, tbody, tfoot, thead, tr, th, td,
18 | article, aside, canvas, details, figcaption, figure,
19 | footer, header, hgroup, menu, nav, section, summary,
20 | time, mark, audio, video {
21 | margin:0;
22 | padding:0;
23 | border:0;
24 | outline:0;
25 | font-size:100%;
26 | vertical-align:baseline;
27 | background:transparent;
28 | }
29 |
30 | body {
31 | line-height:1;
32 | }
33 |
34 | article,aside,details,figcaption,figure,
35 | footer,header,hgroup,menu,nav,section {
36 | display:block;
37 | }
38 |
39 | nav ul {
40 | list-style:none;
41 | }
42 |
43 | blockquote, q {
44 | quotes:none;
45 | }
46 |
47 | blockquote:before, blockquote:after,
48 | q:before, q:after {
49 | content:'';
50 | content:none;
51 | }
52 |
53 | a {
54 | margin:0;
55 | padding:0;
56 | font-size:100%;
57 | vertical-align:baseline;
58 | background:transparent;
59 | }
60 |
61 | /* change colours to suit your needs */
62 | ins {
63 | background-color:#ff9;
64 | color:#000;
65 | text-decoration:none;
66 | }
67 |
68 | /* change colours to suit your needs */
69 | mark {
70 | background-color:#ff9;
71 | color:#000;
72 | font-style:italic;
73 | font-weight:bold;
74 | }
75 |
76 | del {
77 | text-decoration: line-through;
78 | }
79 |
80 | abbr[title], dfn[title] {
81 | border-bottom:1px dotted;
82 | cursor:help;
83 | }
84 |
85 | table {
86 | border-collapse:collapse;
87 | border-spacing:0;
88 | }
89 |
90 | /* change border colour to suit your needs */
91 | hr {
92 | display:block;
93 | height:1px;
94 | border:0;
95 | border-top:1px solid #cccccc;
96 | margin:1em 0;
97 | padding:0;
98 | }
99 |
100 | input, select {
101 | vertical-align:middle;
102 | }
--------------------------------------------------------------------------------
/css/screen.css:
--------------------------------------------------------------------------------
1 | body{
2 | background-image: -o-linear-gradient(45deg, #1A658D 0%, #6CBFDA 100%);
3 | background-image: -moz-linear-gradient(45deg, #1A658D 0%, #6CBFDA 100%);
4 | background-image: -webkit-linear-gradient(45deg, #1A658D 0%, #6CBFDA 100%);
5 | background-image: -ms-linear-gradient(45deg, #1A658D 0%, #6CBFDA 100%);
6 | background-image: linear-gradient(135deg, #1A658D 0%, #6CBFDA 100%);
7 | background-attachment: fixed;
8 | text-align: center;
9 | }
10 |
11 | #header{
12 | margin: 0 auto;
13 | width: 311px;
14 | height: 80px;
15 | background-image: url( '../img/fibonacci_icon.png' );
16 | background-repeat: no-repeat;
17 | background-position: center left;
18 | background-size: contain;
19 | }
20 |
21 | h1, h2, span.action{
22 | font-family: Avenir, Helvetica, Arial, sans-serif;
23 | color: hsla(200,100%,90%,1);
24 | text-align: left;
25 | font-size: 2.5em;
26 | margin-top: 50px;
27 | padding-left: 90px;
28 | padding-top: 10px
29 | }
30 | h2{
31 | font-size: 1.6em;
32 | font-weight: normal;
33 | margin-top: -10px
34 | }
35 | span.action{
36 | padding: 0;
37 | font-size: 1em;
38 | margin: 13px;
39 | }
40 | div{
41 | outline: 1px solid hsla(200,100%,90%,0.2);
42 | background-color: hsla(200,100%,1%,0.1);
43 | }
44 | div.selected{
45 | background-color: hsla(0, 0%, 100%, 0.75);
46 | }
47 |
48 | #flexcanvas, #codeExportTextarea{
49 | width: 100%;
50 | height: 600px !important;
51 | position: absolute;
52 | top: 180px;
53 | }
54 | #flexcanvas div{
55 | min-height: 10px;
56 | min-width: 10px;
57 | }
58 | #codeExportTextarea{
59 | box-sizing: border-box;
60 | resize: none;
61 | border: none;
62 | background-color: hsla(200,100%,1%,0.6);
63 | padding: 50px;
64 | font-family: Courier;
65 | font-size: 16px;
66 | color: hsla(200,100%,90%,1);
67 | display: none;
68 | outline: none;
69 | overflow-y: scroll;
70 | text-align: left;
71 | white-space: pre-wrap;
72 | }
73 | #codeExportTextarea p{
74 | width: 600px;
75 | margin: 0 auto;
76 | margin-bottom: 15px;
77 | }
78 |
79 | #triggerHTMLCode, #triggerCSSCode, #triggerInfo{
80 | margin: 0 auto;
81 | margin-top: 675px;
82 | padding: 0 25px 0 25px;
83 | margin-bottom: 10px;
84 | opacity: 0.6
85 | }
86 | #splitControls{
87 | position: absolute;
88 | outline: none;
89 | background-color: transparent;
90 | }
91 | #splitControls img{
92 | margin: 15px 5px;
93 | opacity: 0.7;
94 | cursor: pointer;
95 | }
96 |
97 | #optionsBar{
98 | box-sizing: border-box;
99 | -webkit-box-flex: 0 0 auto;
100 | -webkit-flex: 0 0 auto;
101 | -ms-flex: 0 0 auto;
102 | flex: 0 0 auto;
103 | width: 200px;
104 | outline: 1px solid hsla(100, 100%, 100%, 0.6);
105 | box-shadow: 0 0 10px rgba(0,0,0,0.3);
106 | padding: 20px;
107 | background-color: hsla(100, 100%, 100%, 0.5);
108 | text-align: left;
109 | }
110 |
111 | #optionsBar img{
112 | cursor: pointer;
113 | margin: 5px;
114 | margin-bottom: 15px;
115 | }
116 |
117 | ::-webkit-input-placeholder { color:hsla(200,100%,90%,1); }
118 | ::-moz-placeholder { color:hsla(200,100%,90%,1); } /* firefox 19+ */
119 | :-ms-input-placeholder { color:hsla(200,100%,90%,1); } /* ie */
120 | input:-moz-placeholder { color:hsla(200,100%,90%,1); }
121 |
122 | #optionsBar label{
123 | font-family: Avenir;
124 | font-size: 1.05em;
125 | font-weight: bold;
126 | color: hsla(200,100%,100%,0.8);
127 | text-shadow: 0 -1px hsla(200,100%,0%,0.3);
128 | }
129 | #optionsBar select{
130 | width: 160px;
131 | margin-bottom: 15px;
132 | }
133 | #optionsBar input{
134 | box-sizing: border-box;
135 | width: 160px;
136 | height: 30px;
137 | -webkit-appearance: none;
138 | appearance: none;
139 | border: none;
140 | border-bottom: 2px solid hsla(200,100%,90%,1);
141 | border-right: 2px solid hsla(200,100%,90%,1);
142 | padding-right: 5px;
143 | background: none;
144 | font-family: Avenir;
145 | color: hsla(200,100%,10%,1);
146 | font-size: 1em;
147 | text-align: right;
148 | outline: none;
149 | }
150 |
151 | #optionsBar button{
152 | width: 160px;
153 | margin-bottom: 15px;
154 | font-family: Avenir;
155 | font-size: 1.05em;
156 | font-weight: bold;
157 | color: hsla(200,100%,100%,0.8);
158 | text-shadow: 0 -1px hsla(200,100%,0%,0.3);
159 | padding: 5px 15px;
160 | -webkit-appearance: none;
161 | appearance: none;
162 | border: none;
163 | outline: none;
164 | cursor: pointer;
165 | box-shadow: 0 0 0 1px hsla(100,100%,100%,0.2) inset, 0 0 0 1px hsla(200,100%,0%,0.1);
166 | border-radius: 5px;
167 | background-image: -o-linear-gradient(0deg, #1A658D 0%, #6CBFDA 100%);
168 | background-image: -moz-linear-gradient(0deg, #1A658D 0%, #6CBFDA 100%);
169 | background-image: -webkit-linear-gradient(0deg, #1A658D 0%, #6CBFDA 100%);
170 | background-image: -ms-linear-gradient(0deg, #1A658D 0%, #6CBFDA 100%);
171 | background-image: linear-gradient(0deg, #1A658D 0%, #6CBFDA 100%);
172 | }
173 |
174 | .disabled{
175 | opacity: 0.4;
176 | pointer-events: none;
177 | }
178 |
179 |
180 | footer{
181 | box-sizing: border-box;
182 | text-align: center;
183 | margin-top: 50px;
184 | width: 100%;
185 | height: 40px;
186 | padding: 15px;
187 | background-color: hsla(200,100%,90%,0.3);
188 | outline: 1px solid hsla(200,100%,90%,0.6);
189 | font-family: Avenir;
190 | color: hsla(200,100%,100%,0.8);
191 | }
192 |
193 | footer a{
194 | font-weight: bold;
195 | color: hsla(200,100%,100%,1);
196 | text-decoration: none;
197 | }
--------------------------------------------------------------------------------
/img/CSSFile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxsteenbergen/Fibonacci/abdb26ea9e6d961fb529823844718ee33eb8637f/img/CSSFile.png
--------------------------------------------------------------------------------
/img/HTMLFile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxsteenbergen/Fibonacci/abdb26ea9e6d961fb529823844718ee33eb8637f/img/HTMLFile.png
--------------------------------------------------------------------------------
/img/addhorizontal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxsteenbergen/Fibonacci/abdb26ea9e6d961fb529823844718ee33eb8637f/img/addhorizontal.png
--------------------------------------------------------------------------------
/img/addvertical.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxsteenbergen/Fibonacci/abdb26ea9e6d961fb529823844718ee33eb8637f/img/addvertical.png
--------------------------------------------------------------------------------
/img/expand.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxsteenbergen/Fibonacci/abdb26ea9e6d961fb529823844718ee33eb8637f/img/expand.png
--------------------------------------------------------------------------------
/img/fibonacci_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxsteenbergen/Fibonacci/abdb26ea9e6d961fb529823844718ee33eb8637f/img/fibonacci_icon.png
--------------------------------------------------------------------------------
/img/fibonacci_icon@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxsteenbergen/Fibonacci/abdb26ea9e6d961fb529823844718ee33eb8637f/img/fibonacci_icon@2x.png
--------------------------------------------------------------------------------
/img/fibonacci_icon_blue.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxsteenbergen/Fibonacci/abdb26ea9e6d961fb529823844718ee33eb8637f/img/fibonacci_icon_blue.png
--------------------------------------------------------------------------------
/img/fibonacci_icon_blue@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxsteenbergen/Fibonacci/abdb26ea9e6d961fb529823844718ee33eb8637f/img/fibonacci_icon_blue@2x.png
--------------------------------------------------------------------------------
/img/info.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxsteenbergen/Fibonacci/abdb26ea9e6d961fb529823844718ee33eb8637f/img/info.png
--------------------------------------------------------------------------------
/img/options.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxsteenbergen/Fibonacci/abdb26ea9e6d961fb529823844718ee33eb8637f/img/options.png
--------------------------------------------------------------------------------
/img/remove.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxsteenbergen/Fibonacci/abdb26ea9e6d961fb529823844718ee33eb8637f/img/remove.png
--------------------------------------------------------------------------------
/img/shrink.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxsteenbergen/Fibonacci/abdb26ea9e6d961fb529823844718ee33eb8637f/img/shrink.png
--------------------------------------------------------------------------------
/img/splithorizontal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxsteenbergen/Fibonacci/abdb26ea9e6d961fb529823844718ee33eb8637f/img/splithorizontal.png
--------------------------------------------------------------------------------
/img/splitvertical.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxsteenbergen/Fibonacci/abdb26ea9e6d961fb529823844718ee33eb8637f/img/splitvertical.png
--------------------------------------------------------------------------------
/img/trash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maxsteenbergen/Fibonacci/abdb26ea9e6d961fb529823844718ee33eb8637f/img/trash.png
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Fibonacci – Flexbox Composer
9 |
10 |
11 |
12 |
Fibonacci is an offshoot of an internal tool created to let non-developers design page layouts using Flexbox, without having to learn HTML or CSS.
' +
86 | '
Fibonacci starts with a blank <div>, which you can then split to your heart\'s content. It generates both the HTML and CSS needed to recreate the layout in your own pages. ' +
87 | 'After you\'ve made your horizontal or vertical split, you can then add a new sibling, shrink or expand, give it a fixed width/height, remove or split it again. ' +
88 | 'Remember to add a unit when you enter a fixed width or height!
' +
89 | '
Once you\'re happy with the layout, hit the export icons to copy the generated code and paste it wherever you need it in your own code.
' +
90 | '
Fibonacci does *not* use the Fibonacci sequence in any way, despite reports to the contrary. The reasoning behind the name is simple. While testing the tool, I divided the main container into a Fibonacci-esque structure. That\'s it. The structured reminded me of Fibonacci, I liked the ring of it, I called the tool Fibonacci. The End.
' +
91 | '
Tiny sidenote: Fibonacci is mostly a little sideproject and by no means perfect or bug free. Contributions are highly welcome :)