Defly.io Online - Juega ahora en Coolmath Games (2023)

'; } if (tipo de signupPromoBottom !== 'undefined' && SignupPromoBottom !== '') {signupContainerBottom = '

} function preroll_signup_top_handler() { trackEvent('Hiciste clic en registro pre-roll', 'Inscripción pre-roll arriba', document.title); } function preroll_signup_bottom_handler() { trackEvent('Hiciste clic en registro pre-roll', 'Inscripción pre-roll abajo', documento .título);}

'; jQuery("#html5game").replaceWith(notCheerpxBrowser); juego_ancho = drupalSettings.cmatgame.swfembed.swf.swf_1.width; juego_altura = drupalSettings.cmatgame.swfembed.swf.swf_1.altura; var swfURLObject = drupalSettings.cmatgame.swfembed.swf.u; var swfURLArray = swfURLObject.split("/"); swf_1_game_movie_param = swfURLArray[swfURLArray.longitud-1]; //cheerpx js var swf_game_url = cmgGetCheerpxUrl()+swfURLArray[swfURLArray.length-1]+'&w='+game_width+'&h='+game_height; noticiaswfiframe = '

'; jQuery("#swfgame").replaceWith(newswffiframe); iframeLoaded(); displayCmgCheerpxLoadingScreen(); } else { Gametype = "Flash"; var swf_game_url = jQuery("#swfgame").attr("src"); if (typeof swf_game_url !== 'indefinido' && swf_game_url.indexOf("//") === 0) { swf_game_url = ventana.ubicación .protocol + swf_game_url; } else if (typeof swf_game_url !== 'indefinido' && swf_game_url .indexOf("//") > 0) { swf_game_url = swf_game_url.replace("http:", ventana.ubicación.protocolo); } newswfiframe = '

'; jQuery("#swfgame").replaceWith(newswfiframe); iframeLoaded(); var gameInstructions = document.getElementById('game-instructions'); typeof instrucción del juego !== 'desconocido' && instrucción del juego !== null && typeof instrucción del juego s.innerHTML !== 'desconocido' && instrucción del juego .innerHTML !== null) { gametructions.innerHTML = '

Si este juego flash no funciona en su computadora, visiteaquípor ayuda

