45 lines
1.4 KiB
JavaScript
45 lines
1.4 KiB
JavaScript
// Start when DOM is ready
|
|
$(function() {
|
|
// Create Chocolats
|
|
chocosFaces();
|
|
// Init Emballage
|
|
$('.flip-container').addClass('argent');
|
|
|
|
|
|
});
|
|
|
|
|
|
// --- FUNCTIONS
|
|
function chocosFaces()
|
|
{
|
|
// Background
|
|
var chocosNum = 5;
|
|
for (i = 1; i < chocosNum+1; i++) {
|
|
$('.chocos-holder .choco'+i+' .front').css('background-image', 'url('+themeImg+'/chocos/'+i+'F.png)');
|
|
$('.chocos-holder .choco'+i+' .back').css('background-image', 'url('+themeImg+'/chocos/'+i+'B.png)');
|
|
}
|
|
|
|
// Texte
|
|
// Faces chocos identiques
|
|
if(theme == "chocolate" || theme == "cinema" || theme == "oriental" || theme == "champetre") {
|
|
$('#base-txt .noms-holder').clone().appendTo(".chocos-holder .front");
|
|
$('#base-txt .date-holder-line').clone().appendTo(".chocos-holder .back");
|
|
}
|
|
// Faces chocos différentes
|
|
else {
|
|
$('#base-txt .noms-holder').clone().appendTo(".chocos-holder .choco1 .front");
|
|
$('#base-txt .date-holder').clone().appendTo(".chocos-holder .choco2 .front");
|
|
$('#base-txt .noms-holder').clone().appendTo(".chocos-holder .choco4 .front");
|
|
}
|
|
// Specific theme
|
|
if(theme == "fleurs" || theme == "tendance" || theme == "uv" || theme == "voyage" || theme == "vintage" || theme == "gourmandise") {
|
|
$('#base-txt .noms-holder').clone().appendTo(".chocos-holder .choco5 .front");
|
|
}
|
|
}
|
|
|
|
function paramEmballage()
|
|
{
|
|
$('.flip-container').addClass($('#emballage:checked').val());
|
|
}
|
|
|