Skip to content

Commit d27f7e1

Browse files
committed
Fixed not correctly loading image file
Will tweak the filename but it works!
1 parent 9d39380 commit d27f7e1

File tree

4 files changed

+27
-11
lines changed

4 files changed

+27
-11
lines changed

main/index.html

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,8 @@
88
<body>
99
<div id="app"></div>
1010
<!-- built files will be auto injected -->
11-
<script type="text/javascript" src="./node_modules/node-vibrant/dist/vibrant.js"></script>
1211
<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-
});
12+
2113
</script>
2214
</body>
2315
</html>

main/src/App.vue

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div id="app">
3-
<router-link to="/"><img src="logo.png" class="logo"></router-link>
3+
<router-link to="/"><img src="/static/logo-large.png" class="logo"></router-link>
44
<a href="/admin" class="admin">Admin</a>
55
<router-view/>
66
<footer>
@@ -10,9 +10,33 @@
1010
</template>
1111

1212
<script>
13+
import Vibrant from 'node-vibrant'
14+
1315
export default {
1416
name: 'app'
1517
}
18+
Vibrant.from('/static/logo-large.png').getPalette().then(function (palette) {
19+
// import Vibrant from 'node-vibrant'
20+
var css = document.createElement('style')
21+
css.type = 'text/css'
22+
var vibrant = null
23+
var muted = null
24+
console.log(palette)
25+
try {
26+
vibrant = palette.Vibrant.getHex()
27+
} catch (e) {
28+
vibrant = palette.LightVibrant.getHex()
29+
}
30+
try {
31+
muted = palette.Muted.getHex()
32+
} catch (e) {
33+
muted = palette.DarkVibrant.getHex()
34+
}
35+
var styles = 'a {color:' + vibrant + ';} footer {background-color:' + muted + ';color:' + vibrant + ';}'
36+
if (css.styleSheet) css.styleSheet.cssText = styles
37+
else css.appendChild(document.createTextNode(styles))
38+
document.getElementsByTagName('head')[0].appendChild(css)
39+
})
1640
</script>
1741

1842
<style>

main/src/components/Episode.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div class="hello" v-if="loaded">
33
<h1>{{ episode.title }}</h1>
44
<p>{{ episode.summary }}</p>
5-
<audio controls="controls" preload="none">
5+
<audio controls="controls" preload="auto">
66
Your browser doesn't support the audio tag!
77
<source :src="episode.url">
88
</audio>
File renamed without changes.

0 commit comments

Comments
 (0)