Skip to content

Commit

Permalink
UI adjustments to the chrome extnsion
Browse files Browse the repository at this point in the history
  • Loading branch information
jlucaspains committed Jan 16, 2025
1 parent 8148192 commit 200830c
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 10 deletions.
Binary file added browser-extensions/images/icon-128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added browser-extensions/images/icon-48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion browser-extensions/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,9 @@
"host_permissions": [
"https://sharpcooking.lpains.net/api/*",
"https://delightful-flower-0c3edd710-383.centralus.2.azurestaticapps.net/api/*"
]
],
"icons": {
"48": "images/icon-48.png",
"128": "images/icon-128.png"
}
}
24 changes: 18 additions & 6 deletions browser-extensions/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,35 @@
<title>Sharp Cooking Extension</title>
<style>
.container {
height: 5rem;
width: 10rem;
padding: 1rem;
}

.display-text {
min-width: 200px;
font-size: 1rem;
}

.mb-1 {
margin-bottom: 1rem;
}

.flex {
display: flex;
justify-content: center;
}

.result {
font-size: 2rem;
margin: auto;
}
</style>
</head>

<body>
<div class="container">
<div id="sharp-cooking-message">Trying to extract recipe. Please wait...</div>
<div id="sharp-cooking-code" class="result"></div>
<div id="qrcode"></div>
<div id="sharp-cooking-message" class="mb-1 display-text">Trying to extract recipe. Please wait...</div>
<div id="qrcode" class="mb-1 flex">
</div>
<div id="sharp-cooking-code" class="result flex"></div>
</div>
<script src="qrcode.js"></script>
<script src="popup.js">
Expand Down
2 changes: 1 addition & 1 deletion browser-extensions/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ chrome.runtime.onMessage.addListener(
function (request) {
if (request.contentScriptQuery == "parseRecipeResult") {
document.getElementById("sharp-cooking-code").innerHTML = request.code || "";
document.getElementById("sharp-cooking-message").innerHTML = request.error || "";
document.getElementById("sharp-cooking-message").innerHTML = request.error || "Please scan the QR code with your Sharp Cooking app to import the recipe.";

_ = new QRCode(document.getElementById("qrcode"), {
text: request.code,
Expand Down
3 changes: 2 additions & 1 deletion public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@
"changeLanguage": "Change Language",
"changeLanguageTitle": "Change recipe language",
"category": "Category",
"selectCategory": "Select category..."
"selectCategory": "Select category...",
"importFromShareQRCode": "Scan QR Code"
},
"gallery": {
"recipeImage": "Recipe Image"
Expand Down
3 changes: 2 additions & 1 deletion public/locales/pt/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@
"changeLanguage": "Alterar idioma",
"changeLanguageTitle": "Alterar idioma da receita",
"category": "Categoria",
"selectCategory": "Selecione categoria..."
"selectCategory": "Selecione categoria...",
"importFromShareQRCode": "Código QR"
},
"gallery": {
"recipeImage": "Imagem de Receita"
Expand Down

0 comments on commit 200830c

Please sign in to comment.