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

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

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

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