1
0
Fork 0
scrolltron/src/routes/+page.svelte

97 lines
2.2 KiB
Svelte
Raw Normal View History

<script>
import Ticker from 'svelte-ticker';
import {HsvPicker} from 'svelte-color-picker';
2022-12-25 11:58:19 -07:00
import { enhance } from '$app/forms';
function colorCallback(rgba) {
2022-12-24 14:56:55 -07:00
let r = rgba.detail.r;
let g = rgba.detail.g;
let b = rgba.detail.b;
let a = rgba.detail.a;
let horizontal = document.querySelector(".horizontal");
horizontal.style.color = `rgb(${r},${g},${b})`;
}
2022-12-25 11:58:19 -07:00
/** @type {import('./$types').ActionData} */
export let form;
2022-12-25 15:50:53 -07:00
let chyron_text_01 = 'chyron text here. Mooooo. 1234567890. qwertyuyiop. asdfghjkl. zxcvbnm. chyron text here. Mooooo. 1234567890. qwertyuyiop. asdfghjkl. zxcvbnm.';
let chyron_text_02 = ''
let chyron_text_03 = ''
let chyron_text_04 = ''
</script>
2022-12-24 14:56:55 -07:00
<div class="main">
<div class="container">
<h1>Scrolltron</h1>
</div>
<p></p>
<div class="picker">
<HsvPicker on:colorChange={colorCallback} startColor={"#00FF00"}/>
</div>
2022-12-25 11:12:20 -07:00
<div class="form">
2022-12-25 15:50:53 -07:00
<p>
<input bind:value={chyron_text_01} placeholder="{chyron_text_01}">
<input bind:value={chyron_text_02} placeholder="{chyron_text_02}">
<input bind:value={chyron_text_03} placeholder="{chyron_text_03}">
<input bind:value={chyron_text_04} placeholder="{chyron_text_04}">
</p>
2022-12-25 11:58:19 -07:00
</div>
2022-12-25 15:50:53 -07:00
</div>
<p></p>
<div class="horizontal">
<!-- delay affects text starting point offset-->
<Ticker pausing=false duration=60 delay=-10>
{chyron_text_01}
{chyron_text_02}
{chyron_text_03}
{chyron_text_04}
</Ticker>
2022-12-24 14:56:55 -07:00
</div>
<style>
2022-12-24 14:56:55 -07:00
h3 {
padding:0;
margin:0;
font-family: sans-serif;
}
p {
margin:30px 5px;
}
.horizontal{
2022-12-25 15:50:53 -07:00
padding:424px;
font-family: Verdana, sans-serif;
font-weight: 600;
font-size: 2.75em;
2022-12-25 15:50:53 -07:00
background: rgba(30, 24, 150, 0.4);
2022-12-24 14:56:55 -07:00
@keyframes horizontal {
100% { transform: translateX(-50%); }
2022-12-24 14:56:55 -07:00
}
}
.main {
}
.container{
color: pink;
font-family: Verdana, sans-serif;
font-weight: 600;
font-size: 2.75em;
background: rgba(128, 128, 128, 0);
}
2022-12-25 11:12:20 -07:00
.form{
color: rgb(156, 102, 30);
font-family: Verdana, sans-serif;
font-weight: 600;
font-size: 2.75em;
background: rgba(128, 128, 128, 0);
}
.picker{
2022-12-24 14:56:55 -07:00
color: rgb(61, 177, 206);
font-family: Verdana, sans-serif;
font-weight: 600;
font-size: 2.75em;
background: rgba(128, 128, 128, 0);
}
</style>