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,16 +1,18 @@
<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>
<div v-cloak>
<GamesList /> <GamesList />
</div> </div>
</div>
</template> </template>
<style> <style>
@ -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,20 +25,25 @@
</template> </template>
<style> <style>
.item { .spinner-border {
width: 3rem;
height: 3rem;
}
.item {
height: 100%; height: 100%;
background: #222; background: #222;
border-radius: 10px; border-radius: 10px;
} }
.item-image { .item-image {
display: block; display: block;
padding-bottom: 60%; padding-bottom: 60%;
/* 60% sirky */ /* 60% sirky */
position: relative; position: relative;
} }
.item-image-main { .item-image-main {
border-radius: 10px 10px 0 0; border-radius: 10px 10px 0 0;
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -44,52 +51,56 @@
left: 0; left: 0;
top: 0; top: 0;
object-fit: cover; object-fit: cover;
} }
.item-image-icon { .item-image-icon {
position: absolute; position: absolute;
left: 10px; left: 10px;
top: 10px; top: 10px;
width: 30px; width: 30px;
height: auto; height: auto;
} }
.item-details { .item-details {
padding: 10px; padding: 10px;
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
justify-content: space-between; justify-content: space-between;
} }
.item-counts { .item-counts {
border: 1px solid green; border: 1px solid green;
color: green; color: green;
padding: 4px; padding: 4px;
font-size: 12px; font-size: 12px;
font-weight: 600; font-weight: 600;
} }
</style> </style>
<script> <script>
import axios from "axios"; import axios from "axios";
export default {
export default {
data() { data() {
return { return {
isLoaded: true,
games: [] games: []
}; };
}, },
async created() { created() {
try { this.getGames();
var res = async axios.get( },
"https://api.gabenparadise.com/api/data", methods: {
{ crossdomain: true } getGames() {
); this.isLoaded = false;
this.games = res.data; axios.get("https://api.gabenparadise.com/api/data").then(response => {
} catch (e) { console.log(response);
console.error(e); if (response.status === 200) {
} finally { this.isLoaded = true;
console.error('finally'); 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);