Skip to content

Instantly share code, notes, and snippets.

@koyta
Created November 28, 2017 16:00
Show Gist options
  • Save koyta/2daa3abfa6b95cb46aa242ce7ab22c36 to your computer and use it in GitHub Desktop.
Save koyta/2daa3abfa6b95cb46aa242ce7ab22c36 to your computer and use it in GitHub Desktop.
dummy component
import React from "react";
const path = "http://194.87.239.90/fabric/images/3D/mannequin/1600x1600/";
const Dummy = props => {
const imgs = [];
for (let i = 1; i < props.imageCount + 1; i++) {
imgs.push(
<img
key={i}
src={`${path}${i}.png`}
className={`preview__dummy-img ${
props.img === i ? "dummy__img-active" : ""
}`}
alt="dummy"
/>
);
}
return (
<div
className="dummy"
onMouseLeave={props.onMouseLeave}
onMouseMove={props.onMouseMove}
onMouseUp={props.onMouseUp}
onMouseDown={props.onMouseDown}
onWheelCapture={props.onWheelCapture}
style={{
position: 'relaive',
transformOrigin: `50% ${props.imageYOffset}px`,
transform: `scale(${props.scaleCoefficient}) `
}}
>
{imgs}
<div className="wearing">
</div>
</div>
);
};
export default Dummy;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment