Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions Assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@
transition: -webkit-transform 0.2s ease;
transition: transform 0.2s ease;
transition: transform 0.2s ease, -webkit-transform 0.2s ease;
cursor: pointer;
}
#main_news div:hover {
-webkit-transform: translateX(5px);
Expand Down Expand Up @@ -787,6 +788,8 @@

#floatingSearchBtn.move-up {
bottom: 80px;
-webkit-transition: bottom 0.1s ease-out;
transition: bottom 0.1s ease-out;
}

.search-popup-overlay {
Expand Down Expand Up @@ -1630,6 +1633,8 @@ input::placeholder {
right: 20px;
position: fixed;
z-index: 99;
-webkit-transition: bottom 0.1s ease-out;
transition: bottom 0.1s ease-out;
}

.app_top {
Expand Down Expand Up @@ -3553,4 +3558,15 @@ table {
.cost,
.recast {
text-align: center !important;
}

.fade-element {
opacity: 0;
visibility: hidden;
-webkit-transition: opacity 0.3s ease, visibility 0.3s ease;
transition: opacity 0.3s ease, visibility 0.3s ease;
}
.fade-element.visible {
opacity: 1;
visibility: visible;
}/*# sourceMappingURL=style.css.map */
2 changes: 1 addition & 1 deletion Assets/css/style.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Assets/css/style.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Assets/css/style.min.css.map

Large diffs are not rendered by default.

24 changes: 22 additions & 2 deletions Assets/js/CoreDB.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const DB_VERSION = "23.04.2026";
const DB_VERSION = "12.06.2026";
const CDN_URL = "https://cdn.ff14jobguide.ru";
async function loadUpdateFlags() {
try {
Expand Down Expand Up @@ -32,7 +32,7 @@ async function CORE_DB_LOAD(fileNames, version = Date.now()) {
const DB = {};
await Promise.all(
fileNames.map(async (file) => {
const path = `${file}?v${version}`;
const path = `${file}?v=${version}`;
try {
const res = await fetch(path);
const data = await res.json();
Expand All @@ -58,6 +58,8 @@ async function CORE_DB_LOAD(fileNames, version = Date.now()) {
}
});

dynamicMenus();

Object.keys(renderers).forEach((attr) => {
document.querySelectorAll(`[${attr}]`).forEach((el) => {
const key = el.getAttribute(attr);
Expand Down Expand Up @@ -255,3 +257,21 @@ function handleUrlScroll() {
console.error("Ошибка декодирования skill:", error);
}
}

function dynamicMenus() {
document.querySelectorAll(".clearfix_dynamic").forEach((ul) => {
const prefix = ul.dataset.prefix;
const name = ul.dataset.name;
const count = parseInt(ul.dataset.count, 10);

if (!prefix || !name || !count) return;

let listHtml = "";
for (let i = 1; i <= count; i++) {
const num = i.toString().padStart(2, "0");
listHtml += `<li><a href="#${prefix}_${num}" class="job_skill_icon" db-skill-menu="${name} ${num}"></a></li>\n`;
}

ul.innerHTML = listHtml;
});
}
105 changes: 61 additions & 44 deletions Assets/js/index.js
Original file line number Diff line number Diff line change
@@ -1,66 +1,83 @@
$(document).ready(function () {
fetch("https://api.github.com/repos/Murakumo-JP/FFXIVJobGuideRU/issues/3/comments")
document.addEventListener("DOMContentLoaded", () => {
const mainContent = document.querySelector(".main_content");
if (!mainContent) return;

fetch("/DB/Changelog.json")
.then((response) => response.json())
.then((news) => {
const newsMaxCount = 4;
const newsCount = Math.min(news.length, newsMaxCount);
const newsContainer = $(
`<div class="news">
<span>Новости обновления</span>
<div id="main_news"></div>
<div class="warn_info"></div>
</div>
<div class="news_popup">
<div id="newsPopup">
<h2 id="newsTitle"></h2>
<pre id="newsContent"></pre>
</div>
</div>`
);

$(".news_popup").append(newsContainer);
const newsHTML = `
<div class="news">
<span>ЖУРНАЛ ИЗМЕНЕНИЙ</span>
<div id="main_news"></div>
<div class="warn_info"></div>
</div>
<div class="news_popup">
<div id="newsPopup" style="display: none;">
<h2 id="newsTitle"></h2>
<pre id="newsContent"></pre>
</div>
</div>
`;

mainContent.insertAdjacentHTML("afterbegin", newsHTML);

if ($("#overlay").length === 0) {
$(".main_content").append('<div id="overlay"></div>');
if (!document.getElementById("overlay")) {
mainContent.insertAdjacentHTML("beforeend", '<div id="overlay" style="display: none;"></div>');
}

let html = "";
let linksHTML = "";
for (let i = news.length - 1; i >= news.length - newsCount; i--) {
const match = news[i].body.match(/## (.*?)(?:\r\n|\n\n)(.*)/);
const body = match ? match[1] : news[i].body.replace(/\r\n/g, "");
const date = new Date(news[i].created_at).toLocaleDateString();
const patch = news[i];
const date = patch.patch_date;
const title = `${patch.patch_name || "Обновление до патча"} ${patch.patch_version}`;

linksHTML += `<div><span>${date} - </span><a class="news-link" data-index="${i}">${title}</a></div>`;
}

html += `<div><span>${date} - </span><a href="#" class="news-link" data-index="${i}">${body}</a></div>`;
const mainNewsContainer = document.getElementById("main_news");
if (mainNewsContainer) {
mainNewsContainer.innerHTML = linksHTML;
}
$("#main_news").html(html);

$(".news-link").click(function (event) {
event.preventDefault();
const newsLinks = document.querySelectorAll(".news-link");
const newsPopup = document.getElementById("newsPopup");
const overlay = document.getElementById("overlay");
const newsTitle = document.getElementById("newsTitle");
const newsContent = document.getElementById("newsContent");

const index = $(this).data("index");
const currentNews = news[index];
const url = currentNews.html_url;
const match = currentNews.body.match(/## (.*?)(?:\r\n|\n\n)(.*)/);
const title = match ? match[1] : "Новость";
newsLinks.forEach((link) => {
link.addEventListener("click", (event) => {
event.preventDefault();

let content = currentNews.body
.replace(/!\[.*?\]\(\s*https?:\/\/github\.com\/user-attachments\/assets\/[0-9a-f-]+\s*\)\r?\n?/g, "")
.replace(/\(\s*(?:https?:\/\/github\.com\/[\w-]+\/[\w-]+\/commit\/)?[0-9a-f]{40}\s*\)/g, "")
.replace(/## Обновление до патча \d+\.\d+\r?\n?\s?/g, "")
.replace(/## Обновление сайта \d+\.\d+\r?\n?\s?/g, "");
const index = link.getAttribute("data-index");
const currentPatch = news[index];

$("#newsTitle").text(title);
$("#newsContent").text(content);
newsTitle.textContent = `Обновление до патча ${currentPatch.patch_version}`;
newsContent.textContent = currentPatch.patch_changelog.join("\n");

$("#newsPopup, #overlay").fadeIn();
if (newsPopup) newsPopup.style.display = "block";
if (overlay) overlay.style.display = "block";
});
});
})
.catch((error) => {
console.debug(error);
$("#main_news").empty();
console.debug("Не удалось загрузить changelog.json:", error);
const mainNewsContainer = document.getElementById("main_news");
if (mainNewsContainer) {
mainNewsContainer.innerHTML = "";
}
});
});

$(document).on("click", "#overlay", function () {
$("#newsPopup, #overlay").fadeOut();
document.addEventListener("click", (event) => {
if (event.target.id === "overlay") {
const newsPopup = document.getElementById("newsPopup");
const overlay = document.getElementById("overlay");

if (newsPopup) newsPopup.style.display = "none";
if (overlay) overlay.style.display = "none";
}
});
});
2 changes: 0 additions & 2 deletions Assets/js/jquery.min.js

This file was deleted.

Loading