mirror of
https://github.com/voltbonn/profile-picture-generator.git
synced 2024-12-22 15:55:08 +00:00
images have url in their name and hashtagURL can be displayed
This commit is contained in:
parent
d9f131e163
commit
c57707b305
2 changed files with 12 additions and 6 deletions
|
@ -297,9 +297,10 @@ function App() {
|
||||||
*/}
|
*/}
|
||||||
|
|
||||||
<Editor
|
<Editor
|
||||||
background={originalPhoto}
|
backgroundURL={originalPhoto || empty_1x1}
|
||||||
backgroundRatio={originalPhotoRation}
|
backgroundRatio={originalPhotoRation}
|
||||||
foreground={frameURL}
|
frameURL={frameURL}
|
||||||
|
hashtagURL={hashtagURL || empty_1x1}
|
||||||
onChange={handleCordsChange}
|
onChange={handleCordsChange}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ let maxScale = 8;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function Editor({ onChange, background, backgroundRatio, foreground }) {
|
function Editor({ onChange, backgroundURL, backgroundRatio, frameURL, hashtagURL }) {
|
||||||
const editorRef = useRef(null)
|
const editorRef = useRef(null)
|
||||||
const backgroundImageRef = useRef(null)
|
const backgroundImageRef = useRef(null)
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ function Editor({ onChange, background, backgroundRatio, foreground }) {
|
||||||
set_add_x(0)
|
set_add_x(0)
|
||||||
set_add_y(0)
|
set_add_y(0)
|
||||||
set_scale(1)
|
set_scale(1)
|
||||||
}, [background])
|
}, [backgroundURL])
|
||||||
|
|
||||||
const handleMove = useCallback(event => {
|
const handleMove = useCallback(event => {
|
||||||
const prev_x = event.target.dataset.x * 1
|
const prev_x = event.target.dataset.x * 1
|
||||||
|
@ -206,7 +206,7 @@ function Editor({ onChange, background, backgroundRatio, foreground }) {
|
||||||
data-scale={scale}
|
data-scale={scale}
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
src={background}
|
src={backgroundURL}
|
||||||
ref={backgroundImageRef}
|
ref={backgroundImageRef}
|
||||||
alt=""
|
alt=""
|
||||||
className="background"
|
className="background"
|
||||||
|
@ -217,10 +217,15 @@ function Editor({ onChange, background, backgroundRatio, foreground }) {
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<img
|
<img
|
||||||
src={foreground}
|
src={frameURL}
|
||||||
alt=""
|
alt=""
|
||||||
className="foreground"
|
className="foreground"
|
||||||
/>
|
/>
|
||||||
|
<img
|
||||||
|
src={hashtagURL}
|
||||||
|
alt=""
|
||||||
|
className="hashtag"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue