

<?php $__env->startSection('title'); ?>
Character
<?php $__env->stopSection(); ?>

<?php $__env->startSection('meta'); ?>
<meta property="og:title" content="Character - Tadah" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://tadah.tk/" />
<meta property="og:image" content="/images/tadaht.png" />
<meta property="og:description" content="Change your character" />
<meta name="theme-color" content="#0000FF">
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
	<div class="container">
		<div class="row">
			<div class="col-md-3">
				<div class="card">
					<div class="card-header">Character</div>
					<div class="card-body">
						<button id="regenerateThumbnail" class="btn btn-primary btn-block">Regenerate</button>
						<img src="<?php echo e(route('users.thumbnail', Auth::user()->id)); ?>" class="img-fluid" alt="Character image">
					</div>
				</div>
			</div>
			<div class="col-md-8">
				<div class="card">
					<div class="card-header">
						<ul class="nav nav-tabs card-header-tabs">
							<li class="nav-item"><a class="nav-link<?php echo (!isset($type) ? ' active' : ''); ?>" href="<?php echo e(route('users.characterbodycolors')); ?>">Body Colors</a></li>
							<li class="nav-item"><a class="nav-link<?php echo ($type == "Hat" ? ' active' : ''); ?>" href="<?php echo e(route('users.characteritems', 'hats')); ?>">Hats</a></li>
							<li class="nav-item"><a class="nav-link<?php echo ($type == "T-Shirt" ? ' active' : ''); ?>" href="<?php echo e(route('users.characteritems', 'tshirts')); ?>">T-Shirts</a></li>
							<li class="nav-item"><a class="nav-link<?php echo ($type == "Shirt" ? ' active' : ''); ?>" href="<?php echo e(route('users.characteritems', 'shirts')); ?>">Shirts</a></li>
							<li class="nav-item"><a class="nav-link<?php echo ($type == "Pants" ? ' active' : ''); ?>" href="<?php echo e(route('users.characteritems', 'pants')); ?>">Pants</a></li>
							<li class="nav-item"><a class="nav-link<?php echo ($type == "Face" ? ' active' : ''); ?>" href="<?php echo e(route('users.characteritems', 'faces')); ?>">Faces</a></li>
						</ul>
					</div>
					<div class="card-body">
                        <?php if($items->count() > 0): ?>
                            <div class="row mx-auto -mb-2 -m-2">
                                <?php $__currentLoopData = $items->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <div class="col-12 col-sm-4 col-md-2 p-2">
                                        <div class="card mb-2 border-0 text-center" style="width: 100%; height: 175px">
                                            <img class="card-img-top" style="object-fit: contain;" src="<?php echo e(route('catalog.getthumbnail', $item->id)); ?>" width="100" height="100" alt="<?php echo e($item->name); ?> thumbnail">
                                            <div class="card-body p-1" style="display: block;">
                                                <div class="text-truncate" style=""><?php echo e($item->name); ?></div>
                                                <form method="POST" action="<?php echo e(url('/character/toggle/' . $item->id)); ?>">
                                                    <?php echo csrf_field(); ?>
                                                    <button type="submit" style="width: 100%" class="btn btn-sm btn-<?php echo e(($item->wearing) ? "danger" : "primary"); ?>"><?php echo e(($item->wearing) ? "Remove" : "Equip"); ?></button>
                                                </form>
                                            </div>
                                        </div>
                                    </div>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </div>
                        <?php else: ?>
                            <div class="col text-center">
                                <h2>Nothing found</h2>
                                <p>You don't own any items in this category.</p>
                            </div>
                        <?php endif; ?>
					</div>
				</div>
			</div>
		</div>
	</div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('scripts'); ?>
	<script>
        // Inherited from RBLXhue circa. 2016 (with permission)
        // Thanks, Raymonf
        $(document).ready(function() {
			$.ajaxSetup({
				headers: {
					'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
				}
			})

			$('#regenerateThumbnail').click(function(evt) {
				alert('Not implemented. It\'ll be announced when thumbnails are live!');
                /*var $t = $(this);
				$.ajax({
					type: "POST",
					url: "/character/regen",
					success: function (msg){
						if(msg.startsWith("OK")) {
							$t.html("Regenerating");
							$t.addClass("disabled");
						} else {
							alert(msg);
						}
					}
				});
				evt.preventDefault();
				return false;*/
			});
		});
	</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH D:\project\tadah\tadah\resources\views/users/character.blade.php ENDPATH**/ ?>