forked from brycepj/flexbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
executable file
·259 lines (209 loc) · 10.9 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
<!DOCTYPE html>
<html class="no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="icon" type="image/png" href="myicon.png">
<title>flexbox in 5 minutes</title>
<meta name="description" content="take an interactive tour through all the major features of the new flexbox CSS property.">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/build/style.css">
<link href="//fonts.googleapis.com/css?family=Arvo:400,700|PT+Sans" rel='stylesheet' type='text/css'>
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
<script type="text/javascript" charset="utf-8" src="js/lib/modernizr.js"></script>
</head>
<body id="flexbox-app">
<div class="masthead">
<h1 class="mh-logo">flexbox in 5 minutes</h1>
<p class="mh-desc">an interactive tour of all the major features of the new CSS property: flexbox.</p>
<div class="mh-cond-content">
<h2 class="mh-desc">What can you do here?</p>
<ul>
<li>Take a step-by-step tour through the main properties of flexbox, including a few demos</li>
<li>Play to your heart's content, changing properties of the flex container and individual flex items</li>
<li>Copy and paste live code samples from whatever you create</li>
</ul>
<p class="mh-warning"></p>
</div>
<a href="https://twitter.com/share" class="twitter-share-button" data-url="http://devbryce.com/site/flexbox"
data-text="flexbox in 5 minutes">Tweet</a>
<script>!function (d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0], p = /^http:/.test(d.location) ? 'http' : 'https';
if (!d.getElementById(id)) {
js = d.createElement(s);
js.id = id;
js.src = p + '://platform.twitter.com/widgets.js';
fjs.parentNode.insertBefore(js, fjs);
}
}(document, 'script', 'twitter-wjs');</script>
</div>
<div id="flex-container-wrap" class="flex-container-wrap">
<div id="flex-container" class="flex-container" data-bind="template: { name: 'flex-list', foreach: items },
style:{
display:cPropsCurrent.display,
flexWrap:cPropsCurrent.flexWrap,
flexDirection:cPropsCurrent.flexDirection,
justifyContent:cPropsCurrent.justifyContent,
alignContent:cPropsCurrent.alignContent,
alignItems:cPropsCurrent.alignItems,
backgroundColor:cPropsDefault.backgroundColor,
width:cPropsCurrent.width
}">
</div>
</div>
<aside class="sidebar">
<div id="message-box" class="message-box">
<span class="mb-title">tour</span>
<span class="mb-progress" data-bind="text:tourBox.tourProgress"></span>
<p class="mb-content" data-bind="html:tourBox.currentMessage"></p>
<a class="mb-action" href="#" target="_blank"
data-bind="visible:tourBox.hasButton,text:tourBox.currentXText,attr: {href:tourBox.currentXUrl}"></a>
<a class="mb-action" href="#" target="_blank"
data-bind="visible:tourBox.currentAction,click:tourAction,text:tourBox.currentXText">do it!</a>
<nav class="mb-nav">
<a href="#" data-bind="click:tourPrevious"><i class="fa fa-chevron-left"></i></a>
<a href="#" data-bind="click:tourNext"><i class="fa fa-chevron-right"></i></a>
</nav>
</div>
<div class="control-panel">
<span class="cp-title">control panel</span>
<div class="cp-wrap">
<div class="cp-items">
<span class="cp-c-title">new item</span>
<div class="cp-i-add-remove">
<a class="cp-i-add" data-bind="click:newItem"><i class="fa fa-plus"></i></a>
<a class="cp-i-remove" data-bind="click:oneLessItem"><i class="fa fa-minus"></i></a>
</div>
<div class="cp-i-settings">
<div class="cp-i-s-width">
<label for="fixed">fixed<input data-bind="checked:flexType" type="radio" name="flexType"
value="fixed" checked/></label>
<label for="flexy">flexible<input data-bind="checked:flexType" type="radio" name="flexType"
value="flexy"/></label>
</div>
<label for="">lorem? <input data-bind="value:loremCount" type="text"/></label>
</div>
<div class="cp-actions">
<a href="#" data-bind="click:destroyAll">delete all</a>
<a href="#" data-bind="click:tourResize">resize box</a>
</div>
</div>
<div class="cp-container">
<span class="cp-c-title">container properties</span>
<label>flex-direction: <select
data-bind="options:flexDirectionOptions, value:cPropsCurrent.flexDirection"></select> </label>
<label>flex-wrap: <select data-bind="options:flexWrapOptions, value:cPropsCurrent.flexWrap"></select>
</label>
<label>justify-content: <select
data-bind="options:justifyContentOptions, value:cPropsCurrent.justifyContent"></select> </label>
<label>align-items: <select
data-bind="options:alignItemsOptions, value:cPropsCurrent.alignItems"></select> </label>
<label>align-content: <select
data-bind="options:alignContentOptions, value:cPropsCurrent.alignContent"></select> </label>
</div>
</div>
</div>
<div class="code-box">
<span class="cb-title">code samples</span>
<div class="cb-item">
<code>
<pre>
.flex-container {
display:flex;
flex-direction: <span data-bind="text:cPropsCurrent.flexDirection"></span>;
flex-wrap: <span data-bind="text:cPropsCurrent.flexWrap"></span>;
justify-content: <span data-bind="text:cPropsCurrent.justifyContent"></span>;
align-content: <span data-bind="text:cPropsCurrent.alignContent"></span>;
align-items: <span data-bind="text:cPropsCurrent.alignItems"></span>;
}
</pre>
</code>
</div>
<div class="cb-item">
<code>
<pre>
.flex-items-default {
width: <span data-bind="text:iPropsDefault.width">null</span>;
height: <span data-bind="text:iPropsDefault.height">null</span>;
flex-grow: <span data-bind="text:iPropsDefault.flexGrow">null</span>;
flex-shrink: <span data-bind="text:iPropsDefault.flexGrow">null</span>;
flex-basis: <span data-bind="text:iPropsDefault.flexGrow">null</span>;
}
</pre>
</code>
</div>
<div class="code-box-items" data-bind="template: { name: 'code-box-items', foreach: items, as:'item' }">
</div>
</div>
</aside>
<script type="template/knockout" id="flex-list">
<div class="flex-item animated" data-bind="style:{
height:iPropsCurrent.height,
width:iPropsCurrent.width,
margin:iPropsCurrent.margin,
flexGrow:iPropsCurrent.flexGrow,
flexShrink:iPropsCurrent.flexShrink,
flexBasis:iPropsCurrent.flexBasis,
alignSelf:iPropsCurrent.alignSelf
}">
<a href="#" class="fi-destroy-btn" data-bind="click:destroySelf"><i class="fa fa-times"></i></a>
<a href="#" class="fi-settings-btn" data-bind="click:toggleSettings, visible:tallEnough"><i class="fa fa-cog"></i></a>
<span class="fi-index" data-bind="text:index"></span>
<p class="fi-content" data-bind="visible:viewContent,text:content"></p>
<div class="fi-options" data-bind="visible:viewSettings">
<span class="fi-o-title"><a href="#"
data-bind="click:makeFixedWidth, style:{fontSize:highlightFixed}">fixed</a> or <a
href="#"
data-bind="click:makeFlexyWidth, style:{fontSize:highlightFlexy}">flexy</a> width?</span>
<div class="fi-options-fixed" data-bind="visible:isFixedWidth"><label>width: <input type="text"
data-bind="enable:isFixedWidth, value:iPropsCurrent.width"></label>
<label>height: <input type="text" data-bind="enable:isFixedWidth, value:iPropsCurrent.height"></label>
</div>
<div class="fi-options-flexy" data-bind="visible:isFlexyWidth">
<label>flex-grow: <input type="text"
data-bind="enable:isFlexyWidth, value:iPropsCurrent.flexGrow"></label>
<label for="">flex-shrink: <input type="text" data-bind="value:iPropsCurrent.flexShrink"></label>
<label for="">flex-basis: <input type="text" data-bind="value:iPropsCurrent.flexBasis"></label>
</div>
</div>
</div>
</script>
<script type="template/knockout" id="code-box-items">
<div class="cb-item">
<code>
<pre>
.flex-item-<span data-bind="text:item.index"></span> {
width: <span
data-bind="text:item.iPropsCurrent.width() ? item.iPropsCurrent.width() : '<property unused>'"></span><span
data-bind="visible:item.iPropsCurrent.width">;</span>
height: <span
data-bind="text:item.iPropsCurrent.height() ? item.iPropsCurrent.height() : '<property unused>'"></span><span
data-bind="visible:item.iPropsCurrent.height">;</span>
flex-grow: <span
data-bind="text:item.iPropsCurrent.flexGrow() ? item.iPropsCurrent.flexGrow() : '<property unused>'">null</span><span
data-bind="visible:item.iPropsCurrent.flexGrow">;</span>
flex-shrink: <span
data-bind="text:item.iPropsCurrent.flexShrink() ? item.iPropsCurrent.flexShrink() : '<property unused>'"></span><span
data-bind="visible:item.iPropsCurrent.flexShrink">;</span>
flex-basis: <span
data-bind="text:item.iPropsCurrent.flexBasis() ? item.iPropsCurrent.flexBasis() : '<property unused>'"></span><span
data-bind="visible:item.iPropsCurrent.flexBasis">;</span>
}
</pre>
</code>
</div>
</script>
<script type="text/javascript" charset="utf-8" src="js/lib/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="js/lib/knockout.js"></script>
<script type="text/javascript" charset="utf-8" src="js/main.js"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-39897695-2', 'devbryce.com');
ga('send', 'pageview');
</script>
<link rel="stylesheet" href="scss/vendors/_animate.scss"/>
</body>
</html>