You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
969 B

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. function applyDefaultStyle(element) {
  2. element.style.position = "fixed";
  3. element.style.zIndex = 99999999;
  4. element.style.color = "#FFF";
  5. element.style.backgroundColor = "rgba(0, 0, 0, 0.5)";
  6. element.style.padding = "0.25em 0.5ch";
  7. element.style.fontSize = "3vmax";
  8. }
  9. let mCalorieCount = document.createElement("div");
  10. mCalorieCount.id = "ykonsole-calorie-count";
  11. applyDefaultStyle(mCalorieCount);
  12. mCalorieCount.style.left = 0;
  13. mCalorieCount.style.top = 0;
  14. mCalorieCount.innerHTML = `
  15. <b>25</b>:<b>23</b>
  16. <br/>
  17. <b>883</b> kal
  18. `;
  19. document.body.append(mCalorieCount);
  20. let mResults = document.createElement("div");
  21. mResults.id = "ykonsole-result";
  22. applyDefaultStyle(mResults);
  23. mResults.style.right = 0;
  24. mResults.style.bottom = 0;
  25. mResults.style.textAlign = "right";
  26. mResults.innerHTML = `
  27. 5&nbsp;161<br/>
  28. 10&nbsp;332<br/>
  29. 15&nbsp;490<br/>
  30. 20&nbsp;712<br/>
  31. 25&nbsp;875<br/>
  32. `;
  33. document.body.append(mResults);
  34. chrome.storage.sync.get('color', ({color}) => {
  35. });