' + gameInstructions.innerHTML; } } } isRemoveAdSwfJWPLayer = true; } } } jQuery('.game-xp-bar-immerse-button').addClass('enabled'); jQuery('.btn.btn-primary.btn-sm.requestfullscreen').css('display', 'inline-block'); //Deferred js is breaking the display of bigscreen button var deferredbigscreenbtn = setTimeout(function () { if (jQuery('.btn.btn-primary.btn-sm.requestfullscreen').length && !jQuery('.btn.btn-primary.btn-sm.requestfullscreen').is(":visible")) { jQuery('.btn.btn-primary.btn-sm.requestfullscreen').css('display', 'inline-block'); } }, 2000); } } var objpad = new cmg_game_check(); //check if iframe loaded function iframeLoaded(){ const iframe = document.querySelector(".field-game iframe"); var isDesktop = $('.desktop-layout .game-on-desktop').is(":visible"); if(iframe && isDesktop){ var i = 0; iframe.onload = () => { if(i==0){ i++; trackEventNonInteractive("gameplay", "game loaded", location.pathname); } }; } } iframeLoaded(); function iframeLoadedOnMobile(){ const iframe = document.querySelector(".field-game iframe"); if(iframe){ var i = 0; iframe.onload = () => { if(i==0){ i++; trackEventNonInteractive("gameplay", "game loaded", location.pathname); } }; } } var browser = (function () { var test = function (regexp) { return regexp.test(window.navigator.userAgent) } switch (true) { case test(/edg/i): return "Microsoft Edge"; case test(/trident/i): return "Microsoft Internet Explorer"; case test(/firefox|fxios/i): return "Mozilla Firefox"; case test(/opr\//i): return "Opera"; case test(/ucbrowser/i): return "UC Browser"; case test(/samsungbrowser/i): return "Samsung Browser"; case test(/chrome|chromium|criosm|cros/i): return "Google Chrome"; case test(/safari/i): return "Apple Safari"; default: return "Other"; } })(); jQuery(document).ready(function () { if (typeof drupalSettings != "undefined" && typeof drupalSettings.cmatgame != "undefined" && typeof drupalSettings.cmatgame.flash_emulation != "undefined" && drupalSettings.cmatgame.flash_emulation === "2" && ( /mediatek/i.test(navigator.userAgent) || /aarch64/i.test(navigator.userAgent) ) ) { jQuery('html').addClass('mediatek'); } }); cmgAInvD = false; // user profile related variables var is_level_based = 0; var level_offset = 0; var xp_per_level = 10; var flashemulation = ''; var iframed_game_url = ''; var cmatgame_premium_free_game_limit_days = '180'; var fastly_frontend_domain = 'https://www.coolmathgames.com'; var stripe_subscription_free_trial_group_token = 'b2df5a33'; var destination = '/0-defly-io'; var userprofile_level_xp = "100,200,250,300,350,400,450,500,550,625,700,775,850,925,1000,1075,1150,1225,1300,1375,1450,1525,1600,1700,1800,1900,2000,2100,2200,2300,2400,2500,2600,2700,2800,2900,3000,3100,3200,3300,3400,3500,3600,3700,3800,3900,4000,4100,4200,4300,4400,4500,4600,4700,4800,4900,5000,5100,5200,5300,5400,5500,5600,5700,5800,5900,6000,6100,6200,6300,6400,6500,6600,6700,6800,6900,7000,7100,7200,7300,7400,7500,7600,7700,7800,7900,8000,8100,8200,8300,8400,8500,8600,8700,8800,8900,9000,9100,9200,10000"; userprofile_level_xpData = userprofile_level_xp.split(","); incrementedTotalPlays = false; lastKeyBoardorMouseActivityTime = Date.now(); workerstatusvar = "notstartedinit"; supportCMGDefault = false; // disable a/b test supportCMGABTest = false; supportCMGABTestImage1 = false; supportCMGABTestImage2 = false; supportCMGABTestImage3 = false; start_full_screen_without_ad = true; // define all the marketing promo values to false if they are not defined before if (typeof watchAdtoUnlockGame == "undefined") { watchAdtoUnlockGame = false; } if (typeof displayAdblockOverlay == "undefined") { displayAdblockOverlay = false; } if (typeof supportCMG == "undefined") { supportCMG = false; } if (typeof premiumAvatarGame == "undefined") { premiumAvatarGame = false; } gamesPlayed = navigator.cookieEnabled ? parseInt(localStorage.getItem('gamesPlayed') || 0) : 0; cmg_stop_truex_promo = ""; truex_overlay_preroll_ad_display = false; premiumAvatarGame = false;//disabling to fix timer count down issue function getGameName() { var url = window.location.href; var lastPart = url.split("/").pop(); return lastPart; } var coep_frame_type = 'crossorigin="use-credentials"'; if (/(Firefox)/.test(navigator.userAgent)) { coep_frame_type = 'allow="cross-origin-isolated"'; } function setIframeHeight(iframe) { if (iframe) { var gamename = getGameName(); if (gamename == "0-chess") { iframe.height = "620px"; } } }; jQuery(function(){ setIframeHeight(document.getElementById('html5game')); }); if (isUserValidFreeUserOrSubscriber()) { var userprofileData = JSON.parse(localStorage.getItem("userprofile")); var levelofcompletedgame = 1; if(userprofileData && typeof userprofileData.mygameslist != "undefined") { for (var i = 0; i < userprofileData.mygameslist.length; i++) { if (userprofileData.mygameslist[i].id == gameId) { var levelbasedCompletedStatus = userprofileData.mygameslist[i].timebasedcompletedSt; var levelofcompletedgame = userprofileData.mygameslist[i].level; } } } } var workerstatusvar = "no"; var count = 0; var myInterval; // Active function chkIdleOnpage() { var userActivityTime = Date.now(); // check if user activity is not there more than 55 min 60000*55 = 3300000 if (userActivityTime - lastKeyBoardorMouseActivityTime > 3300000) { if (typeof(w) != "undefined") { workerstatusvar = "terminated"; w.terminate(); w = undefined; } } else { // May be keyboard is active start new worker settimebased(); } } // Inactive if (!is_level_based) { // check idle time in every 5 min 60000 * 5 = 300000 idleOnPageCheckTimer = setInterval(function () { chkIdleOnpage() }, 300000); } function settimebased() { if (!is_level_based) { jQuery(document).ready(function () { if (navigator.cookieEnabled) { if (isUserValidFreeUserOrSubscriber()) { window.addEventListener("beforeunload", function (e) { console.log("CMGProfileXP: beforeunload of page save nonXPTime in userprofile -- calling saveUserProgress"); saveUserProgress(); }); } if (typeof(Worker) !== "undefined") { if (typeof(w) == "undefined") { w = new Worker("/modules/custom/cmatgame_userprofile/js/userprogress_workers.js"); var timerInterval = 60000; if(typeof xpTimeInterval !== "undefined" && parseInt(xpTimeInterval)) { timerInterval = xpTimeInterval * 1000; } else { xpTimeInterval = 180; timerInterval = xpTimeInterval * 1000; } w.onmessage = function (event) { var userActivityTime = Date.now(); // save userprofile object back to localstorage userprofile = event.data; localStorage.setItem("userprofile", JSON.stringify(userprofile)); if (isUserValidFreeUserOrSubscriber()) { // display user progressbar display_user_profile_progressbar(); //checkTimeBasedGameCompletion checkTimeBasedGameCompletion(gameId); //adding save userprogress back to api server saveUserProgress(); } if(typeof cmg_game_xp_dsp == "function") { cmg_game_xp_dsp(userprofile); } chkIdleOnpage(); }; var userprofile = localStorage.getItem("userprofile"); setTimeout(function () { var userprofile = localStorage.getItem("userprofile"); var currentGameData = searchGamesById(gameId); if (typeof drupalSettings.cmatgame != "undefined" && typeof drupalSettings.cmatgame.swfembed != "undefined" && drupalSettings.cmatgame.swfembed != "" && typeof drupalSettings.cmatgame.flash_emulation != "undefined" && drupalSettings.cmatgame.flash_emulation == 0 ) { //Do nothing here } else if (typeof w != 'undefined') { w.postMessage([ gameId, xp_per_level, userprofile, currentGameData, cmatgameSearchGames, userprofile_level_xpData, xpTimeInterval ]); } }, timerInterval); } } } }); } } // Stop timer function stopTimer() { count = 0; if (workerstatusvar == "terminated") { settimebased(); workerstatusvar = "started"; } window.clearInterval(myInterval); } function checkKeyboardOrMouseActivity() { lastKeyBoardorMouseActivityTime = Date.now(); if (!is_level_based) { if (typeof isRemoveAdSwfJWPLayer === "undefined" || !isRemoveAdSwfJWPLayer) { // html 5 game } else { stopTimer(); } } } function startTimer() { // for flash based game check idle time in every 5 min 60000 * 5 = 300000 myInterval = window.setInterval(timerHandler, 30000); } function timerHandler() { count++; // count of flash based game will for 55 rounds if (count == 55) { workerstatusvar = "terminated"; if (typeof w !== 'undefined') { w.terminate(); w = undefined; } } } document.addEventListener("mousemove", checkKeyboardOrMouseActivity, false); document.addEventListener('keydown', checkKeyboardOrMouseActivity, false); document.addEventListener("keypress", checkKeyboardOrMouseActivity, false); document.addEventListener("touchmove", checkKeyboardOrMouseActivity, false); if (!is_level_based) { if (typeof isRemoveAdSwfJWPLayer === "undefined" || !isRemoveAdSwfJWPLayer) { // html 5 game document.addEventListener("visibilitychange", function() { if (document.visibilityState == 'hidden') { //startTimer(); if (typeof idleOnPageCheckTimer !== 'undefined') { clearInterval(idleOnPageCheckTimer); } if (typeof w !== 'undefined') { w.terminate(); w = undefined; workerstatusvar = "terminated"; } } else if (document.visibilityState == 'visible') { stopTimer(); // starts worker. } }, false); } else { // flash game window.addEventListener('focus', stopTimer); window.addEventListener('blur', startTimer); // Check browser minimize document.addEventListener("visibilitychange", function () { if (document.visibilityState == 'hidden') { startTimer(); } else if (document.visibilityState == 'visible') { stopTimer(); } }, false); startTimer(); } } // end of !is_level_based function putSharedObjectsInDB(syncData) { flashStorage = syncData; saveUserProgress(); } isRemoveAdSwfJWPLayer = false; prerollAdDisplayed = false; //use this when switching from mobile view to desktop view and preroll ad was not shown earlier prerollAdStart = ""; prerollAdEnd = ""; window.addEventListener("message", receiveMessage, false); function receiveMessage(event) { var valid_domain_msg = false; if (/coolmathgames\.com|coolmathgames\.local|coolmathgames/.test(event.origin)) { valid_domain_msg = true; } if (valid_domain_msg && event.data == "cmgGameEventStatic") { ga4_trackEvent("cmgGameEventStatic", ); } else if (event.data == "continue-without-big-screen" && jQuery('#big-screen-overlay').length && valid_domain_msg) { // close overlay if (jQuery('#big-screen-overlay').length) { jQuery('#big-screen-overlay').hide(); if (jQuery('#big-screen-truex-overlay').length) { jQuery('#big-screen-truex-overlay').hide(); } } } else if (event.data == "continue-with-login-big-screen" && jQuery('#big-screen-overlay').length && valid_domain_msg) { jQuery('#big-screen-overlay').hide(); if (jQuery('#big-screen-truex-overlay').length) { jQuery('#big-screen-truex-overlay').hide(); } if (drupalSettings.language !== "en"){ window.location = `/${drupalSettings.language}/login?destination=${window.location.pathname}`; } else { window.location = "/login?destination=" + window.location.pathname; } } else if (event.data == "continue-premium-big-screen" && (jQuery('#big-screen-overlay').length || jQuery('#pr-profile-screen-overlay').length) && valid_domain_msg) { jQuery('#big-screen-overlay').hide(); jQuery('#pr-profile-screen-overlay').hide(); if (jQuery('#big-screen-truex-overlay').length) { jQuery('#big-screen-truex-overlay').hide(); } window.location.reload(); } else if (event.data == "big-screen-profile-customize" && (jQuery('#big-screen-overlay').length || jQuery('#pr-profile-screen-overlay').length) && valid_domain_msg) { jQuery('#big-screen-overlay').hide(); jQuery('#pr-profile-screen-overlay').hide(); if (jQuery('#big-screen-truex-overlay').length) { jQuery('#big-screen-truex-overlay').hide(); } if (getCookie('cmg_fx') !== null) { window.location = '/profile/' + getCookie('cmg_fx').toLowerCase() + '/edit'; } } else if (event.data == "big-screen-premium-benefits" && jQuery('#big-screen-overlay').length && valid_domain_msg) { jQuery('#big-screen-overlay').hide(); if (jQuery('#big-screen-truex-overlay').length) { jQuery('#big-screen-truex-overlay').hide(); } if (getCookie('cmg_fx') !== null) { window.location = '/premium-benefits'; } } else if (event.data == "keypress-from-game") { checkKeyboardOrMouseActivity(); } else if (event.origin === "https://copterroyale.coolmathgames.com" || event.origin === "https://copterroyale2.coolmathgames.com" || event.origin === "https://powerline.coolmathgames.com") { var eventObject = JSON.parse(event.data); if (eventObject.eventType == "gameEvent") { cmgGameEvent(eventObject.key, eventObject.value); } else if (eventObject.eventType == "dataEvent") { cmgDataEvent(eventObject.key, eventObject.value); } } else if (event.origin == 'https://rps-frontend.coolmathgames.com') { var eventObject = JSON.parse(event.data); if (eventObject.eventType == "gameEvent") { cmgGameEvent("Rockpaperscissors "+eventObject.key, eventObject.value); } else if (eventObject.eventType == "dataEvent") { cmgDataEvent("Rockpaperscissors "+eventObject.key, eventObject.value); } } else if (event.origin == 'https://hangman-backend.coolmathgames.com' || event.origin == 'https://hangman-frontend.coolmathgames.com' || event.origin == 'https://hangmanqa-frontend.coolmathgames.com' || event.origin == 'https://hangmanqa.coolmathgames.com') { var eventObject = JSON.parse(event.data); if (eventObject.eventType == "gameEvent") { cmgGameEvent("Hangman "+eventObject.key, eventObject.value); } else if (eventObject.eventType == "dataEvent") { cmgDataEvent("Hangman "+eventObject.key, eventObject.value); } } else if (event.origin == 'https://wordrace-4inrow-stage.coolmathgames.com' || event.origin == 'https://wordrace-4inrow.coolmathgames.com' ) { var eventObject = JSON.parse(event.data); var eventGame = "wordrace"; if (/0-four-in-a-row/.test(location.pathname)) { eventGame = "fourinarow"; } if (eventObject.eventType == "gameEvent") { cmgGameEvent(eventGame+" "+eventObject.key, eventObject.value); } else if (eventObject.eventType == "dataEvent") { cmgDataEvent(eventGame+" "+eventObject.key, eventObject.value); } } else if (event.origin == 'https://hexanaut.coolmathgames.com') { var eventObject = JSON.parse(event.data); var eventGame = "hexanaut"; if (eventObject.eventType == "gameEvent") { cmgGameEvent(eventGame+" "+eventObject.key, eventObject.value); } else if (eventObject.eventType == "dataEvent") { cmgDataEvent(eventGame+" "+eventObject.key, eventObject.value); } } else if (event.origin == 'https://cheerpx.coolmathgames.com' || event.origin == 'https://cheerpx-prod.coolmathgames.com') { //close loading screen closeCmgCheerpxLoadingScreen(); // Remove Narrow screen loading closeCmgCheerpxLoadingScreenResized(); } else if (event.origin == 'https://www.coolmath-games.com' || event.origin != 'https://d8-dev.coolmathgames.com') { if (event.data.eventType == "syncEventPut") { syncData = event.data.syncJSON; putSharedObjectsInDB(syncData); } if (event.data.eventType == "syncEventGet") { if (typeof flashStorageFromDB != "undefined") { // restoring flash shared objects from DB for (var i = 0; i < flashStorageFromDB.length; i++) { flashStorageFromDB[i].swfdata = decodeURI(flashStorageFromDB[i].swfdata); } document.getElementById('swfgame').contentWindow.postMessage({ 'eventType': 'syncEventGet', 'soData': flashStorageFromDB }, '*'); } else { document.getElementById('swfgame').contentWindow.postMessage({ 'eventType': 'gamePlay' }, '*'); } } } else { return; } } // var signupPromoTop = 'Join to Play Ad-Free'; var signupPromoBottom = 'Join to Skip All Ads'; if (typeof signupPromoTop !== 'undefined' && signupPromoTop !== '') { signupContainerTop = '

