optimized some image sizes, testing serviceworker

This commit is contained in:
booploops 2022-01-05 04:12:16 -08:00
parent 6e033e90aa
commit 9054bc50e2
5 changed files with 52 additions and 42 deletions

View file

@ -2941,12 +2941,12 @@ document.addEventListener('musickitloaded', function () {
request.send(); request.send();
}); });
// if ('serviceWorker' in navigator) { if ('serviceWorker' in navigator) {
// // Use the window load event to keep the page load performant // Use the window load event to keep the page load performant
// window.addEventListener('load', () => { window.addEventListener('load', () => {
// navigator.serviceWorker.register('sw.js?v=1'); navigator.serviceWorker.register('sw.js?v=1');
// }); });
// } }
const getBase64FromUrl = async (url) => { const getBase64FromUrl = async (url) => {
const data = await fetch(url); const data = await fetch(url);

View file

@ -19,7 +19,7 @@
<div class="artwork" v-if="showArtwork == true"> <div class="artwork" v-if="showArtwork == true">
<mediaitem-artwork <mediaitem-artwork
:url="item.attributes.artwork ? item.attributes.artwork.url : ''" :url="item.attributes.artwork ? item.attributes.artwork.url : ''"
:size="50" :size="48"
:type="item.type"></mediaitem-artwork> :type="item.type"></mediaitem-artwork>
<button class="overlay-play" @click="playTrack()"><%- include("../svg/play.svg") %></button> <button class="overlay-play" @click="playTrack()"><%- include("../svg/play.svg") %></button>
</div> </div>

View file

@ -50,7 +50,7 @@
}, },
size: { size: {
type: String, type: String,
default: '300' default: '190'
}, },
'contextExt': {type: Object, required: false}, 'contextExt': {type: Object, required: false},
}, },

View file

@ -12,7 +12,7 @@
<mediaitem-artwork <mediaitem-artwork
shadow="large" shadow="large"
:url="data.attributes.artwork ? data.attributes.artwork.url : ''" :url="data.attributes.artwork ? data.attributes.artwork.url : ''"
size="220" type="artists"></mediaitem-artwork> size="190" type="artists"></mediaitem-artwork>
<button class="overlay-play" @click="app.mk.setStationQueue({artist:'a-'+data.id}).then(()=>{ <button class="overlay-play" @click="app.mk.setStationQueue({artist:'a-'+data.id}).then(()=>{
app.mk.play() app.mk.play()
})"> })">

View file

@ -16,6 +16,16 @@ module.exports = {
// Only cache 10 images. // Only cache 10 images.
}, },
},
{
urlPattern: /https:\/\/amp-api.music.apple.com\/v1\//,
handler: 'StaleWhileRevalidate',
options: {
cacheName: 'amp-api',
cacheableResponse: {
statuses: [0, 200],
},
},
}, },
{ {
urlPattern: /https:\/\/is[0-9]-ssl\.mzstatic\.com\/image+/, urlPattern: /https:\/\/is[0-9]-ssl\.mzstatic\.com\/image+/,