From f079c8447ceb675fce77e1621268b61b0fa9d6ea Mon Sep 17 00:00:00 2001 From: David Trattnig <david.trattnig@o94.at> Date: Thu, 12 Mar 2020 18:45:02 +0100 Subject: [PATCH] Clock as custom component. --- contrib/aura-clock/public/index.html | 9 +++++++-- contrib/aura-clock/rollup.config.js | 3 ++- contrib/aura-clock/src/main.js | 12 ------------ web/clock.html | 5 +++++ 4 files changed, 14 insertions(+), 15 deletions(-) diff --git a/contrib/aura-clock/public/index.html b/contrib/aura-clock/public/index.html index 1786e298..b206df49 100644 --- a/contrib/aura-clock/public/index.html +++ b/contrib/aura-clock/public/index.html @@ -8,11 +8,16 @@ <link rel='icon' type='image/png' href='/favicon.png'> <link rel='stylesheet' href='/global.css'> - <link rel='stylesheet' href='/build/bundle.css'> + <link rel='stylesheet' href='/build/aura-clock-bundle.css'> - <script defer src='/build/bundle.js'></script> + <script defer src='/build/aura-clock-bundle.js'></script> </head> <body style="background-color: black;"> + <aura-clock + name="Studio Clock" + logo="https://o94.at/themes/custom/radio_orange/logo1.png" + logosize="180px" + api="http://localhost:3333/api/v1/" /> </body> </html> diff --git a/contrib/aura-clock/rollup.config.js b/contrib/aura-clock/rollup.config.js index f79bbd64..c6a5c217 100644 --- a/contrib/aura-clock/rollup.config.js +++ b/contrib/aura-clock/rollup.config.js @@ -22,7 +22,8 @@ export default { // a separate file - better for performance css: css => { css.write('public/build/aura-clock-bundle.css'); - } + }, + customElement: true }), // If you have external dependencies installed from diff --git a/contrib/aura-clock/src/main.js b/contrib/aura-clock/src/main.js index 443224ba..edb5da3e 100644 --- a/contrib/aura-clock/src/main.js +++ b/contrib/aura-clock/src/main.js @@ -1,13 +1 @@ import StudioClock from './StudioClock.svelte'; - -const clock = new StudioClock({ - target: document.body, - props: { - stationName: "Radio Orange", - stationLogo: "https://o94.at/themes/custom/radio_orange/logo1.png", - stationLogoSize: "180px", - apiUrl: 'http://localhost:3333/api/v1/' - } -}); - -export default clock; \ No newline at end of file diff --git a/web/clock.html b/web/clock.html index 7719117b..584ea093 100644 --- a/web/clock.html +++ b/web/clock.html @@ -14,5 +14,10 @@ </head> <body style="background-color: black;"> + <aura-clock + name="Studio Clock" + logo="https://o94.at/themes/custom/radio_orange/logo1.png" + logosize="180px" + api="http://localhost:3333/api/v1/" /> </body> </html> -- GitLab