61 lines
2.6 KiB
JavaScript
Raw Normal View History

2017-06-22 09:39:42 +02:00
function updateFaces()
{
// reset faces
$('.chocos-holder').find('.noms-holder').remove();
$('.chocos-holder').find('.date-holder').remove();
$('.face-custom-txt').removeClass('face-custom-txt');
$('.face-custom-img').removeClass('face-custom-img');
$(".chocos-holder").empty()
$(".chocos-holder").html($('#temp-base .chocos').contents().clone());
//CHOCOS
// faces chocos identiques
if(theme == "chocolate" || theme == "cinema" || theme == "oriental" || theme == "champetre")
{
//chocos
$('#custom_elmts .noms-holder').clone().appendTo(".chocos-holder .front")
$('#custom_elmts .date-holder-line').clone().appendTo(".chocos-holder .back")
$('.chocos-holder .front').css({'background-image':'url('+themeImg+'/chocos/face_13.png)'})
$('.chocos-holder .back').css({'background-image':'url('+themeImg+'/chocos/face_14.png)'})
//pochette
$('#custom_elmts .noms-holder').clone().appendTo(".container-pochette .front")
$('#custom_elmts .date-holder-line').clone().appendTo(".container-pochette .back")
}
// faces chocos différentes
else
{
//chocos
$('#custom_elmts .noms-holder').clone().appendTo(".chocos-holder .choco1 .front")
$('#custom_elmts .noms-holder').clone().appendTo(".chocos-holder .choco4 .front")
$('#custom_elmts .date-holder').clone().appendTo(".chocos-holder .choco2 .front")
$('.chocos-holder .choco1 .front').css({'background-image':'url('+themeImg+'/chocos/01.png)'})
$('.chocos-holder .choco1 .back').css({'background-image':'url('+themeImg+'/chocos/02.png)'})
$('.chocos-holder .choco2 .front').css({'background-image':'url('+themeImg+'/chocos/03.png)'})
$('.chocos-holder .choco2 .back').css({'background-image':'url('+themeImg+'/chocos/04.png)'})
$('.chocos-holder .choco3 .front').css({'background-image':'url('+themeImg+'/chocos/05.png)'})
$('.chocos-holder .choco3 .back').css({'background-image':'url('+themeImg+'/chocos/06.png)'})
$('.chocos-holder .choco4 .front').css({'background-image':'url('+themeImg+'/chocos/07.png)'})
$('.chocos-holder .choco4 .back').css({'background-image':'url('+themeImg+'/chocos/08.png)'})
$('.chocos-holder .choco5 .front').css({'background-image':'url('+themeImg+'/chocos/09.png)'})
$('.chocos-holder .choco5 .back').css({'background-image':'url('+themeImg+'/chocos/10.png)'})
}
if(theme == "fleurs" || theme == "tendance" || theme == "uv" || theme == "voyage" || theme == "vintage" || theme == "gourmandise")
{
$('#custom_elmts .noms-holder').clone().appendTo(".chocos-holder .choco5 .front")
}
$('.chocos-holder .flip-container').eq(4).show();
}
//Start when DOM is ready
$(function() {
updateFaces();
});