Skip to content

Commit da0f17b

Browse files
committed
use aspect ratio rather than height
1 parent fe97deb commit da0f17b

3 files changed

Lines changed: 4 additions & 14 deletions

File tree

src/components/STLViewer.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,12 @@ export interface Props {
5252
rotationZ?: number;
5353
className?: string;
5454
color?: string;
55+
aspectRatio?: string;
5556
}
5657

5758
export default function STLViewer({
5859
modelPath,
59-
height = "400px",
60+
aspectRatio = "1 / 1",
6061
cameraDistance = 2,
6162
cameraHeight = 45,
6263
autoRotate = true,
@@ -72,8 +73,7 @@ export default function STLViewer({
7273
className={className}
7374
style={{
7475
width: "100%",
75-
maxWidth: "800px",
76-
height,
76+
aspectRatio: aspectRatio,
7777
margin: "2rem auto",
7878
borderRadius: "8px",
7979
overflow: "hidden",

src/content/blog/2025-12-27-3d-printer.mdx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ _By: [MarcusP Printables](https://www.printables.com/model/3464-apple-watch-stan
6060
<STLViewer
6161
client:visible
6262
modelPath="/models/other/apple-watch-stand.stl"
63-
height="400px"
6463
rotationX={Math.PI * 1.5}
6564
cameraDistance={200}
6665
/>
@@ -71,7 +70,6 @@ _[Touch Mapper](https://touch-mapper.org/en/)_
7170
<STLViewer
7271
client:visible
7372
modelPath="/models/other/map.stl"
74-
height="500px"
7573
rotationX={Math.PI * 1.5}
7674
rotationZ={Math.PI}
7775
cameraDistance={300}
@@ -85,7 +83,6 @@ _By: [NotSure](https://www.printables.com/model/968016-ikea-raskog-sorter) and [
8583
<STLViewer
8684
client:visible
8785
modelPath="/models/other/ikea-raskog.stl"
88-
height="400px"
8986
rotationX={-Math.PI * 1.5}
9087
cameraHeight={300}
9188
cameraDistance={200}
@@ -101,7 +98,6 @@ _By: [motherfucker - cults3d](https://cults3d.com/en/3d-model/various/side-load-
10198
<STLViewer
10299
client:visible
103100
modelPath="/models/other/bottle-cage.stl"
104-
height="400px"
105101
rotationX={Math.PI * 1.5}
106102
rotationZ={Math.PI}
107103
cameraDistance={300}
@@ -119,7 +115,6 @@ _By: Brooke Hatton_
119115
<STLViewer
120116
client:visible
121117
modelPath="/models/brooke/helmet-hook.stl"
122-
height="300px"
123118
rotationX={Math.PI * 1.5}
124119
rotationZ={Math.PI * 1.5}
125120
cameraDistance={200}
@@ -134,7 +129,6 @@ _By: Brooke Hatton_
134129
<STLViewer
135130
client:visible
136131
modelPath="/models/brooke/maisie-hook.stl"
137-
height="300px"
138132
rotationX={Math.PI * 1.5}
139133
rotationZ={Math.PI}
140134
cameraDistance={150}
@@ -149,7 +143,6 @@ _By: Brooke Hatton_
149143
<STLViewer
150144
client:visible
151145
modelPath="/models/brooke/dehumidifier-cable-wrap.stl"
152-
height="400px"
153146
rotationX={Math.PI * 1.5}
154147
rotationZ={Math.PI}
155148
cameraDistance={180}
@@ -164,7 +157,6 @@ _By: Brooke Hatton_
164157
<STLViewer
165158
client:visible
166159
modelPath="/models/brooke/family-figures-box.stl"
167-
height="500px"
168160
rotationX={Math.PI * 1.5}
169161
cameraHeight={300}
170162
rotationZ={Math.PI}
@@ -181,7 +173,6 @@ _By: Brooke Hatton_
181173
<STLViewer
182174
client:visible
183175
modelPath="/models/brooke/ortlieb-webbing.stl"
184-
height="300px"
185176
rotationZ={Math.PI}
186177
cameraDistance={50}
187178
/>
@@ -195,7 +186,6 @@ _By: Brooke Hatton_
195186
<STLViewer
196187
client:visible
197188
modelPath="/models/brooke/airer-foot.stl"
198-
height="300px"
199189
rotationX={Math.PI * 1.5}
200190
rotationZ={Math.PI}
201191
cameraDistance={100}

src/styles/global.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ h4 {
6464

6565
p,
6666
ul,
67-
ol ul {
67+
ol ul, img {
6868
margin-bottom: 1.5rem;
6969
}
7070

0 commit comments

Comments
 (0)