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

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

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

<style>
	.content {
		position: absolute;
		display: flex;
		flex-direction: column;
		overflow: hidden;
		justify-content: center;
	}
</style>
