Skip to content

Commit

Permalink
fix(pwa): inserts offline support
Browse files Browse the repository at this point in the history
  • Loading branch information
Novout committed Dec 3, 2021
1 parent aaf0408 commit 435daed
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 64 deletions.
2 changes: 1 addition & 1 deletion src/components/editor/pwa/PWAPrompt.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div
v-if="offlineReady && needRefresh"
v-if="offlineReady || needRefresh"
class="fixed top-0 right-0 m-3 p-2 rounded-sm shadow-lg text-left wb-text bg-theme-background-2 z-max"
role="alert"
>
Expand Down
51 changes: 1 addition & 50 deletions src/components/landing/LandingFirst.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</p>
<div
v-motion
class="flex items-center justify-between lg:w-5/12 xl:w-1/3 mt-32"
class="flex items-center justify-between w-1/2 lg:w-5/12 xl:w-1/3 mt-32"
:initial="{ opacity: 0 }"
:enter="{ opacity: 1, transition: { delay: 300 } }"
>
Expand All @@ -38,51 +38,6 @@
{{ version }}
</div></router-link
>
<a
class="font-bold items-center justify-center shadow-xl ml-5 w-full text-base md:text-lg px-5 py-2 md:px-5 md:py-5 rounded-full border border-gray-800 bg-black-opacity hover:bg-gray-900 text-gray-200 flex flex-col cursor-pointer"
:href="desktopDownload"
target="_blank"
><div>
{{ t('landing.first.editor.desktop') }}
</div>
<div class="flex text-xs">
{{ version }}
<svg
class="ml-1"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
aria-hidden="true"
role="img"
width="18"
height="18"
preserveAspectRatio="xMidYMid meet"
viewBox="0 0 16 16"
>
<g fill="currentColor">
<path
d="M6.555 1.375L0 2.237v5.45h6.555V1.375zM0 13.795l6.555.933V8.313H0v5.482zm7.278-5.4l.026 6.378L16 16V8.395H7.278zM16 0L7.33 1.244v6.414H16V0z"
></path>
</g>
</svg>
<svg
class="ml-1"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
aria-hidden="true"
role="img"
width="18"
height="18"
preserveAspectRatio="xMidYMid meet"
viewBox="0 0 16 16"
>
<g fill="currentColor">
<path
d="M13.281 11.156a.84.84 0 0 1 .375.297c.084.125.143.276.18.453c.02.104.044.2.07.29a1.772 1.772 0 0 0 .219.476c.047.073.11.153.188.242c.067.073.127.167.18.281a.793.793 0 0 1 .077.328a.49.49 0 0 1-.093.305a.944.944 0 0 1-.235.219c-.12.083-.245.156-.375.219c-.13.062-.26.127-.39.195a3.624 3.624 0 0 0-.555.328c-.156.115-.313.26-.469.438a2.815 2.815 0 0 1-.625.523a1.471 1.471 0 0 1-.383.172c-.13.036-.26.06-.39.07c-.302 0-.552-.052-.75-.156c-.198-.104-.37-.294-.516-.57c-.042-.079-.083-.128-.125-.149a.774.774 0 0 0-.203-.055L8.67 15c-.26-.02-.525-.031-.796-.031a4.28 4.28 0 0 0-.672.054c-.229.037-.456.081-.68.133c-.046.01-.093.05-.14.117a1.7 1.7 0 0 1-.196.227a1.106 1.106 0 0 1-.335.219a1.475 1.475 0 0 1-.555.101c-.172 0-.357-.018-.555-.054a1.82 1.82 0 0 1-.531-.18a3.578 3.578 0 0 0-.953-.328c-.313-.057-.643-.11-.992-.156a3.392 3.392 0 0 1-.344-.063a.774.774 0 0 1-.29-.133a.705.705 0 0 1-.194-.219a.78.78 0 0 1-.079-.351c0-.162.021-.318.063-.469c.042-.15.065-.31.07-.476c0-.115-.008-.227-.023-.336a3.53 3.53 0 0 1-.032-.352c0-.265.063-.46.188-.586c.125-.125.307-.224.547-.297a.99.99 0 0 0 .297-.148a2.27 2.27 0 0 0 .234-.203a1.86 1.86 0 0 0 .203-.242c.063-.089.133-.178.211-.266a.114.114 0 0 0 .024-.07c0-.063-.003-.123-.008-.18l-.016-.188c0-.354.055-.71.164-1.07c.11-.36.253-.71.43-1.055a9.08 9.08 0 0 1 .594-.992c.218-.317.435-.612.648-.883a4.35 4.35 0 0 0 .68-1.203c.15-.416.229-.87.234-1.36c0-.207-.01-.413-.031-.616a6.122 6.122 0 0 1-.031-.625c0-.417.047-.792.14-1.125c.094-.334.24-.62.438-.86s.456-.419.773-.539C7.474.075 7.854.01 8.296 0c.527 0 .946.104 1.259.313c.312.208.552.481.718.82c.167.338.274.716.32 1.133c.048.416.074.838.079 1.265v.133c0 .214.002.404.008.57a2.527 2.527 0 0 0 .226.977c.073.161.182.336.328.523c.25.329.506.66.766.993c.26.333.497.677.71 1.03c.214.355.389.725.524 1.11c.136.386.206.802.211 1.25a3.3 3.3 0 0 1-.164 1.04zm-6.554-8.14c.072 0 .132.018.18.054a.357.357 0 0 1 .109.149a.85.85 0 0 1 .054.187c.01.063.016.128.016.196a.282.282 0 0 1-.024.125a.27.27 0 0 1-.07.086l-.094.078a.796.796 0 0 0-.093.093a.428.428 0 0 1-.149.141a2.129 2.129 0 0 0-.18.117a1.31 1.31 0 0 0-.156.133a.264.264 0 0 0-.07.195c0 .047.023.086.07.117a.704.704 0 0 1 .266.305c.052.12.11.237.172.352c.062.114.143.21.242.289c.099.078.253.117.46.117h.048c.208-.01.406-.065.594-.164c.187-.099.375-.203.562-.313a.633.633 0 0 1 .102-.046a.37.37 0 0 0 .101-.055l.57-.445a.926.926 0 0 0 .024-.102a2.75 2.75 0 0 0 .016-.11a.236.236 0 0 0-.04-.14a.4.4 0 0 0-.093-.094a.34.34 0 0 0-.133-.054a.909.909 0 0 1-.14-.04a1.083 1.083 0 0 1-.352-.14a1.457 1.457 0 0 0-.344-.156c-.02-.006-.036-.021-.047-.047a.983.983 0 0 1-.031-.094a.23.23 0 0 1-.008-.102a.126.126 0 0 0-.008-.078c0-.062.005-.127.016-.195a.551.551 0 0 1 .07-.195a.417.417 0 0 1 .125-.14a.411.411 0 0 1 .203-.056c.162 0 .279.06.352.18c.073.12.112.25.117.39a.397.397 0 0 1-.039.18a.379.379 0 0 0-.04.172c0 .042.014.07.04.086a.26.26 0 0 0 .102.031c.12 0 .197-.028.234-.085a.533.533 0 0 0 .062-.258c0-.12-.01-.253-.03-.399a1.32 1.32 0 0 0-.126-.406a.969.969 0 0 0-.242-.313a.574.574 0 0 0-.383-.124c-.27 0-.466.067-.586.203c-.12.135-.182.338-.187.609c0 .078.005.156.015.234c.01.079.016.157.016.235c0 .026-.003.039-.008.039a.218.218 0 0 1-.047-.016a4.263 4.263 0 0 1-.093-.039a.774.774 0 0 0-.118-.039a.514.514 0 0 0-.203-.008a1.007 1.007 0 0 1-.125.008c-.073 0-.11-.013-.11-.039c0-.078-.004-.177-.015-.297c-.01-.12-.036-.24-.078-.36a.995.995 0 0 0-.156-.296c-.063-.078-.156-.12-.281-.125a.323.323 0 0 0-.227.086a.905.905 0 0 0-.164.203a.64.64 0 0 0-.086.266a5.4 5.4 0 0 1-.031.25a1.459 1.459 0 0 0 .07.406c.026.083.055.156.086.219c.031.062.068.093.11.093c.025 0 .06-.018.101-.054c.042-.037.063-.07.063-.102c0-.016-.008-.026-.024-.031a.147.147 0 0 0-.047-.008c-.036 0-.068-.018-.094-.055a.468.468 0 0 1-.062-.125a5.144 5.144 0 0 1-.047-.148a.564.564 0 0 1 .055-.398c.047-.084.133-.128.258-.133zM5.023 15.18c.125 0 .248-.01.368-.032a.97.97 0 0 0 .336-.125a.614.614 0 0 0 .234-.242a.943.943 0 0 0 .094-.375a.816.816 0 0 0-.047-.273a.963.963 0 0 0-.133-.25a2.763 2.763 0 0 0-.203-.281a2.763 2.763 0 0 1-.203-.282a62.93 62.93 0 0 1-.29-.43c-.093-.14-.187-.288-.28-.445a8.124 8.124 0 0 1-.235-.406a2.646 2.646 0 0 0-.266-.398a1.203 1.203 0 0 0-.218-.211a.469.469 0 0 0-.29-.094a.436.436 0 0 0-.296.11a2.26 2.26 0 0 0-.258.265a3.241 3.241 0 0 1-.297.305c-.11.099-.25.177-.422.234a.744.744 0 0 0-.312.172c-.073.073-.11.185-.11.336c0 .104.008.208.024.312c.015.104.026.209.031.313c0 .14-.02.273-.063.398a1.157 1.157 0 0 0-.062.367c0 .141.05.24.148.297c.1.058.211.097.336.117c.157.027.305.047.446.063c.14.016.278.04.414.07c.135.032.27.065.406.102c.135.036.279.094.43.172c.03.015.078.034.14.054l.211.07c.078.027.151.048.219.063a.741.741 0 0 0 .148.024zm2.86-.938c.146 0 .302-.015.469-.047a3.54 3.54 0 0 0 .976-.336a2.59 2.59 0 0 0 .406-.257a.222.222 0 0 0 .032-.047a.305.305 0 0 0 .023-.063v-.008c.031-.114.057-.24.078-.375a8.63 8.63 0 0 0 .055-.414a8.98 8.98 0 0 1 .055-.414c.02-.135.039-.268.054-.398c.021-.14.047-.276.078-.406c.032-.13.073-.253.125-.368a1.03 1.03 0 0 1 .211-.304a1.54 1.54 0 0 1 .344-.25v-.016l-.008-.023a.29.29 0 0 1 .047-.149a1.4 1.4 0 0 1 .117-.164a.582.582 0 0 1 .149-.133a.946.946 0 0 1 .164-.078a9.837 9.837 0 0 0-.102-.375a4.938 4.938 0 0 1-.094-.375a7.126 7.126 0 0 0-.093-.476a2.954 2.954 0 0 0-.11-.36a1.317 1.317 0 0 0-.18-.32c-.077-.104-.174-.23-.288-.375a1.189 1.189 0 0 1-.118-.156a.555.555 0 0 1-.046-.196a2.206 2.206 0 0 0-.047-.203a9.48 9.48 0 0 0-.242-.75a2.91 2.91 0 0 0-.172-.383a3.87 3.87 0 0 0-.172-.289c-.052-.078-.107-.117-.164-.117c-.125 0-.274.05-.446.149c-.171.099-.354.208-.546.328c-.193.12-.38.232-.563.336c-.182.104-.346.153-.492.148a.7.7 0 0 1-.43-.148a2.236 2.236 0 0 1-.36-.344c-.109-.13-.2-.242-.273-.336c-.073-.094-.127-.146-.164-.156c-.041 0-.065.031-.07.093a2.56 2.56 0 0 0-.008.211v.133c0 .032-.005.052-.016.063c-.057.12-.12.237-.187.351c-.068.115-.135.232-.203.352a1.611 1.611 0 0 0-.219.758c0 .078.005.156.016.234c.01.078.036.154.078.227l-.016.03a1.31 1.31 0 0 1-.133.157a1.072 1.072 0 0 0-.132.164a2.796 2.796 0 0 0-.407.93c-.078.333-.12.672-.125 1.015c0 .089.006.178.016.266c.01.089.016.177.016.266a.526.526 0 0 1-.008.086a.525.525 0 0 0-.008.086a.75.75 0 0 1 .313.109c.12.068.25.154.39.258c.14.104.274.224.399.36c.125.135.244.267.359.398c.115.13.198.26.25.39c.052.13.086.237.101.32a.444.444 0 0 1-.125.329a.955.955 0 0 1-.312.203c.089.156.198.289.328.398c.13.11.271.198.422.266c.151.068.315.117.492.148c.177.032.35.047.516.047zm3.133 1.11c.109 0 .216-.016.32-.047a1.65 1.65 0 0 0 .445-.203c.136-.089.26-.198.375-.329a3.07 3.07 0 0 1 .977-.75l.258-.117a2.18 2.18 0 0 0 .257-.133a.962.962 0 0 0 .165-.132a.256.256 0 0 0 .078-.188a.295.295 0 0 0-.024-.117a.58.58 0 0 0-.07-.117a5.136 5.136 0 0 1-.203-.305a1.978 1.978 0 0 1-.149-.297l-.125-.312a2.558 2.558 0 0 1-.11-.352a.28.28 0 0 0-.054-.101a.53.53 0 0 0-.46-.235a.533.533 0 0 0-.266.07l-.266.149a7.335 7.335 0 0 1-.281.148a.656.656 0 0 1-.297.07a.411.411 0 0 1-.258-.077a.636.636 0 0 1-.172-.211a2.218 2.218 0 0 1-.117-.258l-.094-.258a1.26 1.26 0 0 1-.14.188a.666.666 0 0 0-.125.203c-.068.156-.11.33-.125.523c-.026.302-.06.596-.102.883a4.7 4.7 0 0 1-.21.86a1.914 1.914 0 0 0-.063.273a2.88 2.88 0 0 0-.032.289c0 .255.079.466.235.633c.156.166.367.25.633.25z"
></path>
</g>
</svg>
</div>
</a>
</div>
</div>
</div>
Expand All @@ -98,9 +53,5 @@
const { t } = useI18n()
const env = useEnv()
const desktopDownload = computed(
() =>
`https://github.com/Novout/better-write/releases/tag/v${env.packageVersion()}`
)
const version = computed(() => `v${env.packageVersion()}`)
</script>
16 changes: 3 additions & 13 deletions src/router.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,17 @@
import { createRouter, createWebHistory } from 'vue-router'
import { defineAsyncComponent } from 'vue'
import Loading from '@/pages/generics/GenericsLoading.vue'

const routes = [
{
path: '/',
component: defineAsyncComponent({
loader: () => import('@/pages/Editor.vue'),
loadingComponent: Loading,
}),
component: () => import('@/pages/Editor.vue'),
},
{
path: '/landing',
component: defineAsyncComponent({
loader: () => import('@/pages/Landing.vue'),
loadingComponent: Loading,
}),
component: () => import('@/pages/Landing.vue'),
},
{
path: '/:pathMatch(.*)*',
component: defineAsyncComponent(
() => import('@/pages/generics/Generics404.vue')
),
component: () => import('@/pages/generics/Generics404.vue'),
},
]

Expand Down

0 comments on commit 435daed

Please sign in to comment.