Skip to content
This repository has been archived by the owner on Jan 16, 2023. It is now read-only.

Commit

Permalink
change icon
Browse files Browse the repository at this point in the history
  • Loading branch information
theowenyoung committed Nov 23, 2022
1 parent ec52d0d commit e1e88de
Show file tree
Hide file tree
Showing 21 changed files with 22 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# ChangeLog

## 0.0.36

- Change Icon for adapting both light and dark mode
- Add Dark Mode Option

## 0.0.35

- Support Hacker News Modern Extension
Expand Down
Binary file modified assets/icon.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 assets/icon.xcf
Binary file not shown.
Binary file added assets/icon1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion scripts/generate-icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ import * as fs from "https://deno.land/[email protected]/fs/mod.ts";
import * as path from "https://deno.land/[email protected]/path/mod.ts";

async function main(){
{
const icon = await Deno.readFile(
'assets/icon.png',
);
await fs.ensureDir(path.join("src",'icons'));
// copy icon to dist
// await Deno.writeFile(getDistFilePath(siteIdentifier, "icon.png"), icon);
// generate apple-touch-icon
const sizes = [16,32,64,128,512]
const sizes = [16,32,48,64,128,512]
for (const size of sizes) {
const appleTouchIcon = await resize(icon, {
width: size,
Expand All @@ -25,6 +26,7 @@ async function main(){
},
);
}
}
}

main();
1 change: 1 addition & 0 deletions src/background/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ chrome.webRequest.onHeadersReceived.addListener(function(details) {
types: ['main_frame']
}, ['responseHeaders']);

let currentScheme = 'light'
chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
if (request.action === "getMainFramePageLanguageState") {
chrome.tabs.sendMessage(sender.tab.id, {
Expand Down
Binary file added src/icons/dark-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 src/icons/dark-icon-16.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 src/icons/dark-icon-32.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 src/icons/dark-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.
Binary file added src/icons/dark-icon-512.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 src/icons/dark-icon-64.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 modified src/icons/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 modified src/icons/icon-16.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 modified src/icons/icon-32.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 src/icons/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.
Binary file modified src/icons/icon-512.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 modified src/icons/icon-64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

"icons": {
"32": "/icons/icon-32.png",
"48": "/icons/icon-48.png",
"64": "/icons/icon-64.png",
"128": "/icons/icon-128.png"
},
Expand Down Expand Up @@ -80,6 +81,7 @@
"match_about_blank": true,
"js": ["/lib/languages.js", "/lib/config.js", "/lib/platformInfo.js"]
},

{
"matches": ["<all_urls>"],
"run_at": "document_end",
Expand Down
7 changes: 6 additions & 1 deletion src/options/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@ <h3 class="w3-wide"><b>Immersive Translate</b></h3>
</div>
<ul style="margin-right:0 !important;" id="neverTranslateSites" class="w3-ul w3-card-4 w3-margin w3-round list"></ul>
<br>
<p><b data-i18n="lblDarkMode">Dark mode</b></p>
<select id="darkMode" class="w3-select w3-margin">
<option value="auto" data-i18n="msgAutomatic">Automatic</option>
<option value="yes" data-i18n="msgYes">Yes</option>
<option value="no" data-i18n="msgNo">No</option>
</select>
<div class="w3-display-container w3-padding w3-margin-top">
<div class="w3-display-left">
<p><b data-i18n="msgIsShowDualLanguage">Show dual language?</b></p>
Expand Down Expand Up @@ -301,7 +307,6 @@ <h3 class="w3-wide"><b>Immersive Translate</b></h3>

</div>
</div>

<script src="/lib/languages.js"></script>
<script src="/lib/config.js"></script>
<script src="/lib/platformInfo.js"></script>
Expand Down
5 changes: 5 additions & 0 deletions src/options/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ twpConfig.onReady(function () {
fillLanguageList($("#addToNeverTranslateLangs"))
fillLanguageList($("#addToAlwaysTranslateLangs"))

$("#darkMode").onchange = (e) => {
twpConfig.set("darkMode", e.target.value);
updateDarkMode();
};
$("#darkMode").value = twpConfig.get("darkMode");
function enableDarkMode() {
if (!$("#darkModeElement")) {
const el = document.createElement("style")
Expand Down

0 comments on commit e1e88de

Please sign in to comment.