Skip to content

Commit 0bce4ee

Browse files
author
hoang.tran12
committed
udpate UI + refactor
1 parent 7da283a commit 0bce4ee

File tree

5 files changed

+57
-15
lines changed

5 files changed

+57
-15
lines changed

popup/helpers/checkForUpdate.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ export async function checkForUpdate() {
2020
});
2121
updateBtn.setAttribute(
2222
"data-tooltip",
23-
t({ vi: "Đã có phiên bản mới", en: "Update available" })
23+
t({
24+
vi: "Đã có phiên bản mới v" + lastestVer,
25+
en: "Update available v" + lastestVer,
26+
})
2427
);
2528
updateBtn.setAttribute("data-flow", "bottom");
2629
updateBtn.onclick = () => {

popup/popup.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ <h3>
2929
</a>
3030
<br />
3131
<span id="version"></span>
32-
<button id="update-btn">(update)</button>
32+
<button id="update-btn" class="rainbow-bg">(update)</button>
3333
<p>Make with <i class="fa-solid fa-heart fa-beat" style="color:#ff0000a3"></i>
3434
by <a data-track="author" target="_blank" href="https://github.com/HoangTran0410">Hoang Tran</a>
3535
</p>

popup/styles/default.less

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ option {
159159
display: none;
160160
border: none;
161161
border-radius: 5px;
162-
padding: 3px;
162+
padding: 5px;
163163
color: @bg_body;
164164
background-color: @bg_update;
165165
font-weight: bold;
@@ -594,6 +594,32 @@ option {
594594
}
595595
}
596596

597+
// https://codepen.io/nohoid/pen/eYXpNL
598+
// https://codepen.io/pec-man/pen/xxKgxaN
599+
.rainbow-bg {
600+
background: linear-gradient(90deg, red, orange, yellow, green, blue, indigo, violet, indigo, blue, green, yellow, orange, red, red);
601+
background-size: 1000% 100%;
602+
animation: create-rainbow-gradient-shift 15s ease infinite;
603+
604+
color: white;
605+
text-shadow: 0 0 15px black;
606+
}
607+
608+
@keyframes create-rainbow-gradient-shift {
609+
0% {
610+
background-position: 0% 82%
611+
}
612+
613+
50% {
614+
background-position: 100% 19%
615+
}
616+
617+
100% {
618+
background-position: 0% 82%
619+
}
620+
}
621+
622+
597623
// https://www.cssportal.com/css-tooltip-generator/
598624
@keyframes tooltip-vert {
599625
to {

popup/tabs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,9 +487,9 @@ const tabs = [
487487
s.remove_tracking_in_url,
488488
s.prevent_closeBrowser_lastTab,
489489
s.chongLuaDao,
490-
s.createInvisibleText,
491490
s.shortenURL,
492491
s.unshorten,
492+
s.createInvisibleText,
493493
createTitle("--- Automation ---", "--- Tự động ---"),
494494
s.scrollToVeryEnd,
495495
s.screenshotFullPage,

scripts/createInvisibleText.js

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
export default {
22
icon: '<i class="fa-regular fa-eye-slash fa-lg"></i>',
33
name: {
4-
en: "Create invisible text",
4+
en: "Create invisible message",
55
vi: "Tạo tin nhắn tàng hình",
66
},
77
description: {
8-
en: "Create invisible text to hide messages. Receiver to use this feature to decode messages.",
8+
en: "Create invisible text to hide secret messages. Receiver to use this feature to decode messages.",
99
vi: "Tạo tin nhắn tàng hình, giúp ẩn đi thông tin quan trọng, người nhận cần dùng chức năng này để có thể giải mã.",
1010
},
1111

@@ -15,14 +15,15 @@ export default {
1515

1616
popupScript: {
1717
onClick: async () => {
18+
const { t } = await import("../popup/helpers/lang.js");
1819
Swal.fire({
1920
icon: "info",
20-
title: "Tin nhắn tàng hình",
21-
text: "Vui lòng chọn",
21+
title: t({ vi: "Tin nhắn tàng hình", en: "Invisible messages" }),
22+
text: t({ vi: "Vui lòng chọn", en: "Please choose" }),
2223
showDenyButton: true,
2324
showCancelButton: false,
24-
confirmButtonText: "Tạo tin nhắn",
25-
denyButtonText: "Giải mã tin nhắn",
25+
confirmButtonText: t({ vi: "Tạo tin nhắn", en: "Create message" }),
26+
denyButtonText: t({ vi: "Giải mã tin nhắn", en: "Decode message" }),
2627
}).then((result) => {
2728
if (result.isConfirmed) {
2829
doEncode();
@@ -34,17 +35,29 @@ export default {
3435
function doEncode() {
3536
Swal.fire({
3637
icon: "question",
37-
title: "Nhập tin nhắn",
38-
html: "Đặt ngoặc nhọn >< bao ngoài những nội dung muốn tành hình<br/><br/> Ví dụ: Hôm nay <b>>đi chơi không<</b> trời đẹp quá.",
38+
title: t({ vi: "Nhập tin nhắn", en: "Enter message" }),
39+
html: t({
40+
vi: "Đặt ngoặc nhọn >< bao ngoài những nội dung muốn tành hình<br/><br/> Ví dụ: Gọi tôi <b>>0123456789<</b> là Hoang.",
41+
en: "Wrap text in >< to hide message<br/><br/> Example: Call me <b>>0123456789, abc street<</b> Jane.",
42+
}),
3943
input: "textarea",
4044
showCancelButton: true,
4145
}).then((result) => {
4246
if (result.isConfirmed) {
4347
let encoded = encode(result.value);
4448
Swal.fire({
4549
icon: "success",
46-
title: "Tạo tin tàng hình thành công",
47-
html: result.value + "<br/> Bạn hãy copy và sử dụng nhé",
50+
title: t({
51+
vi: "Tạo tin tàng hình thành công",
52+
en: "Create invisible message successfully",
53+
}),
54+
html:
55+
result.value +
56+
"<br/><br/>" +
57+
t({
58+
vi: " Bạn hãy copy và sử dụng nhé",
59+
en: " Please copy and use",
60+
}),
4861
input: "textarea",
4962
inputValue: encoded,
5063
});
@@ -72,7 +85,7 @@ export default {
7285
} else {
7386
Swal.fire({
7487
icon: "info",
75-
title: "Tin nhắn này chưa được mã hoá",
88+
title: "Tin nhắn này không có nội dung tàng hình",
7689
text: result.value,
7790
});
7891
}

0 commit comments

Comments
 (0)