' + promoción de registro en la parte superior + '

'; } else {inscribirsePromoTop = ''; SignupContainerTop = '

' + promoción de registro en la parte superior + '

'; } if (tipo de signupPromoBottom !== 'undefined' && SignupPromoBottom !== '') {signupContainerBottom = '

' + REGÍSTRATE PROMO ABAJO + '

'; } else {signupPromoBottom = ''; SignupContainerBottom = '

' + REGÍSTRATE PROMO ABAJO + '

} function preroll_signup_top_handler() { trackEvent('Hiciste clic en registro pre-roll', 'Registro pre-roll arriba', document.title); } function preroll_signup_bottom_handler() { trackEvent('Hiciste clic en registro pre-roll', 'registro pre-roll abajo', documento .title); } // Defina esta variable en experiments.js con signUpURLABTest. var cmg_upg_days_limit = 180; var user_dst = nombre de la ruta de la ubicación de la ventana; user_dst = user_dst.replace("\/", ""); if (window.location.host !== 'cmatgame.local') { if (typeofsignUpURL === 'desconocido' || SignUpURL === '') {signUpURL = '/premium-access/ b2df5a33?origin=' + user_dst; } else { URL de registro = URL de registro + '?origin=' + user_dst; } } else if (typeofsignUpURLABTest === "indefinido" || SignUpURLABTest === null) {signUpURL = 'https://' + window.location.hostname + '/premium-access/ b2df5a33?origin= ' + user_dst ; } else {signUpURL = SignUpURLABTest; } function subscribe_promo_handler() { if (typeof freeTrialUser !== 'undefined' && freeTrialUser) { trackEvent('Premium Subscription ' +subscriberLeg, 'Se hizo clic en una superposición de suscripción. } function subscriptionSignUpUrl() { var user_played_games = '' ; var zeroFreeGamesLeftUsers = localStorage.getItem("zeroFreeGamesLeftUsers"); if (userPlayedGames !== 'undefined' && userPlayedGames) { user_played_games = "upg=" + userPlayedGames; } else { user_played_games = "upg=0"; } if (zeroFreeGamesLeftUsers !== null && user_played_games !== '') { user_played_games = user_played_games + '&zfg=' + zeroFreeGamesLeftUsers; } else if (zeroFreeGamesLeftUsers !== null) { user_played_games = 'zfg=' + zeroFreeGamesLeftUsers; } if (type of signUpURL !== 'indefinido' && SignUpURL !== null && SignUpURL.indexOf('upg') === -1) { if (signUpURL.indexOf('?random_true') > -1) {signUpURL =signUpURL.replace( '?random_true', ''); } if (signUpURL.indexOf('?') > -1) {signUpURL =signUpURL + '&' + user_played_games; } else { URL de registro = URL de registro + '?' + juegos jugados por usuario; function actualizar el tiempo de mis juegos (gameId) { var userActivityTime = Date.now (); if (currentTimeInterval >= 2) { currentTimeInterval = 0; if (isUserValidFreeUserOrSubscriber()) { // guardar MyGames solo para suscriptores saveMyGames(gameId, 0, 1); hora actual = tiempo de actividad del usuario; } } else { intervalo de tiempo actual = intervalo de tiempo actual + 1; saveUserProgress(); } } function updateMyGamesTimeSpent1(gameId) { if (isUserValidFreeUserOrSubscriber()) { // guardar MyGames solo para suscriptores if (userActivityTime - lastKeyBoardorMouseActivityTime <= 60000) { saveMyGames(gameId, 0, 1); } } } function updateMyGamesTimeSpentLevelBase(gameId, level) { if (isUserValidFreeUserOrSubscriber()) { // guardar MyGames solo para suscriptores saveMyGames( gameId, 1, level); if (is_level_based) { var userActivityTime = Date.now(); // Para juegos basados ​​en niveles. Compruebe si no ha habido actividad del usuario durante más de 55 minutos. 60000*55 = 3300000 if (userActivityTime - lastKeyBoardorMouseActivityTime <= 3300000) { var objGameNode = {}; objGameNode[GameId] = "No"; var localgamestrate = "storagelocal-" + gameId + "-storagelocal"; localStorage.setItem( " runoncestarted", JSON.stringify(objGameNode)); localStorage.setItem(localgamestrate, "No"); updateMyGamesTimeSpentLevelBase(gameId, levelofcompletedgame) } } function cmgGetCheerpxUrl() { var CheerpxUrl = 'https://cheerpx-prod.coolmathgames.com /cheerpx.html?f='; if (ubicación.host!= "www.coolmathgames.com" && !/(Firefox)/.test(navigator.userAgent)) { CheerpxUrl = 'https://cheerpx.coolmathgames. com/cheerpx.html?f=' ; Devuelve CheerpxUrl. } función mostrarCmgCheerpxLoadingScreen() { jQuery("#swfgame").parent().before('

El juego flash se está cargando
puede tardar más de lo habitual

'); } // Función de pantalla de carga de pantalla estrecha displayCmgCheerpxLoadingScreenResize(){ jQuery("#swfgame").parent().before('

