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

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

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

    "
	>
		{$title}
	</div>
{/if}

<style>
	.title {
		position: absolute;
		overflow: hidden;
		display: flex;
		justify-content: center;
		align-items: center;
	}
</style>
