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

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

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

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

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