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

129 lines
3.5 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';
2022-12-27 13:32:58 -07:00
function ticker_font_color_Callback(ticker_font_color) {
let r = ticker_font_color.detail.r;
let g = ticker_font_color.detail.g;
let b = ticker_font_color.detail.b;
let a = ticker_font_color.detail.a;
let horizontal = document.querySelector(".horizontal");
horizontal.style.color = `rgba(${r},${g},${b},${a})`;
}
2022-12-27 13:32:58 -07:00
function ticker_background_color_Callback(ticker_background_color) {
let rb = ticker_background_color.detail.r;
let gb = ticker_background_color.detail.g;
let bb = ticker_background_color.detail.b;
let ab = ticker_background_color.detail.a;
let hz_background = document.querySelector(".horizontal");
hz_background.style.background = `rgba(${rb},${gb},${bb},${ab})`;
}
2022-12-25 11:58:19 -07:00
/** @type {import('./$types').ActionData} */
export let form;
2022-12-27 13:32:58 -07:00
let ticker_text_01 = 'ticker text here. Mooooo.';
let ticker_text_02 = '1234567890. qwertyuyiop. asdfghjkl. zxcvbnm. ticker text here. Mooooo. 555.';
let ticker_text_03 = '1234567890. qwertyuyiop. asdfghjkl. zxcvbnm.';
let ticker_text_04 = ' 1234567890. qwertyuyiop. asdfghjkl. zxcvbnm.';
2022-12-25 17:11:47 -07:00
2022-12-27 13:32:58 -07:00
let ticker_font_size = 2.75;
let ticker_font_weight = 600;
let ticker_speed = 30;
</script>
2022-12-26 14:35:35 -07:00
<div class="horizontal">
<!-- delay affects text starting point offset-->
2022-12-27 13:32:58 -07:00
<Ticker duration={ticker_speed} delay=0 pausing=false>
2022-12-26 14:35:35 -07:00
<span
2022-12-27 13:32:58 -07:00
style="font-size: {ticker_font_size}em;
font-weight: {ticker_font_weight}
2022-12-26 14:35:35 -07:00
">
2022-12-27 13:32:58 -07:00
{ticker_text_01}
{ticker_text_02}
{ticker_text_03}
{ticker_text_04}
2022-12-26 14:35:35 -07:00
</span>
</Ticker>
</div>
2022-12-24 14:56:55 -07:00
<div class="main">
<div class="container">
<!-- <center><h3>Scrolltron</h3></center> -->
</div>
<br>
<div class="font_color_picker">
2022-12-27 13:32:58 -07:00
Font Color: <HsvPicker on:colorChange={ticker_font_color_Callback} startColor={"#00FF00"}/>
2022-12-24 14:56:55 -07:00
</div>
<p></p>
<div class="background_color_picker">
2022-12-27 13:32:58 -07:00
Background Color: <HsvPicker on:colorChange={ticker_background_color_Callback} startColor={"#5500FF"}/>
2022-12-24 14:56:55 -07:00
</div>
2022-12-25 11:12:20 -07:00
<div class="form">
2022-12-25 15:50:53 -07:00
<p>
2022-12-27 13:32:58 -07:00
<input bind:value={ticker_text_01} placeholder="{ticker_text_01}">
<input bind:value={ticker_text_02} placeholder="{ticker_text_02}">
<input bind:value={ticker_text_03} placeholder="{ticker_text_03}">
<input bind:value={ticker_text_04} placeholder="{ticker_text_04}">
2022-12-25 15:50:53 -07:00
</p>
2022-12-27 13:32:58 -07:00
Font Size: <input type=range min="0.5" max="40" bind:value={ticker_font_size}>
Font Weight: <input type=range min="200" max="600" bind:value={ticker_font_weight}>
Speed: <input type=range min="5" max="200" bind:value={ticker_speed}>
2022-12-25 11:58:19 -07:00
</div>
2022-12-25 15:50:53 -07:00
</div>
<p></p>
<style>
2022-12-24 14:56:55 -07:00
h3 {
padding:0;
margin:0;
font-family: sans-serif;
}
p {
margin:30px 5px;
}
.horizontal{
/* padding:426px;*/
font-family: Verdana, sans-serif;
/*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);
}
.font_color_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);
}
.background_color_picker{
color: rgb(197, 123, 27);
font-family: Verdana, sans-serif;
font-weight: 600;
font-size: 2.75em;
background: rgba(128, 128, 128, 0);
}
</style>