diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 00000000..5008ddfc Binary files /dev/null and b/.DS_Store differ diff --git a/app_badge.png b/app_badge.png new file mode 100644 index 00000000..4847115c Binary files /dev/null and b/app_badge.png differ diff --git a/gp_badge.png b/gp_badge.png new file mode 100644 index 00000000..c3833055 Binary files /dev/null and b/gp_badge.png differ diff --git a/index.html b/index.html index e812fc02..ea8c69ba 100644 --- a/index.html +++ b/index.html @@ -23,6 +23,11 @@ - + + + +
+
+
+
+ × +
+
+

Try Fluid Simulation app!

+ +
+
+
+
+ \ No newline at end of file diff --git a/promo_back.png b/promo_back.png new file mode 100644 index 00000000..31dda3ed Binary files /dev/null and b/promo_back.png differ diff --git a/script.js b/script.js index f02dfa3d..df97d6af 100644 --- a/script.js +++ b/script.js @@ -24,6 +24,35 @@ SOFTWARE. 'use strict'; +// Promo code + +const promoPopup = document.getElementsByClassName('promo')[0]; +const promoPopupClose = document.getElementsByClassName('promo-close')[0]; + +if (isMobile()) { + setTimeout(() => { + promoPopup.style.display = 'table'; + }, 20000); +} + +promoPopupClose.addEventListener('click', e => { + promoPopup.style.display = 'none'; +}); + +const appleLink = document.getElementById('apple_link'); +appleLink.addEventListener('click', e => { + ga('send', 'event', 'link promo', 'app'); + window.open('https://apps.apple.com/us/app/fluid-simulation/id1443124993'); +}); + +const googleLink = document.getElementById('google_link'); +googleLink.addEventListener('click', e => { + ga('send', 'event', 'link promo', 'app'); + window.open('https://play.google.com/store/apps/details?id=games.paveldogreat.fluidsimfree'); +}); + +// Simulation code + const canvas = document.getElementsByTagName('canvas')[0]; resizeCanvas();