fix: landscape modals and iOS PWA support
This commit is contained in:
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "vue-nonograms-solid",
|
"name": "vue-nonograms-solid",
|
||||||
"version": "1.11.2",
|
"version": "1.11.3",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "vue-nonograms-solid",
|
"name": "vue-nonograms-solid",
|
||||||
"version": "1.11.2",
|
"version": "1.11.3",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"fireworks-js": "^2.10.8",
|
"fireworks-js": "^2.10.8",
|
||||||
"flag-icons": "^7.5.0",
|
"flag-icons": "^7.5.0",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "vue-nonograms-solid",
|
"name": "vue-nonograms-solid",
|
||||||
"version": "1.11.2",
|
"version": "1.11.3",
|
||||||
"homepage": "https://nonograms.7u.pl/",
|
"homepage": "https://nonograms.7u.pl/",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
11
src/App.vue
11
src/App.vue
@@ -23,6 +23,7 @@ const canInstall = ref(false);
|
|||||||
const installDismissed = ref(false);
|
const installDismissed = ref(false);
|
||||||
const isCoarsePointer = ref(false);
|
const isCoarsePointer = ref(false);
|
||||||
const isStandalone = ref(false);
|
const isStandalone = ref(false);
|
||||||
|
const isIos = ref(false);
|
||||||
const themePreference = ref('system');
|
const themePreference = ref('system');
|
||||||
const appVersion = __APP_VERSION__;
|
const appVersion = __APP_VERSION__;
|
||||||
let displayModeMedia = null;
|
let displayModeMedia = null;
|
||||||
@@ -109,6 +110,7 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
if (typeof window !== 'undefined') {
|
if (typeof window !== 'undefined') {
|
||||||
isCoarsePointer.value = window.matchMedia('(pointer: coarse)').matches;
|
isCoarsePointer.value = window.matchMedia('(pointer: coarse)').matches;
|
||||||
|
isIos.value = /ipad|iphone|ipod/.test(navigator.userAgent.toLowerCase());
|
||||||
const storedTheme = typeof localStorage !== 'undefined' ? localStorage.getItem('theme') : null;
|
const storedTheme = typeof localStorage !== 'undefined' ? localStorage.getItem('theme') : null;
|
||||||
if (storedTheme === 'light' || storedTheme === 'dark' || storedTheme === 'system') {
|
if (storedTheme === 'light' || storedTheme === 'dark' || storedTheme === 'system') {
|
||||||
themePreference.value = storedTheme;
|
themePreference.value = storedTheme;
|
||||||
@@ -160,10 +162,13 @@ onUnmounted(() => {
|
|||||||
/>
|
/>
|
||||||
<FixedBar />
|
<FixedBar />
|
||||||
|
|
||||||
<div v-if="canInstall && !installDismissed" class="install-banner">
|
<div v-if="(canInstall || (isIos && !isStandalone)) && !installDismissed" class="install-banner">
|
||||||
<div class="install-text">{{ t('pwa.installTitle') }}</div>
|
<div class="install-text">
|
||||||
|
<span v-if="isIos && !isStandalone">{{ t('pwa.installIos') }}</span>
|
||||||
|
<span v-else>{{ t('pwa.installTitle') }}</span>
|
||||||
|
</div>
|
||||||
<div class="install-actions">
|
<div class="install-actions">
|
||||||
<button class="btn-neon secondary install-btn" @click="handleInstall">
|
<button v-if="!isIos" class="btn-neon secondary install-btn" @click="handleInstall">
|
||||||
{{ installLabel }}
|
{{ installLabel }}
|
||||||
</button>
|
</button>
|
||||||
<button class="install-close" @click="installDismissed = true">×</button>
|
<button class="install-close" @click="installDismissed = true">×</button>
|
||||||
|
|||||||
@@ -340,12 +340,20 @@ const confirm = () => {
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
max-width: 800px;
|
max-width: 800px;
|
||||||
width: 90%;
|
width: 90%;
|
||||||
|
max-height: 90vh;
|
||||||
|
overflow-y: auto;
|
||||||
border: 1px solid var(--accent-cyan);
|
border: 1px solid var(--accent-cyan);
|
||||||
box-shadow: 0 0 50px rgba(0, 242, 255, 0.2);
|
box-shadow: 0 0 50px rgba(0, 242, 255, 0.2);
|
||||||
animation: slideUp 0.3s ease;
|
animation: slideUp 0.3s ease;
|
||||||
transition: all 0.3s ease-in-out;
|
transition: all 0.3s ease-in-out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 768px), (max-height: 600px) {
|
||||||
|
.modal {
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.modal-content {
|
.modal-content {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
|||||||
@@ -215,6 +215,8 @@ onUnmounted(() => {
|
|||||||
width: fit-content;
|
width: fit-content;
|
||||||
max-width: min(92vw, 560px);
|
max-width: min(92vw, 560px);
|
||||||
min-width: 280px;
|
min-width: 280px;
|
||||||
|
max-height: 90vh;
|
||||||
|
overflow-y: auto;
|
||||||
border: 1px solid var(--primary-accent);
|
border: 1px solid var(--primary-accent);
|
||||||
box-shadow: 0 0 50px rgba(0, 242, 255, 0.2);
|
box-shadow: 0 0 50px rgba(0, 242, 255, 0.2);
|
||||||
animation: slideUp 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
|
animation: slideUp 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
|
||||||
@@ -223,6 +225,12 @@ onUnmounted(() => {
|
|||||||
overflow-wrap: anywhere;
|
overflow-wrap: anywhere;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 768px), (max-height: 600px) {
|
||||||
|
.modal {
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
h2 {
|
h2 {
|
||||||
font-size: 2.5rem;
|
font-size: 2.5rem;
|
||||||
color: var(--primary-accent);
|
color: var(--primary-accent);
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ const messages = {
|
|||||||
'pwa.installTitle': 'Zainstaluj aplikację i graj offline',
|
'pwa.installTitle': 'Zainstaluj aplikację i graj offline',
|
||||||
'pwa.installMobile': 'Dodaj do ekranu głównego',
|
'pwa.installMobile': 'Dodaj do ekranu głównego',
|
||||||
'pwa.installDesktop': 'Zainstaluj na komputerze',
|
'pwa.installDesktop': 'Zainstaluj na komputerze',
|
||||||
|
'pwa.installIos': 'Aby zainstalować: kliknij Udostępnij i wybierz "Dodaj do ekranu głównego"',
|
||||||
'pwa.offlineReady': 'Aplikacja gotowa do pracy offline',
|
'pwa.offlineReady': 'Aplikacja gotowa do pracy offline',
|
||||||
'pwa.newContent': 'Dostępna nowa wersja, odśwież aby zaktualizować',
|
'pwa.newContent': 'Dostępna nowa wersja, odśwież aby zaktualizować',
|
||||||
'pwa.reload': 'Odśwież',
|
'pwa.reload': 'Odśwież',
|
||||||
@@ -223,6 +224,7 @@ const messages = {
|
|||||||
'pwa.installTitle': 'Install the app and play offline',
|
'pwa.installTitle': 'Install the app and play offline',
|
||||||
'pwa.installMobile': 'Add to home screen',
|
'pwa.installMobile': 'Add to home screen',
|
||||||
'pwa.installDesktop': 'Install on desktop',
|
'pwa.installDesktop': 'Install on desktop',
|
||||||
|
'pwa.installIos': 'To install: tap Share and select "Add to Home Screen"',
|
||||||
'pwa.offlineReady': 'App ready to work offline',
|
'pwa.offlineReady': 'App ready to work offline',
|
||||||
'pwa.newContent': 'New content available, click on reload button to update',
|
'pwa.newContent': 'New content available, click on reload button to update',
|
||||||
'pwa.reload': 'Reload',
|
'pwa.reload': 'Reload',
|
||||||
|
|||||||
Reference in New Issue
Block a user