{% extends "base.html.twig" %}
{% block title %}{{ parent() }} | Connexion{% endblock %}
{% block stylesheets %}<link rel="stylesheet" href="{{ asset('css/connexion.css') }}">{% endblock %}
{% block h1 %}Connexion{% endblock %}
{% block content %}
<div class="wrapper col-12 d-flex flex-lg-row flex-column ">
<div class="col-lg-7 col-12 my-auto">
<img id="slideShow" class="d-block w-50 mx-auto" src="" alt="">
</div>
<div class=" col-lg-3 col-6 mb-5 mx-auto d-flex flex-column justify-content-center">
<form action="{{ path('connexion')}}" method="post" class='col-12 mx-auto text-center mt-5'>
<div class="col-12 form-group mx-auto mt-2">
<input type="text" id="inputEmail" class="form-control " name="_username" placeholder="Email">
</div>
<div class="col-12 form-group mx-auto my-3">
<div class='input-group'>
<input type="password" id="inputPassword" class="form-control" name="_password" data-toggle="password" placeholder="Mot de passe">
<span class="input-group-text bg-white">
<i class="fa fa-eye"></i>
</span>
</div>
</div>
<input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}">
<a class='reset-password-link' href="{{ path('app_forgot_password_request') }}">Mot de passe oubliƩ ?</a>
<input type="submit" value="Connexion" class="col-12 btn btn-dark my-3">
</form>
</div>
</div>
<textarea name="" hidden id="photos" cols="30" rows="10">{{photos}}</textarea>
{% endblock %}
{% block javascripts %}
<script>
var photos = JSON.parse(document.querySelector('#photos').innerHTML)
nbphotos = photos.length
function photoShow() {
let position = Math.trunc(Math.random() * (nbphotos))
let nomPhoto = photos[position]
let cheminPhoto = "{{ asset('img/photoProduitUpload/') }}"
document.getElementById('slideShow').setAttribute('src', cheminPhoto + nomPhoto)
}
photoShow()
setInterval("photoShow()", 5000);
</script>
<script src="{{ asset("js/bootstrap-show-password.min.js") }}"></script>
{% endblock %}