v1.4.0
This commit is contained in:
@@ -1,5 +1,14 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 1.4.0 (2025-08-31)
|
||||||
|
|
||||||
|
- intégration des drapeaux d'attaque dans la barre de menu principale
|
||||||
|
- suppression des tours gauche et droite sur les petits écrans
|
||||||
|
|
||||||
|
## 1.3.3 (2025-08-30)
|
||||||
|
|
||||||
|
- suppression du rouleau de notification dans l'onglet messages du menu
|
||||||
|
|
||||||
## 1.3.2 (2025-08-29)
|
## 1.3.2 (2025-08-29)
|
||||||
|
|
||||||
- correction du calcul du pourcentage des points troupes
|
- correction du calcul du pourcentage des points troupes
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"manifest_version": 3,
|
"manifest_version": 3,
|
||||||
"name": "KAplus",
|
"name": "KAplus",
|
||||||
"version": "1.3.2",
|
"version": "1.4.0",
|
||||||
|
|
||||||
"author": "Samuel Campos - netoik.io",
|
"author": "Samuel Campos - netoik.io",
|
||||||
"description": "Extension développée pour améliorer l'expérience de jeu KingsAge (fonctionne avec ou sans premium)",
|
"description": "Extension développée pour améliorer l'expérience de jeu KingsAge (fonctionne avec ou sans premium)",
|
||||||
|
@@ -1,3 +1,18 @@
|
|||||||
|
@keyframes blinking {
|
||||||
|
0%, 100% {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
50% {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width:1000px) {
|
||||||
|
#display_left, #display_right {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#banner_container {
|
#banner_container {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
@@ -10,17 +25,33 @@
|
|||||||
.shortcut-element {
|
.shortcut-element {
|
||||||
top: 148px !important;
|
top: 148px !important;
|
||||||
text-align: center !important;
|
text-align: center !important;
|
||||||
|
padding: 0 10px 0 12px !important;
|
||||||
|
}
|
||||||
|
.flag {
|
||||||
|
position: absolute;
|
||||||
|
top: 5px;
|
||||||
|
width: 50px;
|
||||||
|
opacity: 0.7;
|
||||||
}
|
}
|
||||||
.shortcut_container {
|
.shortcut_container {
|
||||||
float: none;
|
float: none;
|
||||||
display:
|
|
||||||
}
|
}
|
||||||
.shortcut_container:first-child {
|
.shortcut_container_left {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
.shortcut_container:last-child {
|
.shortcut_container_right {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
.shortcut_container_flag {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
.shortcut_container_flag_left {
|
||||||
|
left: 10px;
|
||||||
|
}
|
||||||
|
.shortcut_container_flag_right {
|
||||||
|
right: 15px;
|
||||||
|
}
|
||||||
.shortcut_element {
|
.shortcut_element {
|
||||||
margin: 0 !important;
|
margin: 0 !important;
|
||||||
padding: 0 !important;
|
padding: 0 !important;
|
||||||
@@ -28,13 +59,16 @@
|
|||||||
width: 70px !important;
|
width: 70px !important;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
.shortcut_container_flag .shortcut_element {
|
||||||
|
width: auto !important;
|
||||||
|
}
|
||||||
.shortcut_element_left, .shortcut_element_right, .shortcut_element_left_premium, .shortcut_element_right_premium {
|
.shortcut_element_left, .shortcut_element_right, .shortcut_element_left_premium, .shortcut_element_right_premium {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
.shortcut_element_center, .shortcut_element_center_premium {
|
.shortcut_element_center, .shortcut_element_center_premium {
|
||||||
background: none;
|
background: none;
|
||||||
float: none;
|
float: none;
|
||||||
diplay: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
.shortcut_element_marker, .shortcut_element_marker_premium {
|
.shortcut_element_marker, .shortcut_element_marker_premium {
|
||||||
background-image: none !important;
|
background-image: none !important;
|
||||||
@@ -46,15 +80,26 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
opacity: 0.7;
|
opacity: 0.7;
|
||||||
}
|
}
|
||||||
|
a.no_attack {
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
|
a.has_attack {
|
||||||
|
.shortcut_element_image {
|
||||||
|
animation: blinking 2s infinite;
|
||||||
|
}
|
||||||
|
.shortcut_element_desc {
|
||||||
|
color: #FFFFFF;
|
||||||
|
}
|
||||||
|
}
|
||||||
a:hover, a.has_notif {
|
a:hover, a.has_notif {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
a.has_notif .shortcut_element_image::after {
|
a.has_notif::after {
|
||||||
background-image: url("moz-extension://__MSG_@@extension_id__/images/notif.svg"), url("chrome-extension://__MSG_@@extension_id__/images/notif.svg");
|
background-image: url("moz-extension://__MSG_@@extension_id__/images/notif.svg"), url("chrome-extension://__MSG_@@extension_id__/images/notif.svg");
|
||||||
background-size: 13px 13px;
|
background-size: 13px 13px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: -13px;
|
top: -13px;
|
||||||
right: 3px;
|
right: -3px;
|
||||||
width: 13px;
|
width: 13px;
|
||||||
height: 13px;
|
height: 13px;
|
||||||
content: "";
|
content: "";
|
||||||
|
@@ -30,6 +30,17 @@ function createRow(key, value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function shortcutElementReplace(elt, img, text) {
|
function shortcutElementReplace(elt, img, text) {
|
||||||
|
hyperlinkElements = elt.getElementsByTagName("a");
|
||||||
|
if (hyperlinkElements.length == 2) {
|
||||||
|
hyperlinkElements[0].remove();
|
||||||
|
elt.getElementsByTagName("a")[0].classList.add("has_notif");
|
||||||
|
}
|
||||||
|
imageElements = elt.getElementsByTagName("img");
|
||||||
|
if (imageElements.length == 1 && imageElements[0].getAttribute("src").endsWith("new_report.png")) {
|
||||||
|
imageElements[0].remove();
|
||||||
|
elt.getElementsByTagName("a")[0].classList.add("has_notif");
|
||||||
|
}
|
||||||
|
|
||||||
spanImageElement = document.createElement("span");
|
spanImageElement = document.createElement("span");
|
||||||
spanImageElement.classList.add("shortcut_element_image");
|
spanImageElement.classList.add("shortcut_element_image");
|
||||||
|
|
||||||
@@ -37,12 +48,6 @@ function shortcutElementReplace(elt, img, text) {
|
|||||||
imgElement.setAttribute("src", chrome.runtime.getURL("images/"+img+".svg"));
|
imgElement.setAttribute("src", chrome.runtime.getURL("images/"+img+".svg"));
|
||||||
spanImageElement.appendChild(imgElement);
|
spanImageElement.appendChild(imgElement);
|
||||||
|
|
||||||
hyperlinkElements = elt.getElementsByTagName("a");
|
|
||||||
if (hyperlinkElements.length == 2) {
|
|
||||||
hyperlinkElements[0].remove();
|
|
||||||
elt.getElementsByTagName("a")[0].classList.add("has_notif");
|
|
||||||
}
|
|
||||||
|
|
||||||
hyperlinkElement = elt.getElementsByTagName("a")[0];
|
hyperlinkElement = elt.getElementsByTagName("a")[0];
|
||||||
hyperlinkElement.textContent = "";
|
hyperlinkElement.textContent = "";
|
||||||
hyperlinkElement.appendChild(spanImageElement);
|
hyperlinkElement.appendChild(spanImageElement);
|
||||||
@@ -55,6 +60,46 @@ function shortcutElementReplace(elt, img, text) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function shortcutElementAddFlag(elt, side) {
|
||||||
|
shortcutContainer = document.createElement("div");
|
||||||
|
shortcutContainer.classList.add("shortcut_container", "shortcut_container_flag", "shortcut_container_flag_"+side);
|
||||||
|
shortcutElement = document.createElement("div");
|
||||||
|
shortcutElement.classList.add("shortcut_element");
|
||||||
|
shortcutElementCenter = document.createElement("span");
|
||||||
|
shortcutElementCenter.classList.add("shortcut_element_center");
|
||||||
|
shortcutElementMarker = document.createElement("span");
|
||||||
|
shortcutElementMarker.classList.add("shortcut_element_marker");
|
||||||
|
|
||||||
|
hyperlink = document.createElement("a");
|
||||||
|
hyperlink.classList.add("no_attack");
|
||||||
|
|
||||||
|
spanImage = document.createElement("span");
|
||||||
|
spanImage.classList.add("shortcut_element_image");
|
||||||
|
image = document.createElement("img");
|
||||||
|
image.setAttribute("src", chrome.runtime.getURL("images/flag.svg"));
|
||||||
|
|
||||||
|
spanDesc = document.createElement("span");
|
||||||
|
spanDesc.classList.add("shortcut_element_desc");
|
||||||
|
|
||||||
|
layTowerAttacks = document.getElementsByClassName("lay_tower_"+side+"_top_attack");
|
||||||
|
if (layTowerAttacks.length == 1) {
|
||||||
|
hyperlink.setAttribute("href", layTowerAttacks[0].getElementsByTagName("a")[0].getAttribute("href"));
|
||||||
|
spanDesc.textContent = layTowerAttacks[0].textContent;
|
||||||
|
hyperlink.classList.add("has_attack");
|
||||||
|
hyperlink.classList.remove("no_attack");
|
||||||
|
}
|
||||||
|
|
||||||
|
spanImage.appendChild(image);
|
||||||
|
hyperlink.appendChild(spanImage);
|
||||||
|
hyperlink.appendChild(spanDesc);
|
||||||
|
shortcutElementMarker.appendChild(hyperlink);
|
||||||
|
shortcutElementCenter.appendChild(shortcutElementMarker);
|
||||||
|
shortcutElement.appendChild(shortcutElementCenter);
|
||||||
|
shortcutContainer.appendChild(shortcutElement);
|
||||||
|
elt.appendChild(shortcutContainer);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Improve main menu display */
|
||||||
layCastleTopElements = document.getElementsByClassName("lay_castle_top");
|
layCastleTopElements = document.getElementsByClassName("lay_castle_top");
|
||||||
if (layCastleTopElements.length == 1) {
|
if (layCastleTopElements.length == 1) {
|
||||||
shortcutElements = layCastleTopElements[0].getElementsByClassName("shortcut_element");
|
shortcutElements = layCastleTopElements[0].getElementsByClassName("shortcut_element");
|
||||||
@@ -65,8 +110,17 @@ if (layCastleTopElements.length == 1) {
|
|||||||
shortcutElementReplace(shortcutElements[4], "messages", "");
|
shortcutElementReplace(shortcutElements[4], "messages", "");
|
||||||
shortcutElementReplace(shortcutElements[5], "tools", "");
|
shortcutElementReplace(shortcutElements[5], "tools", "");
|
||||||
shortcutElementReplace(shortcutElements[6], "favorites", "");
|
shortcutElementReplace(shortcutElements[6], "favorites", "");
|
||||||
|
|
||||||
|
shortcutBar = layCastleTopElements[0].getElementsByClassName("shortcut-element")[0];
|
||||||
|
shortcutElementAddFlag(shortcutBar, "left");
|
||||||
|
shortcutElementAddFlag(shortcutBar, "right");
|
||||||
|
|
||||||
|
shortcutContainers = layCastleTopElements[0].getElementsByClassName("shortcut_container");
|
||||||
|
shortcutContainers[0].classList.add("shortcut_container_left");
|
||||||
|
shortcutContainers[2].classList.add("shortcut_container_right");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Display unit-points on user profile */
|
||||||
if (document.body.id === "info_player") {
|
if (document.body.id === "info_player") {
|
||||||
mainContentPane = document.getElementsByClassName("contentpane")[1];
|
mainContentPane = document.getElementsByClassName("contentpane")[1];
|
||||||
borderLists = mainContentPane.getElementsByClassName("borderlist");
|
borderLists = mainContentPane.getElementsByClassName("borderlist");
|
||||||
@@ -95,6 +149,7 @@ if (document.body.id === "info_player") {
|
|||||||
playerPropertiesTable.appendChild(createRow("% points troupes:", armyPercent));
|
playerPropertiesTable.appendChild(createRow("% points troupes:", armyPercent));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Display unit-points on village overview */
|
||||||
if (document.body.id === "overview") {
|
if (document.body.id === "overview") {
|
||||||
settlements = document.getElementById("settlement").textContent.split("|");
|
settlements = document.getElementById("settlement").textContent.split("|");
|
||||||
noborderRows = document.getElementsByClassName("noborder");
|
noborderRows = document.getElementsByClassName("noborder");
|
||||||
|
Reference in New Issue
Block a user