<!doctype html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Skittles Puzzle</title>
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
    	<meta name="description" content="Skittles Puzzle">
    	<meta name="viewport" content="width=device-width,initial-scale=1">
		<!-- Main stylesheet -->
		<link rel="stylesheet" href="<?php echo asset('css/style.min.css'); ?>">
	</head>
	<body>

		<!-- $ SUBMIT RESULT FORM $ -->
		<div class="popup">
			<h1>Congratulations!</h1>
			<p>You have won. Enter your name or nickname below.</p>
			<form id="result">
				<div class="response"></div>
				<p>
					<label for="nickname">Name or nickname</label>
					<input type="text" name="nickname" id="nickname" required>
				</p>
				<p>
					<label for="time">Your time</label>
					<input type="text" name="time" id="time" readonly>
				</p>
				<p>
					<input type="submit" value="Send">
				</p>
			</form>
		</div>

		<!-- $ WRAPPER $ -->
		<div class="wrapper">
			<div class="layout">

				<!-- $ LEFT COLUMN $ -->
				<div class="right-column layout__item one-whole portable-one-half">
					<figure class="skittles-logo">
						<img src="<?php echo asset('img/logo.png'); ?>" alt="Skittles logo">
					</figure>
					<div class="rules">
						<small>How to play</small>
						<ul class="list-inline">
							<li><a href="<?php echo URL::to('rules/en'); ?>"><img src="<?php echo asset('img/flags/gb.png'); ?>" alt=""></a></li>
							<li><a href="<?php echo URL::to('rules/rs'); ?>"><img src="<?php echo asset('img/flags/rs.png'); ?>" alt=""></a></li>
							<li><a href="<?php echo URL::to('rules/hr'); ?>"><img src="<?php echo asset('img/flags/hr.png'); ?>" alt=""></a></li>
							<li><a href="<?php echo URL::to('rules/sl'); ?>"><img src="<?php echo asset('img/flags/si.png'); ?>" alt=""></a></li>
							<li><a href="<?php echo URL::to('rules/ba'); ?>"><img src="<?php echo asset('img/flags/ba.png'); ?>" alt=""></a></li>
						</ul>
					</div>
					<div class="stopwatch">
						<i class="ion ion-ios7-alarm-outline"></i>
						<span class="timer"></span>
					</div>
					<div id="surface"></div>
					<div id="level"></div>
					<div class="standings">
						<h1>The Fastest Skittles Players</h1>
						<ul class="list-bare">
							<?php $place = 1; ?>
							<?php foreach($standings as $standing) : ?>
								<li><?php echo $place; ?>. <?php echo $standing->nickname; ?> (<?php echo ($standing->time / 1000) . 's'; ?>)</li>
								<?php $place++; ?>
							<?php endforeach; ?>
						</ul>
					</div>
				</div>

				<!-- $ RIGHT COLUMN $ -->
				<div class="left-column layout__item one-whole portable-one-half">
					<p class="mt mb--">Play with us!</p>
					<figure class="app-title">
						<img src="<?php echo asset('img/title.png'); ?>" alt="Skittles Puzzle">
					</figure>
					<p class="three-quarters">Place the Skittles puzzle as quickly as possible correctly in the SKITTLES image and enter your time achieved on the list of the best!</p>
					<div id="pieces"></div>
				</div>

				<!-- $ FOOTER $ -->
				<footer class="site-footer layout__item one-whole"></footer>

			</div>
		</div>

		<!-- Javascript -->
		<script src="<?php echo asset('js/scripts.min.js'); ?>"></script>
		<!--[if (gte IE 6)&(lte IE 8)]>
			<script type="text/javascript" src="js/selectivizr.min.js"></script>
		<![endif]-->
	</body>
</html>