Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pixel drawing missing when I changed grid pixel size #1

Open
patricibal opened this issue Jul 4, 2023 · 3 comments
Open

Pixel drawing missing when I changed grid pixel size #1

patricibal opened this issue Jul 4, 2023 · 3 comments

Comments

@patricibal
Copy link

Hello,

I loved using this and making my pixel drawings! I was wondering if there is a way to save your own pixel drawings/download it?

Also, when I finished my pixel drawings, I have noticed when I change the size of the pixel board, the drawing would disappear. And when I put the pixel board back to the original size I drew my pixel on (16 x 16), my pixel drawing was no longer there.

To replicate this:

  1. Go to https://araujodanield.github.io/odin-etch-a-sketch/
  2. Draw pixel on 16 x 16
  3. Change board to 22 x 22 and pixel is gone
  4. Go back to 16 x 16 and pixel is no longer there

Please let me know if this is something you will be working on and make updates, I would love to try this again.

Thank you,
Patrici Bal

@araujodanield
Copy link
Owner

Hello Patrici,

Thank you for your feedback! I'm glad you liked it and had fun testing my project.

About the drawing disappearing after changing the size of the pixel board, I remember that this was a functional feature in the first tests I did before starting to upload this repository, but when I started working on other features, I lost it at some point and I didn't notice until now.
Taking a quick look at the code is probably because the createPixels function has the following line: px.style.border = "1px solid rgba(0, 0, 0, 0.1)", which gives the pixels a black color with an opacity of 0.1 every time you update the pixel board. It seems simple to solve but I would have to look carefully to not break other functions or the board itself.

As for the save/download function, it's a very good idea that I confess I didn't have during the development of the project 😅. I use Opera GX as my default browser, so during my tests and times when I drew something cool, I just used its print screen function that allows you to select all or just a part of the screen.
To create these two features, the challenge for me would be learning how to convert the pixel board, which is a group of individual divs, into a JPEG or PNG image. I don't have this knowledge at the moment, but I'll do some research on this subject when I have some free time.

This year has been a little busy for me, working in different areas, so I don't have much free time to work on my projects. But I plan to come back to them soon and I already had plans to update this one with a new UI design, so I will definitely use this opportunity to implement your suggestions as well!

Thanks again for your feedback and compliments, and feel free to use this repository as a base or reference if you have plans to work on a similar project in the future!

All the best,
Daniel Araujo

@patricibal
Copy link
Author

Hi!

thank you for responding. I had another idea, you could have feature where people could share their pixels on social media e.g. twitter, Instagram stories, facebook, etc.

Kind regards,
Patrici

@araujodanield
Copy link
Owner

Good idea, I'll try to implement this as well!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants