BrianHepler / MMM-Selfieshot

Taking a Selfie with USB cam on MagicMirror.
MIT License
8 stars 6 forks source link

More options #20

Closed Alexandre-Venditti69 closed 1 year ago

Alexandre-Venditti69 commented 1 year ago

Hello, thank you for this wonderful work. I'm not a coder but I would liked to use your work, and will code be added? I would liked to add something like "postlastphoto" function: open win popup, with 2 possibilities: to take a selfie, or send by mail, printer...do hoy think hoy can do somethings for me?

BrianHepler commented 1 year ago

Hmm. Displaying the last photo taken shouldn't be a problem. There already is an email function that will send the photo along as soon as it is taken. I'm not sure what is gained by sending that photo again.

I'll look into adding a notification to display the last photo taken.

Alexandre-Venditti69 commented 1 year ago

yes your module directly send by email. what I wanted to suggest is after displaying the photo result, open a popup that asks if they want to validate the photo => notification to sendmail or Re take the photo again => shoot function.

Alexandre-Venditti69 commented 1 year ago

La fin de votre module est if (showing) rd.classList.toggle("shown"); setTimeout(()=>{ if (showing) rd.classList.toggle("shown"); if (showing) con.classList.toggle("shown"); }, this.config.resultDuration);

Faire quelque chose comme :

if (showing) rd.classList.toggle("shown"); If ..{this.postLastPhoto(result); } setTimeout(()=>{ if (showing) rd.classList.toggle("shown"); if (showing) con.classList.toggle("shown"); }, this.config.resultDuration); postLastPhoto: function(result) {.. And this will open a window popup to chose what do you want.

Alexandre-Venditti69 commented 1 year ago

Cela viendrai à la fin de votre module : postLastPhoto : function () { var showing = true; var wrapper = document.createElement("div"); //wrapper.innerHTML = "Choose"; var icon = document.createElement('div'); icon1.id= "RETRY"; icon2.id= "PRINT"; icon1.style.backgroundImage = "url(/...)"; icon2.style.backgroundImage = "url(/...)"; icon1.classList.add("busy"); icon2.classList.add("busy"); icon1.onclick = (event)=> { event.sendsocketNotification(SELFIE_RETRY)); }; icon2.onclick = (event)=> { event.sendsocketNotification(SELFIE_PRINT); wrapper.appendChild(icon1); wrapper.appendChild(icon2); }; else wrapper.className = "" return wrapper } wrapper.appendChild(icon) } printPhoto : fonction () { sendMail: function(filepath) }

Alexandre-Venditti69 commented 1 year ago

Et ajoutant ceci également : socketNotificationReceived: function(noti, payload) { if (noti == "SHOOT_RESULT") { this.postShoot(payload); } if (noti == "WEB_REQUEST") { this.shoot(payload); } if (noti == "SELFIE_AFTER") { this.postLastPhoto(payload); } if (noti == "SELFIE_RETRY") { this.shoot(payload); } if (noti == "SELFIE_PRINT") { this.printPhoto(payload) },

BrianHepler commented 1 year ago

Huh. Interesting work. If you roll that into a pull request, I can add it to the main branch.

Alexandre-Venditti69 commented 1 year ago

Huh. Interesting work. If you roll that into a pull request, I can add it to the main branch.

I'm going to work on this most seriously, and I'm coming back to share my work with you. Thank you for your support.