smash redo v(idfk anymore)
3
.gitmodules
vendored
@ -1,3 +1,6 @@
|
||||
[submodule "HTML-Games-V2"]
|
||||
path = HTML-Games-V2
|
||||
url = https://github.com/WBattist/HTML-Games-V2
|
||||
[submodule "smash-kart"]
|
||||
path = smash-kart
|
||||
url = https://github.com/ghp1tallteam/ghp1tallteam.github.io
|
||||
|
@ -1,46 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Baloo+2:wght@600&display=swap" rel="stylesheet">
|
||||
<link rel="icon" href="images/favicon.png" sizes="16x16">
|
||||
|
||||
<style>
|
||||
.content { padding-top: 50%; }
|
||||
|
||||
.center {
|
||||
display: block;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
a {
|
||||
color: white;
|
||||
}
|
||||
|
||||
p {
|
||||
text-align: center;
|
||||
font-family: 'Baloo 2', cursive;
|
||||
color: white;
|
||||
font-size: 200%;
|
||||
}
|
||||
|
||||
.vertical-center {
|
||||
margin: 0;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
-ms-transform: translateY(-50%);
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body style="background-color:#2e75d0;">
|
||||
<div>
|
||||
<img src="images/SmashKarts-404-PageNotFound.png" alt="SmashKarts404" class="center">
|
||||
<p>The Page you are looking for doesn't exist or another error occurred. <br>Go back, or go directly to <a href="https://smashkarts.io/">smashkarts.io</a></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1 +0,0 @@
|
||||
{"Keys":["com.unity.services.core.cloud-environment","com.unity.services.core.version","com.unity.services.core.initializer-assembly-qualified-names","com.unity.services.analytics.version","com.unity.services.analytics.initializer-assembly-qualified-names","com.unity.purchasing.version","com.unity.purchasing.initializer-assembly-qualified-names","com.unity.services.core.all-package-names","com.unity.services.core.environment-name"],"Values":[{"m_Value":"production","m_IsReadOnly":false},{"m_Value":"1.12.5","m_IsReadOnly":true},{"m_Value":"Unity.Services.Core.Registration.CorePackageInitializer, Unity.Services.Core.Registration, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null;Unity.Services.Core.Internal.IInitializablePackageV2, Unity.Services.Core.Internal, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null","m_IsReadOnly":true},{"m_Value":"6.0.2","m_IsReadOnly":true},{"m_Value":"Ua2CoreInitializeCallback, Unity.Services.Analytics, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null","m_IsReadOnly":true},{"m_Value":"4.12.0","m_IsReadOnly":true},{"m_Value":"UnityEngine.Purchasing.Registration.IapCoreInitializeCallback, UnityEngine.Purchasing.Stores, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null","m_IsReadOnly":true},{"m_Value":"com.unity.services.core;com.unity.services.analytics;com.unity.purchasing","m_IsReadOnly":false},{"m_Value":"production","m_IsReadOnly":false}]}
|
@ -1,308 +0,0 @@
|
||||
<linker>
|
||||
<assembly fullname="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
|
||||
<type fullname="ApplyQualitySettingsToGameObject" preserve="all" />
|
||||
<type fullname="ArenaBoost" preserve="all" />
|
||||
<type fullname="AutoDetectQuality" preserve="all" />
|
||||
<type fullname="AwardSeasonPointsSequence" preserve="all" />
|
||||
<type fullname="AwardXpSequence" preserve="all" />
|
||||
<type fullname="BillboardArenaObject" preserve="all" />
|
||||
<type fullname="BoostCollectable" preserve="all" />
|
||||
<type fullname="BoostCollectableService" preserve="all" />
|
||||
<type fullname="BotLorePanel" preserve="all" />
|
||||
<type fullname="BotManager" preserve="all" />
|
||||
<type fullname="CamShakeTransform" preserve="all" />
|
||||
<type fullname="ChallengeSpriteArraySO" preserve="all" />
|
||||
<type fullname="ChallengeSpriteSO" preserve="all" />
|
||||
<type fullname="CoinsWidget" preserve="all" />
|
||||
<type fullname="Collectable" preserve="all" />
|
||||
<type fullname="CollectableAnimator" preserve="all" />
|
||||
<type fullname="CollectableBoostAnimator" preserve="all" />
|
||||
<type fullname="CollectableFactory" preserve="all" />
|
||||
<type fullname="CollectableSpawnPoint" preserve="all" />
|
||||
<type fullname="CopyLinkScreen" preserve="all" />
|
||||
<type fullname="Crystal.SafeArea" preserve="all" />
|
||||
<type fullname="CullingGroup" preserve="all" />
|
||||
<type fullname="CullingManager" preserve="all" />
|
||||
<type fullname="CustomizationImageData" preserve="all" />
|
||||
<type fullname="DontGoThroughThings" preserve="all" />
|
||||
<type fullname="FirebaseDynamicLinkCreator" preserve="all" />
|
||||
<type fullname="FlagCollectableCollider" preserve="all" />
|
||||
<type fullname="FlagReturnZone" preserve="all" />
|
||||
<type fullname="FloatingText" preserve="all" />
|
||||
<type fullname="FpsDisplay" preserve="all" />
|
||||
<type fullname="FrameRateToggleController" preserve="all" />
|
||||
<type fullname="GameManager" preserve="all" />
|
||||
<type fullname="GameModeController" preserve="all" />
|
||||
<type fullname="GameModeInfoScreen" preserve="all" />
|
||||
<type fullname="GameModeManagerCTF" preserve="all" />
|
||||
<type fullname="GameModeManagerFlagHolder" preserve="all" />
|
||||
<type fullname="GameModeManagerLootCollector" preserve="all" />
|
||||
<type fullname="GameModeManagerScoreCollector" preserve="all" />
|
||||
<type fullname="GameScreenManager" preserve="all" />
|
||||
<type fullname="GameStartScreen" preserve="all" />
|
||||
<type fullname="GameTutorialManager" preserve="all" />
|
||||
<type fullname="GameTutorialPopupWidget" preserve="all" />
|
||||
<type fullname="GenericObjectPooler" preserve="all" />
|
||||
<type fullname="GenericPoolableObject" preserve="all" />
|
||||
<type fullname="GunGameUIManager" preserve="all" />
|
||||
<type fullname="HatData" preserve="all" />
|
||||
<type fullname="HatHolderHudIcon" preserve="all" />
|
||||
<type fullname="HatsTransformTransferHelper" preserve="all" />
|
||||
<type fullname="HealthCircle" preserve="all" />
|
||||
<type fullname="HUDLeaderboard" preserve="all" />
|
||||
<type fullname="ImgPopAndTransitionEffect" preserve="all" />
|
||||
<type fullname="ImgPopAndTransitionEffectMultiple" preserve="all" />
|
||||
<type fullname="InGameAntiCheat" preserve="all" />
|
||||
<type fullname="InGameChallengesPanel" preserve="all" />
|
||||
<type fullname="InGameLeaderboardScreen" preserve="all" />
|
||||
<type fullname="InGameScreenManager" preserve="all" />
|
||||
<type fullname="InputTouchesAutoDrive" preserve="all" />
|
||||
<type fullname="InputTouchesManual" preserve="all" />
|
||||
<type fullname="ItemDataHolder" preserve="all" />
|
||||
<type fullname="JoystickMove" preserve="all" />
|
||||
<type fullname="JumpForce" preserve="all" />
|
||||
<type fullname="LavaRockSFX" preserve="all" />
|
||||
<type fullname="Leaderboard" preserve="all" />
|
||||
<type fullname="LeaderboardEntry" preserve="all" />
|
||||
<type fullname="LoadingWheel" preserve="all" />
|
||||
<type fullname="LobMine" preserve="all" />
|
||||
<type fullname="LookAtCamera" preserve="all" />
|
||||
<type fullname="MasterClientManager" preserve="all" />
|
||||
<type fullname="MeshCombiner" preserve="all" />
|
||||
<type fullname="MobileControlsManager" preserve="all" />
|
||||
<type fullname="MobileInputAutoDrive" preserve="all" />
|
||||
<type fullname="MobileInputKeyboard" preserve="all" />
|
||||
<type fullname="MobileInputManual" preserve="all" />
|
||||
<type fullname="NewPlayerSurveyScreen" preserve="all" />
|
||||
<type fullname="ObjectPooler" preserve="all" />
|
||||
<type fullname="OffsetScrolling" preserve="all" />
|
||||
<type fullname="OnlinePresenceUI" preserve="all" />
|
||||
<type fullname="ParticleSystemActions" preserve="all" />
|
||||
<type fullname="PauseScreen" preserve="all" />
|
||||
<type fullname="Photon.Pun.UtilityScripts.PhotonTeamsManager" preserve="all" />
|
||||
<type fullname="PhotonSocial" preserve="all" />
|
||||
<type fullname="PingDisplay" preserve="all" />
|
||||
<type fullname="PingManager" preserve="all" />
|
||||
<type fullname="PitchShiftedSound" preserve="all" />
|
||||
<type fullname="PlayerKartLoadout" preserve="all" />
|
||||
<type fullname="PlayerStatsPanel" preserve="all" />
|
||||
<type fullname="PointerEventsAutoDrive" preserve="all" />
|
||||
<type fullname="PointerEventsManual" preserve="all" />
|
||||
<type fullname="PopcornCelebrationSound" preserve="all" />
|
||||
<type fullname="PowerWidget" preserve="all" />
|
||||
<type fullname="PressAnyKeyToDisable" preserve="all" />
|
||||
<type fullname="ProgressBar" preserve="all" />
|
||||
<type fullname="SeasonWidget" preserve="all" />
|
||||
<type fullname="SkinnedHatPositioner" preserve="all" />
|
||||
<type fullname="SkipTutorialPopup" preserve="all" />
|
||||
<type fullname="SmashKartsTeamsManager" preserve="all" />
|
||||
<type fullname="SnowArenaGlowPulse" preserve="all" />
|
||||
<type fullname="SpawnManager" preserve="all" />
|
||||
<type fullname="SpawnPoint" preserve="all" />
|
||||
<type fullname="SpecialLootboxManager" preserve="all" />
|
||||
<type fullname="StarrySkyStaticParticleSystem" preserve="all" />
|
||||
<type fullname="SteeringWheelMove" preserve="all" />
|
||||
<type fullname="TeamPicker" preserve="all" />
|
||||
<type fullname="UIGlint" preserve="all" />
|
||||
<type fullname="UIGradient" preserve="all" />
|
||||
<type fullname="UIVehicle" preserve="all" />
|
||||
<type fullname="UnityStandardAssets.Cameras.ProtectCameraFromWallClip" preserve="all" />
|
||||
<type fullname="UnityStandardAssets.Utility.AutoMoveAndRotate" preserve="all" />
|
||||
<type fullname="VariableJoystick" preserve="all" />
|
||||
<type fullname="VehicleBullet" preserve="all" />
|
||||
<type fullname="VehicleCamera" preserve="all" />
|
||||
<type fullname="VehicleCameraManager" preserve="all" />
|
||||
<type fullname="VehicleCelebration" preserve="all" />
|
||||
<type fullname="VehicleCharacter" preserve="all" />
|
||||
<type fullname="VehicleMobileUI" preserve="all" />
|
||||
<type fullname="WifiWarning" preserve="all" />
|
||||
<type fullname="WinCeremonyAdManager" preserve="all" />
|
||||
<type fullname="XpBoostPopup" preserve="all" />
|
||||
<type fullname="XpMultiplierBtn" preserve="all" />
|
||||
<type fullname="XpWidget" preserve="all" />
|
||||
<type fullname="ItemData" preserve="nothing" serialized="true" />
|
||||
<type fullname="FriendRequestSpriteMap" preserve="nothing" serialized="true" />
|
||||
<type fullname="ObjectPoolItem" preserve="nothing" serialized="true" />
|
||||
<type fullname="Photon.Pun.UtilityScripts.PhotonTeam" preserve="nothing" serialized="true" />
|
||||
<type fullname="RoundStatsData" preserve="nothing" serialized="true" />
|
||||
<type fullname="UnityStandardAssets.Utility.AutoMoveAndRotate/Vector3andSpace" preserve="nothing" serialized="true" />
|
||||
</assembly>
|
||||
<assembly fullname="FluffyUnderware.DevTools, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
|
||||
<type fullname="FluffyUnderware.DevTools.ComponentPool" preserve="all" />
|
||||
<type fullname="FluffyUnderware.DevTools.PoolManager" preserve="all" />
|
||||
<type fullname="FluffyUnderware.DevTools.FloatRegion" preserve="nothing" serialized="true" />
|
||||
<type fullname="FluffyUnderware.DevTools.IntRegion" preserve="nothing" serialized="true" />
|
||||
<type fullname="FluffyUnderware.DevTools.PoolSettings" preserve="nothing" serialized="true" />
|
||||
</assembly>
|
||||
<assembly fullname="ToolBuddy.Curvy, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
|
||||
<type fullname="FluffyUnderware.Curvy.CurvyGlobalManager" preserve="all" />
|
||||
<type fullname="FluffyUnderware.Curvy.CurvySpline" preserve="all" />
|
||||
<type fullname="FluffyUnderware.Curvy.CurvySplineSegment" preserve="all" />
|
||||
<type fullname="FluffyUnderware.Curvy.Generator.CGMeshResource" preserve="all" />
|
||||
<type fullname="FluffyUnderware.Curvy.Generator.CurvyGenerator" preserve="all" />
|
||||
<type fullname="FluffyUnderware.Curvy.Generator.Modules.BuildRasterizedPath" preserve="all" />
|
||||
<type fullname="FluffyUnderware.Curvy.Generator.Modules.BuildShapeExtrusion" preserve="all" />
|
||||
<type fullname="FluffyUnderware.Curvy.Generator.Modules.BuildVolumeMesh" preserve="all" />
|
||||
<type fullname="FluffyUnderware.Curvy.Generator.Modules.BuildVolumeSpots" preserve="all" />
|
||||
<type fullname="FluffyUnderware.Curvy.Generator.Modules.CreateMesh" preserve="all" />
|
||||
<type fullname="FluffyUnderware.Curvy.Generator.Modules.DeformMesh" preserve="all" />
|
||||
<type fullname="FluffyUnderware.Curvy.Generator.Modules.GameObjectToMesh" preserve="all" />
|
||||
<type fullname="FluffyUnderware.Curvy.Generator.Modules.InputGameObject" preserve="all" />
|
||||
<type fullname="FluffyUnderware.Curvy.Generator.Modules.InputSplinePath" preserve="all" />
|
||||
<type fullname="FluffyUnderware.Curvy.Generator.Modules.InputSplineShape" preserve="all" />
|
||||
<type fullname="FluffyUnderware.Curvy.MetaCGOptions" preserve="all" />
|
||||
<type fullname="FluffyUnderware.Curvy.Pools.ArrayPoolsSettings" preserve="all" />
|
||||
<type fullname="FluffyUnderware.Curvy.CurvyCGEvent" preserve="nothing" serialized="true" />
|
||||
<type fullname="FluffyUnderware.Curvy.CurvyControlPointEvent" preserve="nothing" serialized="true" />
|
||||
<type fullname="FluffyUnderware.Curvy.CurvySplineEvent" preserve="nothing" serialized="true" />
|
||||
<type fullname="FluffyUnderware.Curvy.Generator.CGBoundsGroup" preserve="nothing" serialized="true" />
|
||||
<type fullname="FluffyUnderware.Curvy.Generator.CGBoundsGroupItem" preserve="nothing" serialized="true" />
|
||||
<type fullname="FluffyUnderware.Curvy.Generator.CGGameObjectProperties" preserve="nothing" serialized="true" />
|
||||
<type fullname="FluffyUnderware.Curvy.Generator.CGMaterialSettingsEx" preserve="nothing" serialized="true" />
|
||||
<type fullname="FluffyUnderware.Curvy.Generator.CGMeshResourceCollection" preserve="nothing" serialized="true" />
|
||||
<type fullname="FluffyUnderware.Curvy.Generator.CGModuleInputSlot" preserve="nothing" serialized="true" />
|
||||
<type fullname="FluffyUnderware.Curvy.Generator.CGModuleLink" preserve="nothing" serialized="true" />
|
||||
<type fullname="FluffyUnderware.Curvy.Generator.CGModuleOutputSlot" preserve="nothing" serialized="true" />
|
||||
<type fullname="FluffyUnderware.Curvy.Generator.CGModuleProperties" preserve="nothing" serialized="true" />
|
||||
</assembly>
|
||||
<assembly fullname="Unity.Addressables, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" preserve="all">
|
||||
<type fullname="UnityEngine.AddressableAssets.Addressables" preserve="all" />
|
||||
<type fullname="UnityEngine.AddressableAssets.AssetReference" preserve="nothing" serialized="true" />
|
||||
</assembly>
|
||||
<assembly fullname="Unity.AI.Navigation, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
|
||||
<type fullname="Unity.AI.Navigation.NavMeshSurface" preserve="all" />
|
||||
</assembly>
|
||||
<assembly fullname="Unity.InputSystem, Version=1.11.2.0, Culture=neutral, PublicKeyToken=null">
|
||||
<type fullname="UnityEngine.InputSystem.InputActionAsset" preserve="all" />
|
||||
<type fullname="UnityEngine.InputSystem.InputActionReference" preserve="all" />
|
||||
<type fullname="UnityEngine.InputSystem.UI.InputSystemUIInputModule" preserve="all" />
|
||||
<type fullname="UnityEngine.InputSystem.InputAction" preserve="nothing" serialized="true" />
|
||||
<type fullname="UnityEngine.InputSystem.InputActionMap" preserve="nothing" serialized="true" />
|
||||
<type fullname="UnityEngine.InputSystem.InputBinding" preserve="nothing" serialized="true" />
|
||||
<type fullname="UnityEngine.InputSystem.InputControlScheme" preserve="nothing" serialized="true" />
|
||||
<type fullname="UnityEngine.InputSystem.InputControlScheme/DeviceRequirement" preserve="nothing" serialized="true" />
|
||||
</assembly>
|
||||
<assembly fullname="Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" preserve="all">
|
||||
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.AssetBundleProvider" preserve="all" />
|
||||
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.AtlasSpriteProvider" preserve="all" />
|
||||
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.BundledAssetProvider" preserve="all" />
|
||||
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.InstanceProvider" preserve="all" />
|
||||
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.SceneProvider" preserve="all" />
|
||||
</assembly>
|
||||
<assembly fullname="Unity.TextMeshPro, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
|
||||
<type fullname="TMPro.TextMeshProUGUI" preserve="all" />
|
||||
<type fullname="TMPro.TMP_Dropdown" preserve="all" />
|
||||
<type fullname="TMPro.TMP_FontAsset" preserve="all" />
|
||||
<type fullname="TMPro.TMP_Dropdown/DropdownEvent" preserve="nothing" serialized="true" />
|
||||
<type fullname="TMPro.TMP_Dropdown/OptionDataList" preserve="nothing" serialized="true" />
|
||||
<type fullname="TMPro.VertexGradient" preserve="nothing" serialized="true" />
|
||||
<type fullname="TMPro.FaceInfo_Legacy" preserve="nothing" serialized="true" />
|
||||
<type fullname="TMPro.FontAssetCreationSettings" preserve="nothing" serialized="true" />
|
||||
<type fullname="TMPro.KerningTable" preserve="nothing" serialized="true" />
|
||||
<type fullname="TMPro.TMP_Character" preserve="nothing" serialized="true" />
|
||||
<type fullname="TMPro.TMP_FontFeatureTable" preserve="nothing" serialized="true" />
|
||||
<type fullname="TMPro.TMP_FontWeightPair" preserve="nothing" serialized="true" />
|
||||
</assembly>
|
||||
<assembly fullname="UnityEngine.AIModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
|
||||
<type fullname="UnityEngine.AI.NavMeshData" preserve="all" />
|
||||
<type fullname="UnityEngine.AI.NavMeshObstacle" preserve="all" />
|
||||
</assembly>
|
||||
<assembly fullname="UnityEngine.AnimationModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
|
||||
<type fullname="UnityEngine.AnimationClip" preserve="all" />
|
||||
<type fullname="UnityEngine.Animator" preserve="all" />
|
||||
<type fullname="UnityEngine.Avatar" preserve="all" />
|
||||
<type fullname="UnityEngine.RuntimeAnimatorController" preserve="all" />
|
||||
</assembly>
|
||||
<assembly fullname="UnityEngine.AudioModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
|
||||
<type fullname="UnityEngine.AudioClip" preserve="all" />
|
||||
<type fullname="UnityEngine.AudioListener" preserve="all" />
|
||||
<type fullname="UnityEngine.AudioSource" preserve="all" />
|
||||
</assembly>
|
||||
<assembly fullname="UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
|
||||
<type fullname="UnityEngine.Camera" preserve="all" />
|
||||
<type fullname="UnityEngine.Cubemap" preserve="all" />
|
||||
<type fullname="UnityEngine.FlareLayer" preserve="all" />
|
||||
<type fullname="UnityEngine.GameObject" preserve="all" />
|
||||
<type fullname="UnityEngine.Light" preserve="all" />
|
||||
<type fullname="UnityEngine.LightingSettings" preserve="all" />
|
||||
<type fullname="UnityEngine.LightmapSettings" preserve="all" />
|
||||
<type fullname="UnityEngine.LineRenderer" preserve="all" />
|
||||
<type fullname="UnityEngine.Material" preserve="all" />
|
||||
<type fullname="UnityEngine.Mesh" preserve="all" />
|
||||
<type fullname="UnityEngine.MeshFilter" preserve="all" />
|
||||
<type fullname="UnityEngine.MeshRenderer" preserve="all" />
|
||||
<type fullname="UnityEngine.Object" preserve="all" />
|
||||
<type fullname="UnityEngine.Projector" preserve="all" />
|
||||
<type fullname="UnityEngine.RectTransform" preserve="all" />
|
||||
<type fullname="UnityEngine.RenderSettings" preserve="all" />
|
||||
<type fullname="UnityEngine.Shader" preserve="all" />
|
||||
<type fullname="UnityEngine.Sprite" preserve="all" />
|
||||
<type fullname="UnityEngine.SpriteRenderer" preserve="all" />
|
||||
<type fullname="UnityEngine.Texture2D" preserve="all" />
|
||||
<type fullname="UnityEngine.Transform" preserve="all" />
|
||||
<type fullname="UnityEngine.U2D.SpriteAtlas" preserve="all" />
|
||||
<type fullname="UnityEngine.Events.ArgumentCache" preserve="nothing" serialized="true" />
|
||||
<type fullname="UnityEngine.Events.PersistentCallGroup" preserve="nothing" serialized="true" />
|
||||
<type fullname="UnityEngine.Events.PersistentListenerMode" preserve="nothing" serialized="true" />
|
||||
<type fullname="UnityEngine.Events.UnityEvent" preserve="nothing" serialized="true" />
|
||||
<type fullname="UnityEngine.RectOffset" preserve="nothing" serialized="true" />
|
||||
</assembly>
|
||||
<assembly fullname="UnityEngine.ParticleSystemModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
|
||||
<type fullname="UnityEngine.ParticleSystem" preserve="all" />
|
||||
<type fullname="UnityEngine.ParticleSystemRenderer" preserve="all" />
|
||||
</assembly>
|
||||
<assembly fullname="UnityEngine.PhysicsModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
|
||||
<type fullname="UnityEngine.BoxCollider" preserve="all" />
|
||||
<type fullname="UnityEngine.CapsuleCollider" preserve="all" />
|
||||
<type fullname="UnityEngine.HingeJoint" preserve="all" />
|
||||
<type fullname="UnityEngine.MeshCollider" preserve="all" />
|
||||
<type fullname="UnityEngine.PhysicMaterial" preserve="all" />
|
||||
<type fullname="UnityEngine.Rigidbody" preserve="all" />
|
||||
<type fullname="UnityEngine.SphereCollider" preserve="all" />
|
||||
</assembly>
|
||||
<assembly fullname="UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
|
||||
<type fullname="UnityEngine.EventSystems.EventSystem" preserve="all" />
|
||||
<type fullname="UnityEngine.EventSystems.EventTrigger" preserve="all" />
|
||||
<type fullname="UnityEngine.EventSystems.StandaloneInputModule" preserve="all" />
|
||||
<type fullname="UnityEngine.UI.Button" preserve="all" />
|
||||
<type fullname="UnityEngine.UI.CanvasScaler" preserve="all" />
|
||||
<type fullname="UnityEngine.UI.ContentSizeFitter" preserve="all" />
|
||||
<type fullname="UnityEngine.UI.GraphicRaycaster" preserve="all" />
|
||||
<type fullname="UnityEngine.UI.HorizontalLayoutGroup" preserve="all" />
|
||||
<type fullname="UnityEngine.UI.Image" preserve="all" />
|
||||
<type fullname="UnityEngine.UI.LayoutElement" preserve="all" />
|
||||
<type fullname="UnityEngine.UI.Mask" preserve="all" />
|
||||
<type fullname="UnityEngine.UI.Scrollbar" preserve="all" />
|
||||
<type fullname="UnityEngine.UI.ScrollRect" preserve="all" />
|
||||
<type fullname="UnityEngine.UI.Shadow" preserve="all" />
|
||||
<type fullname="UnityEngine.UI.Slider" preserve="all" />
|
||||
<type fullname="UnityEngine.UI.Toggle" preserve="all" />
|
||||
<type fullname="UnityEngine.UI.VerticalLayoutGroup" preserve="all" />
|
||||
<type fullname="UnityEngine.EventSystems.EventTrigger/Entry" preserve="nothing" serialized="true" />
|
||||
<type fullname="UnityEngine.EventSystems.EventTrigger/TriggerEvent" preserve="nothing" serialized="true" />
|
||||
<type fullname="UnityEngine.UI.AnimationTriggers" preserve="nothing" serialized="true" />
|
||||
<type fullname="UnityEngine.UI.Button/ButtonClickedEvent" preserve="nothing" serialized="true" />
|
||||
<type fullname="UnityEngine.UI.ColorBlock" preserve="nothing" serialized="true" />
|
||||
<type fullname="UnityEngine.UI.MaskableGraphic/CullStateChangedEvent" preserve="nothing" serialized="true" />
|
||||
<type fullname="UnityEngine.UI.Navigation" preserve="nothing" serialized="true" />
|
||||
<type fullname="UnityEngine.UI.ScrollRect/ScrollRectEvent" preserve="nothing" serialized="true" />
|
||||
<type fullname="UnityEngine.UI.Scrollbar/ScrollEvent" preserve="nothing" serialized="true" />
|
||||
<type fullname="UnityEngine.UI.Slider/SliderEvent" preserve="nothing" serialized="true" />
|
||||
<type fullname="UnityEngine.UI.SpriteState" preserve="nothing" serialized="true" />
|
||||
<type fullname="UnityEngine.UI.Toggle/ToggleEvent" preserve="nothing" serialized="true" />
|
||||
</assembly>
|
||||
<assembly fullname="UnityEngine.UIModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
|
||||
<type fullname="UnityEngine.Canvas" preserve="all" />
|
||||
<type fullname="UnityEngine.CanvasGroup" preserve="all" />
|
||||
<type fullname="UnityEngine.CanvasRenderer" preserve="all" />
|
||||
</assembly>
|
||||
<assembly fullname="UnityEditor.CoreModule">
|
||||
<type fullname="UnityEditor.AnimatedValues.AnimBool" preserve="nothing" serialized="true" />
|
||||
</assembly>
|
||||
<assembly fullname="UnityEngine.TextCoreFontEngineModule">
|
||||
<type fullname="UnityEngine.TextCore.FaceInfo" preserve="nothing" serialized="true" />
|
||||
<type fullname="UnityEngine.TextCore.Glyph" preserve="nothing" serialized="true" />
|
||||
<type fullname="UnityEngine.TextCore.GlyphMetrics" preserve="nothing" serialized="true" />
|
||||
<type fullname="UnityEngine.TextCore.GlyphRect" preserve="nothing" serialized="true" />
|
||||
</assembly>
|
||||
</linker>
|
@ -1 +0,0 @@
|
||||
{"m_buildTarget":"WebGL","m_SettingsHash":"c8457600542ef4a39b37ebaf360078aa","m_CatalogLocations":[{"m_Keys":["AddressablesMainContentCatalogRemoteHash"],"m_InternalId":"https://smashkartsgc.b-cdn.net/assetbundles/remote/webgl/catalog_2025.03.31.15.03.19.hash","m_Provider":"UnityEngine.ResourceManagement.ResourceProviders.TextDataProvider","m_Dependencies":[],"m_ResourceType":{"m_AssemblyName":"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089","m_ClassName":"System.String"},"SerializedData":[7,76,85,110,105,116,121,46,82,101,115,111,117,114,99,101,77,97,110,97,103,101,114,44,32,86,101,114,115,105,111,110,61,48,46,48,46,48,46,48,44,32,67,117,108,116,117,114,101,61,110,101,117,116,114,97,108,44,32,80,117,98,108,105,99,75,101,121,84,111,107,101,110,61,110,117,108,108,75,85,110,105,116,121,69,110,103,105,110,101,46,82,101,115,111,117,114,99,101,77,97,110,97,103,101,109,101,110,116,46,82,101,115,111,117,114,99,101,80,114,111,118,105,100,101,114,115,46,80,114,111,118,105,100,101,114,76,111,97,100,82,101,113,117,101,115,116,79,112,116,105,111,110,115,50,0,0,0,123,0,34,0,109,0,95,0,73,0,103,0,110,0,111,0,114,0,101,0,70,0,97,0,105,0,108,0,117,0,114,0,101,0,115,0,34,0,58,0,116,0,114,0,117,0,101,0,125,0]},{"m_Keys":["AddressablesMainContentCatalogCacheHash"],"m_InternalId":"{UnityEngine.Application.persistentDataPath}/com.unity.addressables/catalog_2025.03.31.15.03.19.hash","m_Provider":"UnityEngine.ResourceManagement.ResourceProviders.TextDataProvider","m_Dependencies":[],"m_ResourceType":{"m_AssemblyName":"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089","m_ClassName":"System.String"},"SerializedData":[7,76,85,110,105,116,121,46,82,101,115,111,117,114,99,101,77,97,110,97,103,101,114,44,32,86,101,114,115,105,111,110,61,48,46,48,46,48,46,48,44,32,67,117,108,116,117,114,101,61,110,101,117,116,114,97,108,44,32,80,117,98,108,105,99,75,101,121,84,111,107,101,110,61,110,117,108,108,75,85,110,105,116,121,69,110,103,105,110,101,46,82,101,115,111,117,114,99,101,77,97,110,97,103,101,109,101,110,116,46,82,101,115,111,117,114,99,101,80,114,111,118,105,100,101,114,115,46,80,114,111,118,105,100,101,114,76,111,97,100,82,101,113,117,101,115,116,79,112,116,105,111,110,115,50,0,0,0,123,0,34,0,109,0,95,0,73,0,103,0,110,0,111,0,114,0,101,0,70,0,97,0,105,0,108,0,117,0,114,0,101,0,115,0,34,0,58,0,116,0,114,0,117,0,101,0,125,0]},{"m_Keys":["AddressablesMainContentCatalog"],"m_InternalId":"{UnityEngine.AddressableAssets.Addressables.RuntimePath}/catalog.json","m_Provider":"UnityEngine.AddressableAssets.ResourceProviders.ContentCatalogProvider","m_Dependencies":["AddressablesMainContentCatalogRemoteHash","AddressablesMainContentCatalogCacheHash"],"m_ResourceType":{"m_AssemblyName":"Unity.Addressables, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null","m_ClassName":"UnityEngine.AddressableAssets.ResourceLocators.ContentCatalogData"},"SerializedData":[7,76,85,110,105,116,121,46,82,101,115,111,117,114,99,101,77,97,110,97,103,101,114,44,32,86,101,114,115,105,111,110,61,48,46,48,46,48,46,48,44,32,67,117,108,116,117,114,101,61,110,101,117,116,114,97,108,44,32,80,117,98,108,105,99,75,101,121,84,111,107,101,110,61,110,117,108,108,75,85,110,105,116,121,69,110,103,105,110,101,46,82,101,115,111,117,114,99,101,77,97,110,97,103,101,109,101,110,116,46,82,101,115,111,117,114,99,101,80,114,111,118,105,100,101,114,115,46,80,114,111,118,105,100,101,114,76,111,97,100,82,101,113,117,101,115,116,79,112,116,105,111,110,115,50,0,0,0,123,0,34,0,109,0,95,0,73,0,103,0,110,0,111,0,114,0,101,0,70,0,97,0,105,0,108,0,117,0,114,0,101,0,115,0,34,0,58,0,116,0,114,0,117,0,101,0,125,0]}],"m_ProfileEvents":false,"m_LogResourceManagerExceptions":true,"m_ExtraInitializationData":[],"m_DisableCatalogUpdateOnStart":false,"m_IsLocalCatalogInBundle":false,"m_CertificateHandlerType":{"m_AssemblyName":"","m_ClassName":""},"m_AddressablesVersion":"1.22.3","m_maxConcurrentWebRequests":500,"m_CatalogRequestsTimeout":0}
|
@ -1,64 +0,0 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "480659433590",
|
||||
"firebase_url": "https://webgltest-17af1.firebaseio.com",
|
||||
"project_id": "webgltest-17af1"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:480659433590:android:c652ed8da1b9b6bba0d757",
|
||||
"android_client_info": {
|
||||
"package_name": "com.tallteam.citychase"
|
||||
}
|
||||
},
|
||||
"oauth_client": [
|
||||
{
|
||||
"client_id": "480659433590-1bi0hhf4nhihf8us5hl01bc85gqu1gdv.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.tallteam.citychase",
|
||||
"certificate_hash": "4cd609ababfbce2ccba8ca0fbdbd7b2825e04958"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "480659433590-siuffae0dh9rfe8ogdrte18b28h6btb0.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.tallteam.citychase",
|
||||
"certificate_hash": "1076e8422abdb0b94b841bc1b4757a27e62f4995"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "480659433590-taggfgh36o2bo0tnv0teiictlllhl9ia.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyChTmpDm02hGgErKjhcHpCkNNYGnp42fTc"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": [
|
||||
{
|
||||
"client_id": "480659433590-taggfgh36o2bo0tnv0teiictlllhl9ia.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
},
|
||||
{
|
||||
"client_id": "480659433590-l5p8a1j4mrosprt53alcgegei6p8uijs.apps.googleusercontent.com",
|
||||
"client_type": 2,
|
||||
"ios_info": {
|
||||
"bundle_id": "com.tallteam.citychase",
|
||||
"app_store_id": "1473010859"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"admob_app_id": "ca-app-pub-1463476156508236~1150509880"
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
@ -1,254 +0,0 @@
|
||||
html {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
*,
|
||||
*:before,
|
||||
*:after {
|
||||
box-sizing: inherit;
|
||||
}
|
||||
|
||||
/* remove auto zoom when entering text on iOS */
|
||||
input, textarea, select {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#mainContainer {
|
||||
position: relative;
|
||||
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
|
||||
/* Use dynamic viewport units if supported */
|
||||
@supports (width: 100dvw) {
|
||||
width: 100dvw;
|
||||
height: 100dvh;
|
||||
}
|
||||
}
|
||||
|
||||
#gameContainer {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#gameCanvasWrapper {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
/* cg already handle left and right padding */
|
||||
padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px) 0;
|
||||
}
|
||||
|
||||
#gameCanvas {
|
||||
position: static;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#xsolla-iframe {
|
||||
position: absolute;
|
||||
width: 80%;
|
||||
height: 100%;
|
||||
left: 50.5%;
|
||||
transform: translate(-50%, 0%);
|
||||
border: none;
|
||||
|
||||
/* cg already handle left and right padding */
|
||||
padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px) 0;
|
||||
|
||||
display: none;
|
||||
}
|
||||
|
||||
#adContainerMainMenu {
|
||||
display: none;
|
||||
--shown_display: block;
|
||||
}
|
||||
|
||||
#smashkarts-io_300x250b {
|
||||
display: flex;
|
||||
/* border: 1px solid red; */
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#adContainerWin {
|
||||
display: none;
|
||||
--shown_display: block;
|
||||
}
|
||||
|
||||
#smashkarts-io_300x250_2b {
|
||||
display: flex;
|
||||
/* border: 1px solid red; */
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#adContainerDeath {
|
||||
display: none;
|
||||
--shown_display: block;
|
||||
}
|
||||
|
||||
#smashkarts-io_728x90b {
|
||||
display: flex;
|
||||
/* border: 1px solid red; */
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 600px) {
|
||||
#smashkarts-io_300x250 {
|
||||
/* border: 1px solid blue; */
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* try to handle mobile dialog */
|
||||
canvas+* {
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.logo {
|
||||
display: block;
|
||||
|
||||
width: 35vw;
|
||||
|
||||
/* Use dynamic viewport units if supported */
|
||||
@supports (width: 35dvw) {
|
||||
width: 35dvw;
|
||||
}
|
||||
}
|
||||
|
||||
.progress {
|
||||
display: none;
|
||||
margin: 1.5em;
|
||||
border: 2px solid;
|
||||
width: 25vw;
|
||||
|
||||
/* Use dynamic viewport units if supported */
|
||||
@supports (width: 25dvw) {
|
||||
width: 25dvw;
|
||||
}
|
||||
}
|
||||
|
||||
.progress .full {
|
||||
margin: 2px;
|
||||
background: white;
|
||||
height: 1em;
|
||||
transform-origin: top left;
|
||||
}
|
||||
|
||||
#loader {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #1b70f0;
|
||||
background-image: url("../images/overlay.png"), url("../images/menuBGTile.png");
|
||||
background-size: cover, 13vw;
|
||||
background-repeat: no-repeat, repeat;
|
||||
overflow: hidden;
|
||||
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
|
||||
/* Use dynamic viewport units if supported */
|
||||
@supports (width: 100dvw) {
|
||||
width: 100dvw;
|
||||
height: 100dvh;
|
||||
}
|
||||
}
|
||||
|
||||
.spinner {
|
||||
position: absolute;
|
||||
border: 10px solid #f3f3f3;
|
||||
border-top: 10px solid #3498db;
|
||||
border-radius: 50%;
|
||||
animation: spin 1s linear infinite;
|
||||
|
||||
left: 2vw;
|
||||
bottom: 2vh;
|
||||
width: 10vh;
|
||||
height: 10vh;
|
||||
|
||||
/* Use dynamic viewport units if supported */
|
||||
@supports (width: 10dvw) {
|
||||
left: 2dvw;
|
||||
bottom: 2dvh;
|
||||
width: 10dvh;
|
||||
height: 10dvh;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* for all screens */
|
||||
#rotate-landscape {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* only when orientation is in portrait mode */
|
||||
@media all and (orientation:portrait) {
|
||||
#rotate-landscape {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
display: block;
|
||||
background: #1b70f0;
|
||||
background-image: url("../images/overlay.png"), url("../images/menuBGTile.png");
|
||||
background-size: cover, 13vw;
|
||||
background-repeat: no-repeat, repeat;
|
||||
overflow: hidden;
|
||||
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
|
||||
/* Use dynamic viewport units if supported */
|
||||
@supports (width: 100dvw) {
|
||||
width: 100dvw;
|
||||
height: 100dvh;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.center {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
|
||||
width: 90vw;
|
||||
|
||||
/* Use dynamic viewport units if supported */
|
||||
@supports (width: 90dvw) {
|
||||
width: 90dvw;
|
||||
}
|
||||
}
|
@ -1,196 +0,0 @@
|
||||
:root {
|
||||
--sait: var(--discord-safe-area-inset-top, env(safe-area-inset-top));
|
||||
--saib: var(--discord-safe-area-inset-bottom, env(safe-area-inset-bottom));
|
||||
--sail: var(--discord-safe-area-inset-left, env(safe-area-inset-left));
|
||||
--sair: var(--discord-safe-area-inset-right, env(safe-area-inset-right));
|
||||
}
|
||||
|
||||
html {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
*,
|
||||
*:before,
|
||||
*:after {
|
||||
box-sizing: inherit;
|
||||
}
|
||||
|
||||
/* remove auto zoom when entering text on iOS */
|
||||
input, textarea, select {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#mainContainer {
|
||||
position: relative;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
|
||||
/* Use dynamic viewport units if supported */
|
||||
@supports (width: 100dvw) {
|
||||
width: 100dvw;
|
||||
height: 100dvh;
|
||||
}
|
||||
}
|
||||
|
||||
#gameContainer {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#gameCanvasWrapper {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: var(--sait) var(--sair) var(--saib) var(--sail);
|
||||
|
||||
}
|
||||
|
||||
#gameCanvas {
|
||||
position: static;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
/* try to handle mobile dialog */
|
||||
canvas+* {
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.logo {
|
||||
display: block;
|
||||
|
||||
width: 35vw;
|
||||
|
||||
/* Use dynamic viewport units if supported */
|
||||
@supports (width: 35dvw) {
|
||||
width: 35dvw;
|
||||
}
|
||||
}
|
||||
|
||||
.progress {
|
||||
display: none;
|
||||
margin: 1.5em;
|
||||
border: 2px solid;
|
||||
width: 25vw;
|
||||
|
||||
/* Use dynamic viewport units if supported */
|
||||
@supports (width: 25dvw) {
|
||||
width: 25dvw;
|
||||
}
|
||||
}
|
||||
|
||||
.progress .full {
|
||||
margin: 2px;
|
||||
background: white;
|
||||
height: 1em;
|
||||
transform-origin: top left;
|
||||
}
|
||||
|
||||
#loader {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #1b70f0;
|
||||
background-image: url("../images/overlay.png"), url("../images/menuBGTile.png");
|
||||
background-size: cover, 13vw;
|
||||
background-repeat: no-repeat, repeat;
|
||||
overflow: hidden;
|
||||
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
|
||||
/* Use dynamic viewport units if supported */
|
||||
@supports (width: 100dvw) {
|
||||
width: 100dvw;
|
||||
height: 100dvh;
|
||||
}
|
||||
}
|
||||
|
||||
.spinner {
|
||||
position: absolute;
|
||||
border: 10px solid #f3f3f3;
|
||||
border-top: 10px solid #3498db;
|
||||
border-radius: 50%;
|
||||
animation: spin 1s linear infinite;
|
||||
|
||||
left: 2vw;
|
||||
bottom: 2vh;
|
||||
width: 10vh;
|
||||
height: 10vh;
|
||||
|
||||
/* Use dynamic viewport units if supported */
|
||||
@supports (width: 10dvw) {
|
||||
left: 2dvw;
|
||||
bottom: 2dvh;
|
||||
width: 10dvh;
|
||||
height: 10dvh;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* for all screens */
|
||||
#rotate-landscape {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* only when orientation is in portrait mode */
|
||||
@media all and (orientation:portrait) {
|
||||
#rotate-landscape {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
display: block;
|
||||
background: #1b70f0;
|
||||
background-image: url("../images/overlay.png"), url("../images/menuBGTile.png");
|
||||
background-size: cover, 13vw;
|
||||
background-repeat: no-repeat, repeat;
|
||||
overflow: hidden;
|
||||
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
|
||||
/* Use dynamic viewport units if supported */
|
||||
@supports (width: 100dvw) {
|
||||
width: 100dvw;
|
||||
height: 100dvh;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.center {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
|
||||
width: 90vw;
|
||||
|
||||
/* Use dynamic viewport units if supported */
|
||||
@supports (width: 90dvw) {
|
||||
width: 90dvw;
|
||||
}
|
||||
}
|
@ -1,302 +0,0 @@
|
||||
html {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
*,
|
||||
*:before,
|
||||
*:after {
|
||||
box-sizing: inherit;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#mainContainer {
|
||||
position: relative;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
|
||||
/* Use dynamic viewport units if supported */
|
||||
@supports (width: 100dvw) {
|
||||
width: 100dvw;
|
||||
height: 100dvh;
|
||||
}
|
||||
}
|
||||
|
||||
#gameContainer {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#gameCanvasWrapper {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
|
||||
}
|
||||
|
||||
#gameCanvas {
|
||||
position: static;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#xsolla-iframe {
|
||||
position: absolute;
|
||||
width: 80%;
|
||||
height: 100%;
|
||||
left: 50.5%;
|
||||
transform: translate(-50%, 0%);
|
||||
border: none;
|
||||
padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
|
||||
display: none;
|
||||
}
|
||||
|
||||
#adContainerDeath {
|
||||
display: none;
|
||||
--shown_display: flex;
|
||||
position: absolute;
|
||||
/* border: 1px solid red; */
|
||||
z-index: 100;
|
||||
bottom: 0px;
|
||||
right: 0px;
|
||||
width: fit-content;
|
||||
height: fit-content;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
#adContainerLoadingLeft {
|
||||
display: none;
|
||||
--shown_display: block;
|
||||
position: absolute;
|
||||
transform-origin: left top;
|
||||
transform: translate(0px, -50%);
|
||||
/* border: 1px solid red; */
|
||||
z-index: 100;
|
||||
top: 50%;
|
||||
left: 10px;
|
||||
width: auto;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
#adContainerMainMenu {
|
||||
display: none;
|
||||
--shown_display: block;
|
||||
position: absolute;
|
||||
transform-origin: right top;
|
||||
transform: translate(0px, -50%);
|
||||
/* border: 1px solid red; */
|
||||
z-index: 100;
|
||||
top: 50%;
|
||||
right: 10px;
|
||||
width: auto;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 600px) {
|
||||
#smashkarts-io_300x250 {
|
||||
/* border: 1px solid blue; */
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
#adContainerWin {
|
||||
display: none;
|
||||
--shown_display: block;
|
||||
position: absolute;
|
||||
transform-origin: right bottom;
|
||||
/* border: 1px solid red; */
|
||||
z-index: 100;
|
||||
bottom: 10px;
|
||||
right: 10px;
|
||||
width: auto;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
#adContainerSpectate {
|
||||
display: none;
|
||||
--shown_display: block;
|
||||
position: absolute;
|
||||
transform-origin: right bottom;
|
||||
/* border: 1px solid red; */
|
||||
z-index: 100;
|
||||
bottom: 10px;
|
||||
right: 10px;
|
||||
width: auto;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
#pw-video-container {
|
||||
position: absolute;
|
||||
display: none; /* default to hidden */
|
||||
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
|
||||
/* Use dynamic viewport units if supported */
|
||||
@supports (width: 100dvw) {
|
||||
width: 100dvw;
|
||||
height: 100dvh;
|
||||
}
|
||||
}
|
||||
|
||||
#pw-video-placeholder {
|
||||
position: absolute;
|
||||
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
|
||||
/* Use dynamic viewport units if supported */
|
||||
@supports (width: 100dvw) {
|
||||
width: 100dvw;
|
||||
height: 100dvh;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 600px) {
|
||||
#smashkarts-io_300x250_2 {
|
||||
/* border: 1px solid blue; */
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* try to handle mobile dialog */
|
||||
canvas+* {
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.logo {
|
||||
display: block;
|
||||
|
||||
width: 35vw;
|
||||
|
||||
/* Use dynamic viewport units if supported */
|
||||
@supports (width: 35dvw) {
|
||||
width: 35dvw;
|
||||
}
|
||||
}
|
||||
|
||||
.progress {
|
||||
display: none;
|
||||
margin: 1.5em;
|
||||
border: 2px solid;
|
||||
width: 25vw;
|
||||
|
||||
/* Use dynamic viewport units if supported */
|
||||
@supports (width: 25dvw) {
|
||||
width: 25dvw;
|
||||
}
|
||||
}
|
||||
|
||||
.progress .full {
|
||||
margin: 2px;
|
||||
background: white;
|
||||
height: 1em;
|
||||
transform-origin: top left;
|
||||
}
|
||||
|
||||
#loader {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #1b70f0;
|
||||
background-image: url("../images/overlay.png"), url("../images/menuBGTile.png");
|
||||
background-size: cover, 13vw;
|
||||
background-repeat: no-repeat, repeat;
|
||||
overflow: hidden;
|
||||
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
|
||||
/* Use dynamic viewport units if supported */
|
||||
@supports (width: 100dvw) {
|
||||
width: 100dvw;
|
||||
height: 100dvh;
|
||||
}
|
||||
}
|
||||
|
||||
.spinner {
|
||||
position: absolute;
|
||||
border: 10px solid #f3f3f3;
|
||||
border-top: 10px solid #3498db;
|
||||
border-radius: 50%;
|
||||
animation: spin 1s linear infinite;
|
||||
|
||||
left: 2vw;
|
||||
bottom: 2vh;
|
||||
width: 10vh;
|
||||
height: 10vh;
|
||||
|
||||
/* Use dynamic viewport units if supported */
|
||||
@supports (width: 10dvw) {
|
||||
left: 2dvw;
|
||||
bottom: 2dvh;
|
||||
width: 10dvh;
|
||||
height: 10dvh;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* for all screens */
|
||||
#rotate-landscape {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* only when orientation is in portrait mode */
|
||||
@media all and (orientation:portrait) {
|
||||
#rotate-landscape {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
display: block;
|
||||
background: #1b70f0;
|
||||
background-image: url("../images/overlay.png"), url("../images/menuBGTile.png");
|
||||
background-size: cover, 13vw;
|
||||
background-repeat: no-repeat, repeat;
|
||||
overflow: hidden;
|
||||
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
|
||||
/* Use dynamic viewport units if supported */
|
||||
@supports (width: 100dvw) {
|
||||
width: 100dvw;
|
||||
height: 100dvh;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.center {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
|
||||
width: 90vw;
|
||||
|
||||
/* Use dynamic viewport units if supported */
|
||||
@supports (width: 90dvw) {
|
||||
width: 90dvw;
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 74 KiB |
Before Width: | Height: | Size: 153 KiB |
Before Width: | Height: | Size: 95 KiB |
Before Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 7.6 KiB |
Before Width: | Height: | Size: 727 KiB |
Before Width: | Height: | Size: 47 KiB |
Before Width: | Height: | Size: 363 KiB |
Before Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 236 B |
Before Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 76 KiB |
Before Width: | Height: | Size: 8.8 KiB |
Before Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 70 KiB |
Before Width: | Height: | Size: 42 KiB |
@ -1,346 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us">
|
||||
|
||||
<head>
|
||||
<script src="scripts/constants.js"></script>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<link rel="icon" href="images/favicon.png" sizes="16x16">
|
||||
<!-- og: Open graph meta tags allow you to control what content shows up when a page is shared on Facebook -->
|
||||
<meta property="og:site_name" content="SmashKarts.io">
|
||||
<meta property="og:title" content="Smash Karts" />
|
||||
<meta property="og:url" content="https://smashkarts.io/" />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:description"
|
||||
content="Smash Karts is a free io Multiplayer Kart Battle Arena game. Drive fast. Fire rockets. Make big explosions." />
|
||||
<meta property="og:image" content="images/icon-144.png" />
|
||||
<meta property="og:image:width" content="144" />
|
||||
<meta property="og:image:height" content="144" />
|
||||
<meta itemprop="name" content="Smash Karts" />
|
||||
<meta itemprop="url" content="https://smashkarts.io/" />
|
||||
<meta itemprop="description"
|
||||
content="Smash Karts is a free io Multiplayer Kart Battle Arena game. Drive fast. Fire rockets. Make big explosions." />
|
||||
<meta itemprop="thumbnailUrl" content="https://smashkarts.io/" />
|
||||
<link rel="image_src" href="https://smashkarts.io/" />
|
||||
<meta itemprop="image" content="https://smashkarts.io/" />
|
||||
<meta name="twitter:title" content="Smash Karts" />
|
||||
<meta name="twitter:image" content="images/icon-144.png" />
|
||||
<meta name="twitter:url" content="https://smashkarts.io/" />
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
<meta name="twitter:description"
|
||||
content="Smash Karts is a free io Multiplayer Kart Battle Arena game. Drive fast. Fire rockets. Make big explosions." />
|
||||
<meta name="description"
|
||||
content="Smash Karts is a free io Multiplayer Kart Battle Arena game. Drive fast. Fire rockets. Make big explosions." />
|
||||
<meta name="google-site-verification" content="Kb9JniKgGSfuiJM_DNO2-Va7cSC00GlcBzbDw1Lgw_4" />
|
||||
<meta itemprop="image primaryImageOfPage" content="images/smashkarts.png" />
|
||||
|
||||
<link rel="manifest" href="manifest.json">
|
||||
|
||||
<meta name="apple-mobile-web-app-title" content="Smash Karts">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
||||
<link rel="apple-touch-icon" href="images/icon-144.png">
|
||||
|
||||
<!-- <script type="text/javascript" src="xmlhttprequest-length-computable.js"></script> -->
|
||||
<!--<script type="text/javascript" src="xmlhttprequest-length-computable.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
window.xmlHTTPRequestLengthComputable = {
|
||||
CONTENT_ENCODING_MULTIPLE: 3.0
|
||||
}
|
||||
</script> -->
|
||||
|
||||
<!-- Youtube Game Schema -->
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "http://schema.org",
|
||||
"@type":"VideoGame",
|
||||
"publisher": "Tall Team",
|
||||
"name":[
|
||||
{
|
||||
"@language":"en",
|
||||
"@value":"Smash Karts"
|
||||
}
|
||||
],
|
||||
"description":[
|
||||
{
|
||||
"@language":"en",
|
||||
"@value":"Smash Karts is a free io Multiplayer Kart Battle Arena game. Drive fast. Fire rockets. Make big explosions."
|
||||
}
|
||||
],
|
||||
"applicationCategory":[
|
||||
"Game"
|
||||
],
|
||||
"operatingSystem":[
|
||||
"WEB"
|
||||
],
|
||||
"genre":[
|
||||
"Car Battle",
|
||||
"Shooter",
|
||||
"Multiplayer"
|
||||
],
|
||||
"url":"https://smashkarts.io/",
|
||||
"image":"images/SmashKartsPoster.jpg",
|
||||
"screenshot":"images/SmashKartsBackground.jpg"
|
||||
}
|
||||
</script>
|
||||
<title>Smash Karts</title>
|
||||
<link rel="stylesheet" href="css/main.css" />
|
||||
<meta name="viewport" content="minimal-ui, user-scalable=no, initial-scale=1, maximum-scale=1, width=device-width, viewport-fit=cover" />
|
||||
|
||||
<script src="scripts/ads-init.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="mainContainer">
|
||||
<div id="gameContainer">
|
||||
<div id="gameCanvasWrapper">
|
||||
<canvas id="gameCanvas"></canvas>
|
||||
</div>
|
||||
|
||||
<!-- On canvas ad containers -->
|
||||
<div id="adContainerLoadingLeft"> <!-- loading -->
|
||||
<div id="smashkarts-io_300x600_2"></div> <!-- adinplay -->
|
||||
</div>
|
||||
<div id="adContainerMainMenu"> <!-- main menu -->
|
||||
<div id="smashkarts-io_300x250"></div> <!-- adinplay -->
|
||||
|
||||
<!-- playwire -->
|
||||
<div id="pw_mainmenu"></div>
|
||||
<!-- dummy placement to ensure rewarded videos init correctly when ads are disabled for season pass holders -->
|
||||
<div id="pw_mainmenu_dummy" data-pw-desk="med_rect_atf" data-pw-mobi="med_rect_atf"></div>
|
||||
</div>
|
||||
<div id="adContainerWin"> <!-- win ceremony -->
|
||||
<div id="smashkarts-io_300x250_2"></div> <!-- adinplay -->
|
||||
|
||||
<!-- playwire -->
|
||||
<div id="pw_roundend"></div>
|
||||
<!-- <div data-pw-desk="med_rect_btf" data-pw-mobi="med_rect_btf"></div> -->
|
||||
</div>
|
||||
<div id="adContainerSpectate"> <!-- spectate -->
|
||||
<div id="smashkarts-io_300x250_3"></div> <!-- adinplay -->
|
||||
</div>
|
||||
<div id="adContainerDeath"> <!-- death -->
|
||||
|
||||
<!-- adinplay -->
|
||||
<div id="smashkarts-io_728x90-new"></div>
|
||||
<div id="smashkarts-io_320x100"></div>
|
||||
|
||||
<!-- playwire -->
|
||||
<div id="pw_ondeath"></div>
|
||||
<!-- <div data-pw-desk="leaderboard_atf" data-pw-mobi="leaderboard_atf"></div> -->
|
||||
</div>
|
||||
</div>
|
||||
<div id="pw-video-container"> <!-- playwire -->
|
||||
<div id="pw-video-placeholder"></div>
|
||||
</div>
|
||||
<div id="preroll"></div> <!-- adinplay -->
|
||||
<iframe id="xsolla-iframe"></iframe>
|
||||
</div>
|
||||
<div id="loader">
|
||||
<img class="logo" src="images/smashkarts.png">
|
||||
<div class="spinner"></div>
|
||||
<div class="progress">
|
||||
<div class="full"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="rotate-landscape">
|
||||
<img src="images/r.png" class="center">
|
||||
</div>
|
||||
|
||||
<script src="https://www.gstatic.com/firebasejs/9.9.3/firebase-app-compat.js"></script>
|
||||
<script src="https://www.gstatic.com/firebasejs/9.9.3/firebase-auth-compat.js"></script>
|
||||
<script src="https://www.gstatic.com/firebasejs/9.9.3/firebase-database-compat.js"></script>
|
||||
<script src="https://www.gstatic.com/firebasejs/9.9.3/firebase-analytics-compat.js"></script>
|
||||
<script src="https://www.gstatic.com/firebasejs/9.9.3/firebase-functions-compat.js"></script>
|
||||
|
||||
<script src="scripts/main.js"></script>
|
||||
<script src="scripts/auth.js"></script>
|
||||
<script src="scripts/shop.js"></script>
|
||||
<script src="scripts/cc.js"></script>
|
||||
|
||||
<script src="scripts/ads-common-logic.js"></script>
|
||||
<!--<script src="scripts/ads-offcanvas-logic.js"></script>-->
|
||||
<script src="scripts/ads-positioning-logic.js"></script>
|
||||
<script src="scripts/ads-injector.js"></script>
|
||||
|
||||
<script>
|
||||
//Used for installing progressive web apps
|
||||
if ('serviceWorker' in navigator)
|
||||
{
|
||||
navigator.serviceWorker.register('service-worker2.js');
|
||||
}
|
||||
|
||||
const firebaseConfig = {
|
||||
apiKey: "AIzaSyAdY2qq9083amKDS0R8tn2tjIKQB8mocco",
|
||||
authDomain: "webgltest-17af1.firebaseapp.com",
|
||||
databaseURL: "https://webgltest-17af1.firebaseio.com",
|
||||
projectId: "webgltest-17af1",
|
||||
messagingSenderId: "480659433590",
|
||||
appId: "1:480659433590:web:a01ad1599e963843a0d757",
|
||||
measurementId: "G-1W23DRFHK9"
|
||||
};
|
||||
|
||||
|
||||
// Initialize Firebase
|
||||
firebase.initializeApp(firebaseConfig);
|
||||
|
||||
|
||||
|
||||
analytics = firebase.analytics();
|
||||
gtag('config', 'G-1W23DRFHK9', {'cookie_flags': 'samesite=none;secure'});
|
||||
|
||||
firebaseSetScreen("loading_start");
|
||||
firebaseLogEvent("loading_page_start");
|
||||
|
||||
updateAdBlockDetected();
|
||||
updateLoadingAdBanner();
|
||||
|
||||
var timerStart = Date.now();
|
||||
var sentGameInstanceStartEvent = false;
|
||||
|
||||
// choose the data file based on whether there's support for the ASTC texture compression format
|
||||
var dataFile = "/ef411f9202ce85260af7a3275b825aa8.data.br";
|
||||
var mobileDataFile = "/39e3e431ad42c683480161e7227862bb.data.br";
|
||||
|
||||
//safety check to ensure we dont try to use the mobileDataFile if the filename hasnt been parsed during the build phase
|
||||
if(!mobileDataFile.includes("MOBILE_DATA_FILENAME"))
|
||||
{
|
||||
var c = document.createElement("canvas");
|
||||
var gl = c.getContext("webgl");
|
||||
var gl2 = c.getContext("webgl2");
|
||||
if ((gl && gl.getExtension('WEBGL_compressed_texture_astc')) || (gl2 && gl2.getExtension('WEBGL_compressed_texutre_astc')))
|
||||
{
|
||||
dataFile = mobileDataFile;
|
||||
}
|
||||
}
|
||||
|
||||
const buildUrl = "https://smashkartsgc.b-cdn.net/Build2020New";
|
||||
|
||||
const loaderUrl = buildUrl + "/76f034cff49013ce85bd6945ebf32347.loader.js";
|
||||
const config = {
|
||||
dataUrl: buildUrl + dataFile,
|
||||
frameworkUrl: buildUrl + "/550673fe170b6ae0e0973d8b766bf88c.framework.js.br",
|
||||
codeUrl: buildUrl + "/c19b54fc4d4d40f42a81488cd8477af5.wasm.br",
|
||||
// #if MEMORY_FILENAME
|
||||
// memoryUrl: buildUrl + "/",
|
||||
// #endif
|
||||
// #if SYMBOLS_FILENAME
|
||||
// symbolsUrl: buildUrl + "/",
|
||||
// #endif
|
||||
streamingAssetsUrl: "StreamingAssets",
|
||||
companyName: "TallTeam",
|
||||
productName: "Smash Karts",
|
||||
productVersion: "2.6.0",
|
||||
};
|
||||
|
||||
var mainContainer = document.querySelector("#mainContainer");
|
||||
var gameContainer = document.querySelector("#gameContainer");
|
||||
var canvas = document.querySelector("#gameCanvas");
|
||||
var loadingBar = document.querySelector("#loader");
|
||||
var progressBarFull = document.querySelector("#loader .progress .full");
|
||||
var rotateLandscape = document.querySelector("#rotate-landscape");
|
||||
|
||||
if (isMobile())
|
||||
{
|
||||
mainContainer.className = "unity-mobile";
|
||||
|
||||
// if(isIos())
|
||||
// {
|
||||
// //Allow scrolling on mobile iOS so user can scroll off the top tab bar
|
||||
// document.body.style.overflow = "visible";
|
||||
// }
|
||||
}
|
||||
else
|
||||
{
|
||||
rotateLandscape.id = "rotateLandscapeOff";
|
||||
rotateLandscape.style.display = "none";
|
||||
}
|
||||
const progress = document.querySelector("#loader .progress");
|
||||
progress.style.display = "block";
|
||||
progressBarFull.style.width = "0%";
|
||||
|
||||
var script = document.createElement("script");
|
||||
script.src = loaderUrl;
|
||||
|
||||
var progressCreateUnityInstance = 0;
|
||||
var progressPostCreateUnityInstance = 0;
|
||||
var updateProgressInterval = setInterval(updateProgress, 100);
|
||||
|
||||
var gameInstance;
|
||||
script.onload = () =>
|
||||
{
|
||||
createUnityInstance(canvas, config, (progress) =>
|
||||
{
|
||||
progressCreateUnityInstance = 100 * progress;
|
||||
setProgressWidth();
|
||||
}).then((unityInstance) =>
|
||||
{
|
||||
if (isMobile()) document.body.style.background = "#000000";
|
||||
loadingBar.style.display = "none";
|
||||
window.unityGame = unityInstance;
|
||||
gameInstance = unityInstance;
|
||||
|
||||
if (updateProgressInterval) clearInterval(updateProgressInterval);
|
||||
|
||||
var lt = Date.now() - timerStart;
|
||||
firebaseLogEventWithParam("loading_page_complete", "time", lt);
|
||||
setV(lt);
|
||||
|
||||
onUnityLoadComplete();
|
||||
}).catch((message) =>
|
||||
{
|
||||
alert("TT UnityLoader Error" + message);
|
||||
});
|
||||
};
|
||||
document.body.appendChild(script);
|
||||
|
||||
function onUnityLoadComplete()
|
||||
{
|
||||
//tell unity what ad providers are enabled
|
||||
window.unityGame.SendMessage(unityFirebaseGameOjbectName, "SetDisplayAdProvider", displayAdProvider);
|
||||
window.unityGame.SendMessage(unityFirebaseGameOjbectName, "SetVideoAdProvider", videoAdProvider);
|
||||
|
||||
trySendAdBlockDetectedMessage();
|
||||
}
|
||||
|
||||
function updateProgress()
|
||||
{
|
||||
if (progressCreateUnityInstance > 85)
|
||||
{
|
||||
progressPostCreateUnityInstance += 1;
|
||||
setProgressWidth();
|
||||
}
|
||||
}
|
||||
|
||||
function setProgressWidth()
|
||||
{
|
||||
if (progressCreateUnityInstance == 100.0)
|
||||
{
|
||||
progressBarFull.style.width = "100%";
|
||||
}
|
||||
else
|
||||
{
|
||||
var percent;
|
||||
if (isMobile())
|
||||
{
|
||||
percent = progressCreateUnityInstance * 0.6 + (progressPostCreateUnityInstance * 0.5 * 0.2 + progressCreateUnityInstance * 0.5 * 0.2 * 0.05);
|
||||
percent = Math.min(percent, 90);
|
||||
}
|
||||
else
|
||||
{
|
||||
percent = progressCreateUnityInstance * 0.9 + progressPostCreateUnityInstance * 0.1;
|
||||
percent = Math.min(percent, 95);
|
||||
}
|
||||
progressBarFull.style.width = percent + "%";
|
||||
}
|
||||
}
|
||||
|
||||
function setAdinPlaySubIdForABTest(val)
|
||||
{
|
||||
//set adinplay subid which enables segmented daily reports
|
||||
aiptag.subid = val;
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -1,22 +0,0 @@
|
||||
{
|
||||
"name": "Smash Karts",
|
||||
"short_name": "Smash Karts",
|
||||
"theme_color": "#2196f3",
|
||||
"background_color": "#2196f3",
|
||||
"display": "fullscreen",
|
||||
"orientation": "landscape",
|
||||
"scope": ".",
|
||||
"icons": [
|
||||
{
|
||||
"src": "images/icon-144.png",
|
||||
"sizes": "144x144",
|
||||
"type": "image/png"
|
||||
},
|
||||
{
|
||||
"src": "images/icon-512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png"
|
||||
}
|
||||
],
|
||||
"start_url": "./"
|
||||
}
|
@ -1,60 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Smash Karts - Partners</title>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
|
||||
<link rel="icon" href="favicon.png" sizes="16x16">
|
||||
<link rel="stylesheet" href="css/partners.css" />
|
||||
</head>
|
||||
<body class="single is-preload">
|
||||
|
||||
<!-- Wrapper -->
|
||||
<div id="wrapper">
|
||||
|
||||
<!-- Header -->
|
||||
<header id="header">
|
||||
<h1><a href="https://smashkarts.io/">Smash Karts</a></h1>
|
||||
</header>
|
||||
|
||||
<!-- Main -->
|
||||
<div id="main">
|
||||
<h6>Our Partners</h6>
|
||||
<!-- Post -->
|
||||
<article class="post">
|
||||
<a href="http://crazygames.com" class="image featured"><img src="../images/crazygames.png" alt="" /></a>
|
||||
<h2><a href="http://crazygames.com" target="_blank">CrazyGames</a></h2>
|
||||
<p>"Our goal here at Crazy Games is to provide you with the best free online games on the Internet."</p>
|
||||
<ul class="actions">
|
||||
<li><a href="http://crazygames.com" class="button" target="_blank">Play More Games</a></li>
|
||||
</ul>
|
||||
</article>
|
||||
|
||||
<article class="post">
|
||||
<a href="https://poki.com/" class="image featured"><img src="../images/poki.png" alt="" /></a>
|
||||
<h2><a href="https://poki.com/" target="_blank">Poki</a></h2>
|
||||
<p>"Poki has the best free online games selection and offers the most fun experience to play alone or with friends."</p>
|
||||
<ul class="actions">
|
||||
<li><a href="https://poki.com/" class="button" target="_blank">Play on Poki</a></li>
|
||||
</ul>
|
||||
</article>
|
||||
|
||||
<article class="post">
|
||||
<a href="http://iogames.space" class="image featured"><img src="../images/iogames.png" alt="" /></a>
|
||||
<h2><a href="http://iogames.space" target="_blank">ioGames.space</a></h2>
|
||||
<p>"The main goal of The io Games List, from the very start, has always been to bring exposure to awesome games that would otherwise only exist on a single domain."</p>
|
||||
<ul class="actions">
|
||||
<li><a href="http://iogames.space" class="button" target="_blank">More IO Games</a></li>
|
||||
</ul>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
<!-- Footer -->
|
||||
<section id="footer">
|
||||
<p class="copyright">©<a href="https://tall.team/">Tall Team</a>.</p>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1,44 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Smash Karts - Partners</title>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
|
||||
<link rel="icon" href="favicon.png" sizes="16x16">
|
||||
<link rel="stylesheet" href="css/partners.css" />
|
||||
</head>
|
||||
<body class="single is-preload">
|
||||
|
||||
<!-- Wrapper -->
|
||||
<div id="wrapper">
|
||||
|
||||
<!-- Header -->
|
||||
<header id="header">
|
||||
<h1><a href="https://smashkarts.io/">Smash Karts</a></h1>
|
||||
</header>
|
||||
|
||||
<!-- Main -->
|
||||
<div id="main">
|
||||
|
||||
<!-- Post -->
|
||||
<article class="post">
|
||||
<a href="http://crazygames.com" class="image featured"><img src="../images/crazygames.png" alt="" /></a>
|
||||
<h2><a href="http://crazygames.com" target="_blank">CrazyGames.com</a></h2>
|
||||
<p>"Our goal here at Crazy Games is to provide you with the best free online games on the Internet."</p>
|
||||
<ul class="actions">
|
||||
<li><a href="http://crazygames.com" class="button" target="_blank">Play More Games</a></li>
|
||||
</ul>
|
||||
</article>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Footer -->
|
||||
<section id="footer">
|
||||
<p class="copyright">©<a href="https://tall.team/">Tall Team</a>.</p>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1,37 +0,0 @@
|
||||
html, body, div, span, applet, object,
|
||||
iframe, h1, h2, h3, h4, h5, h6, p, blockquote,
|
||||
pre, a, abbr, acronym, address, big, cite,
|
||||
code, del, dfn, em, img, ins, kbd, q, s, samp,
|
||||
small, strike, strong, sub, sup, tt, var, b,
|
||||
u, i, center, dl, dt, dd, ol, ul, li, fieldset,
|
||||
form, label, legend, table, caption, tbody,
|
||||
tfoot, thead, tr, th, td, article, aside,
|
||||
canvas, details, embed, figure, figcaption,
|
||||
footer, header, hgroup, menu, nav, output, ruby,
|
||||
section, summary, time, mark, audio, video {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
font-size: 100%;
|
||||
font: inherit;
|
||||
vertical-align: baseline;}
|
||||
|
||||
/* Body */
|
||||
body {
|
||||
margin: 0;
|
||||
background: #1b70f0;
|
||||
background-image: url("../../images/overlay.png"), url("../../images/menuBGTile.png");
|
||||
background-size: cover, 13vw;
|
||||
background-repeat: no-repeat, repeat;
|
||||
padding-left: 100px;
|
||||
padding-right: 100px;
|
||||
color: white;
|
||||
}
|
||||
|
||||
a:link {
|
||||
color: aquamarine;
|
||||
}
|
||||
|
||||
a:visited {
|
||||
color: pink;
|
||||
}
|
@ -1,185 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
///////////////////////////
|
||||
//ad tags
|
||||
const adTagLoadingBanner = "smashkarts-io_300x600_2";
|
||||
const adTagMainMenuBanner = "smashkarts-io_300x250";
|
||||
const adTagWinCeremonyBanner = "smashkarts-io_300x250_2";
|
||||
const adTagSpectateBanner = "smashkarts-io_300x250_3";
|
||||
const adTagDeathBannerWeb = "smashkarts-io_728x90-new";
|
||||
const adTagDeathBannerMobile = "smashkarts-io_320x100";
|
||||
|
||||
var currShownAdElementIds = [];
|
||||
|
||||
const officialFullscreenIFramedProxies = [
|
||||
"https://schoolkarts.com/",
|
||||
"https://www.gstatic.com/"
|
||||
]
|
||||
|
||||
function hasAdContent(adElementId)
|
||||
{
|
||||
const ad = document.getElementById(adElementId);
|
||||
|
||||
return (ad != null && ad.innerHTML);
|
||||
}
|
||||
|
||||
function showAd(adElementId)
|
||||
{
|
||||
const ad = document.getElementById(adElementId);
|
||||
|
||||
if(ad != null)
|
||||
{
|
||||
ad.style.display = "block";
|
||||
}
|
||||
}
|
||||
|
||||
function requestAd(adElementId, adShownTimestamp)
|
||||
{
|
||||
if(currShownAdElementIds.includes(adElementId))
|
||||
return;
|
||||
|
||||
if(Date.now() >= (adShownTimestamp.val + bannerMinRefreshDelayMillisecs) || !hasAdContent(adElementId))
|
||||
{
|
||||
adShownTimestamp.val = Date.now();
|
||||
|
||||
destroyAd(adElementId);
|
||||
|
||||
currShownAdElementIds.push(adElementId);
|
||||
|
||||
aiptag.cmd.display.push(function()
|
||||
{
|
||||
aipDisplayTag.display(adElementId);
|
||||
showAd(adElementId);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function hideAd(adElementId)
|
||||
{
|
||||
if(currShownAdElementIds.includes(adElementId))
|
||||
{
|
||||
//for adinplay we dont distingush between hiding and destroying
|
||||
destroyAd(adElementId);
|
||||
|
||||
//if we were hiding you would need to reset the currShownAdElement
|
||||
//currShownAdElementId = null;
|
||||
}
|
||||
}
|
||||
|
||||
function destroyAd(adElementId)
|
||||
{
|
||||
const ad = document.getElementById(adElementId);
|
||||
|
||||
if(ad != null)
|
||||
{
|
||||
ad.style.display = "none";
|
||||
//ad.innerHTML = "";
|
||||
aiptag.cmd.display.push(function()
|
||||
{
|
||||
aipDisplayTag.destroy(adElementId);
|
||||
});
|
||||
}
|
||||
|
||||
const indexToRemove = currShownAdElementIds.indexOf(adElementId);
|
||||
|
||||
if(indexToRemove >= 0)
|
||||
{
|
||||
currShownAdElementIds.splice(indexToRemove, 1);
|
||||
}
|
||||
}
|
||||
|
||||
function requestLoadingAd()
|
||||
{
|
||||
requestAd(adTagLoadingBanner, loadingBannerShownTimestamp);
|
||||
|
||||
//@podonnell: breaking rev - Dec 11th
|
||||
//if(!isIFramed() || isOfficialFullscreenIFramedProxy())
|
||||
// {
|
||||
// requestAd(adTagLoadingBanner, loadingBannerShownTimestamp);
|
||||
// }
|
||||
}
|
||||
|
||||
function hideLoadingAd()
|
||||
{
|
||||
hideAd(adTagLoadingBanner);
|
||||
}
|
||||
|
||||
function requestMainMenuAd()
|
||||
{
|
||||
requestAd(adTagMainMenuBanner, mainMenuBannerShownTimestamp);
|
||||
|
||||
//@podonnell: breaking rev - Dec 11th
|
||||
// if(!isIFramed() || isOfficialFullscreenIFramedProxy())
|
||||
// {
|
||||
// requestAd(adTagMainMenuBanner, mainMenuBannerShownTimestamp);
|
||||
// }
|
||||
}
|
||||
|
||||
function hideMainMenuAd()
|
||||
{
|
||||
hideAd(adTagMainMenuBanner);
|
||||
}
|
||||
|
||||
function requestWinCeremonyAd()
|
||||
{
|
||||
requestAd(adTagWinCeremonyBanner, winCeremonyBannerShownTimestamp);
|
||||
}
|
||||
|
||||
function hideWinCeremonyAd()
|
||||
{
|
||||
hideAd(adTagWinCeremonyBanner);
|
||||
}
|
||||
|
||||
function requestSpectateAd()
|
||||
{
|
||||
requestAd(adTagSpectateBanner, spectateBannerShownTimestamp);
|
||||
}
|
||||
|
||||
function hideSpectateAd()
|
||||
{
|
||||
hideAd(adTagSpectateBanner);
|
||||
}
|
||||
|
||||
function requestDeathAd()
|
||||
{
|
||||
if(isMobile())
|
||||
{
|
||||
requestAd(adTagDeathBannerMobile, deathBannerShownTimestamp);
|
||||
}
|
||||
else
|
||||
{
|
||||
requestAd(adTagDeathBannerWeb, deathBannerShownTimestamp);
|
||||
}
|
||||
}
|
||||
|
||||
function hideDeathAd()
|
||||
{
|
||||
hideAd(adTagDeathBannerMobile);
|
||||
hideAd(adTagDeathBannerWeb);
|
||||
}
|
||||
|
||||
function requestOffCanvasAd(adResArrayToHide, adTagIdToShow)
|
||||
{
|
||||
hideOffCanvasAds(adResArrayToHide);
|
||||
|
||||
currShownAdElementIds.push(adTagIdToShow);
|
||||
|
||||
aiptag.cmd.display.push(function()
|
||||
{
|
||||
aipDisplayTag.display(adTagIdToShow);
|
||||
showAd(adTagIdToShow);
|
||||
});
|
||||
}
|
||||
|
||||
function hideOffCanvasAds(adResArray)
|
||||
{
|
||||
adResArray.forEach(adRes => {
|
||||
destroyAd(adRes.adId);
|
||||
});
|
||||
}
|
||||
|
||||
function isOfficialFullscreenIFramedProxy()
|
||||
{
|
||||
const url = document.referrer;
|
||||
return url != null && officialFullscreenIFramedProxies.includes(url);
|
||||
}
|
@ -1,178 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
let aipRewardedAdAvailable = false;
|
||||
|
||||
function aipVideoPlayerInitialised()
|
||||
{
|
||||
return (typeof aiptag.adplayer !== 'undefined');
|
||||
}
|
||||
|
||||
function showInterstitial(audioOn, interstitialType, interstitialName)
|
||||
{
|
||||
if (!isVideoAdPlaying && firebase.auth().currentUser != null)
|
||||
{
|
||||
//check if the adslib is loaded correctly or blocked by adblockers etc.
|
||||
if (aipVideoPlayerInitialised())
|
||||
{
|
||||
isVideoAdPlaying = true;
|
||||
|
||||
interstitialStart(false);
|
||||
|
||||
aiptag.cmd.player.push(function()
|
||||
{
|
||||
aiptag.adplayer.startPreRoll();
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
//Adlib didnt load this could be due to an adblocker, timeout etc.
|
||||
//Please add your script here that starts the content, this usually is the same script as added in AIP_COMPLETE.
|
||||
console.log("Ad Could not be loaded, load your content here");
|
||||
|
||||
isVideoAdPlaying = false;
|
||||
|
||||
interstitialError(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function onInterstitialComplete(evt)
|
||||
{
|
||||
/*******************
|
||||
***** WARNING *****
|
||||
*******************
|
||||
Please do not remove the PREROLL_ELEM
|
||||
from the page, it will be hidden automaticly.
|
||||
*/
|
||||
console.log("onInterstitialComplete: " + evt);
|
||||
|
||||
isVideoAdPlaying = false;
|
||||
|
||||
if(evt === "video-ad-completed")
|
||||
{
|
||||
interstitialComplete(false);
|
||||
}
|
||||
else if(evt === "video-ad-skipped")
|
||||
{
|
||||
interstitialSkipped(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
interstitialError(false);
|
||||
}
|
||||
}
|
||||
|
||||
function tryInitRewardedInterstitial(audioOn)
|
||||
{
|
||||
if(!window.adblockDetected)
|
||||
{
|
||||
if(aipVideoPlayerInitialised())
|
||||
{
|
||||
initRewardedInterstitial();
|
||||
}
|
||||
else
|
||||
{
|
||||
//poll until video player is ready
|
||||
const checkVideoPlayerInterval = setInterval(() => {
|
||||
//player isnt ready => do nothing
|
||||
if (!aipVideoPlayerInitialised())
|
||||
return;
|
||||
|
||||
//player is ready => stop polling and send message to unity
|
||||
clearInterval(checkVideoPlayerInterval);
|
||||
initRewardedInterstitial();
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function initRewardedInterstitial()
|
||||
{
|
||||
if(!aipRewardedAdAvailable)
|
||||
{
|
||||
//It's important the EventListener rewardedSlotReady is added only once.
|
||||
if(aipAPItag.rewardedSlotEventListener !== true)
|
||||
{
|
||||
aipAPItag.rewardedSlotEventListener = true;
|
||||
|
||||
aiptag.events.addEventListener("rewardedSlotReady", function (e)
|
||||
{
|
||||
if(e.detail.isEmpty !== true)
|
||||
{
|
||||
//rewarded ad is ready to show
|
||||
console.log("rewarded ad is ready to show");
|
||||
aipRewardedAdAvailable = true;
|
||||
window.unityGame.SendMessage(unityFirebaseGameOjbectName, "RewardedInterstitialAvailable");
|
||||
}
|
||||
else
|
||||
{
|
||||
//There is no rewarded ad available
|
||||
console.log("rewarded ad not available");
|
||||
aipRewardedAdAvailable = false;
|
||||
}
|
||||
}, false);
|
||||
}
|
||||
|
||||
//set the preload flag to true to use preloading of the rewarded ad
|
||||
aiptag.cmd.player.push(function() { aiptag.adplayer.startRewardedAd({preload: true, showLoading: false}); });
|
||||
}
|
||||
else
|
||||
{
|
||||
//rewarded ad already preloaded
|
||||
window.unityGame.SendMessage(unityFirebaseGameOjbectName, "RewardedInterstitialAvailable");
|
||||
}
|
||||
}
|
||||
|
||||
function tryShowRewardedInterstitial(audioOn)
|
||||
{
|
||||
if(!aipVideoPlayerInitialised() || !aipRewardedAdAvailable)
|
||||
{
|
||||
interstitialNoFill(true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isVideoAdPlaying && firebase.auth().currentUser != null)
|
||||
{
|
||||
isVideoAdPlaying = true;
|
||||
|
||||
interstitialStart(true);
|
||||
|
||||
aiptag.adplayer.showRewardedAd();
|
||||
|
||||
aipRewardedAdAvailable = false;
|
||||
|
||||
// aiptag.cmd.player.push(function()
|
||||
// {
|
||||
//
|
||||
// aiptag.adplayer.startRewardedAd();
|
||||
// });
|
||||
}
|
||||
}
|
||||
|
||||
function onRewardedInterstitialGranted()
|
||||
{
|
||||
console.log("Reward Granted");
|
||||
|
||||
isVideoAdPlaying = false;
|
||||
|
||||
interstitialComplete(true);
|
||||
}
|
||||
|
||||
function onRewardedInterstitialComplete(evt)
|
||||
{
|
||||
//evt can be: timeout, empty or closed
|
||||
console.log("Rewarded Ad Completed: " + evt);
|
||||
|
||||
isVideoAdPlaying = false;
|
||||
|
||||
if(evt === "closed")
|
||||
{
|
||||
//skipped by the user
|
||||
interstitialSkipped(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
//timeout or empty
|
||||
interstitialNoFill(true);
|
||||
}
|
||||
}
|
@ -1,282 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
///////////////////////////
|
||||
var cgEnvDisabled;
|
||||
bannerMinRefreshDelayMillisecs = 1000 * 60; //increase time for cg to 1 min
|
||||
|
||||
//ad tags
|
||||
const adTagMainMenuBanner = "smashkarts-io_300x250b";
|
||||
const adTagWinCeremonyBanner = "smashkarts-io_300x250_2b";
|
||||
const adTagDeathBanner = "smashkarts-io_728x90b";
|
||||
|
||||
var currShownAdElementIds = [];
|
||||
|
||||
function hasAdContent(adElementId)
|
||||
{
|
||||
const ad = document.getElementById(adElementId);
|
||||
|
||||
return (ad != null && ad.innerHTML);
|
||||
}
|
||||
|
||||
function requestAd(adElementId, adShownTimestamp)
|
||||
{
|
||||
if(cgEnvDisabled || currShownAdElementIds.includes(adElementId))
|
||||
return;
|
||||
|
||||
if(Date.now() >= (adShownTimestamp.val + bannerMinRefreshDelayMillisecs) || !hasAdContent(adElementId))
|
||||
{
|
||||
adShownTimestamp.val = Date.now();
|
||||
|
||||
destroyAd(adElementId);
|
||||
|
||||
window.CrazyGames.SDK.banner.requestResponsiveBanner(adElementId, (error, result) =>
|
||||
{
|
||||
if (error)
|
||||
{
|
||||
console.log("Error on request responsive banner (callback)", error);
|
||||
}
|
||||
else
|
||||
{
|
||||
currShownAdElementIds.push(adElementId);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function hideAd(adElementId)
|
||||
{
|
||||
//hiding done on the parent container in ads-common-logic so we only need to reset currShownAdElementId
|
||||
|
||||
const indexToRemove = currShownAdElementIds.indexOf(adElementId);
|
||||
|
||||
if(indexToRemove >= 0)
|
||||
{
|
||||
currShownAdElementIds.splice(indexToRemove, 1);
|
||||
}
|
||||
}
|
||||
|
||||
function destroyAd(adElementId)
|
||||
{
|
||||
if(cgEnvDisabled)
|
||||
return;
|
||||
|
||||
window.CrazyGames.SDK.banner.clearBanner(adElementId);
|
||||
|
||||
const indexToRemove = currShownAdElementIds.indexOf(adElementId);
|
||||
|
||||
if(indexToRemove >= 0)
|
||||
{
|
||||
currShownAdElementIds.splice(indexToRemove, 1);
|
||||
}
|
||||
}
|
||||
|
||||
function requestMainMenuAd()
|
||||
{
|
||||
requestAd(adTagMainMenuBanner, mainMenuBannerShownTimestamp)
|
||||
}
|
||||
|
||||
function hideMainMenuAd()
|
||||
{
|
||||
hideAd(adTagMainMenuBanner);
|
||||
}
|
||||
|
||||
function requestWinCeremonyAd()
|
||||
{
|
||||
requestAd(adTagWinCeremonyBanner, winCeremonyBannerShownTimestamp);
|
||||
}
|
||||
|
||||
function hideWinCeremonyAd()
|
||||
{
|
||||
hideAd(adTagWinCeremonyBanner);
|
||||
}
|
||||
|
||||
//stubs
|
||||
function requestLoadingAd() {}
|
||||
function hideLoadingAd() {}
|
||||
function requestSpectateAd() {}
|
||||
function hideSpectateAd() {}
|
||||
|
||||
function requestDeathAd()
|
||||
{
|
||||
requestAd(adTagDeathBanner, deathBannerShownTimestamp);
|
||||
}
|
||||
|
||||
function hideDeathAd()
|
||||
{
|
||||
hideAd(adTagDeathBanner);
|
||||
}
|
||||
|
||||
function requestOffCanvasAd(adResArrayToHide, adTagIdToShow)
|
||||
{
|
||||
if(cgEnvDisabled)
|
||||
return;
|
||||
|
||||
hideOffCanvasAds(adResArrayToHide);
|
||||
|
||||
if (!window.adblockDetected)
|
||||
{
|
||||
window.CrazyGames.SDK.banner.requestResponsiveBanner(adTagIdToShow, (error, result) =>
|
||||
{
|
||||
if (error)
|
||||
{
|
||||
console.log("Error on request responsive banner (callback)", error);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function hideOffCanvasAds(adResArray)
|
||||
{
|
||||
adResArray.forEach(adRes =>
|
||||
{
|
||||
destroyAd(adRes.adId);
|
||||
});
|
||||
}
|
||||
|
||||
function showInterstitial(audioOn, interstitialType, interstitialName)
|
||||
{
|
||||
if(cgEnvDisabled)
|
||||
{
|
||||
interstitialError(false);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isMobile())
|
||||
{
|
||||
const callbacks =
|
||||
{
|
||||
adStarted: () =>
|
||||
{
|
||||
interstitialStart(false);
|
||||
},
|
||||
adError: (error) =>
|
||||
{
|
||||
console.log("Error midgame ad:", error);
|
||||
interstitialError(false);
|
||||
},
|
||||
adFinished: () =>
|
||||
{
|
||||
interstitialComplete(false);
|
||||
}
|
||||
};
|
||||
|
||||
window.CrazyGames.SDK.ad.requestAd("midgame", callbacks);
|
||||
}
|
||||
}
|
||||
|
||||
function tryInitRewardedInterstitial(audioOn)
|
||||
{
|
||||
if (!window.adblockDetected)
|
||||
{
|
||||
window.unityGame.SendMessage(unityFirebaseGameOjbectName, "RewardedInterstitialAvailable");
|
||||
}
|
||||
}
|
||||
|
||||
function tryShowRewardedInterstitial(unusedParam)
|
||||
{
|
||||
if(cgEnvDisabled)
|
||||
{
|
||||
interstitialError(true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isMobile())
|
||||
{
|
||||
if(!window.adblockDetected)
|
||||
{
|
||||
const callbacks =
|
||||
{
|
||||
adStarted: () =>
|
||||
{
|
||||
interstitialStart(true);
|
||||
},
|
||||
adError: (error) =>
|
||||
{
|
||||
console.log("Error rewarded ad:", error);
|
||||
interstitialError(true);
|
||||
},
|
||||
adFinished: () =>
|
||||
{
|
||||
interstitialComplete(true);
|
||||
}
|
||||
};
|
||||
|
||||
window.CrazyGames.SDK.ad.requestAd("rewarded", callbacks);
|
||||
}
|
||||
else
|
||||
{
|
||||
interstitialNoFill(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getCrazyGamesShareLinkJS(roomName, gameMode, levelName)
|
||||
{
|
||||
if(cgEnvDisabled)
|
||||
return;
|
||||
|
||||
window.CrazyGames.SDK.game.inviteLink({ room: roomName, mode: gameMode, arena: levelName }, (error, link) =>
|
||||
{
|
||||
if (error)
|
||||
{
|
||||
console.log("Invite link error (callback)", error);
|
||||
} else
|
||||
{
|
||||
console.log("Invite link (callback)", link);
|
||||
window.unityGame.SendMessage(unityFirebaseGameOjbectName, "CrazyGamesShareLinkCreated", link);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function showCrazyGamesInviteButton(roomName, gameMode, levelName)
|
||||
{
|
||||
window.CrazyGames.SDK.game.showInviteButton({ room: roomName, mode: gameMode, arena: levelName }, (error, link) =>
|
||||
{
|
||||
if (error)
|
||||
{
|
||||
console.log("Invite link error (callback)", error);
|
||||
} else
|
||||
{
|
||||
console.log("Invite link (callback)", link);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function hideCrazyGamesInviteButton()
|
||||
{
|
||||
window.CrazyGames.SDK.game.hideInviteButton();
|
||||
}
|
||||
|
||||
|
||||
function recordGameplayStart()
|
||||
{
|
||||
if(cgEnvDisabled)
|
||||
return;
|
||||
|
||||
window.CrazyGames.SDK.game.gameplayStart()
|
||||
}
|
||||
|
||||
function recordGameplayStop()
|
||||
{
|
||||
if(cgEnvDisabled)
|
||||
return;
|
||||
|
||||
window.CrazyGames.SDK.game.gameplayStop();
|
||||
}
|
||||
|
||||
function recordHappyTime()
|
||||
{
|
||||
if(cgEnvDisabled)
|
||||
return;
|
||||
|
||||
window.CrazyGames.SDK.game.happytime();
|
||||
}
|
||||
|
||||
|
||||
|
||||
window.CrazyGames.SDK.getEnvironment((_error, environment) =>
|
||||
{
|
||||
console.log(environment); // 'local', 'crazygames' or 'disabled'
|
||||
cgEnvDisabled = (environment === "disabled");
|
||||
});
|
||||
|
@ -1,510 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
//inject bait script
|
||||
var baitScript = document.createElement('script');
|
||||
baitScript.setAttribute('src',baitScriptSrc);
|
||||
baitScript.async = false;
|
||||
document.head.appendChild(baitScript);
|
||||
|
||||
//globals
|
||||
var bannerMinRefreshDelayMillisecs = 0; //can be overwritten depending on ad provider, 0 defaults to requesting a new ad each time
|
||||
|
||||
var loadingBannerShownTimestamp = {val: -1}; //wrap in object to pass by ref
|
||||
const divIdLoadingBanner = "adContainerLoadingLeft";
|
||||
|
||||
var mainMenuBannerShownTimestamp = {val: -1}; //wrap in object to pass by ref
|
||||
const divIdMainMenuBanner = "adContainerMainMenu";
|
||||
|
||||
var winCeremonyBannerShownTimestamp = {val: -1}; //wrap in object to pass by ref
|
||||
const divIdWinCeremonyBanner = "adContainerWin";
|
||||
|
||||
var spectateBannerShownTimestamp = {val: -1}; //wrap in object to pass by ref
|
||||
const divIdSpectateBanner = "adContainerSpectate";
|
||||
|
||||
var deathBannerShownTimestamp = {val: -1}; //wrap in object to pass by ref
|
||||
const divIdDeathBanner = "adContainerDeath";
|
||||
|
||||
const testBaitDelay = 1000;
|
||||
var adblockDetectedType;
|
||||
var pendingAdblockDetectedMessage;
|
||||
|
||||
var isVideoAdPlaying; //used internally in ad provider scripts
|
||||
|
||||
const loadingAdBannerPollDelay = 100;
|
||||
var loadingAdBannerIntervalId;
|
||||
|
||||
function createAdBlockBaitDiv(divId, classList)
|
||||
{
|
||||
var div = document.getElementById(divId);
|
||||
|
||||
if(div == null)
|
||||
{
|
||||
div = document.createElement("div");
|
||||
|
||||
div.id = divId;
|
||||
|
||||
if(classList != null)
|
||||
{
|
||||
div.classList.add(classList);
|
||||
|
||||
}
|
||||
|
||||
div.style.display = "block";
|
||||
div.style.backgroundColor = 'transparent';
|
||||
div.style.height = '10px';
|
||||
div.style.width = '10px';
|
||||
div.style.position = 'fixed';
|
||||
div.style.bottom = '-100px';
|
||||
div.style.left = '-100px';
|
||||
|
||||
div.innerHTML = ' ';
|
||||
|
||||
document.body.appendChild(div);
|
||||
}
|
||||
|
||||
return div;
|
||||
}
|
||||
|
||||
function wasAdBlockDivRemoved(div)
|
||||
{
|
||||
return getComputedStyle(div).display === "none" || div.getBoundingClientRect().height === 0;
|
||||
}
|
||||
|
||||
function onUpdateAdBlockDetectedComplete(detectionType)
|
||||
{
|
||||
if(!window.adblockDetected)
|
||||
{
|
||||
adblockDetectedType = detectionType;
|
||||
|
||||
window.adblockDetected = (detectionType != null);
|
||||
|
||||
if(window.adblockDetected)
|
||||
{
|
||||
console.log(`Adblock detected: ${detectionType}`);
|
||||
}
|
||||
|
||||
pendingAdblockDetectedMessage = true;
|
||||
trySendAdBlockDetectedMessage();
|
||||
}
|
||||
}
|
||||
|
||||
function trySendAdBlockDetectedMessage()
|
||||
{
|
||||
if(window.unityGame != null && pendingAdblockDetectedMessage)
|
||||
{
|
||||
window.unityGame.SendMessage(unityFirebaseGameOjbectName, "OnUpdateAdBlockDetectedComplete", adblockDetectedType != null ? adblockDetectedType : "");
|
||||
|
||||
pendingAdblockDetectedMessage = false;
|
||||
}
|
||||
}
|
||||
|
||||
function updateAdBlockDetected()
|
||||
{
|
||||
if(window.adblockDetected)
|
||||
return;
|
||||
|
||||
var imgUrlTestPassed = true; //should be false but disabling temporarily as previous img src url has been removed
|
||||
var fbDivTestPassed = false;
|
||||
|
||||
//nested function
|
||||
function checkAllAsyncTestsComplete()
|
||||
{
|
||||
if(imgUrlTestPassed && fbDivTestPassed)
|
||||
{
|
||||
onUpdateAdBlockDetectedComplete(null);
|
||||
}
|
||||
}
|
||||
|
||||
//test local div ad bait
|
||||
var localAdBlockDiv = createAdBlockBaitDiv("AdBanner", ['adLeaderboard', 'adBanner', 'leaderboard_ad']);
|
||||
|
||||
//delay testing bait divs to let adblockers do their thing
|
||||
setTimeout(() =>
|
||||
{
|
||||
//test local script bait
|
||||
if(document.getElementById('sklocalscriptbait') == null)
|
||||
{
|
||||
onUpdateAdBlockDetectedComplete("Local Script");
|
||||
return;
|
||||
}
|
||||
|
||||
//test local div bait
|
||||
if(wasAdBlockDivRemoved(localAdBlockDiv))
|
||||
{
|
||||
onUpdateAdBlockDetectedComplete("Local Div");
|
||||
return;
|
||||
}
|
||||
|
||||
//disabling temporarily as previous img src url has been removed
|
||||
// //test image pixel ad bait detection
|
||||
// var img = new Image();
|
||||
//
|
||||
// img.onload = () =>
|
||||
// {
|
||||
// imgUrlTestPassed = true;
|
||||
// checkAllAsyncTestsComplete();
|
||||
// }
|
||||
//
|
||||
// img.onerror = () =>
|
||||
// {
|
||||
// onUpdateAdBlockDetectedComplete("Img Url Test");
|
||||
// return;
|
||||
// };
|
||||
//
|
||||
// img.src = 'https://px.moatads.com/pixel.gif';
|
||||
|
||||
//test bait divs from firebase ids
|
||||
if (typeof firebase !== 'undefined' && firebase.database() != null && firebase.auth() != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
const dbRef = firebase.database().ref();
|
||||
|
||||
dbRef.child("adblock").once("value").then((snapshot) =>
|
||||
{
|
||||
if (snapshot.exists())
|
||||
{
|
||||
var adblockDivIds = snapshot.val();
|
||||
|
||||
if(Array.isArray(adblockDivIds))
|
||||
{
|
||||
var adblockDivs = [];
|
||||
|
||||
adblockDivIds.forEach(divId =>
|
||||
{
|
||||
const div = createAdBlockBaitDiv(divId);
|
||||
adblockDivs.push(div);
|
||||
});
|
||||
|
||||
//delay testing bait divs to let adblockers do their thing
|
||||
setTimeout(() =>
|
||||
{
|
||||
//check bait divs
|
||||
for (let i = 0; i < adblockDivs.length; i++)
|
||||
{
|
||||
const div = adblockDivs[i];
|
||||
|
||||
if(wasAdBlockDivRemoved(div))
|
||||
{
|
||||
onUpdateAdBlockDetectedComplete("Firebase Div");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
fbDivTestPassed = true;
|
||||
checkAllAsyncTestsComplete();
|
||||
}, testBaitDelay);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
console.log(`updateAdBlockDetected error: ${e}`);
|
||||
}
|
||||
}
|
||||
}, testBaitDelay);
|
||||
}
|
||||
|
||||
function setElementSize(identifier, x, y, w, h)
|
||||
{
|
||||
const el = document.getElementById(identifier);
|
||||
if(el != null)
|
||||
{
|
||||
el.style.left = x + "px";
|
||||
el.style.top = y + "px";
|
||||
el.style.width = w + "px";
|
||||
el.style.height = h + "px";
|
||||
}
|
||||
}
|
||||
|
||||
function hideAdContainer(adElementId)
|
||||
{
|
||||
const ad = document.getElementById(adElementId);
|
||||
|
||||
if(ad != null)
|
||||
{
|
||||
ad.style.display = "none";
|
||||
}
|
||||
}
|
||||
|
||||
function showAdContainer(adElementId)
|
||||
{
|
||||
const ad = document.getElementById(adElementId);
|
||||
|
||||
if(ad != null)
|
||||
{
|
||||
ad.style.position = "absolute";
|
||||
ad.style.display = getComputedStyle(ad).getPropertyValue("--shown_display");
|
||||
}
|
||||
}
|
||||
|
||||
function hideLoadingBanner()
|
||||
{
|
||||
if(!offCanvasAdsEnabled)
|
||||
{
|
||||
hideAdContainer(divIdLoadingBanner);
|
||||
hideLoadingAd();
|
||||
}
|
||||
}
|
||||
|
||||
function showLoadingBanner()
|
||||
{
|
||||
if(!offCanvasAdsEnabled)
|
||||
{
|
||||
//check for adblock specifically for main menu banner as we show our own disable blocker panel
|
||||
if(!isMobile() && !window.adblockDetected)
|
||||
{
|
||||
showAdContainer(divIdLoadingBanner);
|
||||
requestLoadingAd();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Used by playwire to ensure everything still gets initialised correctly for season pass holders
|
||||
function showDummyMainMenuBanner()
|
||||
{
|
||||
if(!offCanvasAdsEnabled)
|
||||
{
|
||||
hideWinCeremonyBanner();
|
||||
hideLongBanner();
|
||||
hideMainMenuBanner();
|
||||
hideSpectateBanner();
|
||||
|
||||
showAdContainer(divIdMainMenuBanner);
|
||||
|
||||
requestDummyMainMenuAd();
|
||||
}
|
||||
}
|
||||
|
||||
function hideMainMenuBanner()
|
||||
{
|
||||
if(!offCanvasAdsEnabled)
|
||||
{
|
||||
hideAdContainer(divIdMainMenuBanner);
|
||||
hideMainMenuAd();
|
||||
}
|
||||
}
|
||||
|
||||
function showMainMenuBanner()
|
||||
{
|
||||
if(!offCanvasAdsEnabled)
|
||||
{
|
||||
hideWinCeremonyBanner();
|
||||
hideLongBanner();
|
||||
hideSpectateBanner();
|
||||
|
||||
//check for adblock specifically for main menu banner as we show our own disable blocker panel
|
||||
if(!isMobile() && !window.adblockDetected)
|
||||
{
|
||||
showAdContainer(divIdMainMenuBanner);
|
||||
requestMainMenuAd();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function hideWinCeremonyBanner()
|
||||
{
|
||||
if(!offCanvasAdsEnabled)
|
||||
{
|
||||
hideAdContainer(divIdWinCeremonyBanner);
|
||||
hideWinCeremonyAd();
|
||||
}
|
||||
}
|
||||
|
||||
function showWinCeremonyBanner()
|
||||
{
|
||||
if(!offCanvasAdsEnabled)
|
||||
{
|
||||
hideLongBanner();
|
||||
hideMainMenuBanner();
|
||||
hideSpectateBanner();
|
||||
|
||||
showAdContainer(divIdWinCeremonyBanner);
|
||||
requestWinCeremonyAd();
|
||||
}
|
||||
}
|
||||
|
||||
function hideSpectateBanner()
|
||||
{
|
||||
if(!offCanvasAdsEnabled)
|
||||
{
|
||||
hideAdContainer(divIdSpectateBanner);
|
||||
hideSpectateAd();
|
||||
}
|
||||
}
|
||||
|
||||
function showSpectateBanner()
|
||||
{
|
||||
if(!offCanvasAdsEnabled)
|
||||
{
|
||||
hideLongBanner();
|
||||
hideMainMenuBanner();
|
||||
hideWinCeremonyBanner();
|
||||
|
||||
showAdContainer(divIdSpectateBanner);
|
||||
requestSpectateAd();
|
||||
}
|
||||
}
|
||||
|
||||
function hideLongBanner()
|
||||
{
|
||||
if(offCanvasAdsEnabled)
|
||||
{
|
||||
if(onlyShowOffCanvasAdsOnDeath)
|
||||
{
|
||||
hideBtmAdContainer();
|
||||
hideRightAdContainer();
|
||||
updateGameCanvasSize();
|
||||
}
|
||||
else if(!showBtmAd)
|
||||
{
|
||||
//not showing off canvas btm ad so destroy standard on canvas death banner
|
||||
hideAdContainer(divIdDeathBanner);
|
||||
hideDeathAd();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
hideAdContainer(divIdDeathBanner);
|
||||
hideDeathAd();
|
||||
}
|
||||
}
|
||||
|
||||
function showLongBanner()
|
||||
{
|
||||
if(offCanvasAdsEnabled)
|
||||
{
|
||||
if(onlyShowOffCanvasAdsOnDeath)
|
||||
{
|
||||
if(showBtmAd)
|
||||
{
|
||||
updateBtmAdContainer();
|
||||
}
|
||||
|
||||
if(showRightAd)
|
||||
{
|
||||
updateRightAdContainer();
|
||||
}
|
||||
|
||||
updateGameCanvasSize();
|
||||
}
|
||||
else if(!showBtmAd)
|
||||
{
|
||||
//not showing off canvas btm ad so show standard on canvas death banner
|
||||
hideWinCeremonyBanner();
|
||||
hideMainMenuBanner();
|
||||
|
||||
showAdContainer(divIdDeathBanner);
|
||||
requestDeathAd();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
hideWinCeremonyBanner();
|
||||
hideMainMenuBanner();
|
||||
|
||||
showAdContainer(divIdDeathBanner);
|
||||
requestDeathAd();
|
||||
}
|
||||
}
|
||||
|
||||
function showNonRewardedInterstitial(audioOn, interstitialType, interstitialName)
|
||||
{
|
||||
if(!window.adblockDetected)
|
||||
{
|
||||
//showInterstitial(audioOn, 'start', 'pregame');
|
||||
//showInterstitial(audioOn, 'next', 'winceremony')
|
||||
showInterstitial(audioOn, interstitialType, interstitialName)
|
||||
}
|
||||
else
|
||||
{
|
||||
interstitialError(false);
|
||||
}
|
||||
}
|
||||
|
||||
function interstitialStart(rewarded)
|
||||
{
|
||||
isVideoAdPlaying = true;
|
||||
|
||||
window.unityGame.SendMessage(unityFirebaseGameOjbectName, "InterstitialStart", rewarded ? 1 : 0);
|
||||
|
||||
if(offCanvasAdsEnabled)
|
||||
{
|
||||
hideAllOffCanvasAds();
|
||||
}
|
||||
}
|
||||
|
||||
function interstitialError(rewarded)
|
||||
{
|
||||
isVideoAdPlaying = false;
|
||||
|
||||
window.unityGame.SendMessage(unityFirebaseGameOjbectName, "InterstitialFailed", rewarded ? 1 : 0);
|
||||
|
||||
if(offCanvasAdsEnabled)
|
||||
{
|
||||
refreshAllOffCanvasAds();
|
||||
}
|
||||
}
|
||||
|
||||
function interstitialSkipped(rewarded)
|
||||
{
|
||||
isVideoAdPlaying = false;
|
||||
|
||||
window.unityGame.SendMessage(unityFirebaseGameOjbectName, "InterstitialSkipped", rewarded ? 1 : 0);
|
||||
|
||||
if(offCanvasAdsEnabled)
|
||||
{
|
||||
refreshAllOffCanvasAds();
|
||||
}
|
||||
}
|
||||
|
||||
function interstitialNoFill(rewarded)
|
||||
{
|
||||
isVideoAdPlaying = false;
|
||||
|
||||
window.unityGame.SendMessage(unityFirebaseGameOjbectName, "InterstitialNoFill", rewarded ? 1 : 0);
|
||||
|
||||
if(offCanvasAdsEnabled)
|
||||
{
|
||||
refreshAllOffCanvasAds();
|
||||
}
|
||||
}
|
||||
|
||||
function interstitialComplete(rewarded)
|
||||
{
|
||||
isVideoAdPlaying = false;
|
||||
|
||||
window.unityGame.SendMessage(unityFirebaseGameOjbectName, "InterstitialComplete", rewarded ? 1 : 0);
|
||||
|
||||
if(offCanvasAdsEnabled)
|
||||
{
|
||||
refreshAllOffCanvasAds();
|
||||
}
|
||||
}
|
||||
|
||||
function canShowLoadingAdBanner()
|
||||
{
|
||||
return (!window.adblockDetected &&
|
||||
(loadingState === "None" || loadingState === "Closing" || loadingState === "Closed") &&
|
||||
(userNoAdsEndTimestamp != null && userNoAdsEndTimestamp <= Date.now()) &&
|
||||
!isMobile());
|
||||
}
|
||||
|
||||
function updateLoadingAdBanner()
|
||||
{
|
||||
//poll to determine if we can show a loading ad or not
|
||||
loadingAdBannerIntervalId = setInterval(() =>
|
||||
{
|
||||
if(canShowLoadingAdBanner())
|
||||
{
|
||||
showLoadingBanner();
|
||||
showMainMenuBanner();
|
||||
clearInterval(loadingAdBannerIntervalId);
|
||||
}
|
||||
else if(userNoAdsEndTimestamp != null)
|
||||
{
|
||||
clearInterval(loadingAdBannerIntervalId);
|
||||
}
|
||||
}, loadingAdBannerPollDelay);
|
||||
}
|
@ -1,50 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
///////////////////////////
|
||||
function requestLoadingAd()
|
||||
{
|
||||
}
|
||||
|
||||
function hideLoadingAd()
|
||||
{
|
||||
}
|
||||
|
||||
function requestMainMenuAd()
|
||||
{
|
||||
}
|
||||
|
||||
function hideMainMenuAd()
|
||||
{
|
||||
}
|
||||
|
||||
function requestWinCeremonyAd()
|
||||
{
|
||||
}
|
||||
|
||||
function hideWinCeremonyAd()
|
||||
{
|
||||
}
|
||||
|
||||
function requestSpectateAd()
|
||||
{
|
||||
}
|
||||
|
||||
function hideSpectateAd()
|
||||
{
|
||||
}
|
||||
|
||||
function requestDeathAd()
|
||||
{
|
||||
}
|
||||
|
||||
function hideDeathAd()
|
||||
{
|
||||
}
|
||||
|
||||
function requestOffCanvasAd(adResArrayToHide, adTagIdToShow)
|
||||
{
|
||||
}
|
||||
|
||||
function hideOffCanvasAds(adResArray)
|
||||
{
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
function showInterstitial(audioOn, interstitialType, interstitialName)
|
||||
{
|
||||
}
|
||||
|
||||
function tryInitRewardedInterstitial(audioOn)
|
||||
{
|
||||
}
|
||||
|
||||
function tryShowRewardedInterstitial(audioOn)
|
||||
{
|
||||
}
|
@ -1,69 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
function showInterstitial(unusedParam, interstitialType, interstitialName)
|
||||
{
|
||||
// var audioOnStr = audioOn ? 'on' : 'off';
|
||||
// adConfig({
|
||||
// sound: audioOnStr,
|
||||
// });
|
||||
|
||||
if(typeof adBreak === "function")
|
||||
{
|
||||
adBreak({
|
||||
|
||||
type: interstitialType, // ad shows at start of next level
|
||||
name: interstitialName,
|
||||
beforeAd: () => interstitialStart(false),
|
||||
afterAd: () => interstitialComplete(false),
|
||||
adBreakDone: () => {isVideoAdPlaying = false;}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var onShowRewardedVideoClicked = null;
|
||||
|
||||
function tryInitRewardedInterstitial(unusedParam)
|
||||
{
|
||||
if(typeof adBreak === "function")
|
||||
{
|
||||
adBreak({
|
||||
type: 'reward', // The type of this placement
|
||||
name: 'rewardedxpboost', // A descriptive name for this placement
|
||||
beforeAd: () => interstitialStart(true), // Prepare for the ad. Mute and pause the game flow
|
||||
afterAd: () => console.log("tryInitRewardedInterstitials afterAd"), // Resume the game and re-enable sound
|
||||
beforeReward: (showAdFn) => rewardedInterstitialAvailable(showAdFn), // Show reward prompt (call showAdFn() if clicked)
|
||||
adDismissed: () => interstitialSkipped(true), // Player dismissed the ad before it finished.
|
||||
adViewed: () => interstitialComplete(true), // Player watched the ad–give them the reward.
|
||||
adBreakDone: (placementInfo) => onGoogleRewardedVideoAdBreakDone(placementInfo), // Always called (if provided) even if an ad didn’t show
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function tryShowRewardedInterstitial(unusedParam)
|
||||
{
|
||||
if(onShowRewardedVideoClicked != null)
|
||||
{
|
||||
onShowRewardedVideoClicked();
|
||||
onShowRewardedVideoClicked = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
console.log("tryShowRewardedInterstitial onShowRewardedVideoClicked == null");
|
||||
interstitialNoFill(true);
|
||||
}
|
||||
}
|
||||
|
||||
function rewardedInterstitialAvailable(showAdFn)
|
||||
{
|
||||
console.log("set onShowRewardedVideoClicked");
|
||||
onShowRewardedVideoClicked = showAdFn;
|
||||
window.unityGame.SendMessage(unityFirebaseGameOjbectName, "RewardedInterstitialAvailable");
|
||||
}
|
||||
|
||||
function onGoogleRewardedVideoAdBreakDone(placementInfo)
|
||||
{
|
||||
isVideoAdPlaying = false;
|
||||
console.log(`tryInitRewardedInterstitials adBreakDone with status ${placementInfo.breakStatus}`);
|
||||
window.unityGame.SendMessage(unityFirebaseGameOjbectName, "GoogleRewardedVideoAdBreakDone");
|
||||
}
|
@ -1,173 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
//Keep these in global scope
|
||||
let adBreak;
|
||||
let adConfig;
|
||||
|
||||
//PLAYWIRE
|
||||
if(isPlaywireEnabled())
|
||||
{
|
||||
//PLAYWIRE RAMP v1.0
|
||||
// var ramp = {config: '//config.playwire.com/1024690/v2/websites/73592/banner.json' };
|
||||
//
|
||||
// var playwireScript = document.createElement("script");
|
||||
// playwireScript.id = "ramp";
|
||||
// playwireScript.type = "text/javascript";
|
||||
// playwireScript.async = true;
|
||||
// playwireScript.src = "//cdn.intergient.com/ramp.js";
|
||||
// document.head.appendChild(playwireScript);
|
||||
|
||||
//PLAYWIRE RAMP v2.0
|
||||
window.ramp = window.ramp || {};
|
||||
window.ramp.que = window.ramp.que || [];
|
||||
window.ramp.passiveMode = true;
|
||||
window.ramp.onReady = function()
|
||||
{
|
||||
playwireRampInitialised = true;
|
||||
|
||||
//ads stealing focus bugfix
|
||||
const handleSlotRenderEnded = () => {
|
||||
let hasFocus = true;
|
||||
let intervalId;
|
||||
|
||||
const handleBlur = () => {
|
||||
hasFocus = false;
|
||||
};
|
||||
|
||||
const handleFocus = () => {
|
||||
hasFocus = true;
|
||||
};
|
||||
|
||||
window.addEventListener('blur', handleBlur);
|
||||
window.addEventListener('focus', handleFocus);
|
||||
|
||||
intervalId = setInterval(() => {
|
||||
if (!hasFocus) {
|
||||
window.focus();
|
||||
clearInterval(intervalId);
|
||||
window.removeEventListener('blur', handleBlur);
|
||||
window.removeEventListener('focus', handleFocus);
|
||||
} else {
|
||||
clearInterval(intervalId);
|
||||
window.removeEventListener('blur', handleBlur);
|
||||
window.removeEventListener('focus', handleFocus);
|
||||
}
|
||||
}, 1000);
|
||||
};
|
||||
|
||||
window.googletag.pubads().addEventListener('slotRenderEnded', handleSlotRenderEnded);
|
||||
};
|
||||
|
||||
window._pwGA4PageviewId = ''.concat(Date.now());
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
window.gtag = window.gtag || function () {
|
||||
dataLayer.push(arguments);
|
||||
};
|
||||
gtag('js', new Date());
|
||||
gtag('config', 'G-F2WLE0BJLM', { 'send_page_view': false, 'cookie_flags': 'samesite=none;secure' });
|
||||
gtag(
|
||||
'event',
|
||||
'ramp_js',
|
||||
{
|
||||
'send_to': 'G-F2WLE0BJLM',
|
||||
'pageview_id': window._pwGA4PageviewId
|
||||
}
|
||||
);
|
||||
|
||||
var playwireScript = document.createElement("script");
|
||||
playwireScript.type = "text/javascript";
|
||||
playwireScript.async = true;
|
||||
playwireScript.src = "//cdn.intergient.com/1024690/73592/ramp.js";
|
||||
document.head.appendChild(playwireScript);
|
||||
|
||||
//PLAYWIRE PRECONNECTS
|
||||
addPreconnectLink("https://cdn.intergi.com", true);
|
||||
addPreconnectLink("https://cdn.intergient.com", true);
|
||||
addPreconnectLink("https://securepubads.g.doubleclick.net", true);
|
||||
addPreconnectLink("https://cdn.playwire.com", true);
|
||||
addPreconnectLink("https://z.moatads.com", true);
|
||||
|
||||
function addPreconnectLink(preconnectUrl, crossOriginEnabled)
|
||||
{
|
||||
var link = document.createElement('link');
|
||||
link.rel = 'preconnect';
|
||||
link.href = preconnectUrl;
|
||||
|
||||
if(crossOriginEnabled)
|
||||
{
|
||||
link.crossOrigin = 'anonymous';
|
||||
}
|
||||
|
||||
document.head.appendChild(link);
|
||||
}
|
||||
}
|
||||
|
||||
//ADINPLAY
|
||||
if(isAdinPlayEnabled())
|
||||
{
|
||||
window.aiptag = window.aiptag || {cmd: []};
|
||||
aiptag.cmd.display = aiptag.cmd.display || [];
|
||||
aiptag.cmd.player = aiptag.cmd.player || [];
|
||||
|
||||
//CMP tool settings
|
||||
aiptag.cmp = {
|
||||
show: true,
|
||||
position: "bottom", //centered, bottom
|
||||
button: false,
|
||||
buttonText: "Privacy settings",
|
||||
buttonPosition: "bottom-left" //bottom-left, bottom-right, top-left, top-right
|
||||
}
|
||||
|
||||
//init video player
|
||||
if(videoAdProvider === AdProviderAdinplay)
|
||||
{
|
||||
aiptag.cmd.player.push(function() {
|
||||
aiptag.adplayer = new aipPlayer({
|
||||
AD_WIDTH: 960,
|
||||
AD_HEIGHT: 540,
|
||||
AD_DISPLAY: 'fullscreen', //default, fullscreen, center, fill
|
||||
LOADING_TEXT: 'loading advertisement',
|
||||
PREROLL_ELEM: function(){return document.getElementById('preroll');},
|
||||
AIP_COMPLETE: function(evt){onInterstitialComplete(evt);},
|
||||
AIP_REWARDEDCOMPLETE: function(evt){onRewardedInterstitialComplete(evt);},
|
||||
AIP_REWARDEDGRANTED: function(){onRewardedInterstitialGranted();}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
var adinplayScript = document.createElement("script");
|
||||
adinplayScript.type = "text/javascript";
|
||||
adinplayScript.async = true;
|
||||
adinplayScript.src = "//api.adinplay.com/libs/aiptag/pub/SHK/smashkarts.io/tag.min.js";
|
||||
document.head.appendChild(adinplayScript);
|
||||
}
|
||||
|
||||
//GOOGLE H5 GAMES
|
||||
if(isGoogleH5GamesEnabled())
|
||||
{
|
||||
window.googletag = window.googletag || { cmd: [] };
|
||||
googletag.cmd.push(() =>
|
||||
{
|
||||
var url = (window.location != window.parent.location) ? document.referrer : document.location.href;
|
||||
if (url.startsWith("https://smashkarts.io/") || url.startsWith("http://smashkarts.io/") ||
|
||||
url.startsWith("https://www.smashkarts.io/") || url.startsWith("http://www.smashkarts.io/")
|
||||
|| url.includes("smashkarts-dev.firebaseapp.com"))
|
||||
{
|
||||
(function ()
|
||||
{
|
||||
var afgads = document.createElement('script');
|
||||
afgads.setAttribute("async", true);
|
||||
afgads.setAttribute("type", "text/javascript");
|
||||
afgads.setAttribute("data-ad-frequency-hint", "30s");
|
||||
afgads.setAttribute("data-ad-client", "ca-pub-1463476156508236");
|
||||
afgads.setAttribute("src", "https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js");
|
||||
var node = document.getElementsByTagName('script')[0];
|
||||
node.parentNode.insertBefore(afgads, node);
|
||||
})();
|
||||
|
||||
window.adsbygoogle = window.adsbygoogle || [];
|
||||
adBreak = adConfig = function (o) { adsbygoogle.push(o); };
|
||||
adConfig({ preloadAdBreaks: "on", sound: "on" });
|
||||
}
|
||||
});
|
||||
}
|
@ -1,64 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
//PLAYWIRE
|
||||
if(isPlaywireEnabled())
|
||||
{
|
||||
var pwCommonScript = document.createElement("script");
|
||||
pwCommonScript.src = pwCommonScriptSrc;
|
||||
document.body.appendChild(pwCommonScript);
|
||||
|
||||
if(displayAdProvider === AdProviderPlaywire)
|
||||
{
|
||||
var pwDisplayScript = document.createElement("script");
|
||||
pwDisplayScript.src = pwDisplayScriptSrc;
|
||||
document.body.appendChild(pwDisplayScript);
|
||||
}
|
||||
|
||||
if(videoAdProvider === AdProviderPlaywire)
|
||||
{
|
||||
var pwVideoScript = document.createElement("script");
|
||||
pwVideoScript.src = pwVideoScriptSrc;
|
||||
document.body.appendChild(pwVideoScript);
|
||||
}
|
||||
}
|
||||
|
||||
//ADINPLAY
|
||||
if(isAdinPlayEnabled())
|
||||
{
|
||||
if(displayAdProvider === AdProviderAdinplay)
|
||||
{
|
||||
var adinplayDisplayScript = document.createElement("script");
|
||||
adinplayDisplayScript.src = adinplayDisplayScriptSrc;
|
||||
document.body.appendChild(adinplayDisplayScript);
|
||||
}
|
||||
|
||||
if(videoAdProvider === AdProviderAdinplay)
|
||||
{
|
||||
var adinplayVideoScript = document.createElement("script");
|
||||
adinplayVideoScript.src = adinplayVideoScriptSrc;
|
||||
document.body.appendChild(adinplayVideoScript);
|
||||
}
|
||||
}
|
||||
|
||||
//GOOGLE H5 GAMES
|
||||
if(isGoogleH5GamesEnabled())
|
||||
{
|
||||
var googleH5GamesVideoScript = document.createElement("script");
|
||||
googleH5GamesVideoScript.src = googleH5GamesVideoScriptSrc;
|
||||
document.body.appendChild(googleH5GamesVideoScript);
|
||||
}
|
||||
|
||||
//DUMMY ADS
|
||||
if(displayAdProvider === AdProviderDummy)
|
||||
{
|
||||
var dummyDisplayScript = document.createElement("script");
|
||||
dummyDisplayScript.src = dummyDisplayScriptSrc;
|
||||
document.body.appendChild(dummyDisplayScript);
|
||||
}
|
||||
|
||||
if(videoAdProvider === AdProviderDummy)
|
||||
{
|
||||
var dummyVideoScript = document.createElement("script");
|
||||
dummyVideoScript.src = dummyVideoScriptSrc;
|
||||
document.body.appendChild(dummyVideoScript);
|
||||
}
|
@ -1,527 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
var btmAdContainer = document.getElementById("btmContainer");
|
||||
var btmAdPlaceholder = document.getElementById("btmAdPlaceholder");
|
||||
var btmAdResText = document.getElementById("btmAdResText");
|
||||
|
||||
var rightAdContainer = document.getElementById("rightContainer");
|
||||
var rightAdPlaceholder = document.getElementById("rightAdPlaceholder");
|
||||
var rightAdResText = document.getElementById("rightAdResText");
|
||||
|
||||
function displayingBtmAd()
|
||||
{
|
||||
return currBtmAdIndex >= 0;
|
||||
}
|
||||
|
||||
function displayingRightAd()
|
||||
{
|
||||
return currRightAdIndex >= 0;
|
||||
}
|
||||
|
||||
function sortAdResArrays()
|
||||
{
|
||||
btmAdResolutions.sort(sortRightAdResArrays);
|
||||
rightAdResolutions.sort(sortBtmAdResArrays);
|
||||
btmAdResolutionsMobile.sort(sortRightAdResArrays);
|
||||
rightAdResolutionsMobile.sort(sortBtmAdResArrays);
|
||||
}
|
||||
|
||||
function sortBtmAdResArrays(adResObj1, adResObj2)
|
||||
{
|
||||
if(adResObj1.w === adResObj2.w)
|
||||
{
|
||||
if(adResObj1.h === adResObj2.h)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else if(adResObj1.h > adResObj2.h)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else if(adResObj1.w > adResObj2.w)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
function sortRightAdResArrays(adResObj1, adResObj2)
|
||||
{
|
||||
if(adResObj1.h === adResObj2.h)
|
||||
{
|
||||
if(adResObj1.w === adResObj2.w)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else if(adResObj1.w > adResObj2.w)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else if(adResObj1.h > adResObj2.h)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
function updateOffCanvasAdContainers()
|
||||
{
|
||||
if(onlyShowOffCanvasAdsOnDeath)
|
||||
{
|
||||
if(displayingBtmAd())
|
||||
{
|
||||
updateBtmAdContainer();
|
||||
}
|
||||
else
|
||||
{
|
||||
hideBtmAdContainer();
|
||||
}
|
||||
|
||||
if(displayingRightAd())
|
||||
{
|
||||
updateRightAdContainer();
|
||||
}
|
||||
else
|
||||
{
|
||||
hideRightAdContainer();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
updateBtmAdContainer();
|
||||
updateRightAdContainer();
|
||||
}
|
||||
}
|
||||
|
||||
function updateOffCanvasBorderCorner()
|
||||
{
|
||||
//border corner
|
||||
if(displayingBtmAd() && displayingRightAd())
|
||||
{
|
||||
gameContainer.style.borderBottomRightRadius = offCanvasBorderBtmRightCornerRadiusStyle;
|
||||
}
|
||||
else
|
||||
{
|
||||
gameContainer.style.borderBottomRightRadius = "0px";
|
||||
}
|
||||
}
|
||||
|
||||
function updateBtmAdContainer()
|
||||
{
|
||||
if (offCanvasAdsEnabled && showBtmAd)
|
||||
{
|
||||
//padding
|
||||
//main container
|
||||
var mainContainerStyle = getComputedStyle(mainContainer);
|
||||
var mainContainerPadLeft = parseInt(mainContainerStyle.getPropertyValue("padding-left"));
|
||||
var mainContainerPadRight = parseInt(mainContainerStyle.getPropertyValue("padding-right"));
|
||||
var mainContainerPadTop = parseInt(mainContainerStyle.getPropertyValue("padding-top"));
|
||||
var mainContainerPadBtm = parseInt(mainContainerStyle.getPropertyValue("padding-bottom"));
|
||||
|
||||
//ad container
|
||||
var btmAdContainerStyle = getComputedStyle(btmAdContainer);
|
||||
var btmAdContainerPadLeft = parseInt(btmAdContainerStyle.getPropertyValue("padding-left"));
|
||||
var btmAdContainerPadRight = parseInt(btmAdContainerStyle.getPropertyValue("padding-right"));
|
||||
var btmAdContainerPadTop = parseInt(btmAdContainerStyle.getPropertyValue("padding-top"));
|
||||
var btmAdContainerPadBtm = parseInt(btmAdContainerStyle.getPropertyValue("padding-bottom"));
|
||||
|
||||
//calc max ad sizes
|
||||
var maxAdWidth = window.innerWidth - mainContainerPadLeft - mainContainerPadRight - btmAdContainerPadLeft - btmAdContainerPadRight - rightAdContainer.getBoundingClientRect().width;
|
||||
var maxAdHeight = (window.innerHeight * maxAdHeightPercentage) - mainContainerPadTop - mainContainerPadBtm - btmAdContainerPadTop - btmAdContainerPadBtm;
|
||||
|
||||
//calc best ad size
|
||||
var bestAdWidth = 0;
|
||||
var bestAdHeight = 0;
|
||||
|
||||
var tempBtmAdIndex = -1;
|
||||
var btmAdResArray = isMobile() ? btmAdResolutionsMobile : btmAdResolutions;
|
||||
|
||||
for (let i = 0; i < btmAdResArray.length; i++)
|
||||
{
|
||||
const adRes = btmAdResArray[i];
|
||||
|
||||
const adWidth = adRes.w;
|
||||
const adHeight = adRes.h;
|
||||
|
||||
if (adHeight <= maxAdHeight && adHeight >= bestAdHeight && adWidth <= maxAdWidth && adWidth >= bestAdWidth)
|
||||
{
|
||||
tempBtmAdIndex = i;
|
||||
|
||||
bestAdWidth = adWidth;
|
||||
bestAdHeight = adHeight;
|
||||
}
|
||||
}
|
||||
|
||||
// console.log(`windowWidth: ${window.innerWidth} maxAdWidth: ${maxAdWidth} closestAdWidth: ${closestAdWidth}`);
|
||||
|
||||
if (tempBtmAdIndex >= 0)
|
||||
{
|
||||
gameContainer.style.borderBottom = offCanvasBorderStyle;
|
||||
|
||||
var containerHeight = bestAdHeight + btmAdContainerPadTop + btmAdContainerPadBtm + "px";
|
||||
btmAdContainer.style.display = "flex";
|
||||
btmAdContainer.style.minHeight = containerHeight;
|
||||
btmAdContainer.style.height = containerHeight;
|
||||
|
||||
btmAdPlaceholder.style.display = "flex";
|
||||
btmAdPlaceholder.style.width = bestAdWidth + "px";
|
||||
btmAdPlaceholder.style.height = bestAdHeight + "px";
|
||||
|
||||
if(debugAdContainers)
|
||||
{
|
||||
btmAdResText.style.display = "block";
|
||||
btmAdResText.innerHTML = `${bestAdWidth}x${bestAdHeight}`;
|
||||
}
|
||||
else
|
||||
{
|
||||
btmAdResText.style.display = "none";
|
||||
}
|
||||
|
||||
//if we arent already showing an ad then request one
|
||||
if(currBtmAdIndex != tempBtmAdIndex)
|
||||
{
|
||||
currBtmAdIndex = tempBtmAdIndex;
|
||||
|
||||
const adTagIdToShow = btmAdResArray[currBtmAdIndex].adId;
|
||||
|
||||
requestOffCanvasAd(btmAdResArray, adTagIdToShow);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
hideBtmAdContainer();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
hideBtmAdContainer();
|
||||
}
|
||||
}
|
||||
|
||||
function hideBtmAdContainer()
|
||||
{
|
||||
gameContainer.style.borderBottom = "0px";
|
||||
|
||||
btmAdContainer.style.display = "none";
|
||||
btmAdPlaceholder.style.display = "none";
|
||||
btmAdResText.style.display = "none";
|
||||
|
||||
hideOffCanvasAds(btmAdResolutions);
|
||||
hideOffCanvasAds(btmAdResolutionsMobile);
|
||||
|
||||
currBtmAdIndex = -1;
|
||||
}
|
||||
|
||||
function updateRightAdContainer()
|
||||
{
|
||||
if (offCanvasAdsEnabled && showRightAd)
|
||||
{
|
||||
//padding
|
||||
//main container
|
||||
var mainContainerStyle = getComputedStyle(mainContainer);
|
||||
var mainContainerPadLeft = parseInt(mainContainerStyle.getPropertyValue("padding-left"));
|
||||
var mainContainerPadRight = parseInt(mainContainerStyle.getPropertyValue("padding-right"));
|
||||
var mainContainerPadTop = parseInt(mainContainerStyle.getPropertyValue("padding-top"));
|
||||
var mainContainerPadBtm = parseInt(mainContainerStyle.getPropertyValue("padding-bottom"));
|
||||
|
||||
//ad container
|
||||
var rightAdContainerStyle = getComputedStyle(rightAdContainer);
|
||||
var rightAdContainerPadLeft = parseInt(rightAdContainerStyle.getPropertyValue("padding-left"));
|
||||
var rightAdContainerPadRight = parseInt(rightAdContainerStyle.getPropertyValue("padding-right"));
|
||||
var rightAdContainerPadTop = parseInt(rightAdContainerStyle.getPropertyValue("padding-top"));
|
||||
var rightAdContainerPadBtm = parseInt(rightAdContainerStyle.getPropertyValue("padding-bottom"));
|
||||
|
||||
//calc max ad sizes
|
||||
var maxAdWidth = (window.innerWidth * maxAdWidthPercentage) - mainContainerPadLeft - mainContainerPadRight - rightAdContainerPadLeft - rightAdContainerPadRight;
|
||||
var maxAdHeight = window.innerHeight - mainContainerPadTop - mainContainerPadBtm - rightAdContainerPadTop - rightAdContainerPadBtm;
|
||||
|
||||
//calc closest ad width
|
||||
var bestAdWidth = 0;
|
||||
var bestAdHeight = 0;
|
||||
|
||||
var tempRightAdIndex = -1;
|
||||
var rightAdResArray = isMobile() ? rightAdResolutionsMobile : rightAdResolutions;
|
||||
|
||||
for (let i = 0; i < rightAdResArray.length; i++)
|
||||
{
|
||||
const adRes = rightAdResArray[i];
|
||||
|
||||
const adWidth = adRes.w;
|
||||
const adHeight = adRes.h;
|
||||
|
||||
if (adWidth <= maxAdWidth && adWidth >= bestAdWidth && adHeight <= maxAdHeight && adHeight >= bestAdHeight)
|
||||
{
|
||||
tempRightAdIndex = i;
|
||||
|
||||
bestAdWidth = adWidth;
|
||||
bestAdHeight = adHeight;
|
||||
}
|
||||
}
|
||||
|
||||
// console.log(`windowHeight: ${window.innerHeight} maxAdHeight: ${maxAdHeight} closestAdHeight: ${closestAdHeight}`);
|
||||
|
||||
//set ad container sizes
|
||||
if (tempRightAdIndex >= 0)
|
||||
{
|
||||
gameContainer.style.borderRight = offCanvasBorderStyle;
|
||||
|
||||
var containerWidth = bestAdWidth + rightAdContainerPadLeft + rightAdContainerPadRight + "px";
|
||||
rightAdContainer.style.display = "flex";
|
||||
rightAdContainer.style.minWidth = containerWidth;
|
||||
rightAdContainer.style.width = containerWidth;
|
||||
|
||||
rightAdPlaceholder.style.display = "flex";
|
||||
rightAdPlaceholder.style.width = bestAdWidth + "px";
|
||||
rightAdPlaceholder.style.height = bestAdHeight + "px";
|
||||
|
||||
if(debugAdContainers)
|
||||
{
|
||||
rightAdResText.style.display = "block";
|
||||
rightAdResText.innerHTML = `${bestAdWidth}x${bestAdHeight}`;
|
||||
}
|
||||
else
|
||||
{
|
||||
//rightAdPlaceholder.style.display = "none";
|
||||
rightAdResText.style.display = "none";
|
||||
}
|
||||
|
||||
//if we arent already showing an ad then request one
|
||||
if(currRightAdIndex != tempRightAdIndex)
|
||||
{
|
||||
currRightAdIndex = tempRightAdIndex;
|
||||
|
||||
const adTagIdToShow = rightAdResArray[currRightAdIndex].adId;
|
||||
|
||||
requestOffCanvasAd(rightAdResArray, adTagIdToShow);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
hideRightAdContainer();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
hideRightAdContainer();
|
||||
}
|
||||
}
|
||||
|
||||
function hideRightAdContainer()
|
||||
{
|
||||
gameContainer.style.borderRight = "0px";
|
||||
|
||||
rightAdContainer.style.display = "none";
|
||||
rightAdPlaceholder.style.display = "none";
|
||||
rightAdResText.style.display = "none";
|
||||
|
||||
hideOffCanvasAds(rightAdResolutions);
|
||||
hideOffCanvasAds(rightAdResolutionsMobile);
|
||||
|
||||
currRightAdIndex = -1;
|
||||
}
|
||||
|
||||
function hideAllOffCanvasAds()
|
||||
{
|
||||
//bottom
|
||||
hideOffCanvasAds(btmAdResolutions);
|
||||
hideOffCanvasAds(btmAdResolutionsMobile);
|
||||
currBtmAdIndex = -1;
|
||||
|
||||
//right
|
||||
hideOffCanvasAds(rightAdResolutions);
|
||||
hideOffCanvasAds(rightAdResolutionsMobile);
|
||||
currRightAdIndex = -1;
|
||||
}
|
||||
|
||||
function refreshAllOffCanvasAds()
|
||||
{
|
||||
updateOffCanvasAdContainers();
|
||||
}
|
||||
|
||||
function updateAdBlockerContainer()
|
||||
{
|
||||
if(!window.adblockDetected)
|
||||
{
|
||||
document.getElementById("btmAdBlockerContainer").style.display = "none";
|
||||
document.getElementById("rightAdBlockerContainer").style.display = "none";
|
||||
}
|
||||
}
|
||||
|
||||
function createOffCanvasAdDivs()
|
||||
{
|
||||
//bottom
|
||||
var btmAdResArray = isMobile() ? btmAdResolutionsMobile : btmAdResolutions;
|
||||
|
||||
btmAdResArray.forEach(btmAdRes => {
|
||||
var adDiv = document.createElement("div");
|
||||
adDiv.id = btmAdRes.adId;
|
||||
|
||||
if(setOffCanvasAdDivDimensions)
|
||||
{
|
||||
adDiv.style.width = btmAdRes.w + "px";
|
||||
adDiv.style.height = btmAdRes.h + "px";
|
||||
}
|
||||
|
||||
btmAdPlaceholder.appendChild(adDiv);
|
||||
});
|
||||
|
||||
//right
|
||||
var rightAdResArray = isMobile() ? rightAdResolutionsMobile : rightAdResolutions;
|
||||
|
||||
rightAdResArray.forEach(rightAdRes => {
|
||||
var adDiv = document.createElement("div");
|
||||
adDiv.id = rightAdRes.adId;
|
||||
|
||||
if(setOffCanvasAdDivDimensions)
|
||||
{
|
||||
adDiv.style.width = rightAdRes.w + "px";
|
||||
adDiv.style.height = rightAdRes.h + "px";
|
||||
}
|
||||
|
||||
rightAdPlaceholder.appendChild(adDiv);
|
||||
});
|
||||
}
|
||||
|
||||
function offCanvasAdsOnLoad()
|
||||
{
|
||||
createOffCanvasAdDivs();
|
||||
resizeOffCanvasAdContainers();
|
||||
updateAdBlockerContainer();
|
||||
}
|
||||
|
||||
function offCanvasAdsOnResize()
|
||||
{
|
||||
resizeOffCanvasAdContainers();
|
||||
}
|
||||
|
||||
function resizeOffCanvasAdContainers()
|
||||
{
|
||||
updateOffCanvasAdContainers();
|
||||
updateOffCanvasBorderCorner();
|
||||
}
|
||||
|
||||
sortAdResArrays();
|
||||
|
||||
window.addEventListener("load", offCanvasAdsOnLoad);
|
||||
window.addEventListener("resize", offCanvasAdsOnResize);
|
||||
|
||||
|
||||
// //CHEAT KEYS
|
||||
// function handleCheatKey(keyboardEvent)
|
||||
// {
|
||||
// var key = keyboardEvent.key;
|
||||
|
||||
// if (key == "b" || key == "B")
|
||||
// {
|
||||
// //Toggle bottom ad
|
||||
// showBtmAd = !showBtmAd;
|
||||
|
||||
// resizeContainers();
|
||||
|
||||
// console.log(`Toggle showBtmAd: ${showBtmAd}`);
|
||||
// }
|
||||
// else if (key == "r" || key == "R")
|
||||
// {
|
||||
// //Toggle right ad
|
||||
// showRightAd = !showRightAd;
|
||||
|
||||
// resizeContainers();
|
||||
|
||||
// console.log(`Toggle showRightAd: ${showRightAd}`);
|
||||
// }
|
||||
// else if (key == "=")
|
||||
// {
|
||||
// cheatCyclePadding(true);
|
||||
|
||||
// console.log("Inc padding");
|
||||
// }
|
||||
// else if (key == "-")
|
||||
// {
|
||||
// cheatCyclePadding(false);
|
||||
|
||||
// console.log("Dec padding");
|
||||
// }
|
||||
// else if (key == "x" || key == "X")
|
||||
// {
|
||||
// onlyShowOffCanvasAdsOnDeath = !onlyShowOffCanvasAdsOnDeath;
|
||||
|
||||
// if(onlyShowOffCanvasAdsOnDeath)
|
||||
// {
|
||||
// currRightAdIndex = -1;
|
||||
// currBtmAdIndex = -1;
|
||||
// }
|
||||
|
||||
// resizeContainers();
|
||||
|
||||
// console.log(`Toggle onlyShowOffCanvasAdsOnDeath: ${onlyShowOffCanvasAdsOnDeath}`);
|
||||
// }
|
||||
// }
|
||||
|
||||
// window.addEventListener("keypress", handleCheatKey)
|
||||
|
||||
// function cheatCyclePadding(increasePadding)
|
||||
// {
|
||||
// const maxPadding = 150;
|
||||
// const paddingInc = 10;
|
||||
|
||||
// //bottom padding
|
||||
// var btmAdContainerStyle = getComputedStyle(btmAdContainer);
|
||||
// var btmAdContainerPadLeft = parseInt(btmAdContainerStyle.getPropertyValue("padding-left"));
|
||||
// var btmAdContainerPadRight = parseInt(btmAdContainerStyle.getPropertyValue("padding-right"));
|
||||
// var btmAdContainerPadTop = parseInt(btmAdContainerStyle.getPropertyValue("padding-top"));
|
||||
// var btmAdContainerPadBtm = parseInt(btmAdContainerStyle.getPropertyValue("padding-bottom"));
|
||||
|
||||
// //right padding
|
||||
// var rightAdContainerStyle = getComputedStyle(rightAdContainer);
|
||||
// var rightAdContainerPadLeft = parseInt(rightAdContainerStyle.getPropertyValue("padding-left"));
|
||||
// var rightAdContainerPadRight = parseInt(rightAdContainerStyle.getPropertyValue("padding-right"));
|
||||
// var rightAdContainerPadTop = parseInt(rightAdContainerStyle.getPropertyValue("padding-top"));
|
||||
// var rightAdContainerPadBtm = parseInt(rightAdContainerStyle.getPropertyValue("padding-bottom"));
|
||||
|
||||
// if(increasePadding)
|
||||
// {
|
||||
// //btm
|
||||
// btmAdContainer.style.paddingLeft = Math.min(btmAdContainerPadLeft + paddingInc, maxPadding) + "px";
|
||||
// btmAdContainer.style.paddingRight = Math.min(btmAdContainerPadRight + paddingInc, maxPadding) + "px";
|
||||
// btmAdContainer.style.paddingTop = Math.min(btmAdContainerPadTop + paddingInc, maxPadding) + "px";
|
||||
// btmAdContainer.style.paddingBottom = Math.min(btmAdContainerPadBtm + paddingInc, maxPadding) + "px";
|
||||
|
||||
// //right
|
||||
// rightAdContainer.style.paddingLeft = Math.min(rightAdContainerPadLeft + paddingInc, maxPadding) + "px";
|
||||
// rightAdContainer.style.paddingRight = Math.min(rightAdContainerPadRight + paddingInc, maxPadding) + "px";
|
||||
// rightAdContainer.style.paddingTop = Math.min(rightAdContainerPadTop + paddingInc, maxPadding) + "px";
|
||||
// rightAdContainer.style.paddingBottom = Math.min(rightAdContainerPadBtm + paddingInc, maxPadding) + "px";
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// //btm
|
||||
// btmAdContainer.style.paddingLeft = Math.max(btmAdContainerPadLeft - paddingInc, 0) + "px";
|
||||
// btmAdContainer.style.paddingRight = Math.max(btmAdContainerPadRight - paddingInc, 0) + "px";
|
||||
// btmAdContainer.style.paddingTop = Math.max(btmAdContainerPadTop - paddingInc, 0) + "px";
|
||||
// btmAdContainer.style.paddingBottom = Math.max(btmAdContainerPadBtm - paddingInc, 0) + "px";
|
||||
|
||||
// //right
|
||||
// rightAdContainer.style.paddingLeft = Math.max(rightAdContainerPadLeft - paddingInc, 0) + "px";
|
||||
// rightAdContainer.style.paddingRight = Math.max(rightAdContainerPadRight - paddingInc, 0) + "px";
|
||||
// rightAdContainer.style.paddingTop = Math.max(rightAdContainerPadTop - paddingInc, 0) + "px";
|
||||
// rightAdContainer.style.paddingBottom = Math.max(rightAdContainerPadBtm - paddingInc, 0) + "px";
|
||||
// }
|
||||
|
||||
// resizeContainers();
|
||||
// }
|
@ -1,169 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
var gameContainer;
|
||||
function updateAdSizes()
|
||||
{
|
||||
if(gameContainer == null)
|
||||
{
|
||||
gameContainer = document.getElementById('gameContainer');
|
||||
}
|
||||
|
||||
if(gameContainer != null)
|
||||
{
|
||||
updateLongBanner();
|
||||
|
||||
if(!offCanvasAdsEnabled)
|
||||
{
|
||||
updateMainMenuBanner();
|
||||
updateWinBanner();
|
||||
updateSpectateBanner();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var mainMenuBanner;
|
||||
const defaultMainMenuScaleStr = "scale(100%, 100%)";
|
||||
const defaultMainMenuTranslateStr = "translate(0px, -50%)";
|
||||
function updateMainMenuBanner()
|
||||
{
|
||||
if(mainMenuBanner == null)
|
||||
{
|
||||
mainMenuBanner = document.getElementById(divIdMainMenuBanner);
|
||||
}
|
||||
|
||||
if(mainMenuBanner != null && mainMenuBanner.style.display !== "none")
|
||||
{
|
||||
var adContainerW = mainMenuBanner.offsetWidth;
|
||||
var adContainerH = mainMenuBanner.offsetHeight;
|
||||
var gameContainerH = gameContainer.offsetHeight;
|
||||
|
||||
if(adContainerH/gameContainerH > 0.75)
|
||||
{
|
||||
var newHeight = gameContainerH * 0.75;
|
||||
var newScale = newHeight / adContainerH;
|
||||
var scaleString = "scale( " + newScale + "," + newScale + ")";
|
||||
mainMenuBanner.style.transform = `${scaleString} ${defaultMainMenuTranslateStr}`;
|
||||
}
|
||||
else
|
||||
{
|
||||
mainMenuBanner.style.transform = `${defaultMainMenuScaleStr} ${defaultMainMenuTranslateStr}`
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var winBanner;
|
||||
const defaultWinCeremonyScaleStr = "scale(100%, 100%)";
|
||||
const defaultWinCeremonyTranslateStr = "translate(0px, 0px)"; //"translate(0px, -50%)"
|
||||
function updateWinBanner()
|
||||
{
|
||||
if(winBanner == null)
|
||||
{
|
||||
winBanner = document.getElementById(divIdWinCeremonyBanner);
|
||||
}
|
||||
|
||||
if(winBanner != null && winBanner.style.display !== "none")
|
||||
{
|
||||
var adContainerW = winBanner.offsetWidth;
|
||||
var adContainerH = winBanner.offsetHeight;
|
||||
var gameContainerH = gameContainer.offsetHeight;
|
||||
|
||||
if(adContainerH/gameContainerH > 0.75)
|
||||
{
|
||||
var newHeight = gameContainerH * 0.75;
|
||||
var newScale = newHeight / adContainerH;
|
||||
var scaleString = "scale( " + newScale + "," + newScale + ")";
|
||||
winBanner.style.transform = `${scaleString} ${defaultWinCeremonyTranslateStr}`;
|
||||
}
|
||||
else
|
||||
{
|
||||
winBanner.style.transform = `${defaultWinCeremonyScaleStr} ${defaultWinCeremonyTranslateStr}`
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var spectateBanner;
|
||||
const defaultSpectateScaleStr = "scale(100%, 100%)";
|
||||
const defaultSpectateTranslateStr = "translate(0px, 0px)"; //"translate(0px, -50%)"
|
||||
function updateSpectateBanner()
|
||||
{
|
||||
if(spectateBanner == null)
|
||||
{
|
||||
spectateBanner = document.getElementById(divIdSpectateBanner);
|
||||
}
|
||||
|
||||
if(spectateBanner != null && spectateBanner.style.display !== "none")
|
||||
{
|
||||
var adContainerW = spectateBanner.offsetWidth;
|
||||
var adContainerH = spectateBanner.offsetHeight;
|
||||
var gameContainerH = gameContainer.offsetHeight;
|
||||
|
||||
if(adContainerH/gameContainerH > 0.75)
|
||||
{
|
||||
var newHeight = gameContainerH * 0.75;
|
||||
var newScale = newHeight / adContainerH;
|
||||
var scaleString = "scale( " + newScale + "," + newScale + ")";
|
||||
spectateBanner.style.transform = `${scaleString} ${defaultSpectateTranslateStr}`;
|
||||
}
|
||||
else
|
||||
{
|
||||
spectateBanner.style.transform = `${defaultSpectateScaleStr} ${defaultSpectateTranslateStr}`
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var longBanner;
|
||||
function updateLongBanner()
|
||||
{
|
||||
if(longBanner == null)
|
||||
{
|
||||
longBanner = document.getElementById(divIdDeathBanner);
|
||||
|
||||
if(isMobile() && longBanner != null)
|
||||
{
|
||||
//revert from right to center for mobile
|
||||
longBanner.style.right = "auto";
|
||||
}
|
||||
}
|
||||
|
||||
if(longBanner != null && longBanner.style.display !== "none")
|
||||
{
|
||||
longBanner.style.bottom = 0 + "px";
|
||||
//longBanner.style.width = 100 + "vw";
|
||||
//longBanner.style.width = gameContainer.offsetWidth + "px";
|
||||
|
||||
var adContainerW = longBanner.offsetWidth;
|
||||
var adContainerH = longBanner.offsetHeight;
|
||||
var gameContainerH = gameContainer.offsetHeight;
|
||||
|
||||
if(isMobile())
|
||||
{
|
||||
longBanner.style.top = (gameContainerH - adContainerH) + "px";
|
||||
longBanner.style.transform = "scale( 1, 1) translate(0px, -10px)";
|
||||
}
|
||||
else
|
||||
{
|
||||
//reserve 30% screen height for horizontal ads, 75% for vertical ads
|
||||
let heightPercentage = (adContainerW > adContainerH) ? 0.3 : 0.75;
|
||||
|
||||
if(adContainerH/gameContainerH > heightPercentage)
|
||||
{
|
||||
const newHeight = gameContainerH * heightPercentage;
|
||||
const newScale = newHeight / adContainerH;
|
||||
const scaleString = "scale( " + newScale + "," + newScale + ")";
|
||||
//const offsetX = 0;
|
||||
const offsetX = (adContainerW - adContainerW*newScale)/2 - 10;
|
||||
const offsetY = (adContainerH - adContainerH*newScale)/2 - 10;
|
||||
const translateString = "translate(" + offsetX + "px, " + offsetY + "px)";
|
||||
longBanner.style.transform = translateString + " " + scaleString;
|
||||
}
|
||||
else
|
||||
{
|
||||
longBanner.style.transform = "scale( 1, 1) translate(-10px, -10px)";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//window.addEventListener("load", updateAdSizes);
|
||||
//window.addEventListener("resize", updateAdSizes);
|
||||
setInterval(updateAdSizes, 500);
|
@ -1,24 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
var rampCurrPath;
|
||||
var rampCurrAdUnitId;
|
||||
var rampCurrAdUnitType;
|
||||
const adUnitTypes = ["med_rect_atf", "med_rect_btf", "leaderboard_atf"];
|
||||
|
||||
function requestOffCanvasAd(adResArrayToHide, adTagIdToShow)
|
||||
{
|
||||
}
|
||||
|
||||
function hideOffCanvasAds(adResArray)
|
||||
{
|
||||
}
|
||||
|
||||
function rampInitialised()
|
||||
{
|
||||
return playwireRampInitialised;
|
||||
}
|
||||
|
||||
function rampVideoPlayerInitialised()
|
||||
{
|
||||
return rampInitialised() && ramp.settings.slots.rewarded_video !== undefined;
|
||||
}
|
@ -1,100 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
function hideAllAdUnits()
|
||||
{
|
||||
if(!rampInitialised())
|
||||
return;
|
||||
|
||||
if(typeof ramp.destroyUnits === "function" && rampCurrAdUnitId != null)
|
||||
{
|
||||
//patch fix: pass in currently used ad unit types instead of "all" as "all" was previously causing an issue relating to trying to also destroy the video player unit
|
||||
ramp.destroyUnits(adUnitTypes);
|
||||
//ramp.destroyUnits("all");
|
||||
|
||||
//set path to gamepage as no ad units are enabled for gamepage
|
||||
ramp.setPath("gamepage");
|
||||
|
||||
rampCurrAdUnitId = null;
|
||||
rampCurrAdUnitType = null;
|
||||
}
|
||||
}
|
||||
|
||||
function rampDisplayAdUnit(path, adUnitId, adUnitType)
|
||||
{
|
||||
if(!rampInitialised())
|
||||
return;
|
||||
|
||||
if (!isVideoAdPlaying && rampCurrAdUnitId != adUnitId && typeof ramp.setPath === "function" && typeof ramp.addUnits === "function")
|
||||
{
|
||||
hideAllAdUnits();
|
||||
|
||||
rampCurrPath = path;
|
||||
|
||||
ramp.setPath(path).then(() =>
|
||||
{
|
||||
var pwUnits = [
|
||||
{
|
||||
selectorId: adUnitId,
|
||||
type: adUnitType
|
||||
}
|
||||
];
|
||||
|
||||
rampCurrAdUnitId = adUnitId;
|
||||
rampCurrAdUnitType = adUnitType;
|
||||
|
||||
ramp.addUnits(pwUnits).then(() =>
|
||||
{
|
||||
ramp.displayUnits();
|
||||
}).catch((e) =>
|
||||
{
|
||||
ramp.displayUnits();
|
||||
});
|
||||
|
||||
}).catch((e) =>
|
||||
{
|
||||
console.log(`playwire setPath ${path} error: ${e}`);
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function requestDummyMainMenuAd()
|
||||
{
|
||||
rampDisplayAdUnit("premium-main", "pw_mainmenu_dummy", "med_rect_atf");
|
||||
}
|
||||
|
||||
function requestMainMenuAd()
|
||||
{
|
||||
rampDisplayAdUnit("mainmenu", "pw_mainmenu", "med_rect_atf");
|
||||
}
|
||||
|
||||
function hideMainMenuAd()
|
||||
{
|
||||
hideAllAdUnits();
|
||||
}
|
||||
|
||||
function requestWinCeremonyAd()
|
||||
{
|
||||
rampDisplayAdUnit("roundend", "pw_roundend", "med_rect_btf");
|
||||
}
|
||||
|
||||
function hideWinCeremonyAd()
|
||||
{
|
||||
hideAllAdUnits();
|
||||
}
|
||||
|
||||
//stubs
|
||||
function requestLoadingAd() {}
|
||||
function hideLoadingAd() {}
|
||||
function requestSpectateAd() {}
|
||||
function hideSpectateAd() {}
|
||||
|
||||
function requestDeathAd()
|
||||
{
|
||||
rampDisplayAdUnit("ondeath", "pw_ondeath", "leaderboard_atf");
|
||||
}
|
||||
|
||||
function hideDeathAd()
|
||||
{
|
||||
hideAllAdUnits();
|
||||
}
|
@ -1,250 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
function rampVideoPlayerInitialised()
|
||||
{
|
||||
return rampInitialised() && ramp.settings.slots.rewarded_video !== undefined;
|
||||
}
|
||||
|
||||
function showInterstitial(audioOn, interstitialType, interstitialName)
|
||||
{
|
||||
if(!rampVideoPlayerInitialised())
|
||||
{
|
||||
interstitialError(false);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isVideoAdPlaying && firebase.auth().currentUser != null)
|
||||
{
|
||||
isVideoAdPlaying = true;
|
||||
|
||||
var functionRef = firebase.functions().httpsCallable("getPlaywireRewardedVideoCodeNew");
|
||||
|
||||
functionRef(null).then((response) =>
|
||||
{
|
||||
window.PageOS.BUS.on('gotConfig', function(e)
|
||||
{
|
||||
addNonRewardedVideoStylingObserver();
|
||||
});
|
||||
|
||||
var pwVideoCode = response.data.code;
|
||||
|
||||
if (pwVideoCode !== undefined)
|
||||
{
|
||||
interstitialStart(false);
|
||||
|
||||
setRewardedVideoMsgBoxEnabled(false);
|
||||
|
||||
//Note we use the rewarded video player but don't actually reward the player
|
||||
//This is because there are issues on playwires side if we use both the rewarded and nonrewarded video players
|
||||
ramp.showRewardedVideo({
|
||||
userId: getCurrentUserId(),
|
||||
code: pwVideoCode,
|
||||
callback: (response) =>
|
||||
{
|
||||
isVideoAdPlaying = false;
|
||||
|
||||
ramp.closeRewardedVideo();
|
||||
|
||||
interstitialComplete(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
isVideoAdPlaying = false;
|
||||
|
||||
interstitialError(false);
|
||||
}
|
||||
|
||||
}).catch((error) =>
|
||||
{
|
||||
isVideoAdPlaying = false;
|
||||
|
||||
interstitialError(false);
|
||||
|
||||
var key = `getPlaywireRewardedVideoCodeNew_NonRewarded_${Date.now()}`;
|
||||
|
||||
SendDataToUnity("OnFunctionError", key, error.message);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const boltRewardedVideoPlayerId = "tyche_precontent_player";
|
||||
|
||||
function tryInitRewardedInterstitial(audioOn)
|
||||
{
|
||||
if(!window.adblockDetected)
|
||||
{
|
||||
if(rampVideoPlayerInitialised())
|
||||
{
|
||||
window.unityGame.SendMessage(unityFirebaseGameOjbectName, "RewardedInterstitialAvailable");
|
||||
}
|
||||
else
|
||||
{
|
||||
//poll until video player is ready
|
||||
const checkVideoPlayerInterval = setInterval(() => {
|
||||
//player isnt ready => do nothing
|
||||
if (!rampVideoPlayerInitialised())
|
||||
return;
|
||||
|
||||
//player is ready => stop polling and send message to unity
|
||||
clearInterval(checkVideoPlayerInterval);
|
||||
window.unityGame.SendMessage(unityFirebaseGameOjbectName, "RewardedInterstitialAvailable");
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function tryShowRewardedInterstitial(audioOn)
|
||||
{
|
||||
if(!rampVideoPlayerInitialised())
|
||||
{
|
||||
interstitialNoFill(true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isVideoAdPlaying && firebase.auth().currentUser != null)
|
||||
{
|
||||
isVideoAdPlaying = true;
|
||||
|
||||
var functionRef = firebase.functions().httpsCallable("getPlaywireRewardedVideoCodeNew");
|
||||
|
||||
functionRef(null).then((response) =>
|
||||
{
|
||||
var pwVideoCode = response.data.code;
|
||||
|
||||
if (pwVideoCode !== undefined)
|
||||
{
|
||||
interstitialStart(true);
|
||||
|
||||
setRewardedVideoMsgBoxEnabled(true);
|
||||
|
||||
ramp.showRewardedVideo({
|
||||
userId: getCurrentUserId(),
|
||||
code: pwVideoCode,
|
||||
callback: (response) =>
|
||||
{
|
||||
isVideoAdPlaying = false;
|
||||
|
||||
ramp.closeRewardedVideo();
|
||||
|
||||
//patch fix: removed check for rewardUser as it wasnt been set when displaying static fallback ads when rewarded video fill was unavailable
|
||||
//also it isnt neede as we only use this call for rewarded videos
|
||||
//if(response.adPlayed && response.rewardUser)
|
||||
if(response.adPlayed)
|
||||
{
|
||||
interstitialComplete(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
interstitialNoFill(true);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
isVideoAdPlaying = false;
|
||||
|
||||
interstitialError(true);
|
||||
}
|
||||
|
||||
}).catch((error) =>
|
||||
{
|
||||
isVideoAdPlaying = false;
|
||||
|
||||
interstitialError(true);
|
||||
|
||||
var key = `getPlaywireRewardedVideoCodeNew_${Date.now()}`;
|
||||
|
||||
SendDataToUnity("OnFunctionError", key, error.message);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const rewardedVideoMsgBoxId = "tyche_msg_box";
|
||||
var rewardedVideoMsgBox;
|
||||
|
||||
function setRewardedVideoMsgBoxEnabled(enabled)
|
||||
{
|
||||
if(rewardedVideoMsgBox == null)
|
||||
{
|
||||
rewardedVideoMsgBox = document.getElementById(rewardedVideoMsgBoxId);
|
||||
}
|
||||
|
||||
if(rewardedVideoMsgBox !== null && rewardedVideoMsgBox.style !== null)
|
||||
{
|
||||
rewardedVideoMsgBox.style.display = enabled ? "block" : "none";
|
||||
}
|
||||
}
|
||||
|
||||
function addNonRewardedVideoStylingObserver()
|
||||
{
|
||||
const targetNode = document.getElementById('ramp_rewarded_container');
|
||||
|
||||
const boxconfig = { attributes: true, childList: true, subtree: true };
|
||||
|
||||
const callback = function (mutationList, observer)
|
||||
{
|
||||
for (const mutation of mutationList)
|
||||
{
|
||||
mutation.addedNodes.forEach(addedNode =>
|
||||
{
|
||||
var styleNode = document.querySelector('#tyche_msg_box + div')
|
||||
if (styleNode.style.height)
|
||||
{
|
||||
styleNode.style = 'width: 100%; height: 100vh; border: 4px solid rgba(255, 255, 255, 0.2); box-sizing: border-box;'
|
||||
}
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
const msgBoxObserver = new MutationObserver(callback);
|
||||
msgBoxObserver.observe(targetNode, boxconfig);
|
||||
}
|
||||
|
||||
//--------- OLD NON REWARDED PLAYWIRE VIDEO PLAYER START ------------
|
||||
|
||||
// const boltInterstitialVideoPlayerId = "tyche_trendi_video";
|
||||
// var rampPathPreInterstital;
|
||||
|
||||
// function showInterstitial(audioOn, interstitialType, interstitialName)
|
||||
// {
|
||||
// rampPathPreInterstital = rampCurrPath;
|
||||
|
||||
// rampChangePathWrapper("roundendvid");
|
||||
|
||||
// //vid container
|
||||
// var pwVideoContainer = document.getElementById("pw-video-container");
|
||||
// pwVideoContainer.style.display = "block";
|
||||
|
||||
// window.PageOS.BUS.on('gotConfig', function(e)
|
||||
// {
|
||||
// trySetupBoltCallbacks();
|
||||
// });
|
||||
// }
|
||||
|
||||
// function trySetupBoltCallbacks()
|
||||
// {
|
||||
// if (typeof Bolt !== 'undefined')
|
||||
// {
|
||||
// Bolt.on(boltInterstitialVideoPlayerId, Bolt.BOLT_CONTENT_COMPLETE, hideInterstitial);
|
||||
// Bolt.on(boltInterstitialVideoPlayerId, Bolt.BOLT_AD_COMPLETE, hideInterstitial);
|
||||
// }
|
||||
// }
|
||||
|
||||
// function hideInterstitial()
|
||||
// {
|
||||
// if (typeof Bolt !== 'undefined')
|
||||
// {
|
||||
// Bolt.removeVideo(boltInterstitialVideoPlayerId, true);
|
||||
// }
|
||||
|
||||
// rampChangePathWrapper(rampPathPreInterstital);
|
||||
|
||||
// //vid container
|
||||
// var pwVideoContainer = document.getElementById("pw-video-container");
|
||||
// pwVideoContainer.style.display = "none";
|
||||
// }
|
||||
|
||||
//--------- OLD NON REWARDED PLAYWIRE VIDEO PLAYER END ------------
|
@ -1,516 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
var unityFirebaseGameOjbectName = 'JavascriptMessageReceiver';
|
||||
|
||||
var firstLoad = true;
|
||||
|
||||
function onAuthStateChanged(user) {
|
||||
if(!user)
|
||||
{
|
||||
if(firstLoad)
|
||||
{
|
||||
if(window.customAuthToken != null)
|
||||
{
|
||||
signInWithCustomToken(window.customAuthToken);
|
||||
}
|
||||
else
|
||||
{
|
||||
signInAnonymously();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
getUserNoAdsEndTimestamp();
|
||||
sendAuthDataToUnity();
|
||||
}
|
||||
firstLoad = false;
|
||||
}
|
||||
|
||||
function signInWithCustomToken(token)
|
||||
{
|
||||
firebase.auth().signInWithCustomToken(token)
|
||||
.then((userCredential) => {
|
||||
console.log("signInWithCustomToken Success");
|
||||
})
|
||||
.catch(function(error)
|
||||
{
|
||||
console.log("error logging in " + error.code);
|
||||
console.error(error);
|
||||
window.unityGame.SendMessage(unityFirebaseGameOjbectName, "firebaseSignInWithEmailFailed", error.message);
|
||||
});
|
||||
}
|
||||
|
||||
function signInAnonymously()
|
||||
{
|
||||
firebase.auth().signInAnonymously().catch(function(error) {
|
||||
var errorCode = error.code;
|
||||
console.log("error logging in " + errorCode);
|
||||
console.error(error);
|
||||
});
|
||||
}
|
||||
|
||||
function signInWithEmail(email, password)
|
||||
{
|
||||
firebase.auth().signInWithEmailAndPassword(email, password)
|
||||
.then((userCredential) => {
|
||||
console.log("signInWithEmailAndPassword Success");
|
||||
})
|
||||
.catch(function(error)
|
||||
{
|
||||
console.log("error logging in " + error.code);
|
||||
console.error(error);
|
||||
window.unityGame.SendMessage(unityFirebaseGameOjbectName, "firebaseSignInWithEmailFailed", error.message);
|
||||
});
|
||||
}
|
||||
|
||||
function linkUserWithEmail(email, password)
|
||||
{
|
||||
if(firebase.auth().currentUser != null && firebase.auth().currentUser.isAnonymous)
|
||||
{
|
||||
var credential = firebase.auth.EmailAuthProvider.credential(email, password);
|
||||
firebase.auth().currentUser.linkWithCredential(credential).then(function(user) {
|
||||
console.log("Anonymous account successfully upgraded", user);
|
||||
sendAuthDataToUnity();
|
||||
}, function(error) {
|
||||
console.log("Error upgrading anonymous account", error);
|
||||
console.error(error);
|
||||
window.unityGame.SendMessage(unityFirebaseGameOjbectName, "firebaseLinkUserWithEmailFailed", error.message);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//@podonnell: Turn off linkWithRedirect for mobile etc. as this was previously only being used because linkWithPopup was causing issues
|
||||
//These seem to have been fixed at some stage probably some upgrade of firebase
|
||||
// function checkForRedirect()
|
||||
// {
|
||||
// firebase.auth().getRedirectResult().then(function(result)
|
||||
// {
|
||||
// console.log("linkOrSignInWithGoogle:success");
|
||||
// sendAuthDataToUnity();
|
||||
// }, function(error)
|
||||
// {
|
||||
// if(error.code == "auth/credential-already-in-use")
|
||||
// {
|
||||
// console.log("linkOrSignInWithGoogle:fail auth/credential-already-in-use try signInWithCredential");
|
||||
// firebase.auth().signInWithCredential(error.credential).catch(function(error)
|
||||
// {
|
||||
// console.log("signInWithCredential:: Error logging in " + error.code);
|
||||
// console.error(error);
|
||||
// window.unityGame.SendMessage(unityFirebaseGameOjbectName, "firebaseSignInWithEmailFailed", error.message);
|
||||
// });
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// console.log("linkOrSignInWithGoogle:: Error logging in " + error.code);
|
||||
// console.error(error);
|
||||
// window.unityGame.SendMessage(unityFirebaseGameOjbectName, "firebaseLinkUserWithEmailFailed", error.message);
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
function linkOrSignInWithGoogle()
|
||||
{
|
||||
var provider = new firebase.auth.GoogleAuthProvider();
|
||||
|
||||
if(firebase.auth().currentUser != null && firebase.auth().currentUser.isAnonymous)
|
||||
{
|
||||
//@podonnell: Turn off linkWithRedirect for mobile etc. as this was previously only being used because linkWithPopup was causing issues
|
||||
//These seem to have been fixed at some stage probably some upgrade of firebase
|
||||
// var isSafariBrowser = (navigator.userAgent.indexOf('Safari') > -1 && navigator.userAgent.indexOf('Chrome') <= -1);
|
||||
// if(isMobile() || isSafariBrowser)
|
||||
// {
|
||||
// firebase.auth().currentUser.linkWithRedirect(provider);
|
||||
// }
|
||||
// else
|
||||
{
|
||||
firebase.auth().currentUser.linkWithPopup(provider).then((result) =>
|
||||
{
|
||||
console.log("linkOrSignInWithGoogle:: Success");
|
||||
sendAuthDataToUnity();
|
||||
}).catch((error) =>
|
||||
{
|
||||
if(error.code == "auth/credential-already-in-use")
|
||||
{
|
||||
firebase.auth().signInWithCredential(error.credential).catch(function(error)
|
||||
{
|
||||
console.log("signInWithCredential:: Error logging in " + error.code);
|
||||
console.error(error);
|
||||
window.unityGame.SendMessage(unityFirebaseGameOjbectName, "firebaseSignInWithEmailFailed", error.message);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
console.log("linkOrSignInWithGoogle:: Error logging in " + error.code);
|
||||
console.error(error);
|
||||
window.unityGame.SendMessage(unityFirebaseGameOjbectName, "firebaseLinkUserWithEmailFailed", error.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function linkOrSignInWithApple()
|
||||
{
|
||||
var provider = new firebase.auth.OAuthProvider('apple.com');
|
||||
|
||||
if(firebase.auth().currentUser != null && firebase.auth().currentUser.isAnonymous)
|
||||
{
|
||||
//@podonnell: Turn off linkWithRedirect for mobile etc. as this was previously only being used because linkWithPopup was causing issues
|
||||
//These seem to have been fixed at some stage probably some upgrade of firebase
|
||||
// var isSafariBrowser = (navigator.userAgent.indexOf('Safari') > -1 && navigator.userAgent.indexOf('Chrome') <= -1);
|
||||
// if(isMobile() || isSafariBrowser)
|
||||
// {
|
||||
// firebase.auth().currentUser.linkWithRedirect(provider);
|
||||
// }
|
||||
// else
|
||||
{
|
||||
firebase.auth().currentUser.linkWithPopup(provider).then((result) =>
|
||||
{
|
||||
console.log("linkOrSignInWithApple:: Success");
|
||||
sendAuthDataToUnity();
|
||||
}).catch((error) =>
|
||||
{
|
||||
if(error.code == "auth/credential-already-in-use")
|
||||
{
|
||||
firebase.auth().signInWithCredential(error.credential).catch(function(error)
|
||||
{
|
||||
console.log("signInWithCredential:: Error logging in " + error.code);
|
||||
console.error(error);
|
||||
window.unityGame.SendMessage(unityFirebaseGameOjbectName, "firebaseSignInWithEmailFailed", error.message);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
console.log("linkOrSignInWithApple:: Error logging in " + error.code);
|
||||
console.error(error);
|
||||
window.unityGame.SendMessage(unityFirebaseGameOjbectName, "firebaseLinkUserWithEmailFailed", error.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function signOut()
|
||||
{
|
||||
firebase.auth().signOut().then(function() {
|
||||
console.log("signOut:: Success");
|
||||
signInAnonymously();
|
||||
}).catch(function(error) {
|
||||
console.log("signOut:: Failed ");
|
||||
console.error(error);
|
||||
});
|
||||
}
|
||||
|
||||
function sendAuthDataToUnity()
|
||||
{
|
||||
if(window.unityGame != null && firebase.auth().currentUser != null)
|
||||
{
|
||||
var firebaseUid = firebase.auth().currentUser.uid;
|
||||
var isAnon = firebase.auth().currentUser.isAnonymous;
|
||||
var data = {authToken:"",uid:firebaseUid,isAnonymous:isAnon};
|
||||
var dataJson = JSON.stringify(data);
|
||||
window.unityGame.SendMessage(unityFirebaseGameOjbectName, 'SetAuthToken', dataJson);
|
||||
}
|
||||
}
|
||||
|
||||
function sendPasswordResetEmail(emailAddress)
|
||||
{
|
||||
firebase.auth().sendPasswordResetEmail(emailAddress).then(function() {
|
||||
console.log("sendPasswordResetEmail:: Success");
|
||||
window.unityGame.SendMessage(unityFirebaseGameOjbectName, "SendPasswordResetEmailSuccess");
|
||||
}).catch(function(error) {
|
||||
console.log("sendPasswordResetEmail:: Failed ");
|
||||
window.unityGame.SendMessage(unityFirebaseGameOjbectName, "SendPasswordResetEmailFailed", error.message);
|
||||
console.error(error);
|
||||
});
|
||||
}
|
||||
|
||||
function getValueTT(nodeKey)
|
||||
{
|
||||
const dbRef = firebase.database().ref();
|
||||
dbRef.child(nodeKey).once('value').then((snapshot) => {
|
||||
if (snapshot.exists())
|
||||
{
|
||||
var valJsonStr = JSON.stringify(snapshot.val());
|
||||
SendDataToUnity("OnGetValueSuccess", nodeKey, valJsonStr);
|
||||
}
|
||||
else
|
||||
{
|
||||
window.unityGame.SendMessage(unityFirebaseGameOjbectName, "OnGetValueEmptySuccess", nodeKey);
|
||||
}
|
||||
}).catch((error) =>
|
||||
{
|
||||
window.unityGame.SendMessage(unityFirebaseGameOjbectName, "OnGetValueError", nodeKey, error.message);
|
||||
console.error(error);
|
||||
});
|
||||
}
|
||||
|
||||
function SendDataToUnity(functionName, nk, ds)
|
||||
{
|
||||
var obj =
|
||||
{
|
||||
nodeKey: nk,
|
||||
dataStr: ds
|
||||
}
|
||||
|
||||
window.unityGame.SendMessage(unityFirebaseGameOjbectName, functionName, JSON.stringify(obj));
|
||||
}
|
||||
|
||||
|
||||
function SendResponseToUnity(functionName, k, resonseData)
|
||||
{
|
||||
resonseData["key"] = k;
|
||||
|
||||
window.unityGame.SendMessage(unityFirebaseGameOjbectName, functionName, JSON.stringify(resonseData));
|
||||
}
|
||||
|
||||
function setValueTT(nodeKey, jsonData)
|
||||
{
|
||||
if(firebase.auth().currentUser != null)
|
||||
{
|
||||
const dbRef = firebase.database().ref();
|
||||
var jsonObj = JSON.parse(jsonData);
|
||||
dbRef.child(nodeKey).set(jsonObj, (error) => {
|
||||
if (error) {
|
||||
console.log("auth.js::setValue - Error " + nodeKey);
|
||||
SendDataToUnity("OnSetValueError", nodeKey, error.message);
|
||||
} else {
|
||||
window.unityGame.SendMessage(unityFirebaseGameOjbectName, "OnSetValueSuccess", nodeKey);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function removeValueTT(nodeKey)
|
||||
{
|
||||
if(firebase.auth().currentUser != null)
|
||||
{
|
||||
const dbRef = firebase.database().ref();
|
||||
dbRef.child(nodeKey).remove()
|
||||
.then(function(){
|
||||
window.unityGame.SendMessage(unityFirebaseGameOjbectName, "OnRemoveValueSuccess", nodeKey);
|
||||
})
|
||||
.catch(function(error){
|
||||
console.log("auth.js::removeValueTT error");
|
||||
SendDataToUnity("OnRemoveValueError", nodeKey, error.message);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function updateValueTT(nodeKey, jsonData)
|
||||
{
|
||||
if(firebase.auth().currentUser != null)
|
||||
{
|
||||
const dbRef = firebase.database().ref();
|
||||
var jsonObj = JSON.parse(jsonData);
|
||||
dbRef.child(nodeKey).update(jsonObj, (error) => {
|
||||
if (error) {
|
||||
console.log("auth.js::updateValue Error " + nodeKey);
|
||||
SendDataToUnity( "OnUpdateValueError", nodeKey, error.message);
|
||||
} else {
|
||||
window.unityGame.SendMessage(unityFirebaseGameOjbectName, "OnUpdateValueSuccess", nodeKey);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
var cloudFunctionSuccess = 0;
|
||||
var cloudFunctionFail = 0;
|
||||
|
||||
var regions = ["us-central1", "us-east1", "europe-west1"];
|
||||
var lastError = "internal";
|
||||
|
||||
async function callCloudFunction(functionId, jsonData, key)
|
||||
{
|
||||
var success = false;
|
||||
for(var i=0;i<regions.length; i++)
|
||||
{
|
||||
var success = await callCloudFunctionNew(functionId, jsonData, key, regions[i], i);
|
||||
if(success){ break; }
|
||||
}
|
||||
|
||||
if(!success)
|
||||
{
|
||||
SendDataToUnity( "OnFunctionError", key, lastError);
|
||||
}
|
||||
}
|
||||
|
||||
async function callCloudFunctionNew(functionId, jsonData, key, region, count)
|
||||
{
|
||||
if(firebase.auth().currentUser != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
const dataObject = JSON.parse(jsonData);
|
||||
var functionRef = firebase.app().functions(region).httpsCallable(functionId + "Multi");
|
||||
|
||||
var fbResponse = await functionRef(dataObject);
|
||||
if(fbResponse != null)
|
||||
{
|
||||
var gameResponse = fbResponse.data;
|
||||
|
||||
if(gameResponse != null)
|
||||
{
|
||||
SendResponseToUnity( "OnFunctionComplete", key, gameResponse);
|
||||
cloudFunctionSuccess++;
|
||||
if(!gameResponse.result)
|
||||
{
|
||||
logCloudFunctionError("v5-" + count + "-f", jsonData, gameResponse.debugMessage, functionId);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
logCloudFunctionError("v5-" + count + "-r", "null game response", functionId);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
logCloudFunctionError("v5-" + count + "-n", jsonData, "null FB response", functionId);
|
||||
return false;
|
||||
}
|
||||
} catch (error)
|
||||
{
|
||||
cloudFunctionFail++;
|
||||
logCloudFunctionError("v5-" + count + "-e", jsonData, error.message, functionId);
|
||||
lastError = error.message;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const logCloudFunctionErrors = false;
|
||||
function logCloudFunctionError(debugErrorRootNode, jsonData, message, functionId)
|
||||
{
|
||||
if(logCloudFunctionErrors)
|
||||
{
|
||||
var firebaseUid = firebase.auth().currentUser.uid;
|
||||
var currentTime = new Date().getTime();
|
||||
var debugErrorNode = "cferror/" + debugErrorRootNode + "/" + firebaseUid + "/" + functionId + "/" + currentTime;
|
||||
const dbRef = firebase.database().ref();
|
||||
dbRef.child(debugErrorNode).set({
|
||||
errorData: jsonData,
|
||||
os: getOS(),
|
||||
time: currentTime,
|
||||
successCount: cloudFunctionSuccess,
|
||||
failCound: cloudFunctionFail,
|
||||
errorMessage: message
|
||||
}, (setValueError) =>
|
||||
{
|
||||
if (setValueError)
|
||||
{
|
||||
console.log("logCloudFunctionError setValueError:: " + setValueError.message);
|
||||
} else
|
||||
{
|
||||
var debugErrorWriteSuccessNode = "cferror/" + debugErrorRootNode + "/" + firebaseUid + "/" + functionId + "/" + currentTime + "/successTime";
|
||||
var successTime = new Date().getTime();
|
||||
dbRef.child(debugErrorWriteSuccessNode).set(successTime);
|
||||
//console.log("logCloudFunctionError Success");
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
console.log("logCloudFunctionError:: " + debugErrorRootNode + " " + message);
|
||||
}
|
||||
}
|
||||
|
||||
function logCloudFunctionSuccess(debugErrorRootNode, jsonData, functionId)
|
||||
{
|
||||
var firebaseUid = firebase.auth().currentUser.uid;
|
||||
var currentTime = new Date().getTime();
|
||||
var debugErrorNode = "cferror/" + debugErrorRootNode + "/" + firebaseUid + "/" + functionId + "/" + currentTime;
|
||||
const dbRef = firebase.database().ref();
|
||||
|
||||
dbRef.child(debugErrorNode).set({
|
||||
errorData: jsonData,
|
||||
os: getOS(),
|
||||
time : currentTime,
|
||||
successCount : cloudFunctionSuccess,
|
||||
failCount : cloudFunctionFail,
|
||||
}, (setValueError) => {
|
||||
if (setValueError) {
|
||||
console.log("logCloudFunctionSuccess setValueError:: " + setValueError.message);
|
||||
|
||||
} else {
|
||||
console.log("logCloudFunctionSuccess Success ");
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function getCurrentUserId()
|
||||
{
|
||||
if(firebase.auth().currentUser != null)
|
||||
{
|
||||
return firebase.auth().currentUser.uid;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
function getCurrentUserIsAnon()
|
||||
{
|
||||
if(firebase.auth().currentUser != null)
|
||||
{
|
||||
return firebase.auth().currentUser.isAnonymous;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
var userNoAdsEndTimestamp;
|
||||
function getUserNoAdsEndTimestamp()
|
||||
{
|
||||
if (typeof firebase !== 'undefined' && firebase.database() != null && firebase.auth() != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
var uid = getCurrentUserId();
|
||||
|
||||
if(uid != null && uid !== "")
|
||||
{
|
||||
const dbRef = firebase.database().ref();
|
||||
|
||||
dbRef.child(`users/${uid}/udro/noAdsEndTimestamp`).once("value").then((snapshot) =>
|
||||
{
|
||||
if (snapshot.exists())
|
||||
{
|
||||
userNoAdsEndTimestamp = snapshot.val();
|
||||
}
|
||||
else
|
||||
{
|
||||
userNoAdsEndTimestamp = 0;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
console.log(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
window.addEventListener('load', function() {
|
||||
console.log('Init Auth');
|
||||
if (typeof firebase !== 'undefined' && firebase.auth() != null)
|
||||
{
|
||||
firebase.auth().onAuthStateChanged(onAuthStateChanged);
|
||||
|
||||
//@podonnell: Turn off linkWithRedirect for mobile etc. as this was previously only being used because linkWithPopup was causing issues
|
||||
//These seem to have been fixed at some stage probably some upgrade of firebase
|
||||
//checkForRedirect();
|
||||
}
|
||||
}, false);
|
||||
|
||||
|
||||
function getBrowser()
|
||||
{
|
||||
return window.navigator.userAgent;
|
||||
}
|
||||
|
||||
function getBrowserVisibilityState()
|
||||
{
|
||||
return document.visibilityState;
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
// Used for detecting if ad blockers are enabled
|
||||
var e=document.createElement('div');
|
||||
e.id='sklocalscriptbait';
|
||||
e.style.display='none';
|
||||
document.body.appendChild(e);
|
@ -1,44 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
if(typeof(Worker) !== "undefined")
|
||||
{
|
||||
const checkTimeDelay = 500;
|
||||
let consoleOpen = false;
|
||||
let checkTimestamp = Date.now();
|
||||
|
||||
const consoleCheckerThread = new Worker(ccWorkerScriptSrc);
|
||||
|
||||
consoleCheckerThread.addEventListener("message", (msg) =>
|
||||
{
|
||||
checkTimestamp = msg.data;
|
||||
});
|
||||
|
||||
setInterval(() =>
|
||||
{
|
||||
const wasConsoleOpen = consoleOpen;
|
||||
consoleOpen = (Date.now() - checkTimestamp > checkTimeDelay);
|
||||
|
||||
if(consoleOpen && !wasConsoleOpen)
|
||||
{
|
||||
console.log("%cSTOP!", "color:red; font-style:heavy; font-size:75px; font-weight:900; text-shadow:2px 2px 0 rgb(0,0,0)");
|
||||
console.log("%cThis is a browser feature intended for developers. If someone told you to copy and paste something here, there is a good chance that they are attempting to gain access to your account and personal information!", "font-size:20px;");
|
||||
}
|
||||
}, checkTimeDelay);
|
||||
|
||||
////Alternative just to pause lock up debugger when console is open
|
||||
// (function pauseGameWhenConsoleOpen()
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// (function pauseDebugger()
|
||||
// {
|
||||
// debugger;
|
||||
// pauseDebugger()
|
||||
// })()
|
||||
// }
|
||||
// catch (e)
|
||||
// {
|
||||
// setTimeout(pauseGameWhenConsoleOpen, 5000)
|
||||
// }
|
||||
// })()
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
setInterval(() =>
|
||||
{
|
||||
self.postMessage(Date.now());
|
||||
debugger;
|
||||
}, self.checkTimeDelay);
|
@ -1,3 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
setOffCanvasAdDivDimensions = true;
|
@ -1,17 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
enableFirebaseAnalytics = false;
|
||||
|
||||
var displayAdProvider = AdProviderDummy;
|
||||
var videoAdProvider = AdProviderDummy;
|
||||
|
||||
pwCommonScriptSrc = ".proxy/scripts/ads-pw-common.js";
|
||||
pwDisplayScriptSrc = ".proxy/scripts/ads-pw-display.js";
|
||||
pwVideoScriptSrc = ".proxy/scripts/ads-pw-video.js";
|
||||
adinplayDisplayScriptSrc = ".proxy/scripts/ads-adinplay-display.js";
|
||||
adinplayVideoScriptSrc = ".proxy/scripts/ads-adinplay-video.js";
|
||||
googleH5GamesVideoScriptSrc = ".proxy/scripts/ads-google-h5-games-video.js";
|
||||
|
||||
|
||||
baitScriptSrc = ".proxy/scripts/banger.js";
|
||||
ccWorkerScriptSrc = ".proxy/scripts/ccWorker.js";
|
@ -1,76 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
let enableFirebaseAnalytics = true;
|
||||
|
||||
//ADS
|
||||
const AdProviderPlaywire = "Playwire";
|
||||
const AdProviderGoogleH5Games = "GoogleH5Games";
|
||||
const AdProviderAdinplay = "AdinPlay";
|
||||
const AdProviderDummy = "None";
|
||||
var displayAdProvider = AdProviderAdinplay;
|
||||
var videoAdProvider = AdProviderAdinplay;
|
||||
|
||||
var playwireRampInitialised = false;
|
||||
|
||||
var pwCommonScriptSrc = "scripts/ads-pw-common.js";
|
||||
var pwDisplayScriptSrc = "scripts/ads-pw-display.js";
|
||||
var pwVideoScriptSrc = "scripts/ads-pw-video.js";
|
||||
var adinplayDisplayScriptSrc = "scripts/ads-adinplay-display.js";
|
||||
var adinplayVideoScriptSrc = "scripts/ads-adinplay-video.js";
|
||||
var googleH5GamesVideoScriptSrc = "scripts/ads-google-h5-games-video.js";
|
||||
var dummyDisplayScriptSrc = "scripts/ads-dummy-display.js";
|
||||
var dummyVideoScriptSrc = "scripts/ads-dummy-video.js";
|
||||
|
||||
function isPlaywireEnabled()
|
||||
{
|
||||
return displayAdProvider === AdProviderPlaywire || videoAdProvider === AdProviderPlaywire;
|
||||
}
|
||||
|
||||
function isAdinPlayEnabled()
|
||||
{
|
||||
return displayAdProvider === AdProviderAdinplay || videoAdProvider === AdProviderAdinplay;
|
||||
}
|
||||
|
||||
function isGoogleH5GamesEnabled()
|
||||
{
|
||||
return videoAdProvider === AdProviderGoogleH5Games;
|
||||
}
|
||||
|
||||
//OFF CANVAS ADS
|
||||
var debugAdContainers = false;
|
||||
var offCanvasAdsEnabled = false;
|
||||
var showBtmAd = false;
|
||||
var showRightAd = true;
|
||||
var setOffCanvasAdDivDimensions = false; //false by default, true for crazygames
|
||||
var onlyShowOffCanvasAdsOnDeath = false;
|
||||
|
||||
var maxAdWidthPercentage = 0.25;
|
||||
var maxAdHeightPercentage = 0.25;
|
||||
var offCanvasBorderSize = "5";
|
||||
var offCanvasBorderStyle = `#99c7fc ${offCanvasBorderSize}px solid`;
|
||||
var offCanvasBorderBtmRightCornerRadiusStyle = "8px";
|
||||
|
||||
var btmAdResolutions = [
|
||||
{ w: 970, h: 250, adId: "smashkarts-io_970x250_2" },
|
||||
{ w: 970, h: 90, adId: "smashkarts-io_970x90" },
|
||||
{ w: 728, h: 90, adId: "smashkarts-io_728x90_2" },
|
||||
];
|
||||
|
||||
var rightAdResolutions = [
|
||||
{ w: 336, h: 1050, adId: "smashkarts-io_336x1050" },
|
||||
{ w: 300, h: 600, adId: "smashkarts-io_300x600" },
|
||||
{ w: 160, h: 600, adId: "smashkarts-io_160x600" },
|
||||
];
|
||||
|
||||
var btmAdResolutionsMobile = [
|
||||
{ w: 320, h: 50, adId: "smashkarts-io_320x50" },
|
||||
];
|
||||
|
||||
var rightAdResolutionsMobile = [
|
||||
];
|
||||
|
||||
var currBtmAdIndex = -1;
|
||||
var currRightAdIndex = -1;
|
||||
|
||||
var baitScriptSrc = "scripts/banger.js";
|
||||
var ccWorkerScriptSrc = "scripts/ccWorker.js";
|
@ -1,2 +0,0 @@
|
||||
const IS_DEV = true;
|
||||
const DISCORD_CLIENT_ID = "1283039649975107584";
|
@ -1,2 +0,0 @@
|
||||
const IS_DEV = false;
|
||||
const DISCORD_CLIENT_ID = "1217877285923979415";
|
@ -1,268 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
function setV(val2)
|
||||
{
|
||||
if(window.unityGame != null)
|
||||
{
|
||||
window.unityGame.SendMessage(unityFirebaseGameOjbectName, "V2", val2);
|
||||
}
|
||||
}
|
||||
|
||||
function isMobile()
|
||||
{
|
||||
var isMobile = RegExp(/Android|webOS|iPhone|iPod|iPad/i).test(navigator.userAgent);
|
||||
return isMobile || isIpad();
|
||||
}
|
||||
|
||||
function isTablet()
|
||||
{
|
||||
var userAgent = navigator.userAgent.toLowerCase();
|
||||
var isAndroidTablet = ((userAgent.search("android") > -1) && !(userAgent.search("mobile") > -1));
|
||||
|
||||
return isAndroidTablet || isIpad();
|
||||
}
|
||||
|
||||
function isIpad()
|
||||
{
|
||||
var isIpad = RegExp(/iPad/i).test(navigator.userAgent);
|
||||
|
||||
if (!isIpad)
|
||||
{
|
||||
const isMac = RegExp(/Macintosh/i).test(navigator.userAgent);
|
||||
|
||||
if (isMac && navigator.maxTouchPoints && navigator.maxTouchPoints > 2)
|
||||
{
|
||||
isIpad = true;
|
||||
}
|
||||
}
|
||||
return isIpad;
|
||||
}
|
||||
|
||||
function getOS()
|
||||
{
|
||||
var detectedOS = "Unknown";
|
||||
if (window.navigator.userAgent.indexOf("Windows") != -1) { detectedOS = "Windows";}
|
||||
else if (window.navigator.userAgent.indexOf("CrOS") != -1) { detectedOS = "Chrome";}
|
||||
else if (window.navigator.userAgent.indexOf("Mac") != -1) detectedOS="Mac/iOS";
|
||||
else if (window.navigator.userAgent.indexOf("X11") != -1) detectedOS="UNIX";
|
||||
else if (window.navigator.userAgent.indexOf("Linux") != -1) detectedOS="Linux";
|
||||
|
||||
return detectedOS;
|
||||
}
|
||||
|
||||
function isIos()
|
||||
{
|
||||
var isIos = (/iPhone|iPad|iPod/i.test(navigator.userAgent));
|
||||
return isIos || isIpad();
|
||||
}
|
||||
|
||||
|
||||
function copyTextToClipboard(text)
|
||||
{
|
||||
var textArea = document.createElement("textarea");
|
||||
textArea.style.position = 'fixed';
|
||||
textArea.style.top = 0;
|
||||
textArea.style.left = 0;
|
||||
textArea.style.width = '2em';
|
||||
textArea.style.height = '2em';
|
||||
textArea.style.padding = 0;
|
||||
textArea.style.border = 'none';
|
||||
textArea.style.outline = 'none';
|
||||
textArea.style.boxShadow = 'none';
|
||||
textArea.style.background = 'transparent';
|
||||
textArea.value = text;
|
||||
document.body.appendChild(textArea);
|
||||
textArea.select();
|
||||
try {
|
||||
var successful = document.execCommand('copy');
|
||||
var msg = successful ? 'successful' : 'unsuccessful';
|
||||
console.log('Copying text command was ' + msg);
|
||||
} catch (err) {
|
||||
console.warn('Unable to copy text');
|
||||
}
|
||||
document.body.removeChild(textArea);
|
||||
}
|
||||
|
||||
window.copyText = function (text) {
|
||||
var listener = function () {
|
||||
|
||||
copyTextToClipboard(text);
|
||||
if(isMobile())
|
||||
{
|
||||
document.removeEventListener('touchend', listener);
|
||||
}
|
||||
else
|
||||
{
|
||||
document.removeEventListener('mouseup', listener);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
if(isMobile())
|
||||
{
|
||||
document.addEventListener('touchend', listener);
|
||||
}
|
||||
else
|
||||
{
|
||||
document.addEventListener('mouseup', listener);
|
||||
}
|
||||
};
|
||||
|
||||
function firebaseLogEvent(eventName)
|
||||
{
|
||||
if(enableFirebaseAnalytics && firebase.analytics != null)
|
||||
firebase.analytics().logEvent(eventName);
|
||||
}
|
||||
|
||||
function firebaseSetScreen(screenName)
|
||||
{
|
||||
if(enableFirebaseAnalytics && firebase.analytics != null)
|
||||
{
|
||||
firebase.analytics().setCurrentScreen(screenName);
|
||||
firebase.analytics().logEvent("screen_view", { "screen_name": screenName})
|
||||
}
|
||||
}
|
||||
|
||||
function firebaseLogEventWithParam(eventName, p, v)
|
||||
{
|
||||
if(enableFirebaseAnalytics && firebase.analytics != null)
|
||||
firebase.analytics().logEvent(eventName, { [p]: v});
|
||||
}
|
||||
|
||||
function firebaseLogEventWithParamDict(eventName, paramsDict)
|
||||
{
|
||||
if(enableFirebaseAnalytics && firebase.analytics != null)
|
||||
firebase.analytics().logEvent(eventName, paramsDict);
|
||||
}
|
||||
|
||||
var fs = false;
|
||||
function toggleFullscreen()
|
||||
{
|
||||
if(fs)
|
||||
{
|
||||
console.log("exitFullScreen");
|
||||
exitFullScreen();
|
||||
}
|
||||
else
|
||||
{
|
||||
console.log("setElementFullScreen");
|
||||
var elem = document.documentElement; //document.getElementById("mainContainer");
|
||||
setElementFullScreen(elem);
|
||||
}
|
||||
fs = !fs;
|
||||
}
|
||||
|
||||
function isFullscreen()
|
||||
{
|
||||
return fs;
|
||||
}
|
||||
|
||||
|
||||
function onNextMouseUp(a)
|
||||
{
|
||||
var listenerName = isMobile() ? 'touchend' : 'mouseup';
|
||||
var listener = function () {
|
||||
a();
|
||||
document.removeEventListener(listenerName, listener);
|
||||
};
|
||||
document.addEventListener(listenerName, listener);
|
||||
}
|
||||
|
||||
function openUrl(url)
|
||||
{
|
||||
onNextMouseUp(function () {
|
||||
console.log("openUrl onNextMouseUp");
|
||||
window.open(url, "_blank");
|
||||
});
|
||||
}
|
||||
|
||||
function openPrivacyUrl()
|
||||
{
|
||||
onNextMouseUp(function () {
|
||||
console.log("openPrivacyUrl onNextMouseUp");
|
||||
if(isPlaywireEnabled())
|
||||
{
|
||||
window.open("https://smashkarts.io/privacy/privacyPW.html", "_blank");
|
||||
}
|
||||
else if(isAdinPlayEnabled())
|
||||
{
|
||||
window.open("https://smashkarts.io/privacy/privacyAdinplay.html", "_blank");
|
||||
}
|
||||
else
|
||||
{
|
||||
window.open("https://smashkarts.io/privacy/privacy.html", "_blank");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function setElementFullScreen(el) {
|
||||
onNextMouseUp(function () {
|
||||
var request = el.requestFullscreen || el.webkitRequestFullscreen || el.mozRequestFullScreen || el.msRequestFullscreen;
|
||||
request.call(el);
|
||||
});
|
||||
}
|
||||
|
||||
function exitFullScreen() {
|
||||
onNextMouseUp(function () {
|
||||
var exitFS = document.exitFullscreen || document.webkitExitFullscreen || document.mozCancelFullScreen || document.msExitFullscreen;
|
||||
exitFS.call(document);
|
||||
});
|
||||
}
|
||||
|
||||
function handleKeyDown(keycode)
|
||||
{
|
||||
if(window.unityGame) window.unityGame.SendMessage(unityFirebaseGameOjbectName, "HandleKeyDown", keycode);
|
||||
}
|
||||
|
||||
function handleKeyUp(keycode)
|
||||
{
|
||||
if(window.unityGame) window.unityGame.SendMessage(unityFirebaseGameOjbectName, "HandleKeyUp", keycode);
|
||||
}
|
||||
|
||||
var source = "notset";
|
||||
function setUrlSource(src)
|
||||
{
|
||||
source = src;
|
||||
console.log("setUrlSource " + src);
|
||||
}
|
||||
|
||||
function reloadPage()
|
||||
{
|
||||
location.reload();
|
||||
}
|
||||
|
||||
var loadingState = "None";
|
||||
function updateLoadingState(state)
|
||||
{
|
||||
loadingState = state;
|
||||
}
|
||||
|
||||
function onLoadingToMainMenuComplete(isCG)
|
||||
{
|
||||
hideLoadingBanner();
|
||||
|
||||
if(isCG && !cgEnvDisabled)
|
||||
{
|
||||
window.CrazyGames.SDK.game.sdkGameLoadingStop();
|
||||
}
|
||||
}
|
||||
|
||||
function isIFramed()
|
||||
{
|
||||
try
|
||||
{
|
||||
// Check if the current window is not the top-level window
|
||||
if (window.self !== window.top)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
// If a cross-origin error occurs, assume the content is iframed
|
||||
return true;
|
||||
}
|
||||
|
||||
// Default case: Not iframed
|
||||
return false;
|
||||
}
|
@ -1,90 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
var currentOrderId = "";
|
||||
var currentProductId = "";
|
||||
var completedOrderId = "";
|
||||
var sandbox = false;
|
||||
var shopUrl = (sandbox ? "https://sandbox-secure.xsolla.com" : "https://secure.xsolla.com");
|
||||
|
||||
async function buyProduct(productId)
|
||||
{
|
||||
console.log("buyProduct " + productId);
|
||||
|
||||
var functionRef = firebase.app().functions().httpsCallable("getXsollaTokenForItemMulti");
|
||||
|
||||
var response = await functionRef(productId);
|
||||
if(response != null && response.data != null)
|
||||
{
|
||||
var url = shopUrl + "/paystation3/?access_token=" + response.data.token;
|
||||
currentOrderId = response.data.order_id;
|
||||
currentProductId = productId;
|
||||
openStoreWindowInFrame(url);
|
||||
}
|
||||
}
|
||||
|
||||
async function openStoreWindoWithToken(productId, token, orderId)
|
||||
{
|
||||
var url = shopUrl + "/paystation3/?access_token=" + token;
|
||||
currentOrderId = orderId;
|
||||
currentProductId = productId;
|
||||
openStoreWindowInFrame(url);
|
||||
}
|
||||
|
||||
|
||||
async function openStoreWindowInFrame(url)
|
||||
{
|
||||
var elem = document.getElementById("xsolla-iframe");
|
||||
elem.src = url;
|
||||
elem.style.display = "block";
|
||||
}
|
||||
|
||||
window.addEventListener("message", (event) => {
|
||||
if (event.origin == shopUrl)
|
||||
{
|
||||
if(event.data != null)
|
||||
{
|
||||
var jsonData = JSON.parse(event.data);
|
||||
if(jsonData != null)
|
||||
{
|
||||
if(jsonData.data != null)
|
||||
{
|
||||
if(jsonData.data.action == "change-status" && jsonData.data.value == "done")
|
||||
{
|
||||
completedOrderId = jsonData.data.purchase_invoice_id;
|
||||
}
|
||||
else if (jsonData.data.action == "close-widget")
|
||||
{
|
||||
purchaseComplete();
|
||||
}
|
||||
}
|
||||
|
||||
if(jsonData.command == "return" || jsonData.command == "close-widget")
|
||||
{
|
||||
purchaseComplete();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
console.log("Window event " + event.data);
|
||||
}
|
||||
}, false);
|
||||
|
||||
function purchaseComplete()
|
||||
{
|
||||
if(currentOrderId != "")
|
||||
{
|
||||
var elem = document.getElementById("xsolla-iframe");
|
||||
elem.style.display = "none";
|
||||
|
||||
var obj =
|
||||
{
|
||||
orderId: currentOrderId.toString(),
|
||||
productId: currentProductId
|
||||
}
|
||||
const functionName = (completedOrderId != "") ? "PurchaseComplete" : "PurchaseCanceled";
|
||||
window.unityGame.SendMessage(unityFirebaseGameOjbectName, functionName, JSON.stringify(obj));
|
||||
completedOrderId = "";
|
||||
currentProductId = "";
|
||||
currentOrderId = "";
|
||||
}
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
const PRECACHE = 'precache-v1';
|
||||
|
||||
// A list of local resources we always want to be cached.
|
||||
const PRECACHE_URLS = [
|
||||
];
|
||||
|
||||
// The install handler takes care of precaching the resources we always need.
|
||||
self.addEventListener('install', event => {
|
||||
event.waitUntil(
|
||||
caches.open(PRECACHE)
|
||||
.then(cache => cache.addAll(PRECACHE_URLS))
|
||||
.then(self.skipWaiting())
|
||||
);
|
||||
});
|
||||
|
||||
// The activate handler takes care of cleaning up old caches.
|
||||
self.addEventListener('activate', event => {
|
||||
return null;
|
||||
});
|
||||
|
||||
// The fetch handler serves responses for same-origin resources from a cache.
|
||||
// If no response is found, it populates the runtime cache with the response
|
||||
// from the network before returning it to the page.
|
||||
self.addEventListener('fetch', event => {
|
||||
// Skip cross-origin requests, like those for Google Analytics.
|
||||
return null;
|
||||
});
|
@ -1,27 +0,0 @@
|
||||
const PRECACHE = 'precache-v1';
|
||||
|
||||
// A list of local resources we always want to be cached.
|
||||
const PRECACHE_URLS = [
|
||||
];
|
||||
|
||||
// The install handler takes care of precaching the resources we always need.
|
||||
self.addEventListener('install', event => {
|
||||
event.waitUntil(
|
||||
caches.open(PRECACHE)
|
||||
.then(cache => cache.addAll(PRECACHE_URLS))
|
||||
.then(self.skipWaiting())
|
||||
);
|
||||
});
|
||||
|
||||
// The activate handler takes care of cleaning up old caches.
|
||||
self.addEventListener('activate', event => {
|
||||
return null;
|
||||
});
|
||||
|
||||
// The fetch handler serves responses for same-origin resources from a cache.
|
||||
// If no response is found, it populates the runtime cache with the response
|
||||
// from the network before returning it to the page.
|
||||
self.addEventListener('fetch', event => {
|
||||
// Skip cross-origin requests, like those for Google Analytics.
|
||||
return null;
|
||||
});
|
@ -1,228 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="minimal-ui, user-scalable=no, initial-scale=1, maximum-scale=1, width=device-width" />
|
||||
<title>AdinPlay Ads</title>
|
||||
<script>
|
||||
window.aiptag = window.aiptag || {cmd: []};
|
||||
aiptag.cmd.display = aiptag.cmd.display || [];
|
||||
aiptag.cmd.player = aiptag.cmd.player || [];
|
||||
//CMP tool settings
|
||||
aiptag.cmp = {
|
||||
show: true,
|
||||
position: "centered", //centered, bottom
|
||||
button: true,
|
||||
buttonText: "Privacy settings",
|
||||
buttonPosition: "bottom-left" //bottom-left, bottom-right, top-left, top-right
|
||||
}
|
||||
|
||||
aiptag.cmd.player.push(function() {
|
||||
aiptag.adplayer = new aipPlayer({
|
||||
AIP_REWARDEDCOMPLETE: function (state) {
|
||||
|
||||
//state can be: timeout, empty or closed
|
||||
alert("Rewarded Ad Completed: " + state);
|
||||
},
|
||||
AIP_REWARDEDGRANTED: function () {
|
||||
|
||||
//at this point the reward is granted, usually this will be just before or after AIP_REWARDEDCOMPLETE but this is not always the case
|
||||
alert("Reward Granted");
|
||||
},
|
||||
AD_WIDTH: 960,
|
||||
AD_HEIGHT: 540,
|
||||
AD_DISPLAY: 'default', //default, fullscreen, center, fill
|
||||
TRUSTED: true,
|
||||
LOADING_TEXT: 'loading advertisement',
|
||||
PREROLL_ELEM: function(){return document.getElementById('preroll')},
|
||||
AIP_COMPLETE: function (state) {
|
||||
/*******************
|
||||
***** WARNING *****
|
||||
*******************
|
||||
Please do not remove the PREROLL_ELEM
|
||||
from the page, it will be hidden automaticly.
|
||||
If you do want to remove it use the AIP_REMOVE callback.
|
||||
*/
|
||||
|
||||
alert("Preroll Ad Completed: " + state);
|
||||
},
|
||||
AIP_REMOVE: function () {
|
||||
// Here it's safe to remove the PREROLL_ELEM from the page if you want. But it's not recommend.
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function show_preroll() {
|
||||
//check if the adslib is loaded correctly or blocked by adblockers etc.
|
||||
if (typeof aiptag.adplayer !== 'undefined') {
|
||||
aiptag.cmd.player.push(function() { aiptag.adplayer.startPreRoll(); });
|
||||
} else {
|
||||
//Adlib didnt load this could be due to an adblocker, timeout etc.
|
||||
//Please add your script here that starts the content, this usually is the same script as added in AIP_COMPLETE or AIP_REMOVE.
|
||||
alert("Ad Could not be loaded, load your content here");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<script async src="//api.adinplay.com/libs/aiptag/pub/SHK/smashkarts.io/tag.min.js"></script>
|
||||
</head>
|
||||
<body style="margin:0;padding:0;">
|
||||
<p>Documentation: <a href="https://adinplay.com/api/" target="_blank">https://adinplay.com/api/</a></p>
|
||||
AIP ID: SHK/smashkarts.io<br>
|
||||
AIP PLACEMENT ID: smashkarts-io_300x250<br>
|
||||
AIP PLACEMENT ID: smashkarts-io_300x250_2<br>
|
||||
AIP PLACEMENT ID: smashkarts-io_728x90<br>
|
||||
AIP PLACEMENT ID: smashkarts-io_728x90_2<br>
|
||||
AIP PLACEMENT ID: smashkarts-io_728x90_3<br>
|
||||
AIP PLACEMENT ID: smashkarts-io_728x90-new<br>
|
||||
AIP PLACEMENT ID: smashkarts-io_320x100<br>
|
||||
AIP PLACEMENT ID: smashkarts-io_970x90<br>
|
||||
AIP PLACEMENT ID: smashkarts-io_970x250<br>
|
||||
AIP PLACEMENT ID: smashkarts-io_970x250_2<br>
|
||||
AIP PLACEMENT ID: smashkarts-io_336x1050<br>
|
||||
AIP PLACEMENT ID: smashkarts-io_300x600<br>
|
||||
AIP PLACEMENT ID: smashkarts-io_160x600<br>
|
||||
AIP PLACEMENT ID: smashkarts-io_320x50<br>
|
||||
<br>
|
||||
|
||||
<div id='smashkarts-io_300x250'>
|
||||
<script type='text/javascript'>
|
||||
aiptag.cmd.display.push(function() { aipDisplayTag.display('smashkarts-io_300x250'); });
|
||||
</script>
|
||||
</div>
|
||||
<button onclick="aiptag.cmd.display.push(function() { aipDisplayTag.display('smashkarts-io_300x250'); });">Refresh Ad</button>
|
||||
<div id='smashkarts-io_300x250_2'>
|
||||
<script type='text/javascript'>
|
||||
aiptag.cmd.display.push(function() { aipDisplayTag.display('smashkarts-io_300x250_2'); });
|
||||
</script>
|
||||
</div>
|
||||
<button onclick="aiptag.cmd.display.push(function() { aipDisplayTag.display('smashkarts-io_300x250_2'); });">Refresh Ad</button>
|
||||
<div id='smashkarts-io_728x90'>
|
||||
<script type='text/javascript'>
|
||||
aiptag.cmd.display.push(function() { aipDisplayTag.display('smashkarts-io_728x90'); });
|
||||
</script>
|
||||
</div>
|
||||
<button onclick="aiptag.cmd.display.push(function() { aipDisplayTag.display('smashkarts-io_728x90'); });">Refresh Ad</button>
|
||||
<div id='smashkarts-io_728x90_2'>
|
||||
<script type='text/javascript'>
|
||||
aiptag.cmd.display.push(function() { aipDisplayTag.display('smashkarts-io_728x90_2'); });
|
||||
</script>
|
||||
</div>
|
||||
<button onclick="aiptag.cmd.display.push(function() { aipDisplayTag.display('smashkarts-io_728x90_2'); });">Refresh Ad</button>
|
||||
<div id='smashkarts-io_728x90_3'>
|
||||
<script type='text/javascript'>
|
||||
aiptag.cmd.display.push(function() { aipDisplayTag.display('smashkarts-io_728x90_3'); });
|
||||
</script>
|
||||
</div>
|
||||
<button onclick="aiptag.cmd.display.push(function() { aipDisplayTag.display('smashkarts-io_728x90_3'); });">Refresh Ad</button>
|
||||
<div id='smashkarts-io_728x90-new'>
|
||||
<script type='text/javascript'>
|
||||
aiptag.cmd.display.push(function() { aipDisplayTag.display('smashkarts-io_728x90-new'); });
|
||||
</script>
|
||||
</div>
|
||||
<button onclick="aiptag.cmd.display.push(function() { aipDisplayTag.display('smashkarts-io_728x90-new'); });">Refresh Ad</button>
|
||||
<div id='smashkarts-io_320x100'>
|
||||
<script type='text/javascript'>
|
||||
aiptag.cmd.display.push(function() { aipDisplayTag.display('smashkarts-io_320x100'); });
|
||||
</script>
|
||||
</div>
|
||||
<button onclick="aiptag.cmd.display.push(function() { aipDisplayTag.display('smashkarts-io_320x100'); });">Refresh Ad</button>
|
||||
<div id='smashkarts-io_970x90'>
|
||||
<script type='text/javascript'>
|
||||
aiptag.cmd.display.push(function() { aipDisplayTag.display('smashkarts-io_970x90'); });
|
||||
</script>
|
||||
</div>
|
||||
<button onclick="aiptag.cmd.display.push(function() { aipDisplayTag.display('smashkarts-io_970x90'); });">Refresh Ad</button>
|
||||
<div id='smashkarts-io_970x250'>
|
||||
<script type='text/javascript'>
|
||||
aiptag.cmd.display.push(function() { aipDisplayTag.display('smashkarts-io_970x250'); });
|
||||
</script>
|
||||
</div>
|
||||
<button onclick="aiptag.cmd.display.push(function() { aipDisplayTag.display('smashkarts-io_970x250'); });">Refresh Ad</button>
|
||||
<div id='smashkarts-io_970x250_2'>
|
||||
<script type='text/javascript'>
|
||||
aiptag.cmd.display.push(function() { aipDisplayTag.display('smashkarts-io_970x250_2'); });
|
||||
</script>
|
||||
</div>
|
||||
<button onclick="aiptag.cmd.display.push(function() { aipDisplayTag.display('smashkarts-io_970x250_2'); });">Refresh Ad</button>
|
||||
<div id='smashkarts-io_336x1050'>
|
||||
<script type='text/javascript'>
|
||||
aiptag.cmd.display.push(function() { aipDisplayTag.display('smashkarts-io_336x1050'); });
|
||||
</script>
|
||||
</div>
|
||||
<button onclick="aiptag.cmd.display.push(function() { aipDisplayTag.display('smashkarts-io_336x1050'); });">Refresh Ad</button>
|
||||
<div id='smashkarts-io_300x600'>
|
||||
<script type='text/javascript'>
|
||||
aiptag.cmd.display.push(function() { aipDisplayTag.display('smashkarts-io_300x600'); });
|
||||
</script>
|
||||
</div>
|
||||
<button onclick="aiptag.cmd.display.push(function() { aipDisplayTag.display('smashkarts-io_300x600'); });">Refresh Ad</button>
|
||||
<div id='smashkarts-io_160x600'>
|
||||
<script type='text/javascript'>
|
||||
aiptag.cmd.display.push(function() { aipDisplayTag.display('smashkarts-io_160x600'); });
|
||||
</script>
|
||||
</div>
|
||||
<button onclick="aiptag.cmd.display.push(function() { aipDisplayTag.display('smashkarts-io_160x600'); });">Refresh Ad</button>
|
||||
<div id='smashkarts-io_320x50'>
|
||||
<script type='text/javascript'>
|
||||
aiptag.cmd.display.push(function() { aipDisplayTag.display('smashkarts-io_320x50'); });
|
||||
</script>
|
||||
</div>
|
||||
<button onclick="aiptag.cmd.display.push(function() { aipDisplayTag.display('smashkarts-io_320x50'); });">Refresh Ad</button>
|
||||
<br><br>
|
||||
<button onclick="show_preroll();">Show Video Ad</button> <div id="preroll"></div>
|
||||
<br><br>
|
||||
<script>
|
||||
function show_rewarded() {
|
||||
//check if the adslib is loaded correctly or blocked by adblockers etc.
|
||||
if (typeof aiptag.adplayer !== 'undefined') {
|
||||
aiptag.cmd.player.push(function() { aiptag.adplayer.startRewardedAd({preload: false, showLoading: true}); });
|
||||
} else {
|
||||
//Adlib didnt load this could be due to an adblocker, timeout etc.
|
||||
//Please add your script here that starts the content, this usually is the same script as added in AIP_REWARDEDCOMPLETE.
|
||||
alert("Rewarded Ad Could not be loaded, load your content here");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<button onclick="show_rewarded();">Show Rewarded Ad</button>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
The code below is to preload an rewarded ad, you can determine when you want to show the rewarded ad after the preloading.<br>
|
||||
It's important the EventListener rewardedSlotReady is added only once.<br>
|
||||
<script>
|
||||
//The code below is to preload an rewarded ad, you can determine when you want to show the rewarded ad after the preloading
|
||||
function preload_rewarded() {
|
||||
//check if the adslib is loaded correctly or blocked by adblockers etc.
|
||||
if (typeof aiptag.adplayer !== 'undefined') {
|
||||
//It's important the EventListener rewardedSlotReady is added only once.
|
||||
if(aipAPItag.rewardedSlotEventListener !== true) {
|
||||
aipAPItag.rewardedSlotEventListener = true;
|
||||
aiptag.events.addEventListener("rewardedSlotReady", function (e) {
|
||||
if(e.detail.isEmpty !== true) {
|
||||
//rewarded ad is ready to show
|
||||
if(confirm("Rewarded ad is ready to show, do you want to show the rewarded ad?")) {
|
||||
aiptag.adplayer.showRewardedAd();
|
||||
}
|
||||
} else {
|
||||
//There is no rewarded ad available
|
||||
//Please add your script here that handles the content, this usually is the same script as added in AIP_REWARDEDCOMPLETE.
|
||||
alert("Rewarded Ad not available, handle your content here");
|
||||
}
|
||||
}, false);
|
||||
}
|
||||
|
||||
//set the preload flag to true to use preloading of the rewarded ad
|
||||
aiptag.cmd.player.push(function() { aiptag.adplayer.startRewardedAd({preload: true, showLoading: false}); });
|
||||
} else {
|
||||
//Adlib didnt load this could be due to an adblocker, timeout etc.
|
||||
//Please add your script here that handles the content, this usually is the same script as added in AIP_REWARDEDCOMPLETE.
|
||||
alert("Rewarded Ad Could not be loaded, handle your content here");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<button onclick="preload_rewarded();">Preload Rewarded Ad</button>
|
||||
<br><br>
|
||||
</body>
|
||||
</html>
|
@ -1,56 +0,0 @@
|
||||
@import url("https://fonts.googleapis.com/css2?family=Baloo+2:wght@600&display=swap");
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
background: #1b70f0;
|
||||
background-image: url("../../images/overlay.png"), url("../../images/menuBGTile.png");
|
||||
background-size: cover, 13vw;
|
||||
background-repeat: no-repeat, repeat;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding-top: 3%;
|
||||
font-size: x-large;
|
||||
font-family: 'Baloo 2', cursive;
|
||||
color: white;
|
||||
}
|
||||
|
||||
#logo
|
||||
{
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
#homeLink, #homeLink:visited
|
||||
{
|
||||
color: gold;
|
||||
}
|
||||
|
||||
a:visited, li:visited
|
||||
{
|
||||
color: white;
|
||||
}
|
||||
|
||||
a:hover, li:hover
|
||||
{
|
||||
color: gold;
|
||||
}
|
||||
|
||||
#discordLink, #discordLink:visited
|
||||
{
|
||||
color: rebeccapurple;
|
||||
}
|
||||
|
||||
#footer
|
||||
{
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
p
|
||||
{
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
ul
|
||||
{
|
||||
margin: 0px;
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
|
||||
<title>Smash Karts - Unblocked</title>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
|
||||
<meta name="description" content="Smash Karts unblocked proxies.">
|
||||
<link rel="icon" href="favicon.png" sizes="16x16">
|
||||
<link rel="stylesheet" href="css/unblocked.css" />
|
||||
|
||||
<meta property="og:title" content="Smash Karts unblocked proxies.">
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:url" content="https://smashkarts.io">
|
||||
<meta property="og:description" content="Smash Karts unblocked proxies.">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<a href="http://smashkarts.io"><img id="logo" src="../images/smashkarts.png" alt="" /></a>
|
||||
|
||||
<p>The best way to support the game is to play on <a id="homeLink" href="https://smashkarts.io">smashkarts.io</a><br>However, if our home site is unavailable here are some official proxies:</p>
|
||||
|
||||
<ul>
|
||||
<a href="https://sites.google.com/tall.team/smashkarts" target="_blank"><li>sites.google.com/tall.team/smashkarts</li></a>
|
||||
<a href="https://schoolkarts.com/" target="_blank"><li>schoolkarts.com</li></a>
|
||||
<a href="https://ghp1tallteam.github.io/" target="_blank"><li>ghp1tallteam.github.io</li></a>
|
||||
<a href="https://ghp2smashkarts.github.io/" target="_blank"><li>ghp2smashkarts.github.io</li></a>
|
||||
<a href="https://skunblocked.com/" target="_blank"><li>skunblocked.com</li></a>
|
||||
<a href="https://geometrykarts.com/" target="_blank"><li>geometrykarts.com</li></a>
|
||||
</ul>
|
||||
|
||||
<p>Also, be sure to check out our <a id="discordLink" href="https://discord.gg/Jrhneh5Ty5">Discord</a> for the most up to date proxies and more!</p>
|
||||
|
||||
<a href="https://tall.team/" id="footer">© Tall Team</a>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1,6 +1,6 @@
|
||||
function openSmash() {
|
||||
|
||||
var url = "content/smash-karts/";
|
||||
var url = "smash-kart/";
|
||||
|
||||
var win = window.open('about:blank', '_blank');
|
||||
|
||||
|
1
smash-kart
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 26e86a38b510dd873e2788d2f2bb95c329f53503
|