This commit is contained in:
Michael RICOIS 2017-10-02 10:12:18 +02:00
parent 8929972c06
commit 34cb3bd299

View File

@ -194,62 +194,172 @@ function initFaces()
// Reset
$('.chocos-holder').find('.noms-holder').remove();
$('.chocos-holder').find('.date-holder').remove();
$(".chocos-holder").empty();
$(".chocos-holder").html($('#temp-base .chocos').contents().clone());
$('.chocos-holder').empty();
$('.chocos-holder').html($('#temp-base .chocos').contents().clone());
$('.chocos-holder .flipper .front').html('<div class="colorface color_1"></div><div class="colorface color_2"></div>');
$('.chocos-holder .flipper .back').html('<div class="colorface color_1"></div><div class="colorface color_2"></div>');
$('.container-pochette').find('.noms-holder').remove();
$('.container-pochette').find('.date-holder').remove();
$(".container-pochette").empty();
$(".container-pochette").html($('#temp-base .pochettes').contents().clone());
$('.container-pochette').empty();
$('.container-pochette').html($('#temp-base .pochettes').contents().clone());
$('.container-pochette .pochette .front').html('<div class="colorface color_1"></div><div class="colorface color_2"></div>');
$('.container-pochette .pochette .back').html('<div class="colorface color_1"></div><div class="colorface color_2"></div>');
$(".color_1").addClass(color1);
$(".color_2").addClass(color2);
$('.color_1').addClass(color1);
$('.color_2').addClass(color2);
$('.switch').removeClass('switch');
// Chocos
var color = (color1 == "blanc" || color1 == "ivoire") ? 'noir' : color2;
$('.chocos-holder .choco1 .front .color_2').css({'background-image':'url('+themeImg+'/chocos/'+color2+'/1F.png)'});
$('.chocos-holder .choco1 .back .color_2').css({'background-image':'url('+themeImg+'/chocos/'+color+'/1B.png)'});
$('.chocos-holder .choco1 .front .color_1').css({'background-image':'url('+themeImg+'/chocos/'+color1+'/2F.png)'});
$('.chocos-holder .choco2 .back .color_1').css({'background-image':'url('+themeImg+'/chocos/'+color1+'/2B.png)'});
$('.chocos-holder .choco3 .front .color_2').css({'background-image':'url('+themeImg+'/chocos/'+color2+'/3F.png)'});
$('.chocos-holder .choco3 .back .color_2').css({'background-image':'url('+themeImg+'/chocos/'+color+'/3B.png)'});
$('.chocos-holder .choco4 .front .color_1').css({'background-image':'url('+themeImg+'/chocos/'+color1+'/4F.png)'});
$('.chocos-holder .choco4 .back .color_1').css({'background-image':'url('+themeImg+'/chocos/'+color1+'/4B.png)'});
$('.chocos-holder .choco5 .front .color_2').css({'background-image':'url('+themeImg+'/chocos/'+color2+'/5F.png)'});
$('.chocos-holder .choco5 .back .color_2').css({'background-image':'url('+themeImg+'/chocos/'+color+'/5B.png)'});
$('#custom_elmts .noms-holder').clone().appendTo(".chocos-holder .choco1 .front .color_2");
$('#custom_elmts .date-holder').clone().appendTo(".chocos-holder .choco2 .front .color_1");
$('#custom_elmts .noms-holder').clone().appendTo(".chocos-holder .choco4 .front .color_1");
$(".chocos-holder .choco2").addClass('switch');
$(".chocos-holder .choco4").addClass('switch');
$('.chocos-holder').addClass(theme);
$('.chocos-holder .color_1').css({ 'background-color':colorRGB[color1]});
$('.chocos-holder .color_2').css({ 'color':colorRGB[color2]});
$('.chocos-holder .switch .color_1').css({ 'color':colorRGB[color1]});
$('.chocos-holder .switch .color_2').css({'background-color':colorRGB[color2]});
$('.chocos-holder .flip-container').eq(4).hide();
if (theme == 'damier') {
var color = (color1 == "blanc" || color1 == "ivoire") ? 'noir' : color2;
$('.chocos-holder .choco1 .front .color_2').css({'background-image':'url('+themeImg+'/chocos/'+color2+'/1F.png)'});
$('.chocos-holder .choco1 .back .color_2').css({'background-image':'url('+themeImg+'/chocos/'+color+'/1B.png)'});
$('.chocos-holder .choco1 .front .color_1').css({'background-image':'url('+themeImg+'/chocos/'+color1+'/2F.png)'});
$('.chocos-holder .choco2 .back .color_1').css({'background-image':'url('+themeImg+'/chocos/'+color1+'/2B.png)'});
$('.chocos-holder .choco3 .front .color_2').css({'background-image':'url('+themeImg+'/chocos/'+color2+'/3F.png)'});
$('.chocos-holder .choco3 .back .color_2').css({'background-image':'url('+themeImg+'/chocos/'+color+'/3B.png)'});
$('.chocos-holder .choco4 .front .color_1').css({'background-image':'url('+themeImg+'/chocos/'+color1+'/4F.png)'});
$('.chocos-holder .choco4 .back .color_1').css({'background-image':'url('+themeImg+'/chocos/'+color1+'/4B.png)'});
$('.chocos-holder .choco5 .front .color_2').css({'background-image':'url('+themeImg+'/chocos/'+color2+'/5F.png)'});
$('.chocos-holder .choco5 .back .color_2').css({'background-image':'url('+themeImg+'/chocos/'+color+'/5B.png)'});
$('#custom_elmts .noms-holder').clone().appendTo(".chocos-holder .choco1 .front .color_2");
$('#custom_elmts .date-holder').clone().appendTo(".chocos-holder .choco2 .front .color_1");
$('#custom_elmts .noms-holder').clone().appendTo(".chocos-holder .choco4 .front .color_1");
$('.chocos-holder .choco2').addClass('switch');
$('.chocos-holder .choco4').addClass('switch');
$('.chocos-holder').addClass(theme);
$('.chocos-holder .color_1').css({ 'background-color':colorRGB[color1]});
$('.chocos-holder .color_2').css({ 'color':colorRGB[color2]});
$('.chocos-holder .switch .color_1').css({ 'color':colorRGB[color1]});
$('.chocos-holder .switch .color_2').css({'background-color':colorRGB[color2]});
$('.chocos-holder .flip-container').eq(4).hide();
}
else if(theme == "ruban") {
$(".chocos-holder").html($('#temp-ruban .chocos').contents().clone());
$('.chocos-holder .front').addClass('b-'+color1);
$('.chocos-holder .back').addClass('b-'+color1);
$('.chocos-holder .bande').addClass('b-'+color2);
$('.chocos-holder .txt').addClass('c-'+color1);
$('.chocos-holder .back').css({'background-image':'url('+themeImg+'/chocos/'+color2+'/1B.png)'});
$('.chocos-holder').addClass(theme);
$('.chocos-holder .flip-container').eq(4).hide();
}
else if(theme == "bayadere") {
$('.chocos-holder').html($('#temp-base .chocos').contents().clone());
$('.chocos-holder .flipper .front').html($('#temp-bayadere .bayaface').clone());
$('.chocos-holder .flipper .back').html($('#temp-bayadere .bayaface').clone());
$('.bayaface .col1').addClass('b-'+color1);
$('.bayaface .col2').addClass('b-'+color2);
$('.bayaface .col3').addClass('b-'+color1);
$('.bayaface .col4').addClass('b-'+color2);
$('#custom_elmts .noms-holder').clone().appendTo(".chocos-holder .front");
$('#custom_elmts .date-holder-line').clone().appendTo(".chocos-holder .back");
$('.chocos-holder .back .colover').css({'background-image':'url('+themeImg+'/chocos/'+color2+'/1B.png)'});
$('.chocos-holder').addClass(theme);
$('.chocos-holder .flip-container').eq(4).hide();
}
else if(theme == "liseres") {
$('.chocos-holder').html($('#temp-base .chocos').contents().clone());
$('.chocos-holder .flipper .front').html($('#temp-liseres .lisefacesmall').contents().clone());
$('.chocos-holder .flipper .back').html($('#temp-liseres .lisefacesmall').contents().clone());
var file;
if(color1 == "blanc") {
if(color2 == "argent" || color2 == "or") {
file = color2+'_et_blanc';
color = 'noir'
}
else {
file = color2;
color = color2;
}
}
else {
file = color2;
color = color2;
}
$('.chocos-holder .back .bkgface').css({'background-image':'url('+themeImg+'/chocos/'+((color1 == "blanc" || color1 == "ivoire") ? 'noir' : color2)+'/1B.png)'});
$('#custom_elmts .noms-holder').clone().appendTo(".chocos-holder .front .txtface");
$('#custom_elmts .date-holder-line').clone().appendTo(".chocos-holder .back .txtface");
$('.chocos-holder .bkgface').addClass('b-'+color1);
$('.chocos-holder .txtface').addClass('c-'+color2);
$('.chocos-holder').addClass(theme);
$('.chocos-holder .flip-container').eq(4).hide();
}
// Pochette
$('.container-pochette .pochette1 .front .color_2').css({'background-image':'url('+themeImg+'/box/'+color2+'/1F.png)'}); // 1F - 13
$('.container-pochette .pochette1 .back .color_2').css({'background-image':'url('+themeImg+'/box/'+color+'/1B.png)'}); // 1B - 14
$('.container-pochette .pochette2 .front .color_1').css({'background-image':'url('+themeImg+'/box/'+color1+'/2F.png)'}); // 2F - 15
$('.container-pochette .pochette2 .back .color_1').css({'background-image':'url('+themeImg+'/box/'+color1+'/2B.png)'}); // 2B - 16
$('.container-pochette .pochette3 .front .color_2').css({'background-image':'url('+themeImg+'/box/'+color2+'/3F.png)'}); // 3F - 17
$('.container-pochette .pochette3 .back .color_2').css({'background-image':'url('+themeImg+'/box/'+color+'/3B.png)'}); // 3B - 18
$('.container-pochette .pochette4 .front .color_1').css({'background-image':'url('+themeImg+'/box/'+color1+'/4F.png)'}); // 4F - 19
$('.container-pochette .pochette4 .back .color_1').css({'background-image':'url('+themeImg+'/box/'+color1+'/4B.png)'}); // 4B - 20
$('#custom_elmts .noms-holder').clone().appendTo(".container-pochette .pochette1 .front .color_2")
$('#custom_elmts .noms-holder').clone().appendTo(".container-pochette .pochette4 .front .color_1")
$('#custom_elmts .date-holder').clone().appendTo(".container-pochette .pochette2 .front .color_1")
$(".container-pochette .pochette2").addClass('switch')
$(".container-pochette .pochette4").addClass('switch')
$('.container-pochette').addClass(theme);
$('.container-pochette .color_1').css({ 'background-color':colorRGB[color1]})
$('.container-pochette .color_2').css({ 'color':colorRGB[color2]})
$('.container-pochette .switch .color_1').css({ 'color':colorRGB[color1]})
$('.container-pochette .switch .color_2').css({'background-color':colorRGB[color2]})
if (theme == 'damier') {
$('.container-pochette .pochette1 .front .color_2').css({'background-image':'url('+themeImg+'/box/'+color2+'/1F.png)'}); // 1F - 13
$('.container-pochette .pochette1 .back .color_2').css({'background-image':'url('+themeImg+'/box/'+color+'/1B.png)'}); // 1B - 14
$('.container-pochette .pochette2 .front .color_1').css({'background-image':'url('+themeImg+'/box/'+color1+'/2F.png)'}); // 2F - 15
$('.container-pochette .pochette2 .back .color_1').css({'background-image':'url('+themeImg+'/box/'+color1+'/2B.png)'}); // 2B - 16
$('.container-pochette .pochette3 .front .color_2').css({'background-image':'url('+themeImg+'/box/'+color2+'/3F.png)'}); // 3F - 17
$('.container-pochette .pochette3 .back .color_2').css({'background-image':'url('+themeImg+'/box/'+color+'/3B.png)'}); // 3B - 18
$('.container-pochette .pochette4 .front .color_1').css({'background-image':'url('+themeImg+'/box/'+color1+'/4F.png)'}); // 4F - 19
$('.container-pochette .pochette4 .back .color_1').css({'background-image':'url('+themeImg+'/box/'+color1+'/4B.png)'}); // 4B - 20
$('#custom_elmts .noms-holder').clone().appendTo(".container-pochette .pochette1 .front .color_2");
$('#custom_elmts .noms-holder').clone().appendTo(".container-pochette .pochette4 .front .color_1");
$('#custom_elmts .date-holder').clone().appendTo(".container-pochette .pochette2 .front .color_1");
$('.container-pochette .pochette2').addClass('switch');
$('.container-pochette .pochette4').addClass('switch');
$('.container-pochette').addClass(theme);
$('.container-pochette .color_1').css({ 'background-color':colorRGB[color1]});
$('.container-pochette .color_2').css({ 'color':colorRGB[color2]});
$('.container-pochette .switch .color_1').css({ 'color':colorRGB[color1]});
$('.container-pochette .switch .color_2').css({'background-color':colorRGB[color2]});
$('.container-pochette').addClass(theme);
}
else if(theme == "ruban") {
$('.container-pochette').html($('#temp-ruban .pochettes').contents().clone());
$('.container-pochette .front').addClass('b-'+color1);
$('.container-pochette .back').addClass('b-'+color1);
$('.container-pochette .bande').addClass('b-'+color2);
$('.container-pochette .txt').addClass('c-'+color1);
$('.container-pochette .back').css({'background-image':'url('+themeImg+'/box/'+color+'/1B.png)'});
$('.container-pochette').addClass(theme);
}
else if(theme == "bayadere") {
$(".container-pochette").html($('#temp-base .pochettes').contents().clone());
$('.container-pochette .pochette .front').html($('#temp-bayadere .bayaface').clone());
$('.container-pochette .pochette .back').html($('#temp-bayadere .bayaface').clone());
$('.bayaface .col1').addClass('b-'+color1);
$('.bayaface .col2').addClass('b-'+color2);
$('.bayaface .col3').addClass('b-'+color1);
$('.bayaface .col4').addClass('b-'+color2);
$('#custom_elmts .noms-holder').clone().appendTo(".container-pochette .front");
$('#custom_elmts .date-holder-line').clone().appendTo(".container-pochette .back");
$('.container-pochette .back .colover').css({'background-image':'url('+themeImg+'/box/'+color+'/1B.png)'});
$('.container-pochette').addClass(theme);
}
else if(theme == "liseres") {
$('.container-pochette').html($('#temp-base .pochettes').contents().clone());
$('.container-pochette .pochette .front').html($('#temp-liseres .lisefacesmall').contents().clone());
$('.container-pochette .pochette .back').html($('#temp-liseres .lisefacesmall').contents().clone());
var file;
if(color1 == "blanc") {
if(color2 == "argent" || color2 == "or") {
file = color2+'_et_blanc';
color = 'noir'
}
else {
file = color2;
color = color2;
}
}
else {
file = color2;
color = color2;
}
$('.container-pochette .back .bkgface').css({'background-image':'url('+themeImg+'/chocos/'+((color1 == "blanc" || color1 == "ivoire") ? 'noir' : color2)+'/1B.png)'});
$('#custom_elmts .noms-holder').clone().appendTo(".container-pochette .front .txtface");
$('#custom_elmts .date-holder-line').clone().appendTo(".container-pochette .back .txtface");
$('.container-pochette .bkgface').addClass('b-'+color1);
$('.container-pochette .txtface').addClass('c-'+color2);
$('.container-pochette').addClass(theme);
}
}