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

	/** @type number */ export let templateIndex;
	import { subtitle, multiplier } from '$lib/stores/store';
	console.log($multiplier);
</script>

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

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