Browse Source

Optimizing the Profile Pic.

main
Vitor Pamplona 5 years ago
parent
commit
3eb63f3ba0
2 changed files with 10 additions and 2 deletions
  1. +0
    -1
      index.v5.html
  2. +10
    -1
      js/ui-utils.js

+ 0
- 1
index.v5.html View File

@ -227,7 +227,6 @@ DcJqR5clbAYlO9lHmvb4lsPLZHjugQ==
if (headers["photo-url"] && headers["photo-hash"]) {
const url = Base32URL.decodeAsString(headers["photo-url"]);
CRED.verifyEndPoint(url, headers["photo-hash"]).then(verified => {
console.log(verified);
if (verified) {
UIUtils.drawPicture(elemPref+'-code',url);
}


+ 10
- 1
js/ui-utils.js View File

@ -22,8 +22,17 @@ var UIUtils = {
imageObj.src = url.toLowerCase();
imageObj.onload = function() {
context.drawImage(imageObj,
e(element).width / 2 - imgDim.width / 2 +1,
e(element).width / 2 - imgDim.width / 2,
e(element).height / 5 - imgDim.height / 2,imgDim.width,imgDim.height);
const imgDim2= {width:e(element).width/10,height:e(element).width/10}; //logo dimention
var imageObj2 = new Image();
imageObj2.src = './img/ok-256.png';
imageObj2.onload = function() {
context.drawImage(imageObj2,
e(element).width / 2 - imgDim.width / 2 + imgDim2.width * 2,
e(element).height / 5 - imgDim.height / 2 + imgDim2.height * 2 , imgDim2.width,imgDim2.height);
};
};
}
},


Loading…
Cancel
Save