'); } function closeCmgCheerpxLoadingScreen() { jQuery("#cmg-cheerpxloading-screen").remove(); } // Elimina la función de pantalla de carga de pantalla estrecha closeCmgCheerpxLoadingScreenResize(){ if ($("#cmg-cheerpxloading-screen- resize").length > 0){ jQuery("#cmg-cheerpxloading-screen-resize").remove( ); } } function cmgRemoveMadg() { if(typeof adsManager != "undefined" && adsManager) { adsManager.destroy (); jQuery("#afg_container").hide(); jQuery("#afg_preloader").hide(); jQuery("#Continue-container").hide(); juego").show(); jQuery (".user-controls").attr("style", "display: flex ! important"); // mostrar los controles de usuario jQuery(".falseBtn").remove() if(window.document.getElementById('swfgame ') != null) { window.document.getElementById('swfgame').setAttribute("tabindex","0"); window.document.getElementById('swfgame') .focus(); } else if(window. parent.document.getElementById('html5game') != null){ window.document.getElementById('html5game').setAttribute("tabindex","0"); window.document.getElementById('html5game').focus( ); } } /* * Función de temporizador de anuncios intersticiales */ function gameInterstitialAdTimerAction() { gameInterstitialAdTimerDone = true; clearGameInterstitialAdTimer(); function clearGameInterstitialAdTimer() {clearTimeout(gameInterstitialAdTimer); = null; function cmg_discover_games_let_off() { var myGames = cmg_get_lpg(10 ); if(myGames.length > 0 && isMobile){ myGames = myGames.filter(game => game.mpv == "1"); } if(typeof myGames == "undefined" || myGames == "" | | myGames.length == 0){ //return false; // muestra los juegos seleccionados letbaseURL = location.origin + '/cmg/toppicks.json' ; $.getJSON(baseURL, function(data){ let topPickHTML = '' ; for(let game data){ game = searchGamesById(game.nid)[0]; if(isMobile && game.mpv == "0" ) { continuar; } let gameVideo = ''; if(game.vdo && game .vdo != ""){ videojuego = `

` } topSeleccionarHTML += `

${video del juego} ${juego.título}

`; jQuery("#cmg_pickup_block").html(topPickHTML).prev(".title").text("Mejores selecciones de Coolmath"); jQuery("#cmg_pickup_block").closest(".cmg-pickup-block").addClass("cmg-top-picks").show(); }) } else { let pickupBlockHTML = ''; function RemoveDuplicateGames(array, key) { var check = new Set(); return array.filter(obj => !check.has(obj[clave]) && check.add(obj[clave])); const filteredGames = RemoveDuplicateGames(myGames, 'id'); for(filteredGames のゲーム){ let gameVideo = ''; if(juego.vdo && juego.vdo != ""){ juegoVideo = `

` } let gamePercent = ''; if(game.ilb == "1"){ gamePercent = Math.floor((game.level / game.ml) * 100); } else { gamePercent = Math.floor((game .time/game.mta) * 100); bloque de recogida HTML += `

${video del juego} ${juego.título}

`; } if(juegosfiltrados.longitud <= 3){pickupBlockHTML += `

jugar juegos al azar

