Next Big Update

This commit is contained in:
Václav Španinger 2020-08-10 16:33:28 +02:00
parent ac4b4d1651
commit 2db6d47475
4 changed files with 82 additions and 69 deletions

View File

@ -1,15 +1,17 @@
<template> <template>
<div id="app"> <div id="app">
<div class="header-top"> <div class="header-top">
<div class=""> <div class>
<h1 class="display-4">{{ title }}</h1> <h1 class="display-4">{{ title }}</h1>
<p class="lead">{{ content }}</p> <p class="lead">{{ content }}</p>
</div> </div>
<div class=""> <div class>
<i id="sub-identifi" class="fa fa-bell-o bell" aria-hidden="true"></i> <i id="sub-identifi" class="fa fa-bell-o bell" aria-hidden="true"></i>
</div> </div>
</div> </div>
<GamesList /> <div v-cloak>
<GamesList />
</div>
</div> </div>
</template> </template>
@ -24,7 +26,7 @@ body {
align-items: space-between; align-items: space-between;
} }
.bell{ .bell {
font-size: 2.5rem; font-size: 2.5rem;
font-weight: 300; font-weight: 300;
line-height: 2; line-height: 2;

View File

@ -1,5 +1,5 @@
<template> <template>
<div class="row"> <div class="row" v-if="isLoaded">
<div class="col-sm-6 col-md-4 mb-5" v-for="game of games" v-bind:key="game.name"> <div class="col-sm-6 col-md-4 mb-5" v-for="game of games" v-bind:key="game.name">
<a :href="game.url"> <a :href="game.url">
<div class="item"> <div class="item">
@ -16,6 +16,8 @@
</div> </div>
</a> </a>
</div> </div>
</div>
<div class="d-flex justify-content-center" v-else>
<div class="spinner-border" role="status"> <div class="spinner-border" role="status">
<span class="sr-only">Loading...</span> <span class="sr-only">Loading...</span>
</div> </div>
@ -23,73 +25,82 @@
</template> </template>
<style> <style>
.item { .spinner-border {
height: 100%; width: 3rem;
background: #222; height: 3rem;
border-radius: 10px; }
}
.item-image { .item {
display: block; height: 100%;
padding-bottom: 60%; background: #222;
/* 60% sirky */ border-radius: 10px;
position: relative; }
}
.item-image-main { .item-image {
border-radius: 10px 10px 0 0; display: block;
width: 100%; padding-bottom: 60%;
height: 100%; /* 60% sirky */
position: absolute; position: relative;
left: 0; }
top: 0;
object-fit: cover;
}
.item-image-icon { .item-image-main {
position: absolute; border-radius: 10px 10px 0 0;
left: 10px; width: 100%;
top: 10px; height: 100%;
width: 30px; position: absolute;
height: auto; left: 0;
} top: 0;
object-fit: cover;
}
.item-details { .item-image-icon {
padding: 10px; position: absolute;
display: flex; left: 10px;
align-items: flex-start; top: 10px;
justify-content: space-between; width: 30px;
} height: auto;
}
.item-counts { .item-details {
border: 1px solid green; padding: 10px;
color: green; display: flex;
padding: 4px; align-items: flex-start;
font-size: 12px; justify-content: space-between;
font-weight: 600; }
}
.item-counts {
border: 1px solid green;
color: green;
padding: 4px;
font-size: 12px;
font-weight: 600;
}
</style> </style>
<script> <script>
import axios from "axios"; import axios from "axios";
export default {
data() { export default {
return { data() {
games: [] return {
}; isLoaded: true,
}, games: []
async created() { };
try { },
var res = async axios.get( created() {
"https://api.gabenparadise.com/api/data", this.getGames();
{ crossdomain: true } },
); methods: {
this.games = res.data; getGames() {
} catch (e) { this.isLoaded = false;
console.error(e); axios.get("https://api.gabenparadise.com/api/data").then(response => {
} finally { console.log(response);
console.error('finally'); if (response.status === 200) {
} this.isLoaded = true;
this.games = response.data;
}
});
} }
}; }
};
</script> </script>

View File

@ -44,8 +44,8 @@ if (process.env.NODE_ENV === "production") {
messaging.getToken().then(function (token) { messaging.getToken().then(function (token) {
console.log("Token: ", token) console.log("Token: ", token)
console.log(JSON.stringify({ "token": token })); console.log(JSON.stringify({ "token": token }));
//FIX: New URL
axios.post('https://dev.steelants.cz/vasek/gabenparadise/api/subscribe', { axios.post('https://api.gabenparadise.com/subscribe', {
"token" : token "token" : token
}, { }, {
headers: { headers: {

View File

@ -1,10 +1,10 @@
self.__precacheManifest = [].concat(self.__precacheManifest || []); /*self.__precacheManifest = [].concat(self.__precacheManifest || []);*/
// workbox.setConfig({ // workbox.setConfig({
// debug: true // debug: true
// }); // });
workbox.precaching.precacheAndRoute(self.__precacheManifest, {}); //workbox.precaching.precacheAndRoute(self.__precacheManifest, {});
self.addEventListener("push", function (event) { self.addEventListener("push", function (event) {
console.log('Received a push message', event); console.log('Received a push message', event);