Commit 6b040e69 authored by David Trattnig's avatar David Trattnig
Browse files

Make build configurable. #1

parent d32e68f2
...@@ -2,3 +2,4 @@ ...@@ -2,3 +2,4 @@
/public/build/ /public/build/
.DS_Store .DS_Store
.env
NAME="Studio Clock"
LOGO="https://gitlab.servus.at/aura/meta/-/raw/master/images/aura-logo.png"
LOGO_SIZE="100px"
API_URL="http://localhost:8008/api/v1/"
UNKNOWN_TITLE="Unknown Title"
NO_CURRENT_SCHEDULE="Right now, there's no show playing"
NO_NEXT_SCHEDULE="Nothing scheduled next"
PLAY_OFFSET=3
CSS=""
\ No newline at end of file
NAME="Orange 94.0"
LOGO="https://o94.at/themes/custom/radio_orange/logo1.png"
LOGO_SIZE=180px
API_URL="http://localhost:8008/api/v1/"
UNKNOWN_TITLE="Unbekannter Titel"
NO_CURRENT_SCHEDULE="Derzeit keine Sendung"
NO_NEXT_SCHEDULE="Keine weiteren Sendungen"
PLAY_OFFSET=3
CSS="/css/o94.css"
...@@ -63,6 +63,16 @@ ...@@ -63,6 +63,16 @@
"resolve": "^1.14.2" "resolve": "^1.14.2"
} }
}, },
"@rollup/plugin-replace": {
"version": "2.3.3",
"resolved": "https://registry.npmjs.org/@rollup/plugin-replace/-/plugin-replace-2.3.3.tgz",
"integrity": "sha512-XPmVXZ7IlaoWaJLkSCDaa0Y6uVo5XQYHhiMFzOd5qSv5rE+t/UJToPIOE56flKIxBFQI27ONsxb7dqHnwSsjKQ==",
"dev": true,
"requires": {
"@rollup/pluginutils": "^3.0.8",
"magic-string": "^0.25.5"
}
},
"@rollup/pluginutils": { "@rollup/pluginutils": {
"version": "3.1.0", "version": "3.1.0",
"resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz", "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz",
...@@ -234,6 +244,12 @@ ...@@ -234,6 +244,12 @@
"resolved": "https://registry.npmjs.org/console-clear/-/console-clear-1.1.1.tgz", "resolved": "https://registry.npmjs.org/console-clear/-/console-clear-1.1.1.tgz",
"integrity": "sha512-pMD+MVR538ipqkG5JXeOEbKWS5um1H4LUUccUQG68qpeqBYbzYy79Gh55jkd2TtPdRfUaLWdv6LPP//5Zt0aPQ==" "integrity": "sha512-pMD+MVR538ipqkG5JXeOEbKWS5um1H4LUUccUQG68qpeqBYbzYy79Gh55jkd2TtPdRfUaLWdv6LPP//5Zt0aPQ=="
}, },
"dotenv": {
"version": "8.2.0",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.2.0.tgz",
"integrity": "sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw==",
"dev": true
},
"escape-string-regexp": { "escape-string-regexp": {
"version": "1.0.5", "version": "1.0.5",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
......
* {
font-family: "SFMono-Regular",Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
}
#station-name {
margin-top: 18px;
}
\ No newline at end of file
...@@ -7,24 +7,25 @@ ...@@ -7,24 +7,25 @@
<title>Aura Engine - Studio Clock</title> <title>Aura Engine - Studio Clock</title>
<link rel='icon' type='image/png' href='/favicon.png'> <link rel='icon' type='image/png' href='/favicon.png'>
<link rel='stylesheet' href='/global.css'>
<link rel='stylesheet' href='/build/aura-clock-bundle.css'> <link rel='stylesheet' href='/build/aura-clock-bundle.css'>
<script defer src='/build/aura-clock-bundle.js'></script> <script defer src='/build/aura-clock-bundle.js'></script>
</head> </head>
<body style="background-color: black;"> <body style="background-color: black;">
<aura-clock
<aura-clock />
<!-- <aura-clock
name="Radio Orange" name="Radio Orange"
logo="https://o94.at/themes/custom/radio_orange/logo1.png" logo="https://o94.at/themes/custom/radio_orange/logo1.png"
logosize="180px" logosize="180px"
api="http://localhost:8008/api/v1/" api="http://localhost:8008/api/v1/"
css="/sample/o94.css" css="/css/o94.css"
unknowntitle="Unbekannter Titel" unknowntitle="Unbekannter Titel"
nocurrentschedule="Derzeit keine Sendung" nocurrentschedule="Derzeit keine Sendung"
nonextschedule="Keine weiteren Sendungen" nonextschedule="Keine weiteren Sendungen"
playoffset=3> playoffset=3>
</aura-clock> -->
</aura-clock>
</body> </body>
</html> </html>
...@@ -3,6 +3,8 @@ import resolve from '@rollup/plugin-node-resolve'; ...@@ -3,6 +3,8 @@ import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs'; import commonjs from '@rollup/plugin-commonjs';
import livereload from 'rollup-plugin-livereload'; import livereload from 'rollup-plugin-livereload';
import { terser } from 'rollup-plugin-terser'; import { terser } from 'rollup-plugin-terser';
import replace from '@rollup/plugin-replace';
import {config} from 'dotenv';
const production = !process.env.ROLLUP_WATCH; const production = !process.env.ROLLUP_WATCH;
...@@ -15,6 +17,11 @@ export default { ...@@ -15,6 +17,11 @@ export default {
file: 'public/build/aura-clock-bundle.js' file: 'public/build/aura-clock-bundle.js'
}, },
plugins: [ plugins: [
replace({
globalConfig: JSON.stringify(config().parsed)
}),
svelte({ svelte({
// enable run-time checks when not in production // enable run-time checks when not in production
dev: !production, dev: !production,
......
...@@ -2,15 +2,16 @@ ...@@ -2,15 +2,16 @@
<main bind:this={rootElement}></main> <main bind:this={rootElement}></main>
<script> <script>
import { onMount, afterUpdate } from 'svelte'; import { onMount, afterUpdate } from 'svelte';
export let css = "";
export let api = "http://localhost:8008/api/v1/"; export let css = globalConfig.CSS;
export let name = "Studio Clock"; export let api = globalConfig.API_URL;
export let logo = "https://gitlab.servus.at/aura/meta/-/raw/master/images/aura-logo.png"; export let name = globalConfig.NAME;
export let logosize = "100px"; export let logo = globalConfig.LOGO;
export let nocurrentschedule = "Right now, there's no show playing"; export let logosize = globalConfig.LOGO_SIZE;
export let nonextschedule = "Nothing scheduled next!"; export let nocurrentschedule = globalConfig.NO_CURRENT_SCHEDULE;
export let unknowntitle = "Unknown Title"; export let nonextschedule = globalConfig.NO_NEXT_SCHEDULE;
export let playoffset = 3; export let unknowntitle = globalConfig.UNKNOWN_TITLE;
export let playoffset = globalConfig.PLAY_OFFSET;
let time = new Date(); let time = new Date();
let queryCurrent = "clock"; let queryCurrent = "clock";
...@@ -249,31 +250,14 @@ ...@@ -249,31 +250,14 @@
<style> <style>
#station-header { * {
width: 100%; font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
height: 50px;
padding: 40px 100px;
}
#station-name {
margin: 0;
font-size: 3em;
line-height: 80px;
color: #AAA;
}
#station-logo {
align-content: left;
text-align: right;
margin: 0 40px 0 10px;
opacity: 0.88;
filter: invert(100%);
} }
#studio-clock { #studio-clock {
width: calc(100% - 200px); width: calc(100% - 200px);
height: calc(100% - 500px); height: calc(100% - 500px);
margin: 100px; margin: 0 50px 50px 50px;
display: -webkit-flex; display: -webkit-flex;
display: -ms-flexbox; display: -ms-flexbox;
display: flex; display: flex;
...@@ -287,9 +271,36 @@ ...@@ -287,9 +271,36 @@
#right-column { #right-column {
width: 70%; width: 70%;
margin-top: 220px;
padding: 25px 25px 25px 50px; padding: 25px 25px 25px 50px;
} }
#station-header {
width: 100%;
height: 220px;
padding: 0 0 130px 0;
}
#station-wrapper {
text-align: center;
}
#station-name {
margin: 0;
font-size: 3em;
line-height: 60px;
color: #CCC;
font-variant: all-small-caps;
}
#station-logo {
align-content: left;
text-align: right;
margin: 0 0 0 0;
opacity: 0.88;
filter: invert(100%);
}
#current-schedule { #current-schedule {
border: 2px solid #333; border: 2px solid #333;
margin: 20px 20px 40px 20px; margin: 20px 20px 40px 20px;
...@@ -372,7 +383,6 @@ ...@@ -372,7 +383,6 @@
font-size: 1.5em; font-size: 1.5em;
} }
.play-icon,
.track-time-left { .track-time-left {
margin: 25px 50px; margin: 25px 50px;
} }
...@@ -396,7 +406,7 @@ ...@@ -396,7 +406,7 @@
} }
.error { .error {
font-size: 1.1em; font-size: 0.8em;
color:red; color:red;
height:100%; height:100%;
display : flex; display : flex;
...@@ -406,7 +416,6 @@ ...@@ -406,7 +416,6 @@
svg { svg {
width: 100%; width: 100%;
height: 100%;
} }
.clock-face { .clock-face {
...@@ -454,13 +463,16 @@ ...@@ -454,13 +463,16 @@
<div id="station-header">
<img id="station-logo" src="{logo}" style="width:{logosize}" alt="Radio Station" align="left" />
<h1 id="station-name">{name}</h1>
</div>
<div id="studio-clock"> <div id="studio-clock">
<div id="left-column" class="column"> <div id="left-column" class="column">
<div id="station-header">
<div id="station-wrapper">
<img id="station-logo" src="{logo}" style="width:{logosize}" alt="Radio Station" align="center" />
<h1 id="station-name">{name}</h1>
</div>
</div>
<svg viewBox='-50 -50 100 100'> <svg viewBox='-50 -50 100 100'>
<circle class='clock-face' r='48'/> <circle class='clock-face' r='48'/>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment