57 lines
2.4 KiB
JavaScript
57 lines
2.4 KiB
JavaScript
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/1F.png)'})
|
|
$('.chocos-holder .back').css({'background-image':'url('+themeImg+'/chocos/1B.png)'})
|
|
}
|
|
// 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/1F.png)'})
|
|
$('.chocos-holder .choco1 .back').css({'background-image':'url('+themeImg+'/chocos/1B.png)'})
|
|
$('.chocos-holder .choco2 .front').css({'background-image':'url('+themeImg+'/chocos/2F.png)'})
|
|
$('.chocos-holder .choco2 .back').css({'background-image':'url('+themeImg+'/chocos/2B.png)'})
|
|
$('.chocos-holder .choco3 .front').css({'background-image':'url('+themeImg+'/chocos/3F.png)'})
|
|
$('.chocos-holder .choco3 .back').css({'background-image':'url('+themeImg+'/chocos/3B.png)'})
|
|
$('.chocos-holder .choco4 .front').css({'background-image':'url('+themeImg+'/chocos/4F.png)'})
|
|
$('.chocos-holder .choco4 .back').css({'background-image':'url('+themeImg+'/chocos/4B.png)'})
|
|
$('.chocos-holder .choco5 .front').css({'background-image':'url('+themeImg+'/chocos/5F.png)'})
|
|
$('.chocos-holder .choco5 .back').css({'background-image':'url('+themeImg+'/chocos/5B.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();
|
|
});
|