Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
bogdaniculae committed Nov 4, 2024
2 parents 6c069d7 + 663e1f9 commit 113a1fa
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 27 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bible-explorers",
"version": "2.3.1",
"version": "2.3.3",
"description": "App for Bible Explorers",
"main": ".vite/build/main.js",
"repository": {
Expand Down
4 changes: 3 additions & 1 deletion src/Experience/Experience.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ export default class Experience {
const redirectToLanguage = instance.getUrlParameter('language')
if (redirectToLanguage) {
const requiredToLogin = instance.getUrlParameter('login')
window.history.replaceState({}, document.title, '/' + requiredToLogin ? '?login' : '')
const redirectUrl =
window.location.href.split('?')[0] + (requiredToLogin === true ? '?login' : '')
window.history.replaceState({}, document.title, redirectUrl)
_lang.updateLanguage(redirectToLanguage)
}

Expand Down
1 change: 1 addition & 0 deletions src/Experience/Extras/Audio.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ export default class Audio {
audio.pianoTiles = new Howl({
src: ['games/piano-tiles/BIEX_Vignett_m_tverrflute.mp3'],
format: 'mp3',
volume: 0.5,
onload: function () {
document.dispatchEvent(_e.EVENTS.SONG_LOADED)
},
Expand Down
45 changes: 20 additions & 25 deletions src/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,30 +44,27 @@ function showNotification() {

gsap.fromTo(
notification.querySelector('.notification-box'),
{ y: '100px' },
{
duration: 1,
y: '0',
ease: 'power3.out'
{ y: '100px' },
{
duration: 1,
y: '0',
ease: 'power3.out',
}
)
}

function closeNotification() {
const notification = document.querySelector('.notification');
const notification = document.querySelector('.notification')

// Animate the notification-box back out
gsap.to(
notification.querySelector('.notification-box'),
{
duration: 0.5,
y: '100px',
ease: 'power3.in',
onComplete: () => {
notification.close();
}
}
);
gsap.to(notification.querySelector('.notification-box'), {
duration: 0.5,
y: '100px',
ease: 'power3.in',
onComplete: () => {
notification.close()
},
})
}

closeButton.addEventListener('click', closeNotification)
Expand All @@ -80,6 +77,7 @@ if (isElectron()) {

window.electronAPI.onUpdateAvailable(() => {
message.innerHTML = _s.autoUpdate.updateAvailable
restartButton.classList.add('hidden')
showNotification()
})

Expand All @@ -94,7 +92,6 @@ if (isElectron()) {
window.electronAPI.restartApp()
})
} else {

// Register Service Worker
if ('serviceWorker' in navigator) {
window.addEventListener('load', () => {
Expand All @@ -112,24 +109,23 @@ if (isElectron()) {

// Detecting unsupported browsers
function isSupportedBrowser() {
const userAgent = navigator.userAgent;
return /Chrome|Safari/.test(userAgent) && !/Edge|OPR|Firefox/.test(userAgent);
const userAgent = navigator.userAgent
return /Chrome|Safari/.test(userAgent) && !/Edge|OPR|Firefox/.test(userAgent)
}

// Detecting mobile devices (optional, if you want to show it based on devices)
function isMobileDevice() {
return /Mobi|Android/i.test(navigator.userAgent);
return /Mobi|Android/i.test(navigator.userAgent)
}

// Showing notification if unsupported browser or device is detected
if (!isSupportedBrowser() || isMobileDevice()) {
title.innerHTML = _s.notifications.webSupport.title
message.innerHTML = _s.notifications.webSupport.text
message.innerHTML = _s.notifications.webSupport.text
restartButton.classList.add('hidden')
showNotification()
}


// Auth0
const configureClient = async () => {
experience.auth0 = await createAuth0Client({
Expand Down Expand Up @@ -211,4 +207,3 @@ window.addEventListener(_e.ACTIONS.ROUTE_CHANGED, async ({ detail }) => {
await configureClient()
await handleRedirectCallback()
})

0 comments on commit 113a1fa

Please sign in to comment.