Skip to content

Commit c0209da

Browse files
committed
chore(example): Update css
1 parent e90184e commit c0209da

File tree

2 files changed

+44
-24
lines changed

2 files changed

+44
-24
lines changed

examples/1.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,14 @@
88
#content {
99
width: 100%;
1010
background: #eee;
11+
padding-bottom: 200px;
12+
}
13+
.layoutRoot {
14+
display: flex;
15+
flex-wrap: wrap;
1116
}
1217
.box {
18+
display: inline-block;
1319
background: #ccc;
1420
border: 1px solid black;
1521
text-align: center;
@@ -18,6 +24,7 @@
1824
margin-bottom: 10px;
1925
overflow: hidden;
2026
position: relative;
27+
margin: 20px;
2128
}
2229
.box .text {
2330
text-align: center;

test/TestLayout.jsx

Lines changed: 37 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -18,30 +18,43 @@ export default class TestLayout extends React.Component {
1818
return (
1919
<div>
2020
<button onClick={this.onClick} style={{'marginBottom': '10px'}}>Reset first element's width/height</button>
21-
<Resizable className="box" height={this.state.height} width={this.state.width} onResize={this.onResize}>
22-
<div className="box" style={{width: this.state.width + 'px', height: this.state.height + 'px'}}>
23-
<span className="text">{"Raw use of <Resizable> element. 200x200, no constraints."}</span>
24-
</div>
25-
</Resizable>
26-
<ResizableBox className="box" width={200} height={200}>
27-
<span className="text">{"<ResizableBox>, same as above."}</span>
28-
</ResizableBox>
29-
<ResizableBox className="box" width={200} height={200} draggableOpts={{grid: [25, 25]}}>
30-
<span className="text">Resizable box that snaps to even intervals of 25px.</span>
31-
</ResizableBox>
32-
<ResizableBox className="box" width={200} height={200} minConstraints={[150, 150]} maxConstraints={[500, 300]}>
33-
<span className="text">Resizable box, starting at 200x200. Min size is 150x150, max is 500x300.</span>
34-
</ResizableBox>
35-
<ResizableBox className="box box3" width={200} height={200} minConstraints={[150, 150]} maxConstraints={[500, 300]}>
36-
<span className="text">Resizable box with a handle that only appears on hover.</span>
37-
</ResizableBox>
38-
<ResizableBox className="box" width={200} height={200} lockAspectRatio={true}>
39-
<span className="text">Resizable square with a locked aspect ratio.</span>
40-
</ResizableBox>
41-
<ResizableBox className="box" width={200} height={120} lockAspectRatio={true}>
42-
<span className="text">Resizable rectangle with a locked aspect ratio.</span>
43-
</ResizableBox>
44-
21+
<div className="layoutRoot">
22+
<Resizable className="box" height={this.state.height} width={this.state.width} onResize={this.onResize}>
23+
<div className="box" style={{width: this.state.width + 'px', height: this.state.height + 'px'}}>
24+
<span className="text">{"Raw use of <Resizable> element. 200x200, no constraints."}</span>
25+
</div>
26+
</Resizable>
27+
<ResizableBox className="box" width={200} height={200}>
28+
<span className="text">{"<ResizableBox>, same as above."}</span>
29+
</ResizableBox>
30+
<ResizableBox className="box" width={200} height={200} draggableOpts={{grid: [25, 25]}}>
31+
<span className="text">Resizable box that snaps to even intervals of 25px.</span>
32+
</ResizableBox>
33+
<ResizableBox className="box" width={200} height={200} minConstraints={[150, 150]} maxConstraints={[500, 300]}>
34+
<span className="text">Resizable box, starting at 200x200. Min size is 150x150, max is 500x300.</span>
35+
</ResizableBox>
36+
<ResizableBox className="box box3" width={200} height={200} minConstraints={[150, 150]} maxConstraints={[500, 300]}>
37+
<span className="text">Resizable box with a handle that only appears on hover.</span>
38+
</ResizableBox>
39+
<ResizableBox className="box" width={200} height={200} lockAspectRatio={true}>
40+
<span className="text">Resizable square with a locked aspect ratio.</span>
41+
</ResizableBox>
42+
<ResizableBox className="box" width={200} height={120} lockAspectRatio={true}>
43+
<span className="text">Resizable rectangle with a locked aspect ratio.</span>
44+
</ResizableBox>
45+
<ResizableBox className="box" width={200} height={200} axis="x">
46+
<span className="text">Only resizable by "x" axis.</span>
47+
</ResizableBox>
48+
<ResizableBox className="box" width={200} height={200} axis="y">
49+
<span className="text">Only resizable by "y" axis.</span>
50+
</ResizableBox>
51+
<ResizableBox className="box" width={200} height={200} axis="both">
52+
<span className="text">Resizable ("both" axis).</span>
53+
</ResizableBox>
54+
<ResizableBox className="box" width={200} height={200} axis="none">
55+
<span className="text">Not resizable ("none" axis).</span>
56+
</ResizableBox>
57+
</div>
4558
</div>
4659
);
4760
}

0 commit comments

Comments
 (0)