Skip to content

Commit

Permalink
make responsive
Browse files Browse the repository at this point in the history
  • Loading branch information
eimrek committed Aug 8, 2024
1 parent efa7278 commit a9e8471
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 15 deletions.
5 changes: 3 additions & 2 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ function App() {

return (
<div className="App">
<StructureVisualizer cifText={cifText3D} />
<div style={{ margin: "10px" }}></div>
<div style={{ width: "450px", height: "450px", margin: "10px" }}>
<StructureVisualizer cifText={cifText3D} />
</div>
<StructureVisualizer cifText={cifText2D} initSupercell={[3, 3, 1]} />
</div>
);
Expand Down
19 changes: 10 additions & 9 deletions src/StructureVisualizer/ControlBox/index.css
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
.control-box {
position: relative;
z-index: 1;
height: 100px;
width: 450px;
background: rgb(250, 250, 250);
width: 100%;
background: #f8f8f8;
text-align: center;
border: 1px solid #999;
display: flex;
flex-wrap: wrap;
flex-direction: column;
justify-content: center;
align-items: start;
margin-top: -20px;
padding: 30px 10px 10px 10px;
border-radius: 5px;
margin-top: -5px;
padding: 15px 10px 10px 10px;
}

.supercell-container {
Expand All @@ -33,12 +33,13 @@

.control-box-row {
/* margin: 3px; */
padding: 4px 10px;
padding: 4px;
width: 100%;
line-height: inherit;
/* background-color: pink; */
display: flex;
justify-content: space-between;
flex-wrap: wrap;
justify-content: space-around;
align-items: stretch;
}

Expand All @@ -51,8 +52,8 @@
}

.camera-controls {
margin-left: auto;
margin-right: auto;
/* margin-left: auto;
margin-right: auto; */
display: inline-flex;
align-items: center;
justify-items: center;
Expand Down
13 changes: 11 additions & 2 deletions src/StructureVisualizer/StructureWindow/index.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
.structure-window-outer {
position: relative;
/* height: 100%; */
width: 100%;
flex: 1;
display: flex;
align-items: stretch;
}

.structure-window-click-handler {
width: 100%;
}

.structure-window {
position: relative;
z-index: 2;
height: 370px;
width: 450px;
height: 100%;
width: 100%;
background: white;
text-align: center;
border: 1px solid #999;
Expand Down
5 changes: 4 additions & 1 deletion src/StructureVisualizer/StructureWindow/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ class StructureWindow extends React.Component {
}
return (
<div className="structure-window-outer">
<div onClick={() => this.props.setMouseEnabledState(true)}>
<div
className="structure-window-click-handler"
onClick={() => this.props.setMouseEnabledState(true)}
>
<div className={swClassName}>
<Visualizer3dmol
ref={this.props.visualizerRef}
Expand Down
7 changes: 6 additions & 1 deletion src/StructureVisualizer/index.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
.structure-visualizer {
width: 450px;
width: 100%;
height: 100%;
min-height: 250px;
min-width: 250px;
font-size: 16px;
display: flex;
flex-direction: column;
}

0 comments on commit a9e8471

Please sign in to comment.