fix: chagne style

topwar
guofei 2024-11-15 18:27:26 +08:00
parent 18f9e61435
commit d4959a2260
1 changed files with 22 additions and 6 deletions

View File

@ -21,12 +21,18 @@ var configMap = {
width: "666px", width: "666px",
height: "321px", height: "321px",
offsetv: "4px", offsetv: "4px",
imgStyle: {
marginTop: '-5px',
},
}, },
"android-v": { "android-v": {
bkg: androidVPng, bkg: androidVPng,
width: "321px", width: "321px",
height: "666px", height: "666px",
offsetv: "5px", offsetv: "5px",
imgStyle: {
marginLeft: '2px',
},
}, },
"iphone-h": { "iphone-h": {
bkg: iphoneVPng, bkg: iphoneVPng,
@ -39,11 +45,11 @@ var configMap = {
}, },
"iphone-v": { "iphone-v": {
bkg: iphoneVPng, bkg: iphoneVPng,
width: "322px", width: "325px",
height: "693px", height: "690px",
styles: { styles: {
borderRadius: '13px' borderRadius: '13px'
} },
}, },
"ipad-h": { "ipad-h": {
bkg: ipadHPng, bkg: ipadHPng,
@ -52,7 +58,8 @@ var configMap = {
height: "478px", height: "478px",
offsetv: "5px", offsetv: "5px",
imgStyle: { imgStyle: {
transform: 'rotate(-90deg) translate(0, -3px)', marginTop: '-2px',
transform: 'translate(-50%, -50%) rotate(-90deg)',
}, },
styles: { styles: {
transform: "translate(-50%, -50%)", transform: "translate(-50%, -50%)",
@ -64,7 +71,8 @@ var configMap = {
height: "646px", height: "646px",
offsetv: "5px", offsetv: "5px",
imgStyle: { imgStyle: {
transform: 'translate(0, -2px)', marginTop: '-2px',
transform: 'translate(-50%, -50%)',
}, },
styles: { styles: {
transform: "translate(-50%, -50%)", transform: "translate(-50%, -50%)",
@ -152,7 +160,15 @@ function DeviceFrame(props) {
</Alert> </Alert>
</Snackbar> </Snackbar>
<div> <div>
<img src={config.bkg} alt="background" style={{ position: "relative", zIndex: 100, transform: config.rotate ? "rotate(-90deg)" : "", pointerEvents: 'none', ...config.imgStyle }} /> <img src={config.bkg} alt="background" style={{
position: "absolute",
top: "50%",
left: "50%",
zIndex: 100,
transform: `translate(-50%, -50%) ${config.rotate ? "rotate(-90deg)" : ''}`,
pointerEvents: 'none',
...config.imgStyle
}} />
{props.htmlUrl && ( {props.htmlUrl && (
<iframe <iframe
id="deviceFrame" id="deviceFrame"