+
{#if displaySrc}
{/if}
@@ -16,40 +15,45 @@
.lazy-image {
overflow: hidden;
}
- .lazy-image img {
- transition: opacity 0.2s linear;
- }
\ No newline at end of file
diff --git a/routes/_components/NonAutoplayImg.html b/routes/_components/NonAutoplayImg.html
index 57ee503..2455e30 100644
--- a/routes/_components/NonAutoplayImg.html
+++ b/routes/_components/NonAutoplayImg.html
@@ -1,22 +1,13 @@
-{#if staticSrc === src}
-
-{:else}
-
-{/if}
+
\ No newline at end of file
diff --git a/routes/_pages/settings/instances/[instanceName].html b/routes/_pages/settings/instances/[instanceName].html
index ffa4a26..353cb16 100644
--- a/routes/_pages/settings/instances/[instanceName].html
+++ b/routes/_pages/settings/instances/[instanceName].html
@@ -4,7 +4,9 @@
{#if verifyCredentials}
Logged in as:
-
+
{'@' + verifyCredentials.acct}
diff --git a/routes/_store/observers/observers.js b/routes/_store/observers/observers.js
index 7066a9d..3f0f515 100644
--- a/routes/_store/observers/observers.js
+++ b/routes/_store/observers/observers.js
@@ -5,6 +5,7 @@ import { onlineObservers } from './onlineObservers'
import { navObservers } from './navObservers'
import { autosuggestObservers } from './autosuggestObservers'
import { pageVisibilityObservers } from './pageVisibilityObservers'
+import { resizeObservers } from './resizeObservers'
export function observers (store) {
instanceObservers(store)
@@ -14,4 +15,5 @@ export function observers (store) {
navObservers(store)
autosuggestObservers(store)
pageVisibilityObservers(store)
+ resizeObservers(store)
}
diff --git a/routes/_store/observers/resizeObservers.js b/routes/_store/observers/resizeObservers.js
new file mode 100644
index 0000000..f4ae748
--- /dev/null
+++ b/routes/_store/observers/resizeObservers.js
@@ -0,0 +1,14 @@
+import { registerResizeListener } from '../../_utils/resize'
+
+export function resizeObservers (store) {
+ if (!process.browser) {
+ return
+ }
+
+ const recalculateIsMobileSize = () => {
+ store.set({isMobileSize: window.matchMedia('(max-width: 767px)').matches})
+ }
+
+ registerResizeListener(recalculateIsMobileSize)
+ recalculateIsMobileSize()
+}
diff --git a/routes/_utils/decodeImage.js b/routes/_utils/decodeImage.js
new file mode 100644
index 0000000..b661777
--- /dev/null
+++ b/routes/_utils/decodeImage.js
@@ -0,0 +1,14 @@
+export function decodeImage (src) {
+ if (typeof Image.prototype.decode === 'function') {
+ let img = new Image()
+ img.src = src
+ return img.decode()
+ }
+
+ return new Promise((resolve, reject) => {
+ let img = new Image()
+ img.src = src
+ img.onload = resolve
+ img.onerror = reject
+ })
+}
diff --git a/routes/_utils/events.js b/routes/_utils/events.js
index f853d1e..3188479 100644
--- a/routes/_utils/events.js
+++ b/routes/_utils/events.js
@@ -1,23 +1,3 @@
-export function imgLoadError (node, callback) {
- node.addEventListener('error', callback)
-
- return {
- destroy () {
- node.removeEventListener('error', callback)
- }
- }
-}
-
-export function imgLoad (node, callback) {
- node.addEventListener('load', callback)
-
- return {
- destroy () {
- node.removeEventListener('load', callback)
- }
- }
-}
-
export function mouseover (node, callback) {
function onMouseEnter () {
callback(true) // eslint-disable-line