templates/jogo.base.html.twig line 1
{% set rota_controler, rota_base, rota_action = '', '', '' %}{% if rota|length == 3 %}{% set rota_controler, rota_base, rota_action = rota[0], rota[1], rota[2] %}{% elseif rota|length == 4 %}{% set rota_controler, rota_base, rota_action = rota[1], rota[2], rota[3] %}{% elseif rota|length == 5 %}{% set rota_controler, rota_base, rota_action = rota[1], rota[2], rota[3] %}{% endif %}<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><title>Jogos de Palavras</title><meta http-equiv="Cache-Control" content="public, no-store"><meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no"><meta name="mobile-web-app-capable" content="yes"><meta name="HandheldFriendly" content="True"><link rel="shortcut icon" href="/img/favicon.png" /><link rel="stylesheet" href="/css/bootstrap.min.css" ><link rel="stylesheet" href="/css/sweetalert2.min.css"><link rel="stylesheet" href="/css/style.css"><link rel="stylesheet" href="/css/teclado.css?{{ versaoCss }}"><link rel="stylesheet" href="/css/introjs.min.css" />{% block css %}{% endblock %}{% block google_adsense %}{% endblock %}<style>body {font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";padding: 0;margin: 0;background-color: #ffffff;}/* animações */.tremor {animation: tremorAnimation 0.2s infinite;}/* Animação de tremor */@keyframes tremorAnimation {0% { transform: translate(0, 0); }25% { transform: translate(-2px, -2px); }50% { transform: translate(2px, 2px); }75% { transform: translate(-2px, 2px); }100% { transform: translate(2px, -2px); }}.pulse{animation: pulseAnimation 1s infinite;}/* Animação de tremor */@keyframes pulseAnimation {0% { transform: scale(1); }50% { transform: scale(1.2); }100% { transform: scale(1); }}#idDivDica{margin-bottom: 1em;color: #d5143a;}.help{display: none;position: fixed;z-index: 10000;left: 0;top: 0;width: 100%;height: 100%;overflow: auto;background-color: #0e2a60;}.table{font-size: 0.8em;}.odd td{}.even td{background-color: #efeff9}.derrota{transform: rotate(180deg);filter: grayscale(100%);}.desempenho{display: none;position: fixed;z-index: 9000;left: 0;top: 0;width: 100%;height: 100%;overflow: auto;background-color: #0e2a60;}.desempenho .title{padding: 6%;color: #fff;font-size: 1.2em;height: 13%;}.desempenho .title .title1{width: 90%;}.desempenho .title .fechar{text-align: center;width: 10%;}.desempenho .content{background-color: #fff;padding: 20px;border-top-left-radius: 28px;width: 100%;height: 87%;border-top-right-radius: 28px;}.desempenho .content .header{display: flex;width: 100%;font-size: 14px;min-height: 10em;}.desempenho .content .header > div{width: 33%;border-radius: 13px;min-height: 8em;padding: 10px;color: #fff;}.desempenho .content .header > div{background-position-x: 85%;background-size: 2.5em;background-repeat: no-repeat;background-position-y: 85%;}.desempenho .content .header > div.mouse{background-color: #21c897;background-image: url('/img/mouse.png');}.desempenho .content .header > div.relogio{background-color: #0040ff;margin: 0 10px;background-image: url('/img/relogio2.png');}.desempenho .content .header > div.dinheiro{background-color: #9f8809;margin: 0 10px;background-image: url('/img/dinheiro.png');}.desempenho .content .body{padding-top: 1em;text-align: left;width: 100%;color: #000;}.desempenho .content .body .card {/* Add shadows to create the "card" effect */box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);transition: 0.3s;overflow: auto;}.desempenho .content .body .certoResumo{color: #3232a8;font-style: italic;}.desempenho .content .body .erradoResumo{color: #dd3737;font-style: italic;}.desempenho .content .body .certo{color: #3232a8;font-size: 0.8em;font-style: italic;opacity: 0.8;}.desempenho .content .body .errado{color: #dd3737;font-size: 0.8em;font-style: italic;opacity: 0.8;}.desempenho .content .body .container {padding: 1em;}/* ************************ */.extrato{display: none;position: fixed;z-index: 10000;left: 0;top: 0;width: 100%;height: 100%;overflow: auto;background-color: #0e2a60;}.extrato .title{padding: 6%;color: #fff;font-size: 1.2em;height: 13%;}.extrato .title .title1{width: 90%;}.extrato .title .fechar{text-align: center;width: 10%;}.extrato .title .nivel{font-size: 0.7em;}.extrato .content{background-color: #fff;padding: 20px;border-top-left-radius: 28px;width: 100%;height: 87%;border-top-right-radius: 28px;}.extrato .content .header{display: flex;width: 100%;font-size: 14px;min-height: 10em;}.extrato .content .header > div{width: 33%;border-radius: 13px;min-height: 8em;padding: 10px;color: #fff;}.extrato .content .header > div{background-position-x: 85%;background-size: 2.5em;background-repeat: no-repeat;background-position-y: 85%;}.extrato .content .header > div.mouse{background-color: #21c897;background-image: url('/img/mouse.png');}.extrato .content .header > div.relogio{background-color: #0040ff;margin: 0 10px;background-image: url('/img/relogio2.png');}.extrato .content .header > div.dinheiro{background-color: #9f8809;margin: 0 10px;background-image: url('/img/dinheiro.png');}.extrato .content .body{padding-top: 1em;text-align: left;width: 100%;color: #000;}.extrato .content .body .card {/* Add shadows to create the "card" effect */box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);transition: 0.3s;overflow: auto;}.extrato .content .body .certoResumo{color: #3232a8;font-style: italic;}.extrato .content .body .erradoResumo{color: #dd3737;font-style: italic;}.extrato .content .body .certo{color: #3232a8;font-size: 0.8em;font-style: italic;opacity: 0.8;}.extrato .content .body .errado{color: #dd3737;font-size: 0.8em;font-style: italic;opacity: 0.8;}.extrato .content .body .container {padding: 1em;}.btnAssistirVideo.btnAssistirVideoDisabled{opacity: 0.5}</style></head><body>{% if rota_controler == "jogos"%}<!-- navbar --><div class="navbar"><div class="container"><div class="site-title"><a href="/"><h1>Jogos de palavras</h1></a></div></div></div><!-- end navbar --><div class="register app-pages"><div class="container" id="idDivContainer"><!-- cabeçalho --><div id="idDivCabecalho" class="row col-12 text-center" style="font-size: 1.2rem; margin-top: 1em; color: #000"><div class="col-3 p-0 text-center" id="idDivInfoMoedas"></div><div class="col-6 p-0 text-center" id="idDivInfoNivel"></div><div class="col-3 p-0" style="text-align: right" id="idDivInfoAjuda"><span onclick="jogo.callbackQuestion()" class="questionTop"><span>?</span></span></div></div><!-- div do jogo --><div id="idDivJogo" style="margin:10px; overflow: hidden;" ><div id="idDivTabuleiro" style="margin-top: 0.2em;" class="col-lg-12 text-center" ></div></div><!-- div dos botoes, dicas e teclado --><div id="idDivBottom" style="bottom: 0;width: 100%;height: 17.6rem;position: fixed;"><table id="clsCtrlDicas" style="visibility: hidden;width: 98%;margin-left: 1%; margin-bottom: 0.3rem"><tr><td class="btnBackMapa"><svg xmlns="https://www.w3.org/2000/svg" height="2em" viewBox="0 0 512 512"><!--! Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><style>svg{fill:#0e2a60}</style><path d="M512 256A256 256 0 1 0 0 256a256 256 0 1 0 512 0zM271 135c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-87 87 87 87c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L167 273c-9.4-9.4-9.4-24.6 0-33.9L271 135z"/></svg></td><td style="text-align:center; font-size:1em;letter-spacing: 2px;" id="idDivDicasOuPalavras">DICAS</td><td class="btnNextMapa"><svg xmlns="https://www.w3.org/2000/svg" height="2em" viewBox="0 0 512 512"><!--! Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><style>svg{fill:#0e2a60}</style><path d="M0 256a256 256 0 1 0 512 0A256 256 0 1 0 0 256zM241 377c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l87-87-87-87c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0L345 239c9.4 9.4 9.4 24.6 0 33.9L241 377z"/></svg></td></tr></table><div id="idDivDica"></div><div id="idDivTeclado" style="text-align: center;position: absolute;bottom: 1em;width: 100%;"></div></div>{% else %}<!-- cabeçalho --><div id="idDivCabecalho" class="row col-12 text-center" style="font-size: 1.2rem; margin-top: 1em; color: #000"><div class="col-3 p-0 text-center" id="idDivInfoMoedas"></div><div class="col-6 p-0 text-center" id="idDivInfoNivel"></div><div class="col-3 p-0" style="text-align: right" id="idDivInfoAjuda"><span onclick="jogo.callbackQuestion()" class="questionTop"><span>?</span></span></div></div><!-- div do jogo --><div id="idDivJogo" style="margin:10px; overflow: hidden;" ><div id="idDivTabuleiro" style="margin-top: 0.2em;" class="col-lg-12 text-center" ></div></div><!-- div dos botoes, dicas e teclado --><div id="idDivBottom" style="bottom: 0;width: 100%;height: 15.6rem;position: fixed;"><table id="clsCtrlDicas" style="visibility: hidden;width: 98%;margin-left: 1%; margin-bottom: 0.3rem"><tr><td class="btnBackMapa"><svg xmlns="https://www.w3.org/2000/svg" height="2em" viewBox="0 0 512 512"><!--! Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><style>svg{fill:#0e2a60}</style><path d="M512 256A256 256 0 1 0 0 256a256 256 0 1 0 512 0zM271 135c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-87 87 87 87c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L167 273c-9.4-9.4-9.4-24.6 0-33.9L271 135z"/></svg></td><td style="text-align:center; font-size:1em;letter-spacing: 2px;" id="idDivDicasOuPalavras">DICAS</td><td class="btnNextMapa"><svg xmlns="https://www.w3.org/2000/svg" height="2em" viewBox="0 0 512 512"><!--! Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><style>svg{fill:#0e2a60}</style><path d="M0 256a256 256 0 1 0 512 0A256 256 0 1 0 0 256zM241 377c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l87-87-87-87c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0L345 239c9.4 9.4 9.4 24.6 0 33.9L241 377z"/></svg></td></tr></table><div id="idDivDica"></div><div id="idDivTeclado" style="text-align: center;position: absolute;bottom: 1em;width: 100%;"></div></div>{% endif %}<div class="extrato"><div class="title"><div style="display: flex;"><div class="title1"></div><div class="fechar" onclick="jogo.btnShowHideExtrato();"><span style="border: 1px solid;border-radius: 100px;padding: 0 6px;">X</span></div></div><div class="nivel"></div></div><div class="content" id="idDivPosContentExtrato" style="overflow: auto"><div class="header"><div class="mouse"><div>Clicks no teclado</div><div></div></div><div class="relogio"><div>Tempo</div><div></div></div><div class="dinheiro"><div>Saldo</div><div></div></div></div><div class="body" id="idDivPosBodyExtrato"><div style="margin: 1em 0em;" id="idDivPosBodyRelatorio">Extrato</div><div class="card"><div class="container"><p> </p><p> </p><p> </p></div></div><div style="margin: 1em 0em;" id="idDivPosBodyResumo">Resumo</div><div class="card"><div class="container"><p> </p></div></div><p> </p><p> </p></div></div></div><div class="desempenho"><div class="title"><div style="display: flex;"><div class="title1">Desempenho no jogo<span id="idTitle1NomeJogo"></span></div><div class="fechar" onclick="jogo.btnShowHideDesempenho();"><span style="border: 1px solid;border-radius: 100px;padding: 0 6px;">X</span></div></div><div class="nivel"></div></div><div class="content" id="idDivPosContentDesempenho" style="overflow: auto"><div class="body" id="idDivPosBodyDesempenho"><ul class="nav nav-tabs" id="myTab" role="tablist"><li class="nav-item"><a class="nav-link active" id="tabHome" data-toggle="tab" href="#" role="tab" aria-controls="home" aria-selected="true">Geral</a></li><li class="nav-item"><a class="nav-link" id="tabNivel" data-toggle="tab" href="#" role="tab" aria-controls="nivel" aria-selected="false">Por nível</a></li><li class="nav-item"><a class="nav-link" id="tabTabela" data-toggle="tab" href="#" role="tab" aria-controls="tabela" aria-selected="false">Histórico</a></li></ul><div class="tab-content" id="myTabContent"><div class="tab-pane tabHome" role="tabpanel" aria-labelledby="home-tab"><div class="card mb-3" style="padding: 1em"><div id="divGeralTotais"></div></div><div id="divGeralChartVerticalCard" class="card mb-3" style="padding: 1em; display: none"><div id="divGeralChartVertical" style="width: 100%; height: 34vh"></div></div><div id="divGeralChartHorizontalCard" class="card mb-3" style="padding: 1em; display: none"><div id="divGeralChartHorizontal" style="width: 100%; height: 34vh;"></div></div><div id="divGeralChartTempoCard" class="card mb-3" style="padding: 1em; display: none;"><div id="divGeralChartTempo" style="width: 100%; height: 34vh;"></div></div><br /><br /><br /></div><div class="tab-pane tabNivel" role="tabpanel" aria-labelledby="nivel-tab"><div class="card nivel1" style="padding: 1em; margin-bottom: 1em"><div class="card-header"></div><div class="card-body" id="chartNivel1" style="width: 100%; height: 34vh;"></div></div><div class="card nivel2" style="padding: 1em; margin-bottom: 1em"><div class="card-header"></div><div class="card-body" id="chartNivel2" style="width: 100%; height: 34vh;"></div></div><div class="card nivel3" style="padding: 1em; margin-bottom: 1em"><div class="card-header"></div><div class="card-body" id="chartNivel3" style="width: 100%; height: 34vh;"></div></div><div class="card nivel4" style="padding: 1em; margin-bottom: 1em"><div class="card-header"></div><div class="card-body" id="chartNivel4" style="width: 100%; height: 34vh;"></div></div><div class="card nivel5" style="padding: 1em; margin-bottom: 1em"><div class="card-header"></div><div class="card-body" id="chartNivel5" style="width: 100%; height: 34vh;"></div></div><br /><br /><br /></div><div class="tab-pane tabTabela" role="tabpanel" aria-labelledby="tabela-tab"><div class="card" style="margin-top: 1em"><div id="divTabelaHistorico"></div></div><br /><br /><br /><div id="divTabelaHistoricoVersao" class="card mb-3" style="padding: 1em;"><p style="text-align: center;font-size: 10px;">Versão {{ versaoApp }}</p></div></div></div></div></div></div>{% if rota_controler == "jogos"%}<br><br><br><br></div></div><!-- footer --><footer><div class="ft-bottom"><span><a href="/" style="color: #fff;margin-left: 1em;margin-right: 1em;">Jogos de Palavras</a></span><span><a href="mailto:suporte@jogosdepalavras.com.br" style="color: #fff;">suporte@jogosdepalavras.com.br</a></span><br><span>Copyright © 2023 All Rights Reserved </span><span> <a href="/about" style="color: #fff;margin-left: 1em;margin-right: 1em;">Sobre </a></span><span> <a href="/politica-privacidade" style="color: #fff;">Política de privacidade</a> </span></div></footer>{% endif %}</body><!-- script --><script src="/js/teclado.js?{{ versaoJs }}"></script><script src="/js/jquery.min.js"></script><script src="/js/bootstrap.min.js"></script><script src="/js/sweetalert2.js"></script><script src="/js/amcharts5/index.js"></script><script src="/js/amcharts5/percent.js"></script><script src="/js/amcharts5/xy.js"></script><script src="/js/amcharts5/themes/Animated.js"></script><script src="/js/introjs.min.js" ></script><script>var faVideo = '<svg xmlns="http://www.w3.org/2000/svg" height="16" width="18" viewBox="0 0 576 512"><path fill="#ffffff" d="M0 128C0 92.7 28.7 64 64 64H320c35.3 0 64 28.7 64 64V384c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V128zM559.1 99.8c10.4 5.6 16.9 16.4 16.9 28.2V384c0 11.8-6.5 22.6-16.9 28.2s-23 5-32.9-1.6l-96-64L416 337.1V320 192 174.9l14.2-9.5 96-64c9.8-6.5 22.4-7.2 32.9-1.6z"/></svg>';var faVideoYellow = '<svg xmlns="http://www.w3.org/2000/svg" style="width: 33%;" viewBox="0 0 576 512"><path fill="#ffc107" d="M0 128C0 92.7 28.7 64 64 64H320c35.3 0 64 28.7 64 64V384c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V128zM559.1 99.8c10.4 5.6 16.9 16.4 16.9 28.2V384c0 11.8-6.5 22.6-16.9 28.2s-23 5-32.9-1.6l-96-64L416 337.1V320 192 174.9l14.2-9.5 96-64c9.8-6.5 22.4-7.2 32.9-1.6z"/></svg>';var faChartLine = '<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" viewBox="0 0 512 512"><path fill="#ffffff" d="M64 64c0-17.7-14.3-32-32-32S0 46.3 0 64V400c0 44.2 35.8 80 80 80H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H80c-8.8 0-16-7.2-16-16V64zm406.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L320 210.7l-57.4-57.4c-12.5-12.5-32.8-12.5-45.3 0l-112 112c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L240 221.3l57.4 57.4c12.5 12.5 32.8 12.5 45.3 0l128-128z"/></svg>';var faRotate = '<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" viewBox="0 0 512 512"><path fill="#ffffff" d="M142.9 142.9c62.2-62.2 162.7-62.5 225.3-1L327 183c-6.9 6.9-8.9 17.2-5.2 26.2s12.5 14.8 22.2 14.8H463.5c0 0 0 0 0 0H472c13.3 0 24-10.7 24-24V72c0-9.7-5.8-18.5-14.8-22.2s-19.3-1.7-26.2 5.2L413.4 96.6c-87.6-86.5-228.7-86.2-315.8 1C73.2 122 55.6 150.7 44.8 181.4c-5.9 16.7 2.9 34.9 19.5 40.8s34.9-2.9 40.8-19.5c7.7-21.8 20.2-42.3 37.8-59.8zM16 312v7.6 .7V440c0 9.7 5.8 18.5 14.8 22.2s19.3 1.7 26.2-5.2l41.6-41.6c87.6 86.5 228.7 86.2 315.8-1c24.4-24.4 42.1-53.1 52.9-83.7c5.9-16.7-2.9-34.9-19.5-40.8s-34.9 2.9-40.8 19.5c-7.7 21.8-20.2 42.3-37.8 59.8c-62.2 62.2-162.7 62.5-225.3 1L185 329c6.9-6.9 8.9-17.2 5.2-26.2s-12.5-14.8-22.2-14.8H48.4h-.7H40c-13.3 0-24 10.7-24 24z"/></svg>';var faPenToSquare = '<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" viewBox="0 0 512 512"><path fill="#ffffff" d="M471.6 21.7c-21.9-21.9-57.3-21.9-79.2 0L362.3 51.7l97.9 97.9 30.1-30.1c21.9-21.9 21.9-57.3 0-79.2L471.6 21.7zm-299.2 220c-6.1 6.1-10.8 13.6-13.5 21.9l-29.6 88.8c-2.9 8.6-.6 18.1 5.8 24.6s15.9 8.7 24.6 5.8l88.8-29.6c8.2-2.7 15.7-7.4 21.9-13.5L437.7 172.3 339.7 74.3 172.4 241.7zM96 64C43 64 0 107 0 160V416c0 53 43 96 96 96H352c53 0 96-43 96-96V320c0-17.7-14.3-32-32-32s-32 14.3-32 32v96c0 17.7-14.3 32-32 32H96c-17.7 0-32-14.3-32-32V160c0-17.7 14.3-32 32-32h96c17.7 0 32-14.3 32-32s-14.3-32-32-32H96z"/></svg>';var faGears = '<svg xmlns="http://www.w3.org/2000/svg" height="16" width="20" viewBox="0 0 640 512"><path fill="#ffffff" d="M308.5 135.3c7.1-6.3 9.9-16.2 6.2-25c-2.3-5.3-4.8-10.5-7.6-15.5L304 89.4c-3-5-6.3-9.9-9.8-14.6c-5.7-7.6-15.7-10.1-24.7-7.1l-28.2 9.3c-10.7-8.8-23-16-36.2-20.9L199 27.1c-1.9-9.3-9.1-16.7-18.5-17.8C173.9 8.4 167.2 8 160.4 8h-.7c-6.8 0-13.5 .4-20.1 1.2c-9.4 1.1-16.6 8.6-18.5 17.8L115 56.1c-13.3 5-25.5 12.1-36.2 20.9L50.5 67.8c-9-3-19-.5-24.7 7.1c-3.5 4.7-6.8 9.6-9.9 14.6l-3 5.3c-2.8 5-5.3 10.2-7.6 15.6c-3.7 8.7-.9 18.6 6.2 25l22.2 19.8C32.6 161.9 32 168.9 32 176s.6 14.1 1.7 20.9L11.5 216.7c-7.1 6.3-9.9 16.2-6.2 25c2.3 5.3 4.8 10.5 7.6 15.6l3 5.2c3 5.1 6.3 9.9 9.9 14.6c5.7 7.6 15.7 10.1 24.7 7.1l28.2-9.3c10.7 8.8 23 16 36.2 20.9l6.1 29.1c1.9 9.3 9.1 16.7 18.5 17.8c6.7 .8 13.5 1.2 20.4 1.2s13.7-.4 20.4-1.2c9.4-1.1 16.6-8.6 18.5-17.8l6.1-29.1c13.3-5 25.5-12.1 36.2-20.9l28.2 9.3c9 3 19 .5 24.7-7.1c3.5-4.7 6.8-9.5 9.8-14.6l3.1-5.4c2.8-5 5.3-10.2 7.6-15.5c3.7-8.7 .9-18.6-6.2-25l-22.2-19.8c1.1-6.8 1.7-13.8 1.7-20.9s-.6-14.1-1.7-20.9l22.2-19.8zM112 176a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zM504.7 500.5c6.3 7.1 16.2 9.9 25 6.2c5.3-2.3 10.5-4.8 15.5-7.6l5.4-3.1c5-3 9.9-6.3 14.6-9.8c7.6-5.7 10.1-15.7 7.1-24.7l-9.3-28.2c8.8-10.7 16-23 20.9-36.2l29.1-6.1c9.3-1.9 16.7-9.1 17.8-18.5c.8-6.7 1.2-13.5 1.2-20.4s-.4-13.7-1.2-20.4c-1.1-9.4-8.6-16.6-17.8-18.5L583.9 307c-5-13.3-12.1-25.5-20.9-36.2l9.3-28.2c3-9 .5-19-7.1-24.7c-4.7-3.5-9.6-6.8-14.6-9.9l-5.3-3c-5-2.8-10.2-5.3-15.6-7.6c-8.7-3.7-18.6-.9-25 6.2l-19.8 22.2c-6.8-1.1-13.8-1.7-20.9-1.7s-14.1 .6-20.9 1.7l-19.8-22.2c-6.3-7.1-16.2-9.9-25-6.2c-5.3 2.3-10.5 4.8-15.6 7.6l-5.2 3c-5.1 3-9.9 6.3-14.6 9.9c-7.6 5.7-10.1 15.7-7.1 24.7l9.3 28.2c-8.8 10.7-16 23-20.9 36.2L315.1 313c-9.3 1.9-16.7 9.1-17.8 18.5c-.8 6.7-1.2 13.5-1.2 20.4s.4 13.7 1.2 20.4c1.1 9.4 8.6 16.6 17.8 18.5l29.1 6.1c5 13.3 12.1 25.5 20.9 36.2l-9.3 28.2c-3 9-.5 19 7.1 24.7c4.7 3.5 9.5 6.8 14.6 9.8l5.4 3.1c5 2.8 10.2 5.3 15.5 7.6c8.7 3.7 18.6 .9 25-6.2l19.8-22.2c6.8 1.1 13.8 1.7 20.9 1.7s14.1-.6 20.9-1.7l19.8 22.2zM464 304a48 48 0 1 1 0 96 48 48 0 1 1 0-96z"/></svg>';var faGearsBlack = '<svg xmlns="http://www.w3.org/2000/svg" height="16" width="20" viewBox="0 0 640 512"><path fill="#000000" d="M308.5 135.3c7.1-6.3 9.9-16.2 6.2-25c-2.3-5.3-4.8-10.5-7.6-15.5L304 89.4c-3-5-6.3-9.9-9.8-14.6c-5.7-7.6-15.7-10.1-24.7-7.1l-28.2 9.3c-10.7-8.8-23-16-36.2-20.9L199 27.1c-1.9-9.3-9.1-16.7-18.5-17.8C173.9 8.4 167.2 8 160.4 8h-.7c-6.8 0-13.5 .4-20.1 1.2c-9.4 1.1-16.6 8.6-18.5 17.8L115 56.1c-13.3 5-25.5 12.1-36.2 20.9L50.5 67.8c-9-3-19-.5-24.7 7.1c-3.5 4.7-6.8 9.6-9.9 14.6l-3 5.3c-2.8 5-5.3 10.2-7.6 15.6c-3.7 8.7-.9 18.6 6.2 25l22.2 19.8C32.6 161.9 32 168.9 32 176s.6 14.1 1.7 20.9L11.5 216.7c-7.1 6.3-9.9 16.2-6.2 25c2.3 5.3 4.8 10.5 7.6 15.6l3 5.2c3 5.1 6.3 9.9 9.9 14.6c5.7 7.6 15.7 10.1 24.7 7.1l28.2-9.3c10.7 8.8 23 16 36.2 20.9l6.1 29.1c1.9 9.3 9.1 16.7 18.5 17.8c6.7 .8 13.5 1.2 20.4 1.2s13.7-.4 20.4-1.2c9.4-1.1 16.6-8.6 18.5-17.8l6.1-29.1c13.3-5 25.5-12.1 36.2-20.9l28.2 9.3c9 3 19 .5 24.7-7.1c3.5-4.7 6.8-9.5 9.8-14.6l3.1-5.4c2.8-5 5.3-10.2 7.6-15.5c3.7-8.7 .9-18.6-6.2-25l-22.2-19.8c1.1-6.8 1.7-13.8 1.7-20.9s-.6-14.1-1.7-20.9l22.2-19.8zM112 176a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zM504.7 500.5c6.3 7.1 16.2 9.9 25 6.2c5.3-2.3 10.5-4.8 15.5-7.6l5.4-3.1c5-3 9.9-6.3 14.6-9.8c7.6-5.7 10.1-15.7 7.1-24.7l-9.3-28.2c8.8-10.7 16-23 20.9-36.2l29.1-6.1c9.3-1.9 16.7-9.1 17.8-18.5c.8-6.7 1.2-13.5 1.2-20.4s-.4-13.7-1.2-20.4c-1.1-9.4-8.6-16.6-17.8-18.5L583.9 307c-5-13.3-12.1-25.5-20.9-36.2l9.3-28.2c3-9 .5-19-7.1-24.7c-4.7-3.5-9.6-6.8-14.6-9.9l-5.3-3c-5-2.8-10.2-5.3-15.6-7.6c-8.7-3.7-18.6-.9-25 6.2l-19.8 22.2c-6.8-1.1-13.8-1.7-20.9-1.7s-14.1 .6-20.9 1.7l-19.8-22.2c-6.3-7.1-16.2-9.9-25-6.2c-5.3 2.3-10.5 4.8-15.6 7.6l-5.2 3c-5.1 3-9.9 6.3-14.6 9.9c-7.6 5.7-10.1 15.7-7.1 24.7l9.3 28.2c-8.8 10.7-16 23-20.9 36.2L315.1 313c-9.3 1.9-16.7 9.1-17.8 18.5c-.8 6.7-1.2 13.5-1.2 20.4s.4 13.7 1.2 20.4c1.1 9.4 8.6 16.6 17.8 18.5l29.1 6.1c5 13.3 12.1 25.5 20.9 36.2l-9.3 28.2c-3 9-.5 19 7.1 24.7c4.7 3.5 9.5 6.8 14.6 9.8l5.4 3.1c5 2.8 10.2 5.3 15.5 7.6c8.7 3.7 18.6 .9 25-6.2l19.8-22.2c6.8 1.1 13.8 1.7 20.9 1.7s14.1-.6 20.9-1.7l19.8 22.2zM464 304a48 48 0 1 1 0 96 48 48 0 1 1 0-96z"/></svg>';var faExibirTodasAsLetras = '<svg xmlns="http://www.w3.org/2000/svg" height="16" width="18" viewBox="0 0 576 512"><path fill="#ffffff" d="M183.6 42.4C177.5 35.8 169 32 160 32s-17.5 3.8-23.6 10.4l-88 96c-11.9 13-11.1 33.3 2 45.2s33.3 11.1 45.2-2L128 146.3V448c0 17.7 14.3 32 32 32s32-14.3 32-32V146.3l32.4 35.4c11.9 13 32.2 13.9 45.2 2s13.9-32.2 2-45.2l-88-96zM320 64c0 17.7 14.3 32 32 32h50.7l-73.4 73.4c-9.2 9.2-11.9 22.9-6.9 34.9s16.6 19.8 29.6 19.8H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H429.3l73.4-73.4c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8H352c-17.7 0-32 14.3-32 32zm96 192c-12.1 0-23.2 6.8-28.6 17.7l-64 128-16 32c-7.9 15.8-1.5 35 14.3 42.9s35 1.5 42.9-14.3l7.2-14.3h88.4l7.2 14.3c7.9 15.8 27.1 22.2 42.9 14.3s22.2-27.1 14.3-42.9l-16-32-64-128C439.2 262.8 428.1 256 416 256zM395.8 400L416 359.6 436.2 400H395.8z"/></svg>';var faMostrarNoTabuleiro = '<svg xmlns="http://www.w3.org/2000/svg" height="16" width="18" viewBox="0 0 576 512"><path fill="#ffffff" d="M64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64zm64 64v64h64V96h64v64h64V96h64v64H320v64h64v64H320v64h64v64H320V352H256v64H192V352H128v64H64V352h64V288H64V224h64V160H64V96h64zm64 128h64V160H192v64zm0 64V224H128v64h64zm64 0H192v64h64V288zm0 0h64V224H256v64z"/></svg>';var faResolverPalavra = '<svg xmlns="http://www.w3.org/2000/svg" height="16" width="18" viewBox="0 0 576 512"><path fill="#ffffff" d="M112 0C99.1 0 87.4 7.8 82.5 19.7l-66.7 160-13.3 32c-6.8 16.3 .9 35 17.2 41.8s35-.9 41.8-17.2L66.7 224h90.7l5.1 12.3c6.8 16.3 25.5 24 41.8 17.2s24-25.5 17.2-41.8l-13.3-32-66.7-160C136.6 7.8 124.9 0 112 0zm18.7 160H93.3L112 115.2 130.7 160zM256 32v96 96c0 17.7 14.3 32 32 32h80c44.2 0 80-35.8 80-80c0-23.1-9.8-43.8-25.4-58.4c6-11.2 9.4-24 9.4-37.6c0-44.2-35.8-80-80-80H288c-17.7 0-32 14.3-32 32zm96 64H320V64h32c8.8 0 16 7.2 16 16s-7.2 16-16 16zm-32 64h32 16c8.8 0 16 7.2 16 16s-7.2 16-16 16H320V160zM566.6 310.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L352 434.7l-73.4-73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l96 96c12.5 12.5 32.8 12.5 45.3 0l192-192z"/></svg>';var faDica = '<svg xmlns="http://www.w3.org/2000/svg" height="16" width="18" viewBox="0 0 576 512"><path fill="#ffffff" d="M168.2 384.9c-15-5.4-31.7-3.1-44.6 6.4c-8.2 6-22.3 14.8-39.4 22.7c5.6-14.7 9.9-31.3 11.3-49.4c1-12.9-3.3-25.7-11.8-35.5C60.4 302.8 48 272 48 240c0-79.5 83.3-160 208-160s208 80.5 208 160s-83.3 160-208 160c-31.6 0-61.3-5.5-87.8-15.1zM26.3 423.8c-1.6 2.7-3.3 5.4-5.1 8.1l-.3 .5c-1.6 2.3-3.2 4.6-4.8 6.9c-3.5 4.7-7.3 9.3-11.3 13.5c-4.6 4.6-5.9 11.4-3.4 17.4c2.5 6 8.3 9.9 14.8 9.9c5.1 0 10.2-.3 15.3-.8l.7-.1c4.4-.5 8.8-1.1 13.2-1.9c.8-.1 1.6-.3 2.4-.5c17.8-3.5 34.9-9.5 50.1-16.1c22.9-10 42.4-21.9 54.3-30.6c31.8 11.5 67 17.9 104.1 17.9c141.4 0 256-93.1 256-208S397.4 32 256 32S0 125.1 0 240c0 45.1 17.7 86.8 47.7 120.9c-1.9 24.5-11.4 46.3-21.4 62.9zM144 272a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm144-32a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm80 32a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"/></svg>';var controleStartJogo = false;var token = '';var isViewAnuncio = false;const jogo = {saldo: 0,pontos: 0,regras: [],idJogo: 0,modelo: '',desafioDiario: 0,isAltConfig: false,/* variaveis de estatisticas */estatisticas: [],niveis: [],saldoInicial: 0,nivelAlertaPulse: 1,nivelAlertaStress: 2,nivelAlertaFim: 3,clicExibirDica: 0,clicExibirTodasLetras: 0,consolidacao: [],historicoDesempenho: [],isCanViewVideoRewardedInterstitial: true,isCanViewVideoRewarded: true,isCanViewVideoInterstitial: true,isObrigatorioTrocarDeNivel: false,palavraSelecionada: '',handleContador: 0,handleAds: 0,configUser: '',configure: function(IdDoJogo, json, modelo){$("#clsCtrlDicas").css('visibility','hidden');if(IdDoJogo == 1){$("#idDivDica").css('color', '#0e2a60');$("#clsCtrlDicas").css('visibility','visible');} else {$("#idDivDica").css('color', '#0e2a60');}jogo.idJogo = IdDoJogo;jogo.modelo = modelo;jogo.isPalavraSelecionada = 0;if(modelo.lstPalavrasSalvas){jogo.isPalavraSelecionada = modelo.lstPalavrasSalvas.length;jogo.palavraSelecionada = modelo.lstPalavrasSalvas.length;} else if(modelo.palavra){jogo.isPalavraSelecionada = modelo.palavra.length;jogo.palavraSelecionada = modelo.palavra;}jogo.regras = json.parametros[json.nivel]jogo.saldoInicial = jogo.saldo;jogo.clicExibirDica = 0;jogo.clicExibirTodasLetras = 0;if(jogo.handleContador > 0){clearInterval(jogo.handleContador);jogo.handleContador = 0;}/* start o contador no site, marcando sempre as moedas e os pontos*/jogo.handleContador = setInterval(function(){let j = "<img src='/img/tesouro.png' style='width: 1.5em;margin-right: 0.2em;'/>" + jogo.saldo;$("#idDivInfoMoedas").html(j);if(jogo.saldo < 0){if(!Swal.isVisible()){avisoParaAssistirVideoInicioJogo();}} else {if(Swal.isVisible()){if(Swal.getConfirmButton().textContent == "Ganhar créditos!"){Swal.close();}}}}, 100);if(jogo.handleAds > 0){clearInterval(jogo.handleAds);jogo.handleAds = 0;}let dificuldade = '';switch(parseInt(jogo.modelo.nivel)){case 0: dificuldade = 'Aprendiz'; break;case 1: dificuldade = 'Fácil'; break;case 2: dificuldade = 'Intermediário'; break;case 3: dificuldade = 'Difícil'; break;case 4: dificuldade = 'Incrível'; break;}let hdificuldade = '<span onclick="jogo.btnConfig()">' + faGearsBlack + ' ' + dificuldade + '</span>';$("#idDivInfoNivel").html(hdificuldade);/* start a estatistica */jogo.estatisticas.params = [];jogo.setEstatisticas('novo_jogo', '', '');jogo.palavras = json.palavras.filter(e => e.usada == true);/* envia mensagem para o app com os dados do jogo */sendMsg({"acao":"excluirPalavras","palavras": jogo.palavras});/* isso é necessário para reuniciar o jogo, somente com as palavras não usadas */json.palavras = json.palavras.filter(e => e.usada == false);jogo.aplicaRegras('novo_jogo');let idModelo = parseInt(json.idModelo);if(isNaN(idModelo)){idModelo = 0;}$.ajax({url: '/api/perfil/configuracoes/jogo/' + jogo.idJogo + '/configuracoes',dataType: 'json',type: 'POST',data: {modelo: modelo,idModelo: idModelo},success: function (j){jogo.modelo = j;}});$(".nav-link").click(function(){jogo.setAba($(this));});$.ajax({url: '/api/jogos/controle/get/historico/' + jogo.idJogo,dataType: 'json',success: function (j){jogo.historicoDesempenho = j;}});if(jogo.isPalavraSelecionada == 0){this.obrigatorioTrocarDeNivel();}},obrigatorioTrocarDeNivel: function(){isObrigatorioTrocarDeNivel = true;Swal.fire({title: '<strong>Não há mais palavras para este nível</strong>',html: '<p>É obrigatório a troca de nível</p>',showConfirmButton: true,showCloseButton: false,showCancelButton: false,focusConfirm: false,confirmButtonText: 'Ok',allowOutsideClick: false}).then(() => {this.btnConfig();});},formatarData: function(data){let m = data.getMonth() + 1;let dia = data.getDate() < 10 ? '0' + data.getDate() : data.getDate();let mes = m < 10 ? '0' + m : m;let ano = data.getFullYear();let hora = data.getHours();let min = data.getMinutes() < 10 ? '0' + data.getMinutes() : data.getMinutes();return dia + '/' + mes + '/' + ano + ' ' + hora + ':' + min;},checkClickAjuda: function(regra, check){if(jogo.idJogo == 2 || jogo.idJogo == 3){/* forca palavra escondida */if(regra == 'exibir_dica'){if(jogo.clicExibirDica > 0){return false;}if(check){jogo.clicExibirDica++;}}if(regra == 'exibir_todas_letras'){if(jogo.clicExibirTodasLetras > 0){return false;}if(check){jogo.clicExibirTodasLetras++;}}}return true;},aplicaRegras: function(regra){if(!jogo.checkClickAjuda(regra, true)){return;}let r = jogo.getRegras(regra);sendMsg({"acao":"aplicarRegras","regra": r,"jogo": jogo});},setEstatisticas: function (label, value, value2){/*** Estatisticas que o sistema irá contabilizar** - click* - inicio / fim* - win / loss**/let tp = ['click','vencer','perder','iniciar','finalizar'];let idx = tp.find(e => e == label);if(!idx){if(jogo.getRegras(label) == ''){return;}}jogo.estatisticas.params.push({'label': label,'value': value,'value2': value2,'data': new Date()});if(label == 'exibir_todas_letras'|| label == 'exibir_dica'|| label == 'resolver_palavra'|| label == 'mostrar_no_tabuleiro_letra'){jogo.aplicaRegras(label);}},getRegras: function(parametro){if(jogo.regras){return jogo.regras.find(e => e.parametro == parametro);} else {return '';}},getConsolidacao: function(venceu){let idJogo = jogo.idJogo;let palavra = '';let nivel = $("#idDivInfoNivel").text();if(jogo.idJogo == 1){palavra = jogo.palavras.length + ' palavras';} else {palavra = jogo.palavraSelecionada;}let params = jogo.estatisticas.params;let bonus = jogo.bonus;let regras = jogo.regras;let saldoInicial = jogo.saldoInicial;let saldoFinal = jogo.saldo;return {'idJogo': idJogo,'nivel': nivel,'palavra': palavra,'params': params,'bonus': bonus,'regras': regras,'saldoInicial': saldoInicial,'saldoFinal': saldoFinal,'resultado': venceu ? "venceu": "perdeu"}},viewExtrato: function(){/* gerar extrato do jogo */let nome = jogo.consolidacao.idJogo == 3 ? 'Forca' : (jogo.consolidacao.idJogo == 2 ? 'Palavra Escondida' : 'Palavras Cruzadas');let subNome = jogo.consolidacao.nivel;let nClick = jogo.consolidacao.params.filter(e => e.label == 'click').length;let inicio = jogo.consolidacao.params.filter(e => e.label == 'novo_jogo');let fim1 = jogo.consolidacao.params.filter(e => e.label == 'vencer');let fim2 = jogo.consolidacao.params.filter(e => e.label == 'perder');let fim = fim1.length == 0 ? fim2 : fim1;// Calcular a diferença em milissegundoslet diferencaEmMilissegundos = fim[0].data - inicio[0].data;// Calcular a diferença em segundoslet diferencaEmSegundos = diferencaEmMilissegundos / 1000;let intDiferencaEmSegundos = parseInt(diferencaEmSegundos);// Calcular a diferença em minutoslet diferencaEmMinutos = diferencaEmSegundos / 60;let intDiferencaEmMinutos = parseInt(diferencaEmMinutos);// Calcular a diferença em horaslet diferencaEmHoras = diferencaEmMinutos / 60;let intDiferencaEmHoras = parseInt(diferencaEmHoras);let modal = document.querySelector(".extrato");let title = modal.querySelector('.title');title.querySelector('.title1').innerHTML = nome;title.querySelector('.nivel').innerHTML = subNome;let tempo = '';if(intDiferencaEmHoras > 0){let m = intDiferencaEmMinutos - (intDiferencaEmHoras * 60);let s = intDiferencaEmSegundos - (m * 60);tempo = intDiferencaEmHoras + "horas e " + m + "min e " + s+"seg";} else if(intDiferencaEmMinutos > 0){let s = intDiferencaEmSegundos - (intDiferencaEmMinutos * 60);tempo = intDiferencaEmMinutos + "min e " + s +"seg";} else {tempo = intDiferencaEmSegundos+"seg";}let divs = modal.querySelector('.header');divs.children[0].children[1].innerHTML = nClick;divs.children[1].children[1].innerHTML = tempo;divs.children[2].children[1].innerHTML = jogo.consolidacao.saldoFinal + " moedas";let h = jogo.consolidacao.params;let rel = '<table style="width: 100%;">';let c = 0;let debito = 0;let credito = 0;let viewVideos = 0;let saldoAtual = parseInt(jogo.consolidacao.saldoInicial);function getLinhaTable(cls, idx, l, m, s ){return '<tr class="' + cls + '">' +'<td>' + idx + '</td>' +'<td>' + l + '</td>' +'<td style="text-align: right;">' + m + '</td>' +'<td> </td>' +'<td style="text-align: right;">' + s + '</td>' +'</tr>';}for(x in h){if(h[x].label == 'assistirVideo'){c++;saldoAtual+=parseInt(jogo.consolidacao.bonus);rel+=getLinhaTable('certo', c, 'Bônus vídeo', jogo.consolidacao.bonus, saldoAtual);viewVideos++;} else {let p = null;if(jogo.consolidacao.regras){p = jogo.consolidacao.regras.find(e => e.parametro == h[x].label);}if(p){c++;if(p.acao == 'sub'){s = '-';debito+=p.moedas;saldoAtual-=p.moedas;} else {s = '+';credito+=p.moedas;saldoAtual+=p.moedas;}if(p.nome == 'Letra certa' || p.nome == 'Letra errada'){nome = p.nome + ' - ' + h[x].value + '';} else {nome = p.nome;}rel+=getLinhaTable((s == '-' ? 'errado' : 'certo'), c, nome, s + ' ' + p.moedas, saldoAtual);}}}rel+='</table>';let body = modal.querySelector('.body');let container = body.querySelectorAll('.container');container[0].children[0].innerHTML = 'Saldo inicial ' + jogo.consolidacao.saldoInicial + ' moedas';container[0].children[1].innerHTML = rel;container[0].children[2].innerHTML = 'Saldo final ' + jogo.consolidacao.saldoFinal + ' moedas';let resumo = '<div style="font-size: 0.8em;">';resumo+= '<ul>';resumo+= '<li>' + debito + ' moedas debitadas</li>';resumo+= '<li>' + credito + ' moedas creditadas</li>';if(viewVideos > 1){resumo+= '<li>' + (viewVideos * jogo.consolidacao.bonus) + ' moedas creditadas em ' + viewVideos + ' videos assistidos</li>';} else {if(viewVideos > 0){resumo+= '<li>' + (viewVideos * jogo.consolidacao.bonus) + ' moedas creditadas em ' + viewVideos + ' video assistido</li>';}}resumo+= '</ul>';let custoJogo = credito - debito;if(custoJogo > 0){resumo+= '<p class="certoResumo">Parabêns, você conseguiu ganhar ' + custoJogo + ' moedas, aumentando seu saldo de ' + jogo.consolidacao.saldoInicial + ' para ' + jogo.consolidacao.saldo + ' moedas.</p>';} else {resumo+= '<p class="erradoResumo">Este jogo lhe custou ' + (custoJogo *-1) + ' moedas.</p>';}if(viewVideos > 0){resumo+= '<p style="color: #868686;font-size: .8em;font-style: italic;">Para calcular o custo do jogo, não é levado em consideração os créditos recebidos em bônus por vídeos assistidos</p>';}resumo+= '</div>';container[1].children[0].innerHTML = resumo;jogo.btnShowHideExtrato();setTimeout(function(){let posContent = document.getElementById('idDivPosContentExtrato');let posBody = document.getElementById('idDivPosBodyExtrato');let t1 = posContent.getBoundingClientRect().height;let t2 = posBody.getBoundingClientRect().top;let t3 = t1 - t2;posBody.style.maxHeight = t3 + "px";}, 50);},setAba: function(e){$(".nav-link").removeClass('active');e.addClass('active');$(".tab-pane").hide();$("." + e.attr('id')).show();},__GraficosAbaGeral1Vertical: function(params, dadosPorColunaVertical){if(typeof dadosPorColunaVertical != "object") return;$("#divGeralChartVerticalCard").show();am5.array.each(am5.registry.rootElements, function(root) {if (root && root.dom && root.dom.id == "divGeralChartVertical") {root.dispose();}});let root = am5.Root.new("divGeralChartVertical");root.setThemes([am5themes_Animated.new(root)]);var chart = root.container.children.push(am5xy.XYChart.new(root, {panX: false,panY: false,wheelX: "panX",wheelY: "zoomX",paddingLeft: 0,layout: root.verticalLayout}));// Create axes// https://www.amcharts.com/docs/v5/charts/xy-chart/axes/var xRenderer = am5xy.AxisRendererX.new(root, {minGridDistance: 30,minorGridEnabled: false})var xAxis = chart.xAxes.push(am5xy.CategoryAxis.new(root, {categoryField: "category",renderer: xRenderer,}));xRenderer.grid.template.setAll({location: 1})xRenderer.labels.template.setAll({paddingTop: 20});xAxis.data.setAll(dadosPorColunaVertical);var yAxis = chart.yAxes.push(am5xy.ValueAxis.new(root, {renderer: am5xy.AxisRendererY.new(root, {strokeOpacity: 0.1})}));// Add series// https://www.amcharts.com/docs/v5/charts/xy-chart/series/var series = chart.series.push(am5xy.ColumnSeries.new(root, {xAxis: xAxis,yAxis: yAxis,valueYField: "value",categoryXField: "category"}));series.columns.template.setAll({tooltipText: "{categoryX}: {valueY}",tooltipY: 0,strokeOpacity: 0,templateField: "columnSettings",cornerRadiusTL: 5,cornerRadiusTR: 5,});series.columns.template.adapters.add("fill", function (fill, target) {return chart.get("colors").getIndex(series.columns.indexOf(target));});series.columns.template.adapters.add("stroke", function (stroke, target) {return chart.get("colors").getIndex(series.columns.indexOf(target));});series.data.setAll(dadosPorColunaVertical);// Make stuff animate on load// https://www.amcharts.com/docs/v5/concepts/animations/series.appear();chart.appear(1000, 100);},__GraficosAbaGeral1Horizontal: function(params, dadosPorColunaHorizontal){if(typeof dadosPorColunaHorizontal != "object" || dadosPorColunaHorizontal == null) return;$("#divGeralChartHorizontalCard").show();am5.array.each(am5.registry.rootElements, function(root) {if (root && root.dom && root.dom.id == "divGeralChartHorizontal") {root.dispose();}});let root = am5.Root.new("divGeralChartHorizontal");root.setThemes([am5themes_Animated.new(root)]);var chart = root.container.children.push(am5xy.XYChart.new(root, {panX: false,panY: false,wheelX: "panX",wheelY: "zoomX",paddingLeft: 0,layout: root.verticalLayout}));// Create axesvar yRenderer = am5xy.AxisRendererY.new(root, {minGridDistance: 20,cellStartLocation: 0.1,cellEndLocation: 0.5,minorGridEnabled: true});yRenderer.grid.template.set('location', 1);var yAxis = chart.yAxes.push(am5xy.CategoryAxis.new(root, {categoryField: dadosPorColunaHorizontal.categoryYField,renderer: yRenderer,max: dadosPorColunaHorizontal.qtdTotalLinhas,min: 1,strictMinMax: true,adapter: {min: 1,max: dadosPorColunaHorizontal.qtdTotalLinhas,step: 1}}));yAxis.data.setAll(dadosPorColunaHorizontal.dados);var xAxis = chart.xAxes.push(am5xy.ValueAxis.new(root, {min:0,renderer: am5xy.AxisRendererX.new(root, {minGridDistance:30,minorGridEnabled:false})}));var series = chart.series.push(am5xy.ColumnSeries.new(root, {name: dadosPorColunaHorizontal.name,xAxis: xAxis,yAxis: yAxis,valueXField: dadosPorColunaHorizontal.valueXField,categoryYField: dadosPorColunaHorizontal.categoryYField,sequencedInterpolation: true,tooltip: am5.Tooltip.new(root, {pointerOrientation: "horizontal",labelText: "[bold]Tentativa {categoryY}: {valueX} vitórias"})}));series.columns.template.setAll({height: am5.percent(100),tooltipText: "{categoryX}: {valueY}",tooltipY: 0,strokeOpacity: 0,templateField: "columnSettings",cornerRadiusTL: 5,cornerRadiusTR: 5,});series.columns.template.adapters.add("fill", function (fill, target) {return chart.get("colors").getIndex(series.columns.indexOf(target));});series.columns.template.adapters.add("stroke", function (stroke, target) {return chart.get("colors").getIndex(series.columns.indexOf(target));});series.data.setAll(dadosPorColunaHorizontal.dados);var legend = chart.children.push(am5.Legend.new(root, {centerX: am5.p50,x: am5.p50}));series.appear();legend.data.setAll(chart.series.values);chart.appear(1000, 100);},__GraficosAbaGeral1Tempo: function(params, dadosPorLinhaTemporal){if(typeof dadosPorLinhaTemporal != "object") return;$("#divGeralChartTempoCard").show();am5.array.each(am5.registry.rootElements, function(root) {if (root && root.dom && root.dom.id == "divGeralChartTempo") {root.dispose();}});let root = am5.Root.new("divGeralChartTempo");// Set themes// https://www.amcharts.com/docs/v5/concepts/themes/root.setThemes([am5themes_Animated.new(root)]);// Create chart// https://www.amcharts.com/docs/v5/charts/xy-chart/var chart = root.container.children.push(am5xy.XYChart.new(root, {panX: true,panY: true,wheelX: "panX",wheelY: "zoomX",pinchZoomX:true,layout: root.verticalLayout,maxTooltipDistance: 0}));chart.get("colors").set("step", 3);// Add cursor// https://www.amcharts.com/docs/v5/charts/xy-chart/cursor/var cursor = chart.set("cursor", am5xy.XYCursor.new(root, {}));cursor.lineY.set("visible", false);// Create axes// https://www.amcharts.com/docs/v5/charts/xy-chart/axes/var xAxis = chart.xAxes.push(am5xy.DateAxis.new(root, {maxDeviation: 0.3,baseInterval: {timeUnit: "day",count: 1},renderer: am5xy.AxisRendererX.new(root, { minorGridEnabled: true }),tooltip: am5.Tooltip.new(root, {})}));var yAxis = chart.yAxes.push(am5xy.ValueAxis.new(root, {maxDeviation: 0.3,renderer: am5xy.AxisRendererY.new(root, {})}));let label1 = params.label1 ? params.label1 : 'Vitórias';let label2 = params.label2 ? params.label2 : 'Derrotas';// Add series// https://www.amcharts.com/docs/v5/charts/xy-chart/series/var series = chart.series.push(am5xy.LineSeries.new(root, {name: label1,xAxis: xAxis,yAxis: yAxis,valueYField: "vitorias",valueXField: "date",tooltip: am5.Tooltip.new(root, {labelText: "{previousDate}\n"+label1+": {valueY}\n"+label2+": {derrotas}"})}));series.strokes.template.setAll({strokeWidth: 2});series.get("tooltip").get("background").set("fillOpacity", 0.5);var series2 = chart.series.push(am5xy.LineSeries.new(root, {name: label2,xAxis: xAxis,yAxis: yAxis,valueYField: "derrotas",valueXField: "date"}));series2.strokes.template.setAll({strokeDasharray: [2, 2],strokeWidth: 2});// Set date fields// https://www.amcharts.com/docs/v5/concepts/data/#Parsing_datesroot.dateFormatter.setAll({dateFormat: "dd/MM/yyyy H:m:s",dateFields: ["valueX"]});var data = [];for(x in dadosPorLinhaTemporal){let a = new Date(dadosPorLinhaTemporal[x].inicio.split(' ')[0]);let idx = data.findIndex(e => e.date == a.getTime());if(idx == -1){let dia = a.getDate();let mes = a.getMonth() + 1;if(dia < 10){dia = '0' + dia;}if(mes < 10){mes = '0' + mes;}data.push({date: a.getTime(),vitorias: dadosPorLinhaTemporal[x].resultado == 1 ? 1 : 0,derrotas: dadosPorLinhaTemporal[x].resultado == 2 ? 1 : 0,previousDate: dia + '/' + mes + '/' + a.getFullYear()});} else {let v = dadosPorLinhaTemporal[x].resultado == 1 ? 1 : 0;let d = dadosPorLinhaTemporal[x].resultado == 2 ? 1 : 0;data[idx].vitorias += v;data[idx].derrotas += d;}}series.data.setAll(data);series2.data.setAll(data);// Make stuff animate on load// https://www.amcharts.com/docs/v5/concepts/animations/series.appear(1000);series2.appear(1000);var legend = chart.children.push(am5.Legend.new(root, {}));legend.data.setAll(chart.series.values);chart.appear(1000, 100);},__GraficosAbaGeral1: function(params, dadosPorColunaVertical, dadosPorColunaHorizontal, dados){$("#divGeralChartVerticalCard").hide();$("#divGeralChartHorizontalCard").hide();$("#divGeralChartTempoCard").hide();setTimeout(function(){jogo.__GraficosAbaGeral1Vertical(params, dadosPorColunaVertical);}, 10);setTimeout(function(){jogo.__GraficosAbaGeral1Horizontal(params, dadosPorColunaHorizontal);}, 100);setTimeout(function(){jogo.__GraficosAbaGeral1Tempo(params, dados);}, 100);},__GraficosAbaNivel: function(params, dados, nivel){let div = 1;switch(nivel){case 'Aprendiz': div = 1; break;case 'Fácil': div = 2; break;case 'Intermediário': div = 3; break;case 'Difícil': div = 4; break;case 'Incrível': div = 5; break;}let divChart = 'chartNivel' + div;let v = dados.reduce((sum, item) => sum + item.vitorias, 0);let d = dados.reduce((sum, item) => sum + item.derrotas, 0);let divTmp = '<div class="row col-12">';divTmp+= '<div class="col-6">' + nivel + '</div>';divTmp+= '<div class="col-3 p-0" style="text-align: right;">';divTmp+= v + '<img style="width: 20px;" src="/img/trophy.png">';divTmp+= '</div>';divTmp+= '<div class="col-3 p-0" style="text-align: right;">';divTmp+= d + '<img style="width: 20px;" class="derrota" src="/img/trophy.png">';divTmp+= '</div>';divTmp+= '</div>';$(".tabNivel .nivel" + div + " .card-header").html(divTmp);$(".tabNivel .nivel" + div).show();am5.array.each(am5.registry.rootElements, function(root) {if (root && root.dom && root.dom.id == divChart) {root.dispose();}});if(dados.length < 2){$("#" + divChart).html('<p style="text-align: justify;">Não há dados suficiente para montar o grafico. É necessário ter jogado em mais de um dia.<br><br>Neste nivel você jogou somente no dia ' + dados[0].previousDate + '</p>');return;}let root = am5.Root.new(divChart);// Set themes// https://www.amcharts.com/docs/v5/concepts/themes/root.setThemes([am5themes_Animated.new(root)]);// Create chart// https://www.amcharts.com/docs/v5/charts/xy-chart/var chart = root.container.children.push(am5xy.XYChart.new(root, {panX: true,panY: true,wheelX: "panX",wheelY: "zoomX",pinchZoomX:true,layout: root.verticalLayout,maxTooltipDistance: 0}));chart.get("colors").set("step", 3);// Add cursor// https://www.amcharts.com/docs/v5/charts/xy-chart/cursor/var cursor = chart.set("cursor", am5xy.XYCursor.new(root, {}));cursor.lineY.set("visible", false);// Create axes// https://www.amcharts.com/docs/v5/charts/xy-chart/axes/var xAxis = chart.xAxes.push(am5xy.DateAxis.new(root, {maxDeviation: 0.3,baseInterval: {timeUnit: "day",count: 1},renderer: am5xy.AxisRendererX.new(root, { minorGridEnabled: true }),tooltip: am5.Tooltip.new(root, {})}));var yAxis = chart.yAxes.push(am5xy.ValueAxis.new(root, {maxDeviation: 0.3,renderer: am5xy.AxisRendererY.new(root, {})}));let label1 = params.label1 ? params.label1 : 'Vitórias';let label2 = params.label2 ? params.label2 : 'Derrotas';// Add series// https://www.amcharts.com/docs/v5/charts/xy-chart/series/var series = chart.series.push(am5xy.LineSeries.new(root, {name: label1,xAxis: xAxis,yAxis: yAxis,valueYField: "vitorias",valueXField: "date",tooltip: am5.Tooltip.new(root, {labelText: "{previousDate}\n" + label1 + ": {valueY}\nn" + label2 + ": {derrotas}"})}));series.strokes.template.setAll({strokeWidth: 2});series.get("tooltip").get("background").set("fillOpacity", 0.5);var series2 = chart.series.push(am5xy.LineSeries.new(root, {name: label2,xAxis: xAxis,yAxis: yAxis,valueYField: "derrotas",valueXField: "date"}));series2.strokes.template.setAll({strokeDasharray: [2, 2],strokeWidth: 2});// Set date fields// https://www.amcharts.com/docs/v5/concepts/data/#Parsing_datesroot.dateFormatter.setAll({dateFormat: "dd/MM/yyyy H:m:s",dateFields: ["valueX"]});series.data.setAll(dados);series2.data.setAll(dados);// Make stuff animate on load// https://www.amcharts.com/docs/v5/concepts/animations/series.appear(1000);series2.appear(1000);var legend = chart.children.push(am5.Legend.new(root, {}));legend.data.setAll(chart.series.values);chart.appear(1000, 100);},__MontaDadosPorNivel: function(params, dados){$(".tabNivel .card").hide();var vetDadosPorNivel = [];var vetNiveis = [];for(x in dados){if(!dados[x].historico.nivel) continue;let a = new Date(dados[x].inicio.split(' ')[0]);let idxN = vetNiveis.findIndex(e => e.nivel == dados[x].historico.nivel.trim());if(idxN == -1){vetNiveis.push({nivel: dados[x].historico.nivel.trim()})}let idx = vetDadosPorNivel.findIndex(e => e.date == a.getTime() && e.nivel == dados[x].historico.nivel.trim());if(idx == -1){let dia = a.getDate();let mes = a.getMonth() + 1;if(dia < 10){dia = '0' + dia;}if(mes < 10){mes = '0' + mes;}vetDadosPorNivel.push({date: a.getTime(),vitorias: dados[x].resultado == 1 ? 1 : 0,derrotas: dados[x].resultado == 2 ? 1 : 0,previousDate: dia + '/' + mes + '/' + a.getFullYear(),nivel: dados[x].historico.nivel.trim()});} else {let v = dados[x].resultado == 1 ? 1 : 0;let d = dados[x].resultado == 2 ? 1 : 0;vetDadosPorNivel[idx].vitorias += v;vetDadosPorNivel[idx].derrotas += d;}}count = 0;function b(){if(vetNiveis[count]){let dd = vetDadosPorNivel.filter(e => e.nivel == vetNiveis[count].nivel);jogo.__GraficosAbaNivel(params, dd, vetNiveis[count].nivel);}if(count < 6){count++;setTimeout(b(), 100);}}b();},__MontaDadosTabela: function(params, dados){let vetPalavras = [];let countAcerto = 0;let countErro = 0;let countWin = 0;let countLose = 0;for(x in dados){let historico = dados[x].historico;let countA = 0;let countE = 0;for(y in historico.params){let p = dados[x].historico.params[y];if(p.label == 'letra_certa'){countAcerto++;countA++;} else if(p.label == 'letra_errada'){countErro++;countE++;}}(historico.resultado == 'venceu')? countWin++: countLose++;vetPalavras.push({'palavra': historico.palavra ? historico.palavra : historico.nome,'bonus': historico.bonus,'resultado': historico.resultado,'saldoFinal': historico.saldoFinal,'saldoInicial': historico.saldoInicial,'data': dados[x].data,'duracao': dados[x].duracao,'fim': dados[x].fim,'inicio': dados[x].inicio,'certo': countA,'errado': countE});}let t = '<table class="table">';let v = [];let vo = [];for(x in vetPalavras){let c = x % 2 == 0 ? 'odd' : 'even';let d = vetPalavras[x].data;let w = vetPalavras[x].resultado == 'venceu' ? 'ok' : 'nok';let wl = vetPalavras[x].resultado == 'venceu' ? '<img src="/img/trophy.png" style="width: 80%;">' : '<img src="/img/trophy.png" style="width: 80%;" class="derrota">';let h = '<tr class="' + c + '">' +'<td style="width: 15%">' + wl + '</td>' +'<td style="width: 38%">' + jogo.formatarData(new Date(vetPalavras[x].inicio)) + '</td>' +'<td style="">' + vetPalavras[x].palavra + '</td>' +'<td style="width: 10%; text-align: right">' + vetPalavras[x].duracao.toString().replace('.',':') + '</td>' +'</tr>';v.push(vetPalavras[x].inicio);vo.push({'data': vetPalavras[x].inicio,'linha' : h});}v.sort();let vv = v.toReversed();for(x in vv){t+=vo.find(e => e.data == vv[x]).linha;}t+='</table>';$("#divTabelaHistorico").html(t);},__viewDesempenhoForca(params, dados){function geral(params, dados){let countAcerto = 0;let countErro = 0;let countWin = 0;let countLose = 0;let vetDadosGraficos = [];for(x in dados){let historico = dados[x].historico;let countA = 0;let countE = 0;for(y in historico.params){let p = dados[x].historico.params[y];if(p.label == 'letra_certa'){countAcerto++;countA++;} else if(p.label == 'letra_errada'){countErro++;countE++;}}(historico.resultado == 'venceu')? countWin++: countLose++;}$("#divGeralTotais").html("Você jogou o total de " + (countWin + countLose) + " partidas");vetDadosGraficos.push({category: "Vitórias",value: countWin});vetDadosGraficos.push({category: "Derrotas",value: countLose});jogo.__GraficosAbaGeral1(params, vetDadosGraficos, null, dados);}geral(params, dados);jogo.__MontaDadosPorNivel(params, dados);jogo.__MontaDadosTabela(params, dados);},__viewDesempenhoPE(params, dados){function geral(params, dados){let vetTotaisPorLinha = {name: "Número de vitórias por tentativa",valueXField: "qtdVitorias",categoryYField: "linha",categoryField: "linha",qtdTotalLinhas: 6,dados: []};let vetDadosGraficos = [];let countWin = 0;let countLose = 0;vetTotaisPorLinha.dados.push({linha: 1,qtdVitorias: 0},{linha: 2,qtdVitorias: 0},{linha: 3,qtdVitorias: 0},{linha: 4,qtdVitorias: 0},{linha: 5,qtdVitorias: 0},{linha: 6,qtdVitorias: 0});for(x in dados){let historico = dados[x].historico;let idLinha = 0;for(y in historico.params){let p = dados[x].historico.params[y];if(p.label == 'linha'){idLinha = p.value + 1;}}let idxLinha = vetTotaisPorLinha.dados.findIndex(e => e.linha == idLinha);vetTotaisPorLinha.dados[idxLinha].qtdVitorias++;(historico.resultado == 'venceu')? countWin++: countLose++;}vetDadosGraficos.push({category: "Vitórias",value: countWin});vetDadosGraficos.push({category: "Derrotas",value: countLose});$("#divGeralTotais").html("Você jogou o total de " + (countWin + countLose) + " partidas");jogo.__GraficosAbaGeral1(params, vetDadosGraficos, vetTotaisPorLinha, dados);}geral(params, dados);jogo.__MontaDadosPorNivel(params, dados);jogo.__MontaDadosTabela(params, dados);},__viewDesempenhoPC(params, dados){function geral(params, dados){let vetDadosGraficos = [];let countWin = 0;let countLose = 0;for(x in dados){let historico = dados[x].historico;(historico.resultado == 'venceu')? countWin++: countLose++;}vetDadosGraficos.push({category: "Completas",value: countWin});vetDadosGraficos.push({category: "Incompletas",value: countLose});$("#divGeralTotais").html("Você jogou o total de " + (countWin + countLose) + " partidas");jogo.__GraficosAbaGeral1(params, vetDadosGraficos, null, dados);}params.label1 = "Completas";params.label2 = "Incompletas";geral(params, dados);jogo.__MontaDadosPorNivel(params, dados);jogo.__MontaDadosTabela(params, dados);},viewDesempenho: function(){$('.tabHome').show();let modal = document.querySelector(".desempenho");$("#idTitle1NomeJogo").html(jogo.historicoDesempenho.info.nome);if(jogo.historicoDesempenho.info.nome == 'Forca'){jogo.__viewDesempenhoForca(modal, jogo.historicoDesempenho.dados);}if(jogo.historicoDesempenho.info.nome == "Palavra Escondida"){jogo.__viewDesempenhoPE(modal, jogo.historicoDesempenho.dados);}if(jogo.historicoDesempenho.info.nome == "Palavras Cruzadas"){jogo.__viewDesempenhoPC(modal, jogo.historicoDesempenho.dados);}setTimeout(function(){let posContent = document.getElementById('idDivPosContentDesempenho');let posBody = document.getElementById('idDivPosBodyDesempenho');let t1 = posContent.getBoundingClientRect().height;let t2 = posBody.getBoundingClientRect().top;let t3 = t1 - t2;posBody.style.maxHeight = t3 + "px";}, 50);},btnShowHideDesempenho: function(){let modal = document.querySelector(".desempenho");modal.style.display =(modal.style.display == 'block')? 'none': 'block';if(modal.style.display == 'block'){jogo.viewDesempenho();}},btnShowHideExtrato: function(){let modal = document.querySelector(".extrato");modal.style.display =(modal.style.display == 'block')? 'none': 'block';},__showEndGame: function(venceu, msg){let j = jogo.getRegras(venceu ? 'vencer' : 'perder');let texto = "";let titulo = "Parabéns";let icone = 'success';if(venceu){texto = "Parabéns, conseguiu vencer o jogo.";if(msg){texto+='<hr>' + msg + '<hr>Ganhou ';} else {texto+=' e ganhou ';}jogo.setEstatisticas('vencer','Você venceu o jogo');if(j.moedas > 0){texto+= j.moedas + " moedas!";}} else {jogo.setEstatisticas('perder','Você perdeu o jogo');icone = 'error';titulo = "Não foi desta vez";texto = "Fim de Jogo! ";if(msg){texto+='<hr>' + msg + '<hr>';}/*if(j.pontos && j.pontos > 0){texto+= "Perdeu " + j.pontos + " pontos";if(j.moedas && j.moedas > 0){texto+= " e " + j.moedas + " moedas!";}} else { */if(j && j.moedas && j.moedas > 0){texto+= "Perdeu " + j.moedas + " moedas!";}//}}$.ajax({url: '/api/jogos/controle/historico',dataType: 'json',type: 'POST',data: {estatistica: JSON.stringify(jogo.consolidacao),idModelo: jogo.modelo.idModelo},success: function (j){jogo.historicoDesempenho.dados.push(j.dados);}});let m = 0;let p = 0;let a = '';if(j && j.moedas && j.moedas > 0){m = j.moedas;}if(j && j.pontos && j.pontos > 0){p = j.pontos;}if(j && j.acao){a = j.acao;}return {'titulo': titulo,'texto': texto,'pontos': m,'moedas': p,'acao' : a,'icone': icone}},__showEndGameFixed: function(dd, extrato){let param = {title: dd.titulo,html: dd.texto + extrato,showCancelButton: true,confirmButtonText: 'Novo jogo',cancelButtonText: 'Ir para o menu de jogos',allowOutsideClick: false};if(dd.icone == 'success'){param.iconHtml = '<img src="/img/trophy.png" style="width: 100%;">';} else {//param.icon = dd.iconeparam.iconHtml = '<img src="/img/trophy.png" style="width: 100%;" class="derrota">';}Swal.fire(param).then((result) => {if(result.isConfirmed){sendMsg({"acao":"reload","jogo": jogo});} else {jogo.__showEndGameFixed(dd, extrato);sendMsg({"acao":"menuDeJogos"});}});},showEndGame: function(venceu, msg){jogo.aplicaRegras(venceu ? 'vencer' : 'perder');let time = venceu ? 600 : 800;setTimeout(function(){jogo.consolidacao = jogo.getConsolidacao(venceu);let extrato = '<hr><div onclick="jogo.viewExtrato()" style="color: #aa7240;margin-top: 1em;"><i class="fa-solid fa-receipt"></i> Extrato do jogo</div>';let dd = jogo.__showEndGame(venceu, msg);jogo.__showEndGameFixed(dd, extrato);}, time);},callbackQuestion: function(){/*Ajuda A - resolver a palavra (valor = 15)Ajuda B - exibir todas as letras que faltam para completar o tabuleiro (valor = 10)Ajuda C - mostrar no tabuleiro a letra (?) (jogador escolhe uma letra das que apareceram na dica F (valor = 5)*/if(!jogo.regras){alert('Não foi definido os parametros para o nivel ' + jogo.modelo.nivel);return;}let r = jogo.regras.filter(e => e.tpRegra == 'ajuda');let h = '<div id="idDivAreaQuestion">';h+= '<table><tbody>';h+= '<tr>';h+= '<td valign="top">Você tem ' + jogo.saldo + ' moedas em créditos <br><img src="/img/tesouro.png" style="width: 100px;" class="btnAssistirVideo"><p class="btnAssistirVideo" onclick="assistirVideo(\'video\')">' + faVideoYellow + '</p></td>';h+= '<td> </td>';h+= '<td style="text-align:center">';h+= 'Escolha uma das opções abaixo';h+= '<hr />';for(let x in r){let m = parseInt(r[x].moedas);icone = '';switch(r[x].parametro){case 'exibir_todas_letras':icone = faExibirTodasAsLetras;break;case 'mostrar_no_tabuleiro_letra':icone = faMostrarNoTabuleiro;break;case 'resolver_palavra':icone = faResolverPalavra;break;case 'exibir_dica':icone = faDica;break;}if(jogo.checkClickAjuda(r[x].parametro)){if(m <= jogo.saldo){h+='<button class="btn btn-primary btn-sm" style="margin: 2px;" onclick="jogo.setEstatisticas(\'' + r[x].parametro + '\'); ' + r[x].parametro + '()"><table style="width: 10em;"><tr><td>' + icone + '</td><td>' + r[x].nome + ' por ' + r[x].moedas + ' moedas</td></tr></table></button>';} else {h+='<button class="btn btn-warning btn-sm btnAssistirVideo" style="margin: 2px;" onclick="assistirVideo(\'' + r[x].parametro + '\')"> <table style="width: 10em;"><tr><td>' + faVideo + '<br>' + icone + '</td><td>' + r[x].nome + ' por ' + r[x].moedas + ' moedas</td></tr></table></button>';}} else {h+='<button disabled class="btn btn-primary btn-sm" style="margin: 2px;"><table style="width: 10em;"><tr><td>' + icone + '</td><td>' + r[x].nome + ' por ' + r[x].moedas + ' moedas</td></tr></table></button>';}}h+='</td>';h+='</tr>';h+='</table>';h+='<hr>';h+='<div style="text-align:center;width: 100%;">';h+='<button onclick="jogo.btnDesempenho()" class="btn btn-primary btn-sm" style="margin-right: 1em; padding-bottom: 0.5em;">' + faChartLine + '</button>';h+='<button onclick="jogo.btnReload()" class="btn btn-primary btn-sm" style="margin-right: 1em; padding-bottom: 0.5em;">' + faRotate + '</button>';h+='<button onclick="jogo.btnViewRegras()" class="btn btn-primary btn-sm" style="margin-right: 1em; padding-bottom: 0.5em;">' + faPenToSquare + '</button>';h+='<button onclick="jogo.btnConfig()" class="btn btn-primary btn-sm" style="padding-bottom: 0.5em;">' + faGears + '</button>';h+='</div>';h+='</div>';h+='<div id="idDivAreaRegras" style="display:none">';h+='<div id="idDivAreaRegrasRegras" style="font-size: 0.8em;"></div>';h+='<hr>';h+='<div style="text-align:center;width: 100%;">';h+='<div id="idDivAreaRegrasBtn">';h+='<button onclick="jogo.btnViewOpcoes()" class="btn btn-warning btn-sm">Exibir opções do jogo</button>';h+='</div>';h+='</div>';h+='</div>';Swal.fire({title: '<strong>Precisando de ajuda?</strong>',html: h,showConfirmButton: false,showCloseButton: false,showCancelButton: true,focusConfirm: false,cancelButtonText: 'Voltar ao jogo',cancelButtonAriaLabel: 'Voltar ao jogo',allowOutsideClick: false});if(jogo.checkIsCanViewVideo()){$(".btnAssistirVideo").removeClass("btnAssistirVideoDisabled");} else {$(".btnAssistirVideo").addClass("btnAssistirVideoDisabled");}},getDescritivoRegra: function(param, eof){let r = jogo.getRegras(param);if(!eof){eof = "";}if(r){let gp = r.acao == "add" ? "ganha" : "paga";if(r.moedas > 0){return r.nome + " - " + gp + " " + r.moedas + " moedas" + eof;}/*if(r.moedas > 0 || r.pontos > 0){if(r.moedas > 0 && r.pontos > 0){return r.nome + " - " + gp + " " + r.pontos + " pontos e " + r.moedas + " moedas" + eof;} else if(r.moedas > 0){return r.nome + " - " + gp + " " + r.moedas + " moedas" + eof;} else {return r.nome + " - " + gp + " " + r.pontos + " pontos" + eof;}} */}return '';},btnConfig: function(){let html = '<div class="form-group">';html+= '<select data-id="' + jogo.idJogo + '" class="form-select selNivelJogos">';j = jogo.modelo;for(x in j.niveis){html+= '<option value="' + j.niveis[x].id + '" ' + (j.niveis[x].id == j.nivel ? 'selected' : '') + '>';html+= j.niveis[x].label;html+= '</option>';}html+='</select>';html+='</div>';isAltConfig = false;Swal.fire({title: '<strong>Configurações</strong>',html: html,showConfirmButton: true,showCloseButton: false,showCancelButton: false,focusConfirm: false,confirmButtonText: 'Voltar ao jogo',allowOutsideClick: false}).then(() => {if(isAltConfig){Swal.fire({icon: 'warning',title: 'Aguarde, carregando novos dados',showConfirmButton: false,allowOutsideClick: false});} else {if(isObrigatorioTrocarDeNivel){this.obrigatorioTrocarDeNivel();}}});$(".selNivelJogos").change(function(){isAltConfig = true;Swal.close();$.ajax({url: '/api/perfil/configuracoes/jogo/' + jogo.idJogo + '/setnivel',dataType: 'json',type: 'POST',data: {nivel: $(this).val()},success: function(e){isObrigatorioTrocarDeNivel = false;Swal.fire({icon: 'success',title: 'Nível alterado com sucesso'}).then(() => {sendMsg({"acao": "reloaddados","idJogo": jogo.idJogo,"novasPalavras": e.palavras});});}})});$(".checkConfiguracoes").click(function(){$.ajax({url: '/api/perfil/configuracoes/jogo/' + jogo.idJogo + '/setcategoria',dataType: 'json',type: 'POST',data: {id: $(this).val(),checked: $(this).prop('checked')},success: function (j){isAltConfig = true;let ok = j.isCheck == 'yes';$(".checkConfiguracoes[value='" + j.idCat + "']").prop('checked', ok);}});});},btnReload: function(){Swal.close();Swal.fire({title: '<strong>Tem certeza que deseja iniciar novo jogo?</strong>',icon: 'info',showConfirmButton: true,showCloseButton: false,showCancelButton: true,focusConfirm: false,confirmButtonText: 'Reiniciar jogo',confirmButtonAriaLabel: 'Reiniciar jogo',cancelButtonText: 'Voltar ao jogo',cancelButtonAriaLabel: 'Voltar ao jogo',allowOutsideClick: false}).then((result) => {if (result.isConfirmed) {jogo.consolidacao = jogo.getConsolidacao(false);jogo.__showEndGame(false, '');sendMsg({"acao": "reload","jogo": jogo});}});},btnDesempenho: function(){jogo.btnShowHideDesempenho();},btnViewRegras: function(){$("#idDivAreaQuestion").hide('slow');$("#idDivAreaRegras").show('slow');let nj = jogo.getRegras('novo_jogo');let jogoVencer = jogo.getRegras('vencer');let jogoPerder = jogo.getRegras('perder');let h = "";h+="<span style='font-weight: bold;'>Ganhos e perdas de moedas</span>";h+="<div style='text-align:justify'>";h+= "Ao iniciar a partida você paga " + nj.moedas + " moedas, mas se vencer a partida, irá ganhar " + jogoVencer.moedas + " moedas<br>";if(jogoPerder && jogoPerder.moedas > 0){h+= "Se perder a partida, isso irá lhe custar " + jogoPerder.moedas + " moedas.";}h+="</div>";let lCerta = jogo.getDescritivoRegra('letra_certa');let lErrado = jogo.getDescritivoRegra('letra_errada');if(lCerta != '' || lErrado != ''){h+="<hr />";h+="<span style='font-weight: bold;'>Regras ao clicar no teclado</span>";h+="<div style='text-align:center'>";h+= jogo.getDescritivoRegra('letra_certa', '<br>');h+= jogo.getDescritivoRegra('letra_errada', '<br>');h+="</div>";}h+="<hr />";h+="<span style='font-weight: bold;'>Regras referente as ajudas do jogo</span>";h+="<div style='text-align:center'>";h+= jogo.getDescritivoRegra('exibir_todas_letras', '<br>');h+= jogo.getDescritivoRegra('exibir_dica', '<br>');h+= jogo.getDescritivoRegra('resolver_palavra', '<br>');h+= jogo.getDescritivoRegra('mostrar_no_tabuleiro_letra', '<br>');h+="</div>";$("#idDivAreaRegrasRegras").html(h);},btnViewOpcoes: function(){$("#idDivAreaQuestion").show('slow');$("#idDivAreaRegras").hide('slow');},alertAlteracaoConfiguracoes: function(){Swal.fire({title: '<strong>Aviso</strong>',html: '<p>Você realizou alterações nas configurações do jogo</p>',showConfirmButton: true,showCloseButton: false,showCancelButton: true,focusConfirm: false,confirmButtonText: '<i class="fa fa-thumbs-up"></i> Quero um novo jogo com as novas configurações!',confirmButtonAriaLabel: ' <i class="fa fa-thumbs-up"></i> Quero um novo jogo com as novas configurações!',cancelButtonText: 'Quero voltar ao jogo que estava',cancelButtonAriaLabel: 'Quero voltar ao jogo que estava',allowOutsideClick: false}).then((result) => {if (result.isConfirmed) {sendMsg({"acao": "reload","jogo": jogo});}})},showAlertHelp: function(nivel){let c = '';switch(nivel){case 1: c = 'pulse'; break;case 2: c = 'tremor'; break;case 3:h = "Você pode pedir ajuda sempre que precisar, basta clicar no icone <div id='idDivInfoAjuda'><span onclick='jogo.callbackQuestion()' class='questionTop'><span>?</span></span></div>";Swal.fire({title: '<strong>É sua última chance, que tal uma ajuda?</strong>',html: h,showConfirmButton: true,showCloseButton: false,showCancelButton: true,focusConfirm: false,confirmButtonText: '<i class="fa fa-thumbs-up"></i>Pedir ajuda!',confirmButtonAriaLabel: ' <i class="fa fa-thumbs-up"></i>Pedir ajuda!',cancelButtonText: 'Não, eu consigo sozinho',cancelButtonAriaLabel: 'Não, eu consigo sozinho',allowOutsideClick: false}).then((result) => {if (result.isConfirmed) {jogo.callbackQuestion();}});break;}$("#idDivInfoAjuda .questionTop").addClass(c);setTimeout(function(){$("#idDivInfoAjuda .questionTop").removeClass(c);}, 4000);},checkIsCanViewVideo: function(){return jogo.isCanViewVideoRewardedInterstitial || jogo.isCanViewVideoRewarded;if(jogo.isCanViewVideoRewardedInterstitial == true|| jogo.isCanViewVideoRewarded == true|| jogo.isCanViewVideoInterstitial == true){return true;} else {return false;}}}const run = function(v){if(!controleStartJogo){$.ajaxSetup({headers:{ 'X-AUTH-TOKEN': token }});controleStartJogo = true;$("#idDivTabuleiro").html("");$("#idDivDica").html("");if(jogo.desafioDiario > 0){$.ajax({url: '/api/jogos/controle/getDesafiodiario/' + jogo.desafioDiario,dataType: 'json',type: 'GET',beforeSend: function(){Swal.fire({title: 'Aguarde',icon: 'warning',html: '<p>Carregando desafio diario.</p>',showConfirmButton: false,showCloseButton: false,showCancelButton: false,allowOutsideClick: false,focusConfirm: false,});},success: function (v){let r = init(v);jogo.desafioDiario = 0;jogo.configure(r.idJogo, r.json, r.dados);Swal.close();if (v.configUser) {jogo.configUser = v.configUser;}}});} else {let r = init(v);jogo.configure(r.idJogo, r.json, r.dados);if (v.configUser) {jogo.configUser = v.configUser;}}}}const receiveMsg = function (j){let localSaldo = 0;let localPontos = 0;switch(j.funcao){case 'errorAnuncio':$.ajax({url: '/api/jogos/controle/log',data:{'tipo': j.tipo},dataType: 'json',});break;case 'setSaldo':if(isViewAnuncio) {Swal.close();isViewAnuncio = false;}localSaldo = parseInt(j.saldo)jogo.saldo = isNaN(localSaldo) ? 0 : localSaldo;if(j.metodo != "" && typeof eval(j.metodo) == "function" && j.metodo != "video"){setTimeout(function(){eval(j.metodo + "()");jogo.setEstatisticas(j.metodo);}, 100);}break;case 'setSaldoPontos':localSaldo = parseInt(j.saldo)localPontos = parseInt(j.pontos)jogo.saldo = isNaN(localSaldo) ? 0 : localSaldo;jogo.pontos = isNaN(localPontos) ? 0 : localPontos;break;case 'reload':Swal.close();controleStartJogo = false;run(j.p);break;case 'viewAlertAlteracaoConfiguracoes':Swal.close();setTimeout(function(){jogo.alertAlteracaoConfiguracoes();}, 100);break;case 'videoIndisponivel':videoIndisponivel();break;case 'message':alert(j.message);break;}}const assistirVideo = function(metodo) {Swal.close();isViewAnuncio = true;sendMsg({"acao": "assistirVideo","metodo": metodo});}const videoIndisponivel = function(){setTimeout(function(){Swal.fire({title: '',icon: 'warning',html: '<p>No momento não há anúncios disponíveis<hr />Tente mais um pouco, você consegue, acredito em você.</p>',showConfirmButton: true,showCloseButton: false,showCancelButton: false,allowOutsideClick: false,focusConfirm: false,confirmButtonText: '<img src="/img/positive_icon_transparent.png" alt="Confirmar" style="width: 100px; height: 100px; vertical-align: middle;">',confirmButtonColor: "#fff",});sendMsg({"acao":"loading","exec":"stop"});}, 6000);}const avisoParaAssistirVideoInicioJogo = function (){let h = '';h+= '<div>Você tem ' + jogo.saldo + ' moedas de créditos <br><img src="/img/tesouro.png" class="btnAssistirVideo" style="width: 100px;" onclick="assistirVideo(\'video\')"></div></div><hr />';Swal.fire({title: '<strong>Você esta sem moedas suficiente?</strong>',html: h,showConfirmButton: true,showCloseButton: false,showCancelButton: true,focusConfirm: false,confirmButtonText: '<i class="fa fa-thumbs-up"></i>Ganhar créditos!',confirmButtonAriaLabel: ' <i class="fa fa-thumbs-up"></i>Ganhar créditos!',cancelButtonText: 'Voltar ao menu de jogos',cancelButtonAriaLabel: 'Voltar ao menu de jogos',allowOutsideClick: false}).then((result) => {if (result.isConfirmed) {assistirVideo('video');} else {if(result.dismiss && result.dismiss == 'cancel'){sendMsg({"acao":"menuDeJogos"});}}});}{% if rota_controler == "jogos"%}let nome_param_storage = getParamStorageJogo(3);async function carregaDados(){let tmptoken = await localStorage.getItem('token');if(tmptoken != "" && tmptoken != null){token = tmptoken;jogos = await JSON.parse(localStorage.getItem(nome_param_storage));jogo.saldo = await localStorage.getItem('saldo');jogo.bonus = await localStorage.getItem('bonus');jogo.desafioDiario = 2;run(jogos);return true;}return false;}function trocaNivel(idJogo){getDados(idJogo, function(j){jJogo = j.jogos.findIndex(e => e.id == idJogo);localStorage.setItem(getParamStorageJogo(idJogo), JSON.stringify(j.jogos[jJogo]));location.reload();});}function getDados(idJogo, callback){$.ajax({url: '/api/jogos/controle/getPalavras',data:{'idJogos': idJogo},dataType: 'json',success: function (j){if(typeof callback == 'function'){callback(j);}}});}async function start(idJogo){nome_param_storage = getParamStorageJogo(idJogo);if(!await carregaDados()){$.ajax({url: '/api/login/setUserAnonimo',data:{'deviceId': 'web'},dataType: 'json',success: function (j){token = j.token;jogo.saldo = j.jogos.saldo;jogo.bonus = j.jogos.bonusVideo;jogo.desafioDiario = 2;run(j.jogos.jogos[idJogo]);localStorage.setItem('token', j.token);localStorage.setItem('saldo', j.jogos.saldo);localStorage.setItem('bonus', j.jogos.bonusVideo);localStorage.setItem(getParamStorageJogo(1), JSON.stringify(j.jogos.jogos[1]));localStorage.setItem(getParamStorageJogo(2), JSON.stringify(j.jogos.jogos[2]));localStorage.setItem(getParamStorageJogo(3), JSON.stringify(j.jogos.jogos[3]));}});}}async function fnJogoWebExcluirPalavras(msg, nome_param_storage){let jogos = await JSON.parse(localStorage.getItem(nome_param_storage));for(x in msg.palavras){let i = jogos.palavras.findIndex(e => e.palavra == msg.palavras[x].palavra);if(i > -1){jogos.palavras[i].usada = true;}}localStorage.setItem(nome_param_storage, JSON.stringify(jogos));}function getParamStorageJogo(idJogo){switch(parseInt(idJogo)){case 1: return 'jogo_palavras_cruzadas'; break;case 2: return 'jogo_palavra_escondida'; break;case 3: return 'jogo_forca'; break;}return '';}function sendMsg(msg){switch(msg.acao){case 'reloaddados':idJogo = msg.idJogo;jJogo = msg.novasPalavras.jogos.findIndex(e => e.id == idJogo);localStorage.setItem(getParamStorageJogo(idJogo), JSON.stringify(msg.novasPalavras.jogos[jJogo]));location.reload();break;case 'reload':controleStartJogo = false;start();break;case 'excluirPalavras':fnJogoWebExcluirPalavras(msg, getParamStorageJogo(jogo.idJogo));break;case 'assistirVideo':jogo.saldo = parseInt(jogo.saldo) + parseInt(jogo.bonus);localStorage.setItem('saldo', jogo.saldo);$.ajax({url: '/api/perfil/saldo/add',type: 'POST',contentType: 'application/json', // Define o tipo de conteúdo como JSONdata: JSON.stringify({'saldo': jogo.saldo,'nome': 'Video assistido','add': jogo.bonus,'tipo': 3})});break;case 'aplicarRegras':let r = msg.regra;let param = {};if(r.acao == 'sub'){jogo.saldo = parseInt(jogo.saldo) - parseInt(r.moedas);param.sub = r.moedas;} else {jogo.saldo = parseInt(jogo.saldo) + parseInt(r.moedas);param.add = r.moedas;}localStorage.setItem('saldo', jogo.saldo);param.saldo = jogo.saldo;param.nome = r.nome;param.tipo = 5;$.ajax({url: '/api/perfil/saldo/' + r.acao,type: 'POST',contentType: 'application/json', // Define o tipo de conteúdo como JSONdata: JSON.stringify(param)});break;}}$("#idDivBottom").css('width', $('.container').innerWidth());let newHeight = $('#idDivBottom').innerHeight() - $('footer').innerHeight();$("#idDivBottom").css('bottom', $('footer').innerHeight());$("#idDivBottom").css('height', newHeight);{% else %}function sendMsg(msg){if(window.ReactNativeWebView){msg.token = token;window.ReactNativeWebView.postMessage(JSON.stringify(msg));}}window.addEventListener('message',function(event){let j = event.data;if(typeof receiveMsg === 'function'){receiveMsg(j);}},false);document.addEventListener('message',function(event){let j = event.data;if(typeof receiveMsg == 'function'){receiveMsg(j);}},false);{% endif %}/* calculando a área do jogo */var alturaDaJanela = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;var tamanhoDoCabecalho = 1;var alturaCabecalho = document.getElementById('idDivCabecalho').clientHeight;var alturaBottom = document.getElementById('idDivBottom').clientHeight;var alturaJogo = (alturaDaJanela - (alturaBottom + alturaCabecalho)) * .8;$("#idDivJogo").css('height', alturaJogo + 'px');function execIntro(){$.ajax({url: '/api/jogos/controle/viewintro',dataType: 'json',success: function(e){if(e.view && e.view == 'nok'){iconeVideo = "<svg xmlns='http://www.w3.org/2000/svg' style='width: 15%;' viewBox='0 0 576 512'><path fill='#ffc107' d='M0 128C0 92.7 28.7 64 64 64H320c35.3 0 64 28.7 64 64V384c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V128zM559.1 99.8c10.4 5.6 16.9 16.4 16.9 28.2V384c0 11.8-6.5 22.6-16.9 28.2s-23 5-32.9-1.6l-96-64L416 337.1V320 192 174.9l14.2-9.5 96-64c9.8-6.5 22.4-7.2 32.9-1.6z'></path></svg>";introJs().setOptions({nextLabel: 'Próximo',prevLabel: 'Voltar',doneLabel: 'Finalizar',exitOnEsc: false,skipLabel: '',steps: [{title: "Jogos de palavras",intro: "<p style='text-align:justify'>Vamos conheçer os principais elementos da tela, clique em next para continuar</p>"}, {title: "Moedas",element: document.querySelector('#idDivInfoMoedas'),intro: "<p style='text-align:justify'>Suas moedas para jogar, elas irão aumentar ou diminuir conforme as regras de cada jogo! Quando suas moedas chegarem a zero, você poderá assistir a um ou mais videos para ganhar moedas e continuar seus jogos. Sempre que visualizar o icone " + iconeVideo + " so clicar para ganhar as moedas</p>"},{title: "Nível de dificuldade",element: document.querySelector('#idDivInfoNivel'),intro: "<p style='text-align:justify'>O nível do jogo que vôce se encontra. Clique aqui para aumentar ou diminuir o nível do jogo. As possibilidades são: aprendiz, fácil, intermediário, difícil, incrível. São mais de 2500 palavras para você se divertir e testar seus conhecimentos</p>"},{title: "Ajuda",element: document.querySelector('#idDivInfoAjuda'),intro: "<p style='text-align:justify'>Clique aqui para obter ajuda ao jogo, como dicas, mostrar letras que faltam, completar palavras, entre outras possibilidades!</p>"},{title: "Tabuleiro",element: document.querySelector('#idDivJogo'),intro: "<p style='text-align:justify'>Tabuleiro onde o jogo acontece, boa diversão!</p>"}]}).start();}}});}execIntro();</script>{% block javascript %}{% endblock %}</html>