]>
git.immae.eu Git - github/bastienwirtz/homer.git/blob - app.js
10 created: function () {
14 that
.getConfig().then(function (config
) {
16 }).catch(function () {
20 document
.addEventListener('visibilitychange', function () {
21 if (document
.visibilityState
== "visible") {
28 return this.overrideDark
!== null
30 : matchMedia("(prefers-color-scheme: dark)").matches
;
34 checkOffline: function () {
36 return fetch(window
.location
.href
+ "?alive", {
41 }).catch(function () {
45 getConfig: function (event
) {
46 return fetch('config.yml').then(function (response
) {
47 if (response
.status
!= 200) {
50 return response
.text().then(function (body
) {
51 return jsyaml
.load(body
);
55 toggleTheme: function() {
56 this.overrideDark
= !this.isDark
;
61 Vue
.component('service', {
66 <div class="card-content">
68 <div v-if="item.logo" class="media-left">
69 <figure class="image is-48x48">
70 <img :src="item.logo" />
73 <div v-if="item.icon" class="media-left">
74 <figure class="image is-48x48">
75 <i style="font-size: 35px" :class="item.icon"></i>
78 <div class="media-content">
79 <p class="title is-4">{{ item.name }}</p>
80 <p class="subtitle is-6">{{ item.subtitle }}</p>
83 <strong class="tag" v-if="item.tag">#{{ item.tag }}</strong>
89 if ('serviceWorker' in navigator
) {
90 window
.addEventListener('load', function () {
91 navigator
.serviceWorker
.register('/worker.js');