File tree Expand file tree Collapse file tree 4 files changed +20
-44
lines changed Expand file tree Collapse file tree 4 files changed +20
-44
lines changed Original file line number Diff line number Diff line change
1
+ # pogo-vue
2
+
3
+ This repository holds the source code for the new Vue.js-based webapps for Pogo's frontend. It's divided into two directories.
4
+
5
+ - ` admin/ ` is the where the admin interface is, ported from the DeV interface in the main Pogo repository.
6
+
7
+ - ` main/ ` is the client frontend for perusing the feed and listening to episodes.
Original file line number Diff line number Diff line change 8
8
< body >
9
9
< div id ="app "> </ div >
10
10
<!-- built files will be auto injected -->
11
+ < script type ="text/javascript " src ="./node_modules/node-vibrant/dist/vibrant.js "> </ script >
12
+ < script >
13
+ Vibrant . from ( 'logo.png' ) . getPalette ( ) . then ( function ( palette ) {
14
+ var css = document . createElement ( 'style' )
15
+ css . type = 'text/css'
16
+ var styles = 'a {color:' + palette . Vibrant . getHex ( ) + ';} footer {background-color:' + palette . DarkMuted . getHex ( ) + ';}'
17
+ if ( css . styleSheet ) css . styleSheet . cssText = style
18
+ else css . appendChild ( document . createTextNode ( styles ) )
19
+ document . getElementsByTagName ( 'head' ) [ 0 ] . appendChild ( css )
20
+ } ) ;
21
+ </ script >
11
22
</ body >
12
23
</ html >
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<div id =" app" >
3
- <router-link to =" /" ><img src =" /assets/ logo-large .png" class =" logo" ></router-link >
3
+ <router-link to =" /" ><img src =" logo.png" class =" logo" ></router-link >
4
4
<a href =" /admin" class =" admin" >Admin</a >
5
5
<router-view />
6
6
<footer >
11
11
12
12
<script >
13
13
export default {
14
- name: ' app' ,
15
- created () {
16
- this .setStyling ()
17
- },
18
- methods: {
19
- setStyling () {
20
- var store = window .localStorage
21
- var css = document .createElement (' style' )
22
- css .type = ' text/css'
23
- var styles = ' a {color:' + store .getItem (' colourLink' ) + ' ;} footer {background-color:' + store .getItem (' colourAccent' ) + ' ;}'
24
- if (css .styleSheet ) css .styleSheet .cssText = styles
25
- else css .appendChild (document .createTextNode (styles))
26
- document .getElementsByTagName (' head' )[0 ].appendChild (css)
27
- store .setItem (' applied' , true )
28
- }
29
- }
14
+ name: ' app'
30
15
}
31
16
</script >
32
17
Original file line number Diff line number Diff line change 3
3
import Vue from 'vue'
4
4
import App from './App'
5
5
import router from './router'
6
- import * as Vibrant from 'node-vibrant'
7
-
8
- Vue . mixin ( {
9
- created : function ( ) {
10
- var colours = this . $options . colours
11
- var store = window . localStorage
12
- Vibrant . from ( '/assets/logo-large.png' ) . getPalette ( ( err , p ) => {
13
- if ( err === null ) {
14
- colours = p
15
- console . log ( p )
16
- var colourLink = colours . Vibrant . getHex ( )
17
- try {
18
- var colourAccent = colours . LightVibrant . getHex ( )
19
- } catch ( e ) {
20
- colourAccent = colours . DarkVibrant . getHex ( )
21
- }
22
- store . setItem ( 'colourLink' , colourLink )
23
- store . setItem ( 'colourAccent' , colourAccent )
24
- if ( ! store . getItem ( 'applied' ) ) {
25
- location . reload ( )
26
- }
27
- } else {
28
- console . log ( err )
29
- }
30
- } )
31
- }
32
- } )
33
6
34
7
Vue . config . productionTip = false
35
8
You can’t perform that action at this time.
0 commit comments