MediaWiki:Common.js
Ir para navegação
Ir para pesquisar
Nota: Após salvar, você pode ter que limpar o "cache" do seu navegador para ver as alterações.
- Firefox / Safari: Pressione Shift enquanto clica Recarregar, ou pressione Ctrl-F5 ou Ctrl-R (⌘-R no Mac)
- Google Chrome: Pressione Ctrl-Shift-R (⌘-Shift-R no Mac)
- Internet Explorer/Edge: PressioneCtrl enquanto clica Recarregar, ou Pressione Ctrl-F5
- Opera: Pressione Ctrl-F5.
$(document).ready(function() { //------- TOOLTIP IMAGE--------- /* Tooltip image consiste em uma funcionalidade que insere uma tag IMG quando o usuario passa o mouse por cima de uma imagem com a classe "tooltip-image" ao fazer é inserido no body uma tag IMG com a mesma "src" 1.3 vezes maior do que a imagem que o usuario está com o mouse em coma, esta tag IMG terá o mesmo X e Y do mouse + um offset para manter um distanciamento. */ //Distanciamento / margem do mouse const offset = { x: 20, y: 10 }; $('.tooltip-image').on('mouseenter', function(e) { var src = $(this).attr('src'); var size = $(this).width() * 1.3; $('<img src="'+ src +'" id="bigImage" />').css('left', e.pageX + offset.x).css('top', e.pageY + offset.y).css('width', size + "px").appendTo('body').hide().fadeIn(500); }).on('mouseleave', function(){ $('#bigImage').remove(); }); $('.tooltip-image').mousemove(function(e) { $('#bigImage').css('left', e.pageX + offset.x).css('top', e.pageY + offset.y); }); //------- TOOLTIP IMAGE--------- //------- FUNCIONALIDADES PACIENTES KUREHA --------- const pacients = { "bafo":{ image: "/images/c/ce/Bafo_static.png", gif: "/images/e/e0/Bafo.gif"}, "espirrando": { image: "/images/thumb/5/5b/Espirro_static.png/180px-Espirro_static.png", gif: "/images/thumb/9/90/Espirro.gif/180px-Espirro.gif "}, "enjoado": { image: "/images/thumb/5/52/Enjoado_static.png/180px-Enjoado_static.png", gif: "/images/thumb/7/76/Enjoado.gif/180px-Enjoado.gif"}, "tremendo": { image: "/images/thumb/3/35/Tremendo_static.png/180px-Tremendo_static.png", gif: "/images/thumb/f/f4/Tremendo.gif/180px-Tremendo.gif"}, "tossindo": { image: "/images/thumb/e/ef/Tosse_static.png/180px-Tosse_static.png", gif: "/images/thumb/a/a4/Tosse.gif/180px-Tosse.gif"}, "solucando": { image: "/images/thumb/c/c0/Soluco_static.png/180px-Soluco_static.png", gif: "/images/thumb/6/67/Soluco.gif/180px-Soluco.gif"}, "funk": { image: "/images/thumb/e/e8/Funkeiro_static.png/180px-Funkeiro_static.png ", gif: "/images/thumb/7/79/Funkeiro.gif/180px-Funkeiro.gif"}, "fedendo": { image: "/images/thumb/1/1e/Fedido_static.png/180px-Fedido_static.png", gif: "/images/thumb/c/c9/Fedido.gif/180px-Fedido.gif"}, "febre": { image: "/images/thumb/1/14/Febre_static.png/180px-Febre_static.png", gif: "/images/thumb/7/75/Febre.gif/180px-Febre.gif"} }; $('.interactive-pacient').on('mouseenter', function (e){ id = $(this).attr('id'); if(pacients[id]) $(this).attr('src', pacients[id].gif); }).on('mouseleave', function(e){ id = $(this).attr('id'); if(pacients[id]) $(this).attr('src', pacients[id].image); }); //------- FUNCIONALIDADES PACIENTES KUREHA --------- //------- COUNTDOWN MAINPAGE--------- /* O countdown é um codigo pega a data e hora do computador do usuario e aplica um calculo para adaptar o mesmo ao fuso horario de brasilia, após isso ele verifica os eventos do dia começa uma contagem regressiva com base na diferença do horario do computador do usuario com a do evento. */ const timer = $('#event-time'); const eventImage = $('.event-image'); //Informações dos eventos /* 0 - Sunday 1 - Monday 2 - Tuesday 3 - Wednesday 4 - Thursday 5 - Friday 6 - Saturday */ const eventsInfo = { 0: [ {name: 'Foxy race (ship)', time: '09:30:00', src: '/images/c/c0/Event_ship.png'}, {name: 'Foxy count', time: '15:00:00', src: '/images/e/e4/Event_count.png'}, {name: 'Foxy quiz', time: '19:00:00', src: '/images/6/6f/Event_quiz.png'}, {name: 'Deathmatch', time: '22:00:00', src: '/images/8/84/Event_dm.png'}, ], 1: [ {name: 'Foxy count', time: '09:30:00', src: '/images/e/e4/Event_count.png'}, {name: 'Foxy quiz', time: '15:00:00', src: '/images/6/6f/Event_quiz.png'}, {name: 'Deathmatch', time: '19:00:00', src: '/images/8/84/Event_dm.png'}, {name: 'Foxy race (ship)', time: '22:00:00', src: '/images/c/c0/Event_ship.png'}, ], 2: [ {name: 'Foxy quiz', time: '09:30:00', src: '/images/6/6f/Event_quiz.png'}, {name: 'Deathmatch', time: '15:00:00', src: '/images/8/84/Event_dm.png'}, {name: 'Foxy race', time: '19:00:00', src: '/images/0/03/Event_race.png'}, {name: 'Foxy count', time: '22:00:00', src: '/images/e/e4/Event_count.png'}, ], 3: [ {name: 'Deathmatch', time: '09:30:00', src: '/images/8/84/Event_dm.png'}, {name: 'Foxy race (ship)', time: '15:00:00', src: '/images/c/c0/Event_ship.png'}, {name: 'Foxy count', time: '19:00:00', src: '/images/e/e4/Event_count.png'}, {name: 'Foxy quiz', time: '22:00:00', src: '/images/6/6f/Event_quiz.png'}, ], 4: [ {name: 'Foxy race', time: '09:30:00', src: '/images/0/03/Event_race.png'}, {name: 'Foxy count', time: '15:00:00', src: '/images/e/e4/Event_count.png'}, {name: 'Foxy quiz', time: '19:00:00', src: '/images/6/6f/Event_quiz.png'}, {name: 'Deathmatch', time: '22:00:00', src: '/images/8/84/Event_dm.png'}, ], 5: [ {name: 'Foxy count', time: '09:30:00', src: '/images/e/e4/Event_count.png'}, {name: 'Foxy quiz', time: '15:00:00', src: '/images/6/6f/Event_quiz.png'}, {name: 'Deathmatch', time: '19:00:00', src: '/images/8/84/Event_dm.png'}, {name: 'Foxy race (ship)', time: '22:00:00', src: '/images/c/c0/Event_ship.png'}, ], 6: [ {name: 'Foxy quiz', time: '09:30:00', src: '/images/6/6f/Event_quiz.png'}, {name: 'Deathmatch', time: '15:00:00', src: '/images/8/84/Event_dm.png'}, {name: 'Foxy race', time: '19:00:00', src: '/images/0/03/Event_race.png'}, {name: 'Foxy count', time: '22:00:00', src: '/images/e/e4/Event_count.png'}, ] }; const brazilOffset = -3; const eventTime = new Date(); const eventStarting = new Date(); var haveEvent = false; function pad(d) { return (d < 10) ? '0' + String(d) : String(d); } function startTimer(eventTime, name){ interval = setInterval(function() { const now = new Date().getTime(); const distance = eventTime.getTime() - now; if(distance > 0){ const hour = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); const minute = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); const seconds = Math.floor((distance % (1000 * 60)) / 1000); timer.html(pad(hour) + ":" + pad(minute) + ":" + pad(seconds)); }else { haveEvent = false; setDayEvents(); clearInterval(interval); } }, 1000); } function setDayEvents () { const date = new Date(); const dayEvents = eventsInfo[date.getDay()]; const utcTime = date.getTime() + (date.getTimezoneOffset() * 60000); const currentTime = new Date(utcTime + (3600000 * brazilOffset)); $.each(dayEvents, function (key, item) { split = item.time.split(":"); eventTime.setHours(split[0], split[1], split[2]); eventStarting.setHours(split[0], (Number(split[1]) + 1), split[2]); if(currentTime.getTime() <= eventTime.getTime()){ eventImage.attr('src', item.src); haveEvent = true; startTimer(eventTime, name); return false; }else if(currentTime.getTime() > eventTime.getTime() && currentTime.getTime() < eventStarting.getTime()){ eventImage.attr('src', item.src); timer.html('O evento está começando!'); haveEvent = true; setTimeout(function(){ haveEvent = false; return false; }, 300000); } }); if(!haveEvent){ eventImage.attr('src', "/images/a/a5/AnyEvent.png"); timer.html(''); } } if(!haveEvent) setDayEvents(); //------- COUNTDOWN MAINPAGE--------- //------- PERSONAGENS --------- const characters = { 0: {name: "Alvida", types: ["fighter", "support"], link: "/Alvida",img: "/images/8/83/Card-alvida.png"}, 1: {name: "Buchi & Sham", types: ["slasher", "bruiser"], link: "/Buchi",img: "/images/0/0b/Card-buchi.png"}, 2: {name: "Cabaji", types: ["slasher", "dps"], link: "/Cabaji",img: "/images/9/9d/Card-cabaji.png"}, 3: {name: "Chew", types: ["shooter", "dps"], link: "/Chew",img: "/images/0/0f/Card-chew.png"}, 4: {name: "Eric", types: ["shooter", "slasher", "dps"], link: "/Eric",img: "/images/3/31/Card-eric.png"}, 5: {name: "Gin", types: ["fighter", "shooter", "dps"], link: "/Gin",img: "/images/1/18/Card-gin.png"}, 6: {name: "Goldenweek", types: ["support", "especialist"], link: "/Goldenweek",img: "/images/0/0e/Card-goldenweek.png"}, 7: {name: "Hatchan", types: ["slasher", "support"], link: "/Hatchan",img: "/images/3/31/Card-hatchan.png"}, 8: {name: "Jango", types: ["shooter", "support"], link: "/Jango",img: "/images/4/48/Card-jango.png"}, 9: {name: "Kuroobi", types: ["fighter", "tank"], link: "/Kuroobi",img: "/images/6/6a/Card-kuroobi.png"}, 10: {name: "Mohji", types: ["especialist", "bruiser"], link: "/Mohji",img: "/images/5/58/Card-mohji.png"}, 11: {name: "Morgan", types: ["slasher", "bruiser"], link: "/Morgan",img: "/images/4/43/Card-morgan.png"}, 12: {name: "Babe & Drophy", types: ["shooter", "bruiser"], link: "/Mr.4",img: "/images/9/90/Card-mr4.png"}, 13: {name: "Gem & Mikita", types: ["shooter", "dps"], link: "/Mr.5",img: "/images/4/49/Card-mr5.png"}, 14: {name: "Pearl", types: ["fighter", "tank"], link: "/Pearl",img: "/images/d/de/Card-pearl.png"}, 15: {name: "Arlong", types: ["fighter", "bruiser"], link: "/Arlong",img: "/images/1/1e/Card-arlong.png"}, 16: {name: "Bepo", types: ["fighter", "dps"], link: "/Bepo",img: "/images/1/1d/Card-bepo.png"}, 17: {name: "Bon Clay", types: ["fighter", "dps"], link: "/mr.2",img: "/images/2/27/Card-bonchan.png"}, 18: {name: "Buggy", types: ["shooter", "dps"], link: "/buggy",img: "/images/c/ca/Card-buggy.png"}, 19: {name: "Daddy Masterson", types: ["shooter", "dps"], link: "/Daddy_Masterson",img: "/images/2/20/Card-daddy.png"}, 20: {name: "Daz Bonnez", types: ["slasher", "tank"], link: "/mr.1",img: "/images/6/61/Card-dazbonez.png"}, 21: {name: "Miss Doublefinger", types: ["slasher", "bruiser"], link: "/Miss_Doublefinger",img: "/images/5/5f/Card-doublefinger.png"}, 22: {name: "Don Krieg", types: ["shooter", "dps"], link: "/don_krieg",img: "/images/8/8f/Card-krieg.png"}, 23: {name: "Kuro", types: ["slasher", "dps"], link: "/kuro",img: "/images/3/3d/Card-kuro.png"}, 24: {name: "Galdino", types: ["especialist", "support"], link: "/mr.3",img: "/images/7/75/Card-mr3.png"}, 25: {name: "Tashigi", types: ["slasher", "dps"], link: "/tashigi",img: "/images/b/b8/Card-tashigi.png"}, 26: {name: "Nefertari Vivi", types: ["slasher", "support"], link: "/Nefertari_Vivi",img: "/images/9/9c/Card-vivi.png"}, 27: {name: "Wapol", types: ["shooter", "tank"], link: "/wapol",img: "/images/b/ba/Card-wapol.png"}, 28: {name: "Bartolomeo", types: ["especialist", "dps"], link: "/Bartolomeo",img: "/images/a/a9/Card-barto.png"}, 29: {name: "Hawkins", types: ["especialist", "bruiser"], link: "/Basil_Hawkins",img: "/images/8/89/Card-hawkins.png"}, 30: {name: "Bastille", types: ["slasher", "tank"], link: "/bastille",img: "/images/1/13/Card-bastille.png"}, 31: {name: "Bellamy", types: ["fighter", "dps"], link: "/bellamy",img: "/images/7/7e/Card-bellamy.png"}, 32: {name: "Bonney", types: ["fighter", "support"], link: "/Jewelry_Bonney",img: "/images/9/91/Card-bonney.png"}, 33: {name: "Brook", types: ["slasher", "support"], link: "/brook",img: "/images/7/76/Card-brook.png"}, 34: {name: "Capone", types: ["shooter", "dps"], link: "/capone_Bege",img: "/images/c/c0/Card-capone.png"}, 35: {name: "Carrot", types: ["slasher", "especialist", "dps"], link: "/Carrot",img: "/images/8/8d/Card-carrot.png"}, 36: {name: "Chopper", types: ["fighter", "support"], link: "/Tony_Tony_Chopper",img: "/images/1/19/Card-chopper.png"}, 37: {name: "Crocodile", types: ["specialist", "tank"], link: "/Crocodile",img: "/images/5/5d/Card-crocodile.png"}, 38: {name: "Dalmatian", types: ["fighter", "bruiser"], link: "/Dalmatian",img: "/images/9/99/Card-dalmatian.png"}, 39: {name: "Franky", types: ["shooter", "bruiser"], link: "/Franky",img: "/images/6/61/Card-franky.png"}, 40: {name: "Hina", types: ["fighter", "bruiser"], link: "/Hina",img: "/images/5/57/Card-hina.png"}, 41: {name: "Jesus Burguess", types: ["fighter", "tank"], link: "/Jesus_Burgess",img: "/images/2/28/Card-burgess.png"}, 42: {name: "Kid", types: ["shooter", "tank"], link: "/Eustass_Kid",img: "/images/9/9a/Card-kid.png"}, 43: {name: "Killer", types: ["slasher", "dps"], link: "/killer",img: "/images/b/b2/Card-killer.png"}, 44: {name: "Koala", types: ["fighter", "dps"], link: "/killer",img: "/images/f/f3/Card-koala.png"}, 45: {name: "Leo & Mansherry", types: ["especialist", "support"], link: "/Leo",img: "/images/d/d9/Card-leo.png"}, 46: {name: "Monkey D. Luffy", types: ["fighter", "bruiser"], link: "/luffy",img: "/images/a/af/Card-luffy.png"}, 47: {name: "Nami", types: ["especialist", "dps"], link: "/namy",img: "/images/0/08/Card-nami.png"}, 48: {name: "Perona", types: ["especialist", "support"], link: "/perona",img: "/images/6/6d/Card-perona.png"}, 49: {name: "Rebecca", types: ["slasher", "tank"], link: "/Rebecca",img: "/images/9/91/Card-rebecca.png"}, 50: {name: "Robin", types: ["especialist", "dps"], link: "/Nico_Robin",img: "/images/3/3f/Card-robin.png"}, 51: {name: "Ryuma", types: ["slasher", "dps"], link: "/Ryuma",img: "/images/a/ac/Card-ryuma.png"}, 52: {name: "Scratchmen Apoo", types: ["shooter", "support"], link: "/Scratchmen_Apoo",img: "/images/9/90/Card-apoo.png"}, 53: {name: "Smoker", types: ["fighter", "tank"], link: "/Smoker",img: "/images/f/fb/Card-smoker.png"}, 54: {name: "Trafalgar Law", types: ["slasher", "specialist", "bruiser"], link: "/Trafalgar_D._Law",img: "/images/b/b9/Card-law.png"}, 55: {name: "Urouge", types: ["fighter", "tank"], link: "/Urougue",img: "/images/9/98/Card-urouge.png"}, 56: {name: "Usopp", types: ["shooter", "dps"], link: "/Usopp",img: "/images/a/ac/Card-usopp.png"}, 57: {name: "Van Augur", types: ["shooter", "dps"], link: "/Van_Augur",img: "/images/c/c7/Card-vanaugur.png"}, 58: {name: "Ichiji", types: ["fighter", "bruiser"], link: "/Vinsmoke_Ichiji",img: "/images/8/8c/Card-ichiji.png"}, 59: {name: "Niji", types: ["shooter", "dps"], link: "/Vinsmoke_Niji",img: "/images/6/66/Card-niji.png"}, 60: {name: "Reiju", types: ["especialist", "support"], link: "/Vinsmoke_Reiju",img: "/images/2/23/Card-reiju.png"}, 61: {name: "Sanji", types: ["fighter", "dps"], link: "/Vinsmoke_Sanji",img: "/images/0/04/Card-sanji.png"}, 62: {name: "Yonji", types: ["fighter", "tank"], link: "/Vinsmoke_Yonji",img: "/images/7/73/Card-yonji.png"}, 63: {name: "X-drake", types: ["fighter", "bruiser"], link: "/X_Drake",img: "/images/6/69/Card-drake.png"}, 64: {name: "roronoa zoro", types: ["slasher", "bruiser"], link: "/Zoro",img: "/images/6/6f/Card-zoro.png"}, 65: {name: "Bartolomew Kuma", types: ["especialist", "tank"], link: "/Bartholomew_Kuma",img: "/images/b/b5/Card-kuma.png"}, 66: {name: "Boa Hancock", types: ["fighter", "dps"], link: "/Boa_Hancock",img: "/images/4/47/Card-hancock.png"}, 67: {name: "Borsalino Kizaru", types: ["especialist", "shooter", "dps"], link: "/Borsalino_Kizaru",img: "/images/3/32/Card-kizaru.png"}, 68: {name: "Brook (TS)", types: ["slasher", "support"], link: "/Brook_(Timeskip)",img: "/images/1/1d/Card-brookts.png"}, 69: {name: "Chopper (TS)", types: ["fighter", "support"], link: "/Chopper_(Timeskip)",img: "/images/5/53/Card-chopperts.png"}, 70: {name: "Doflamingo", types: ["shooter", "especialist", "dps"], link: "/Donquixote_Doflamingo",img: "/images/8/8d/Card-doflamingo.png"}, 71: {name: "Dracule Mihawk", types: ["slasher", "dps"], link: "/Dracule_Mihawk",img: "/images/9/91/Card-mihawk.png"}, 72: {name: "Emporio Ivankov", types: ["fighter", "support"], link: "/Emporio_Ivankov",img: "/images/c/ca/Card-ivankov.png"}, 73: {name: "Franky (TS)", types: ["shooter", "tank"], link: "/Franky_(Timeskip)",img: "/images/d/d0/Card-frankyts.png"}, 74: {name: "Jinbe", types: ["fighter", "tank"], link: "/jinbe",img: "/images/2/2e/Card-jinbe.png"}, 75: {name: "Marshall D. Teach", types: ["specialist", "bruiser"], link: "/Marshall_D._Teach",img: "/images/f/ff/Card-kurohige.png"}, 76: {name: "Monkey D. Luffy (TS)", types: ["fighter", "dps"], link: "/Luffy_(Timeskip)",img: "/images/e/ed/Card-luffyts.png"}, 77: {name: "Nami (TS)", types: ["especialist", "dps"], link: "/Nami_(Timeskip)",img: "/images/3/35/Card-namits.png"}, 78: {name: "Portgas D. Ace", types: ["especialist", "shooter", "dps"], link: "/Portgas_D._Ace",img: "/images/4/40/Card-ace.png"}, 79: {name: "Robin (TS)", types: ["especialist", "dps"], link: "/Robin_(Timeskip)",img: "/images/b/b0/Card-robints.png"}, 80: {name: "Roronoa zoro (TS)", types: ["slasher", "dps"], link: "/Zoro_(Timeskip)",img: "/images/7/74/Card-zorots.png"}, 81: {name: "Sabo", types: ["fighter", "especialist", "dps"], link: "/Sabo",img: "/images/0/04/Card-sabo.png"}, 82: {name: "Shanks", types: ["slasher", "bruiser"], link: "/Shanks",img: "/images/a/aa/Card-shanks.png"}, 83: {name: "Usopp (TS)", types: ["shooter", "dps"], link: "/Usopp_(Timeskip)",img: "/images/c/cc/Card-usoppts.png"}, 84: {name: "Vinsmoke Sanji (TS)", types: ["fighter", "dps"], link: "/Sanji_(Timeskip)",img: "/images/7/7a/Card-sanjits.png"}, }; $(".filter--icon").on("click", function() { const id = $(this).attr("id"); if(id == "all"){ $(".characters").addClass('show'); }else{ $(".characters:not([data-type-"+id+"])").removeClass('show'); $(".characters[data-type-"+ id +"]").addClass('show'); } }); $.each(characters.reverse(), function (key, item) { x = ''; $.each(item.types,function(key, value){ x += "data-type-"+value+" "; }); $("#characters-container").append( "<div class='characters show' "+x+" >"+ "<a href='http://70.39.70.36/index.php"+item.link+"'>"+ "<img src='"+item.img+"' alt='imagem de "+item.name+"' />"+ "</a>"+ "</div>" ); }); //------- PERSONAGENS --------- //------- SKILL TAB --------- $('.tab-skill').on('click', function(){ $('.tab-skill.active').removeClass('active'); $(this).addClass('active'); const skillId = $(this).data('skill-id'); if($(".skillInfo[data-skill-id="+ skillId +"]")){ $(".skillInfo.active").removeClass('active'); $(".skillInfo[data-skill-id="+ skillId +"]").addClass('active'); } }); //------- SKILL TAB --------- });