`; devuelve el bloque de recogida HTML. jQuery(documento).listo(función(){ if(jQuery("#cmg_pickup_block").length > 0){ const cmg_left_off_html = cmg_discover_games_let_off(); if(cmg_left_off_html){ jQuery("#cmg_pickup_block").html( cmg_left_off_html) .closest(".cmg-pickup-block").show(); } } }); /* * Elimina el preroll y muestra el juego. Nombre de la función anterior: removePrerollAndDisplayGame(). */ var cmgRemovePadgInvoked = false; function cmatgame_premium_subscription_game_display() { var cmatgame_subscriber = getCookie('cmg_sx'); var validSubscriber = false; if (typeof cmatgame_subscriber !== 'indefinido' && cmatgame_subscriber !== null) { validSubscriber = true; if (getCookie("cmg_wl") !== null) { validSubscriber = true; var cmatgame_free_user = getCookie('cmg_fx'); var validFreeUser = false; if (typeof cmatgame_free_user !== 'undefined' && cmatgame_free_user !== null ) { validFreeUser = true; freeGamesExceeded = true; if (validSubscriber || getCookie("cmg_wl") !== null) {retrieveUserProgress(); objpad.cmg_check_access(); jQuery(document).ready(function () { $( '. game-xp-bar-immerse-button').addClass('enabled');jQuery('.btn.btn-primary.btn-sm.requestfullscreen' ).css('display', 'inline-block'); immersive_mode_display_controller(); }); } else if (getCookie('cmg_schwl') !== null || typeof cmg_no_ads !== 'undefined' || (! validSubscriber && schoolHours || (!schoolHours && !targetStateUser) || ( !schoolHours && targetStateUser && getCookie( 'cmg_active_anonymous_user') !== null))) { // Mostrar juego TODO objpad.cmg_check_access(); jQuery(document).ready(function () { $('.game -xp-bar -immerse-button').addClass('habilitado'); jQuery('.btn.btn-primary.btn-sm.requestfullscreen' ).css('display', 'inline block'); }) if (!/ 0-chess/.test(window.location.pathname)) { } } else if (! validSubscriber && !schoolHours && targetStateUser && getCookie('cmg_active_anonymous_user') === null && getCookie('cmg_editor') = == null) { // Si el usuario es de Google, no mostrar el paywall de suscripción var ref = document.referrer; // Contar la cantidad de juegos que el usuario ha jugado este mes userPlayedGames = 0; var userFreeGameList = []; var freeGameNid = 12531; if (sessionStorage.getItem("userFreeGameList") !== null && navigator.cookieEnabled) { userFreeGameList = JSON.parse(sessionStorage.getItem("userFreeGameList")); if (( localStorage.getItem("userPlayedGames") = = null || getCookie('cmg_upg') === null) && freeGameLimit !== 0 && navigator.cookieEnabled) { userPlayedGames = 1; localStorage.setItem("userPlayedGames", userPlayedGames) setCookie('cmg_upg', 'true' , cmg_upg_days_limit * 24 * 60 * 60 * 1000); userFreeGameList = [freeGameNid]; sessionStorage.setItem("userFreeGameList", JSON.stringify(userFreeGameList)); objpad.cmg_check_access(); } else { if (localStorage.getItem(" userPlayedGames") !== null && getCookie('cmg_upg') !== null) { userPlayedGames = parseInt(localStorage.getItem("userPlayedGames")); } else { userPlayedGames = 0 setCookie('cmg_upg', 'true', cmg_upg_days_limit * 24 * 60 * 60 * 1000); if (freeGameLimit != 0 && userPlayedGames < freeGameLimit && userFreeGameList.indexOf(freeGameNid) === -1) { userPlayedGames ++; freeGamesExceeded = false; if (userFreeGameList.length > 0 ) { userFreeGameList = userFreeGameList.concat(freeGameNid); } else { userFreeGameList = [freeGameNid]; localStorage.setItem("userPlayedGames", userPlayedGames); sessionStorage.setItem("userFreeGameList", JSON.stringify(userFreeGameList)); } else { freeGamesExceeded = true; var validReferer = false; var validGameSession = false; if (userFreeGameList.indexOf(freeGameNid) > -1) { validGameSession = true; .com") !== null || ref.match("yahoo.com" ) !== null || ref.match("bing.com") !== null) { validReferer = true; subscribeSignUpUrl(); if (! validReferer && userPlayedGames >= freeGameLimit && ! validGameSession) { clearInterval(intervalId); jQuery("#afg_container").remove(); jQuery(".game-instructions").remove(); var selectedSubscriberText = '

¿Ya eres suscriptor?acceso

'; if (getCookie('cmg_l') != null) { selectedSubscriberText = ''; var encabezado = '

Regístrate para seguir jugando

'; if (getCookie('cmg_l') != nulo && getCookie('cmg_sx') != null) { encabezado = '

Regístrate ahora para seguir jugando

'; jQuery(".juego de campo").html('

' + titular + '

Una colección de los mejores juegos del mundo.
Por lógica, deducción y diversión.Suscríbase ahora' + texto ya suscrito + '

'); jQuery("#videoplayer").remove(); } else { objpad.cmg_check_access(); functionunlockAllLevels() { trackEvent('Desbloquear categoría de todos los niveles', 'Se hizo clic en el botón Desbloquear todos los niveles', document.title) ; todos los niveles = '

nivel desbloqueado

'; jQuery("#subscriber-banner").replaceWith(todos los niveles); var cmgorigidomain = /coolmath-games/; var cmgtargetdomain = ventana.ubicación.protocolo + 'www.coolmath-games.com'; if (/editar-escenario/.prueba(ventana.ubicación.nombre de host)) { cmgtargetdomain = ventana.ubicación.protocolo + 'editar-escenario.coolmath-games.com'; } else if (/d8-dev/.test(ventana.ubicación.nombre de host)) { cmgtargetdomain = ventana.ubicación.protocolo + 'escenario.coolmath-games.com'; else if (/cmatgame.local|dev.coolmath.games.com/.test(window.location.hostname)) { cmgtargetdomain = ventana.ubicación.protocolo + 'escenario.coolmath-games.com'; if (game_type == "html5") { document.getElementById("html5game").contentWindow.unlockAllLevels(); } else { if (cmgorigidomain.test(window.location.hostname)) { document.getElementById("swfObjID").unlockAllLevels(); } else { var receptorgameFrame = document.getElementById("swfgame"); gDate = 新しい日付(); receptorgameFrame.contentWindow.postMessage('unlockAllLevels', cmgtargetdomain); // TODO -- ターゲットのオリジンを設定します } } } function addSubToUnlockGAEvent() { trackEvent('すべてのレベルのロックを解除カテゴリ', 'ロック解除ボタンがクリックされるように購読', document.title) ; trackGoalVirtualPV('/virtual/ロック解除ボタン-クリック'); window.location.href = "https://www.coolmathgames.com/signup/ b2df5a33?origin= /0-defly-io&stual=1" } var immersive_mode_enabled = false; //BS: 1. Función immersive_mode_display_controller() { if (! immersive_ mode_enabled) { immersive_mode_enabled = verdadero; immersive_mode_display(); var bigScreenTimer = null; pantalla grande activa = falso; function cmgbsoptclose() { if (jQuery('#superposición-truex-pantalla-grande').length) { jQuery('#superposición-truex-pantalla-grande').hide(); Popover_login_click = false;関数 cmg_display_login_page() { Popover_login_click = true; if (jQuery('#popover' + gameId).longitud) { jQuery('#popover' + gameId).remove(); sumergir_hover_on = 0; } ventana.ubicación = "/login?destino=" + ventana.ubicación.nombre de ruta } función display_cmg_overlay_signupform(variante) { if (jQuery('#popover' + gameId).longitud) { jQuery('#popover' + gameId).削除(); sumergir_hover_on = 0; if ((getCookie('cmg_sx') === null && getCookie('cmg_wl') === null)) { myStopFunction(); } if (バリアントの種類 === '未定義' || バリアント === '') { バリアント = '/16'; if (cmg_stop_truex_promo !== '' && cmg_stop_truex_promo === 'yes' && jQuery('#superposición-de-pantalla-grande').length) { jQuery('#superposición-de-pantalla-grande').show(); } else if (cmg_stop_truex_promo !== '' && cmg_stop_truex_promo === 'sí') { var big_screen_url = ''; if (getCookie('cmg_fx') === null) { if (drupalSettings. language == 'en') { big_screen_url = '/premium-access/6ea95de6' +variant + '?ts='+new Date()。 getTime();//BSWOJ 非計画 } else { big_screen_url = '/'+drupalSettings. language+'/premium-access/6ea95de6' +variant + '?ts='+new Date().getTime();//BSWOJ anon plan } } else { if (drupalSettings. language == 'en') { big_screen_url = '/profile/premium-access/e180e28d' +variant + '?ts=' + new Date().getTime(); // BSWOJ ログインユーザープラン } else { big_screen_url = '/'+drupalSettings. language+'/profile/premium-access/e180e28d' +variant + '?ts=' + new Date().getTime(); } } if (variante == 'Gracias') { if (drupalSettings. language == 'en') { big_screen_url = '/signup/thank-you/overlay?ts=1596827222&src=wc&origin=/premium-access/1bb008bd/14b&sp =0&cmgtypl=1bb008bd&cmgovly=1'; } else { big_screen_url = '/'+drupalSettings. language+'/signup/Thank-you/overlay?ts=1596827222&src=wc&origin=/premium-access/1bb008bd/14b&sp=0&cmgtypl=1bb008bd&cmgovly=1'; var ov_css = 'style="表示:なし; 位置: 固定; Z-インデックス: 100000; 左: 0; 上: 0; 幅: 100%; 高さ: 100%; オーバーフロー: 自動; 背景色: rgb (0 ,0,0); 背景色: rgba(0,0,0,0.4);" min-altura="1040px"'; var ovc_css = 'style="マージン: 自動; パディング: 10px; 幅: 850px;" min-altura="540px"'; var iframe_overlay = '

'; //Agregue este iframe en el lugar correcto donde lo necesite. jQuery('.global-wrapper').before(iframe_overlay); // TODO jQuery('#big_screen_iframe').css('height', '800px'); jQuery('#big screen overlay').fadeIn(1000 ); jQuery('.big-screen-signup-container .btn-close').on('click', function (e) { e.preventDefault(); jQuery('#big-screen-overlay').hide () ; }); } else { var big_screen_url = ''; if (getCookie('cmg_fx') === null) { if (drupalSettings. language == 'en') { big_screen_url = '/premium-access/849ef809 ' + variante + '?ts=' + nueva Fecha(). get time (); // BSWOJ anon plan } else { big_screen_url = '/'+drupalSettings.language+'/premium-access/849ef809' +variant + '?ts=' + new Date().getTime(); / BSWOJ anon plan } } else { if (drupalSettings. language == 'en') { big_screen_url = '/profile/premium-access/e180e28d' +variant + '?ts=' + new Date().getTime() ; // Plan de usuario de inicio de sesión de BSWOJ } else { big_screen_url = '/'+drupalSettings.language+'/profile/premium-access/e180e28d' +variant + '?ts=' + new Date().getTime(); // Plan de usuario de inicio de sesión de BSWOJ } } if (variante == 'gracias') { if (drupalSettings. language == 'en') { big_screen_url = '/signup/thank-you/overlay?ts=1596827222&src=wc&origin= /premium-access/849ef809 /14b&sp =0&cmgtypl=1bb008bd&cmgovly=1'; } else { big_screen_url = '/'+drupalSettings. &cmgovly =1'; } } if (/coolmathgames/.test(ubicación.host)) { } var ov_css = 'style="display: ninguno; posición: fija; índice z: 100000; izquierda: 0; arriba: 0; ancho: 100 %; altura: 100 %; desbordamiento: automático; color de fondo: rgb(0,0,0); color de fondo: rgba (0,0,0,0.4);" min-height="1040px"' var ovc_css = 'style="margin: auto; relleno: 10px; ancho: 850px;" min-height="540px"'; var iframe_overlay = '

'; // Agrega este iframe en el lugar correcto donde lo necesites. jQuery('.global-wrapper').before(iframe_overlay); // TODO jQuery('#big_screen_iframe').css('height', '800px'); jQuery('#big screen overlay').fadeIn(1000 ); jQuery('.big-screen-signup-container .btn-close').on('click', function (e) { e.preventDefault(); jQuery('#big-screen-overlay').hide () ; }); } } function immersive_mode_exit_handler(variant) { start_full_screen_without_ad = false;//sin anuncios después de la primera prueba bigScreenActive = false; if (getCookie('cmg_sx') === null && getCookie('cmg_wl' ) == = null) { // Redirigir al usuario a la página de registro if (jQuery.fullscreen.isFullScreen()) { jQuery.fullscreen.exit( ); if (cmg_stop_truex_promo !== '' && cmg_stop_truex_promo === 'yes') { display_cmg_overlay_signupform( variante); else if (getCookie('cmg_sx') === null && getCookie('cmg_wl') === null) { myTimerAction(); if (bigScreenTimer) {clearTimeout(bigScreenTimer); bigScreenTimer = null; } } función bigScreenTimerAction() { if (typeof bigScreenActive !== 'indefinido' && bigScreenActive) { clearTimeout(bigScreenTimer); bigScreenTimer = null; var immerse_hover_on = 0; var immerse_hover_in = 0; function immersive_fullscreenButtonText() { var fullscreenButtonText = "¡Nueva característica premium! Pruébelo gratis ahora"; if ((getCookie('cmg_sx') !== null || getCookie('cmg_wl') !== null)) { fullscreenButtonText = "¡Nueva función premium! ¡Pruébela ahora!"; Returns fullscreenButtonText . var cmg_bs_popover_prefix = '

Juega en la pantalla grande después de este anuncio de 30 segundos.

'); miFuncionParada(); trueXTimer = setTimeout(function () { jQuery('#big-screen-truex-header-text').css('background-color', '#16202c').css('padding-top', '14px') .html('

Interactúa con este anuncio para continuar.

'); // .css('margin-top', '150px'); }, 25 * 1000); }); truexAd.onCredit(función (participación) { trackEvent('BigScreen-TrueX-Promo', 'Patrocinador Mostrar video con: Créditos publicitarios TrueX', document.title); jQuery('#big-screen-trueX-header-text') .css('Background Color', '#16202c').css('Padding ', ' 14px').html('

'); document.getElementById("truex-bigscreen-activate-id").onclick = function () {event.preventDefault(); if (typeof bigScreenActive === 'indefinido' || typeof bigScreenActive !== 'definición indefinida ' && !bigScreenActive) { jQuery('#big-screen-signup-container-id').html(""); jQuery('#big-screen-truex-overlay').remove(); cmg_start_game_full_screen(' truex ') ); requestTrueXAdsAndDisplay(cliente) ; }); truexAd.onFinish(función (actividad) { // El usuario llegó al final del anuncio trackEvent('BigScreen-TrueX-Promo', 'Sponsored Show video: TrueX ad terminó', document. title); jQuery('#pantalla-grande -signup-container-id').html(""); jQuery('#pantalla-grande-truex-overlay').remove(); cmg_start_game_full_screen("truex"); }); truexAd.onMessage(función (carga útil) { // log("onMessage = " + carga útil); }); // Agregue la opción TrueX a DOM si (jQuery("#cmg-big-screen-truex- actividad").longitud) { var truex_container = document.getElementById("cmg-gran-pantalla-truex-actividad"); document.getElementById("cmg-gran-pantalla-truex-actividad").onclick = función () { event.preventDefault(); trackEvent('BigScreen-TrueX-Promo', 'Mostrar video patrocinado: se hace clic en el botón', document.title); jQuery('.big-screen-options-container').hide(); if (truex_ad_disponible && tipo de cliente !== 'desconocido') { // BigScreen-TrueX-Promo trackEvent('BigScreen-TrueX-Promo', 'Mostrar video patrocinado: Cargar anuncio TrueX', document.title); client.loadActivityIntoContainer(truexAd , 'big-screen-signup-container-id', { ancho: " 960px", alto: "540px" }); } else { truex_overlay_preroll_ad_display = true; show_big_screen_preroll_ad(); trackEvent('BigScreen-TrueX-Promo', ' Visualización de video patrocinado: Anuncio pre-roll cargado', document.title); } }; } // cmg-big-screen-truex-signup if (jQuery("#cmg-big-screen-truex-signup").length ) { document.getElementById("cmg-big-screen-truex-signup ").onclick = function () {event.preventDefault(); jQuery('#big-screen-truex-overlay').remove(); display_cmg_overlay_signupform (); }; function truex_preroll_display_handler() {event.preventDefault(); trackEvent('BigScreen-TrueX-Promo', 'Mostrar video patrocinado: botón presionado', document.title); jQuery('.big-screen-options- container').hide(); if (truex_ad_disponible && (typeof client !== 'unknown' || cmg_truex_client != null) ) { // BigScreen-TrueX-Promo if (typeof client == "unknown") { client = cmg_truex_client; truexAd = cmg_truexAd; -TrueX-Promo', 'Mostrar video patrocinado: cargar anuncio TrueX', document.title); client.loadActivityIntoContainer(truexAd, 'big-screen-signup-container-id', { width: "960px ", altura: "540px" }); } else { truex_overlay_preroll_ad_display = true; show_big_screen_preroll_ad(); trackEvent('BigScreen-TrueX-Promo', 'Visualización de video patrocinado: Cargando anuncio pre-roll', document.title); function containerClose() { // log("se llamó containerClose. "); } function log(msg) { console.log("CMG [%s] - %s", new Date().toLocaleTimeString(), msg); cmg_truex_promo_events_added = 0; function display_big_screen_truex_options_overlay() { // hash de opciones Inicialice el cliente de publicidad TrueX usando trackEvent('BigScreen-TrueX-Promo', 'Bigscreen button clicked', document.title); if (getCookie('cmg_sx') !== null || getCookie('cmg_wl ') !== null || getCookie('cmg_editor') !== null ) {event.preventDefault(); cmg_start_game_full_screen('truex'); } else { network_user_id = getCookie('_ga'); type !== 'indefinido' && usuario de red id !== '') { id de usuario de red = id de usuario de red.replace('GA', 'cmg').replaceAll("\.", ""); } // Hash de prueba TRUEX // truex_options = {' network_user_id': network_user_id, 'partner_config_hash': '83f879b26797c723882473d6435e6361c105d86b'}; truex_options = { 'network_user_id': network_user_id, 'partner_config_hash': ' 375f2f2b728700cd9 91bb24601b3841c98375886' }; if (tipo de truex != = 'indefinido') { truex.client(truex_options, function (cliente) { requestTrueXAdsAndDisplay(cliente); }); } var ov_css = ' style="Display: None; Position: Fixed; Z-Index: 1000; Left: top: 0; width: 100%; height: 100% ; color de fondo: rgb(0,0, 0); color de fondo: rgba(0,0,0,0.7); " '; var ovc_css = ' '; var ovc_css_id = ' style="margin: auto; margin -arriba: 150px; ancho: 960px; " '; var truex_css = ' '; var truex_options1 = "

Para jugar este juego en modo de pantalla grande

"; var truex_options2 = "

Ver videos patrocinados

"; //var truex_optionsOR = "

"; var truex_options3 = "

"; if (getCookie("cmg_sac") == "no"){ // truex_optionsOR = ""; truex_options3 = ""; } var truex_options4 = "

"; var truex_options_prefix = '

'; var truex_options_suffix = '

'; truex_options = truex_options_prefix + truex_options1 + truex_options2 + truex_options3 + truex_options4 + truex_options_suffix; var truex_options_Heading = '

「+」

'; var preroll_container = '

「+」

「+」

'; jQuery('.global-wrapper').before(bs_truex_options); jQuery('#big_screen_iframe').css('高さ', '800px'); jQuery('.contenedor de opciones de pantalla grande').show(); jQuery('#pantalla-grande-superposición-truex').fadeIn(1000); jQuery('.big-screen-options-container .btn-close').on('click', function (e) { e.preventDefault(); jQuery('#big-screen-truex-overlay').hide (); }); jQuery('#cmg-big-screen-truex-promo-close').on('click', function (e) { e.preventDefault(); jQuery('#big-screen-truex-overlay').hide (); }); 関数 show_big_screen_preroll_ad() {event.preventDefault(); jQuery('#big-screen-truex-header-text').css('padding-top', '14px').html("

"); jQuery('.big-screen-options-container').hide(); var cmatgame_subscriber = getCookie('cmg_sx'); var validSubscriber = false; if (typeof cmatgame_subscriber !== 'unknown' && cmatgame_subscriber != = null) { validSubscriber = true; } // Pre-roll ad var prerollUrls = /0\-testing/; if (! validSubscriber) { // Mostrar anuncio pre-roll window.scrollTo(0, 0); var modal = document.getElementById ('contenedor-pre-roll-de-pantalla-grande'); // modal.style.display = 'bloquear'; // borrar el temporizador de actualización if (typeof refreshTimer !== "unknown") { clearTimeout(refreshTimer); freshTimer = null } var adTagUrl = 'https://pubads.g.doubleclick.net/gampad/ads?iu=/137548614/1023174/71134/1023174-71134-video&description_url=https%3A%2F%2Fwww.coolmathgames.com% 2F&env =vp&impl =s&correlator=&tfcd=0&npa=0&gdfp_req=1&output=vast&sz=640x480&unviewed_position_start=1'; if (typeof window.PW_CMG != "undefined") { var AuctionCallback = function (displayAds, videoUrl) { application = new Application(displayAds window.PW_CMG.startAuction(auctionCallback); } else { // aplicación de bloqueo de anuncios = nueva aplicación (falso, adTagUrl); bs_preroll_timer = 15; bs_preroll_intervalId = setInterval(función () { bs_preroll_timer --; jQuery( '#pantalla-grande- truex-header-text').html('

'); document.getElementById("truex-bigscreen-activate-id").onclick = function () {event.preventDefault(); $('a.requestfullscreen>span.big-screen-popover-span').html ('reproducir en pantalla grande'); if (typeof bigScreenActive === 'indefinido' || typeof bigScreenActive !== 'indefinido' && !bigScreenActive) { jQuery('#big-screen-signup-container-id' ). html(""); jQuery('#gran-pantalla-superposición-truex').remove(); start_full_screen_without_ad = false; cmg_start_game_full_screen('truex'); clearInterval(bs_preroll_intervalId); } }, 1000); // salida TRUEX function cmg_start_game_full_screen(cmgsource) { myStopFunction(); // el anuncio no se actualiza bigScreenActive = true; if (cmg_stop_truex_promo !== '' && cmg_stop_truex_promo === 'yes') { cmgbsoptclose(); bigScreenTimer = setTimeout(function () { bigScreenTimerAction(); }, 60 * 1000); } else { cmgbsoptclose() } var elem = document.getElementById('block-system-main'); if (jQuery('html').hasClass ('mobile-device' )) { requestFullscreenModal(elem, document.title); devuelve false. if (elem.requestFullscreen) { elem.requestFullscreen(); } else if (elem.mozRequestFullScreen) { /* Firefox */ elem.mozRequestFullScreen(); } else if (elem.webkitRequestFullscreen) { /* Chrome, Safari, Opera * / elem.webkitRequestFullscreen(); } else if (elem.msRequestFullscreen) { /* IE/Edge */ elem.msRequestFullscreen(); else { requestFullscreenModal(elem, document.title); devuelve falso. } function immersive_mode_display() { // obtener la variable del juego elem = document.getElementById('block-system-main'); // abrir el juego en pantalla completa $('#game- fullscreen #cmgwadfs').on('click' , function (e) { e.preventDefault(); $('.hasPopup').removeClass('active'); if (/\/test-game\//. test(window.location.pathname)){ cmg_start_game_full_screen (); } if (cmg_stop_truex_promo === '' || cmg_stop_truex_promo !== 'yes') { if (start_full_screen_without_ad) { display_big_screen_truex_options_overlay(); } else { cmg_start_game_full_screen(); } } return; }); // Cierra el pantalla completa del juego $('#block-system-main .close-full-screen').on('click', function (e) { e.preventDefault(); immersive_mode_exit_handler(); jQuery.fullscreen.exit( ); }); $('cuerpo').keypress(function (e) { if (e.that == 27) { if ($('.immerse-button .requestfullscreen ').longitud && tipo de bigScreenActive !== 'desconocido' && bigScreenActive ) { immersive_mode_exit_handler(); } } }); var screen_change_events = "webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange"; on(screen_change_events, function () { if (jQuery.fullscreen.isFullScreen()) { if (jQuery(' html').hasClass('mobile-device')) { jQuery("#block-system-main #html5game" ).attr('src', jQuery('#playNowButton').attr('href')); } $("cuerpo").addClass('immersiveActive') ; elem.classList.add('ventana de pantalla completa'); // agregar alerta de zoom if(typeof chkZoomValues ​​​​=== "función") { chkZoomValues (); } // ajustar el ancho y la altura del juego iframe AdjustWidthHeightGame() ; } else { if (jQuery ('html').hasClass('mobile-device')) { jQuery("#block-system-main #html5game" ).removeAttr('src'); } immersive_mode_exit_handler(); $ ("body").removeClass ('immersiveActive'); elem.classList.remove('full-screen-window'); // Eliminar alerta ampliada $( '.zoomedalert').remove(); $('#html5game ').removeAttr ("estilo"); $('#swfgame').removeAttr("style"); $('.game-xp-bar- sumergir-botón').removeAttr("estilo"); } } ); } función ajustarWidthHeightGame() { var iframe = document.getElementById('html5game') ? document.getElementById('html5game') : document.getElementById('swfgame '); var iframeWidth = parseInt(iframe.width); var iframeHeight = parseInt(iframe .height); // var windowWidth = parseInt(screen.width); // var windowHeight = parseInt(screen.height) - 75; var windowWidth = parseInt($(window).width()); $(window).height()); var xpbarPos = (windowHeight + 75 - iframeHeight) / 2 + iframeHeight + 10; $('.game-xp-bar -immerse-button').css('arriba', xpbarPos + "px"); if ($("cuerpo").hasClass("game-scalable")) { if (iframeHeight > windowHeight) { var rate = iframeHeight / windowHeight; } else { var rate = windowHeight / iframeHeight; // Calcula el ancho del juego según la altura de la ventana var gameWidth = iframeWidth * rate; // Aplica un nuevo ancho y alto usando iframe y barra XP. iframe.style.width = gameWidth + "px"; iframe.style.height = windowHeight + "px"; var xpbarPos = windowHeight + 10; $('.game-xp-bar-immerse-button').css(' top', xpbarPos + "px"); } else if ($("body").hasClass("game-full-screen")) { // Aplicar nuevo ancho y alto usando iframe y XP bar Para hacer. iframe.style.width = windowWidth + "px"; iframe.style.height = windowHeight + "px"; var xpbarPos = windowHeight + 10; $('.game-xp-bar-immerse-button').css(' top', xpbarPos + "px"); functionadjustWidthHeightModalGame(is_resize) { var iframe = $('#immersiveModal').find('#html5game'); var iframeWidth = parseInt(iframe.attr('width')); iframeHeight = parseInt(iframe.attr('height')); var time_out = (is_resize === true) ?500:0; var wdWidth = parseInt($(ventana).width()); var wdHeight = parseInt($ ( ventana).altura()); var oTwdWidth = parseInt($(ventana).outerWidth()); var oTwdHeight = parseInt($(ventana).outerHeight()); var windowWidth = (oTwdWidth > wdWidth) ? wdWidth; var windowHeight = (oTwdHeight > wdHeight) ? oTwdHeight : wdHeight; if ($("cuerpo").hasClass("game-scalable")) { if (iframeHeight > windowHeight) { var rate = iframeHeight / windowHeight; { var rate = windowHeight / iframeHeight; } // Calcular el ancho del juego basado en la altura de la ventana var gameWidth = iframeWidth * rate; // Aplicar nuevo ancho y alto en iframe iframe.css(" ancho", windowWidth); iframe.css("height", windowHeight) ; } else if ($("cuerpo").hasClass("juego-pantalla-completa")) { iframe.css("ancho", ancho de ventana ); iframe.css("alto", alto de ventana); } } // Ajusta el ancho/alto del juego si la pantalla gira de vertical a horizontal. if ($("cuerpo").hasClass("isFullScreen")) {AdjustWidthHeightGame(); } if ($("body").find("#immersiveModal").length) {adjustWidthHeightModalGame(true); } if ( $("#swfgamewrapper #html5game").prop("tagName") == "IFRAME1" && !cmg_is_mobile_device() && document .documentElement.clientWidth >= 960 - ( window.innerWidth-jQuery(document).width() ) ) { if (hide_preroll_ads == false && (prerollAdDisplayed == false || prerollAdEnd != "" && prerollAdStart != prerollAdEnd ) && prerollAdEnd != "mob") { displayPrerollAd_Desktop(); } else if (hide_preroll_ads == true || prerollAdDisplayed == true) { objpad.cmg_check_access(); } } }, false); var cmg_mmg_html = ''; var cmg_mmg_swf_html = ''; var cmg_game_modal_attached = false; function addedModalHtml(elem, title) { cmg_game_modal_attached = true; var elem = document.getElementById('Bloquear sistema principal'); iframed_mobile_game_url; var game_src = ''; var queryString = '?id' + '=' + ID del juego; let isMobile = cmg_is_mobile_device(); } else if (cmgmobile_game_files != ' ' && isMobile) { game_src = jQuery("#html5game").attr("src") + queryString; } else if (iframe_mobile_game_url != '' && isMobile) { game_src = iframe_mobile_game_url; } else { game_src = jQuery("# html5juego").attr("origen"); } html = '

'; $('cuerpo').append(html); var gamewrapper = jQuery("#swfgamewrapper"); jQuery('#immersiveModal .modal-body').html(ゲームラッパー); if (cmg_is_mobile_device() || (jQuery(".game-page-mobile .playNow").length && jQuery(".game-page-mobile .playNow").is(':visible') ) ) { newiframe = '

'; } if (cmg_flash_emulated_game()) { if (drupalSettings.cmatgame.flash_emulation === "1"){ //ruffle game_type = "html5"; var swfURLObject = drupalSettings.cmatgame.swfembed.swf.u; var swfURLArray = swfURLObject.split("/"); juego_ancho = drupalSettings.cmatgame.swfembed.swf.swf_1.width; juego_altura = drupalSettings.cmatgame.swfembed.swf.swf_1.altura; var swf_game_url = 'https://www.coolmath-games.com/sites/cmatgame/files/ruffle1/ruffle.html?f='+swfURLArray[swfURLArray.length-1]+'&w='+game_width+'&h= '+ゲームの高さ; cmg_mmg_swf_html = '

'; } else if (drupalSettings.cmatgame.flash_emulation === "2"){ //ruffle game_type = "html5"; juego_ancho = drupalSettings.cmatgame.swfembed.swf.swf_1.width; game_height = drupalSettings.cmatgame.swfembed.swf.swf_1.height;ゲームタイプ = "html5"; var swfURLObject = drupalSettings.cmatgame.swfembed.swf.u; var swfURLArray = swfURLObject.split("/"); swf_1_game_movie_param = swfURLArray[swfURLArray.longitud-1]; //cheerpx js var swf_game_url = cmgGetCheerpxUrl()+swfURLArray[swfURLArray.length-1]+'&w='+game_width+'&h='+game_height; noticiaswfiframe = '

'; jQuery("#swfgame").replaceWith(newswfiframe); } } } } función requestFullscreenModal(elemento, título) { $("#immersiveModal").addClass('モーダル フェード ショー フルスクリーン モーダル').css({"display":"block", "z -índice"): 10000}); $('cuerpo').addClass('isModalPlay'); $('#immersiveModal').find('#swfgamewrapper').show(); if ($('#html5juego').longitud || cmg_mmg_html) { jQuery("#swfgamewrapper").html(cmg_mmg_html); si (cmg_flash_emulated_game()) { jQuery("#swfgamewrapper").html(cmg_mmg_swf_html); } } else if (jQuery('#swfgame').length) { if (cmg_flash_emulated_game()) { if (drupalSettings.cmatgame.flash_emulation === "2"){ jQuery("#swfgamewrapper").html(newswfiframe) ; } más { jQuery("#swfgamewrapper").html(cmg_mmg_swf_html); iframe cargado en el móvil (); if (drupalSettings.cmatgame.flash_emulation === "2"){displayCmgCheerpxLoadingScreenResize(); $('#immersiveModal').find('.close').click(function () { $("#immersiveModal").remove(); }); ventana.ubicación.hash = "immersiveModal"; $(ventana).on('hashchange', función (evento) { if (ventana.ubicación.hash != "#immersiveModal") { $("#immersiveModal").hide(); if ($('#html5game ').length) { $('#html5game').remove(); } else if (jQuery('#swfgame').length) { jQuery('#swfgame').remove(); } $('body ').removeClass('isModalPlay'); } });調整幅高さモーダルゲーム(false); if (ブラウザの種類 !== "未定義" && ブラウザ == "Microsoft Internet Explorer") { if ("function" === typeof checkVersionBrowser) { ieVersion = checkVersionBrowser(); if (ieVersion == "IE 11" && !jQuery('#html5game').length) { jQuery("#swfgamewrapper").html(cmg_mmg_html); } } } }

FAQs

How to get into Coolmath Games when its blocked? ›

Blocked From Coolmath Games?
  1. Blocked From Coolmath Games?
  2. Don't worry, it's easy to fix.
  3. "Coolmath-Games.com" is now "CoolmathGames.com" (we got rid of the dash).
  4. You may need to have your IT administrator add "CoolmathGames.com" to your website list, along with "Coolmath-Games.com".

What games were removed from Coolmath? ›

Coolmath Games is no longer hosting Ittle Dew, Membrane, Another Perspective, or Ellipsis. These games were originally part of the Coolmath Games Store.

What IO games are on Coolmath Games? ›

After all, many of our most popular games on the Coolmath Games site are IO games. A few of our personal favorites are powerline.io and defly.io. Both are high-action games with giant maps and super fun gameplay. We especially recommend powerline.io if you are good at the game Snake.

What age is Coolmath for? ›

Coolmath.com offers "math learning for ages 13-100" -- lessons, tools and learning that are easy to grasp on topics like algebra, pre-calculus and more.

How do I unblock a game at school? ›

5 tips to unblock blocked games on a school computer
  1. Switching to a mobile hotspot. Using your mobile data is one of the most efficient ways of playing blocked games on a school computer. ...
  2. Using the Tor browser. ...
  3. Using a proxy server. ...
  4. Changing DNS settings. ...
  5. Opting for VPN.
Jul 13, 2023

How to play locked games in school? ›

VPNs switch out your IP address and make you anonymous online, so the WiFi network you're connected to can't tell what site you're trying to visit. And if it doesn't know what app you're on, it can't block you. The thing is, not all VPNs are able to unblock school WiFi restrictions. So you need a reliable VPN that can.

Does Coolmath have scary games? ›

Check out this list of our spookiest and scariest games. Full of ghosts, ghouls, vampires, zombies and other things that go bump in the night.

Who created hexanaut? ›

Exodragon Games is the developer of Hexanaut io. They have developed several popular io games over the years. This includes Hexanaut.io and Defly.io, both of which are available on Coolmath Games.

Is Coolmath Games good for kids? ›

Parents need to know that Coolmath.com is a one-stop math shop for middle and high school students, and also has a helpful section for parents and teachers. There are a lot of ads, but other than that, it's a suitable place for kids to learn math and play educational games.

What is Coolmath 4 kids? ›

Games, lessons, and quizzes on topics of addition, subtraction, multiplication, division, and fractions. A good site if you are looking for games and/or tutorials to reinforce math facts.

What happened to coolmath4kids? ›

Shutdown hoax

However, Cool Math Games confirmed that it would not be shutting down and was focusing on getting new HTML5 games and converting old Flash games to HTML5 after Adobe Flash reached its end-of-life in 2020.

Why did schools ban Coolmath Games? ›

Coolmath is an old website filled with malware and spyware. Students previously used this website on the school equipment and it caused 70 laptops to crash. Equipment invested with viruses must be completely wiped and reformatted.

How do you bypass a blocked game? ›

There is a simple answer to the question of how to bypass blocked games because of some geographical restrictions applied. The only thing you need to have is VPN. It will change your real IP address by providing an alternative secure IP from another country.

Why can't I open Coolmath Games? ›

2) If you CAN'T see the bouncing "Coolmath" in the blue box above, then you probably need to enable, or install a program called Flash. If you are using Chrome, and it says "Click to enable Adobe Flash Player", then click on the box and follow the instructions to enable the player.

Why is Coolmath blocked? ›

Like Newsweek said, Flash would be shutting down to begin with,after all, they've most likely used Flash so many times to play the games on Coolmath. The answer is simple, it was a risk. Back before all of this,Adobe Flash was starting to become a security risk.

Why is Coolmath blocked at school? ›

Coolmath is an old website filled with malware and spyware. Students previously used this website on the school equipment and it caused 70 laptops to crash. Equipment invested with viruses must be completely wiped and reformatted.

References

Top Articles
Latest Posts
Article information

Author: Maia Crooks Jr

Last Updated: 01/11/2023

Views: 5391

Rating: 4.2 / 5 (43 voted)

Reviews: 82% of readers found this page helpful

Author information

Name: Maia Crooks Jr

Birthday: 1997-09-21

Address: 93119 Joseph Street, Peggyfurt, NC 11582

Phone: +2983088926881

Job: Principal Design Liaison

Hobby: Web surfing, Skiing, role-playing games, Sketching, Polo, Sewing, Genealogy

Introduction: My name is Maia Crooks Jr, I am a homely, joyous, shiny, successful, hilarious, thoughtful, joyous person who loves writing and wants to share my knowledge and understanding with you.