Date et couleur

This commit is contained in:
Michael RICOIS 2017-10-09 18:05:56 +02:00
parent abf65e8fd2
commit 70f9e3937c

View File

@ -12,10 +12,10 @@ var monthR = ["","Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Ao
var faceDeg = {
'top': { 'x': 0, 'y': 0, },
'bottom': { 'x': 0, 'y': 0, },
'back': { 'x': 0, 'y': 0, },
'front': { 'x': 0, 'y': 45, },
'left': { 'x': 0, 'y': 0, },
'right': { 'x': 0, 'y': 0, },
'back': { 'x': 0, 'y': 180, },
'front': { 'x': 0, 'y': -45, },
'left': { 'x': 0, 'y': 90, },
'right': { 'x': 0, 'y': -90, },
};
if (theme == "damier") {
@ -226,18 +226,8 @@ function initFaces()
$(".container-db .db-cube1 .back").append('<div class="face-custom-txt face-custom-img"></div>')
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;
}
// DC
$('#custom_elmts .noms-holder').clone().appendTo(".container-db .db-cube1 .front")
@ -304,7 +294,12 @@ $('#PERSOTXT').on('keyup click', function(){
$('#DATEMARIAGE').on('change click', function(e) {
defDATEMARIAGE($(this));
rotateDC(0,90);
var obj = $('.doublecube-holder .date-holder');
if (obj.length == 0) {
var obj = $('.doublecube-holder .date-holder-line');
}
var face = facename(obj);
rotateDC(faceDeg[face]['x'],faceDeg[face]['y']);
});
$('#FACELIBRE').on('change', function(e) {
@ -475,6 +470,23 @@ function defDOUBLECUBEIMAGE(obj){
}
}
function facename(obj){
var face = obj.parent('.cubeface');
if(face.hasClass('top')){
return 'top';
} else if(face.hasClass('bottom')){
return 'bottom';
} else if(face.hasClass('back')){
return 'back';
} else if(face.hasClass('front')){
return 'front';
} else if(face.hasClass('left')){
return 'left';
} else if(face.hasClass('right')){
return 'right';
}
}
function formatDateInput(date)
{
var day = date.substring(6,8);