<script>
	import { templates } from '$lib/templates/templates';

	/** @type number */ export let templateIndex;
	import { time, multiplier } from '$lib/stores/store';
</script>

{#if templates[templateIndex] && $time !== ''}
	<div
		class="time"
		style="
    top: {templates[templateIndex].time.top}px;
    height: {templates[templateIndex].time.height}px;
    left: {templates[templateIndex].time.left}px;
    right: {templates[templateIndex].time.right}px;
    color: {templates[templateIndex].time.color};
    font-size: {templates[templateIndex].time.fontSize * $multiplier}px;
    font-family: {templates[templateIndex].time.fontFamily};
		text-align: {templates[templateIndex].time.textAlign};
		font-weight: {templates[templateIndex].time.fontWeight};
		line-height: {templates[templateIndex].time.lineHeight}px;
    "
	>
		{$time}
	</div>
{/if}

<style>
	.time {
		position: absolute;
		text-transform: uppercase;
		overflow: hidden;
		display: block;
	}
</style>
