// =============================
// CONFIG
// =============================
const FPS_THRESHOLDS = [30, 60, 120];
const COLORS = {
low: '#dc5356', // =120
};
// =============================
// DATA (نمونه — مقادیر را با سیستم خودتان جایگزین کنید)
// title: نام بازی، cover: لینک کاور، fps: {fhd, qhd, uhd}
// =============================
const GAMES = [
{ title: "Assassin's Creed Valhalla", cover: "https://exo.ir/image/cache/catalog/New_Template/Benchmark/Game-Cover/ac-Valhalla-300x300.png", fps: { fhd: 127, qhd: 97, uhd: 57 } },
{ title: "Battlefield V", cover: "https://exo.ir/image/cache/catalog/New_Template/Benchmark/Game-Cover/Battlefield-V-300x300.png", fps: { fhd: 243, qhd: 191, uhd: 111 } },
{ title: "Cyberpunk 2077", cover: "https://exo.ir/image/cache/catalog/New_Template/Benchmark/Game-Cover/CyberPunk2077-300x300.png", fps: { fhd: 116, qhd: 74, uhd: 33 } },
{ title: "DOOM Eternal", cover: "https://exo.ir/image/cache/catalog/New_Template/Benchmark/Game-Cover/Doom-Eternal-300x300.png", fps: { fhd: 338, qhd: 265, uhd: 158 } },
{ title: "Elden Ring", cover: "https://exo.ir/image/cache/catalog/New_Template/Benchmark/Game-Cover/Elden-Ring-300x300.png", fps: { fhd: 131, qhd: 103, uhd: 62 } },
{ title: "Far Cry 6", cover: "https://exo.ir/image/cache/catalog/New_Template/Benchmark/Game-Cover/Farcry6-300x300.png", fps: { fhd: 164, qhd: 126, uhd: 70 } },
{ title: "Forza Horizon 5", cover: "https://exo.ir/image/cache/catalog/New_Template/Benchmark/Game-Cover/Forza-Horizon-300x300.png", fps: { fhd: 145, qhd: 128, uhd: 89 } },
{ title: "God of War", cover: "https://exo.ir/image/cache/catalog/New_Template/Benchmark/Game-Cover/GOD-OF-WAR-300x300.png", fps: { fhd: 121, qhd: 99, uhd: 65 } },
{ title: "Red Dead Redemption 2", cover: "https://exo.ir/image/cache/catalog/New_Template/Benchmark/Game-Cover/RDRII-300x300.png", fps: { fhd: 116, qhd: 93, uhd: 59 } },
{ title: "The Callisto Protocol", cover: "https://exo.ir/image/cache/catalog/New_Template/Benchmark/Game-Cover/The-Callisto-Protocol-300x300.png", fps: { fhd: 103, qhd: 79, uhd: 51 } }
];
// =============================
// HELPERS
// =============================
function colorFor(value){
if (value >= FPS_THRESHOLDS[2]) return COLORS.pro;
if (value >= FPS_THRESHOLDS[1]) return COLORS.high;
if (value >= FPS_THRESHOLDS[0]) return COLORS.mid;
return COLORS.low;
}
function setCircle(el, value){
el.style.setProperty('--progress', Math.min(100, Math.max(0, (value/338)*100)) + '%'); // نرمالسازی ساده نسبت به بیشینهٔ نمونهها
el.style.setProperty('--color', colorFor(value));
}
function updateProgress(idx){
const game = GAMES[idx];
if(!game) return;
const cF = document.getElementById('c-fhd');
const cQ = document.getElementById('c-qhd');
const cU = document.getElementById('c-uhd');
const vF = document.getElementById('v-fhd');
const vQ = document.getElementById('v-qhd');
const vU = document.getElementById('v-uhd');
vF.textContent = game.fps.fhd; setCircle(cF, game.fps.fhd);
vQ.textContent = game.fps.qhd; setCircle(cQ, game.fps.qhd);
vU.textContent = game.fps.uhd; setCircle(cU, game.fps.uhd);
}
// =============================
// BUILD SLIDES
// =============================
const slidesWrap = document.getElementById('fps-slides');
GAMES.forEach((g) => {
const s = document.createElement('div');
s.className = 'slide swiper-slide';
s.setAttribute('data-title', g.title);
s.innerHTML = `
`;
slidesWrap.appendChild(s);
});
// =============================
// INIT SWIPER
// =============================
const glow = document.querySelector('#fps-swiper .glow');
const sw = new Swiper('#fps-swiper', {
grabCursor: true,
centeredSlides: true,
slidesPerView: 'auto',
spaceBetween: 40,
loop: true,
pagination: { el: '.swiper-pagination', clickable: true },
navigation: { nextEl: '#fps-next', prevEl: '#fps-prev' },
on: {
init(){ glow.classList.add('active'); updateProgress(this.realIndex); },
transitionStart(){ glow.classList.remove('active'); },
transitionEnd(){ glow.classList.add('active'); },
slideChange(){ updateProgress(this.realIndex); }
}
});
نقد و بررسیها
هنوز بررسیای ثبت نشده است.