solve: bug#1 => problème de référence multiples dans les array et leurs copies réglés avec [...] et structuredCLone => problème d'ID chiffré en double entre img et graff réglé avec ajout de 'img-' et 'graff-'
task#1: finir formulaire contact (mail + captcha ?) task#2: génération multicollection + fond assortis task#3: supprimer ou modifier colorBtn task#4: responsive hauteur (autour de 1080px ?)
This commit is contained in:
+8
-8
@@ -314,13 +314,13 @@ import { toRaw } from 'vue'
|
|||||||
c = this.getRandomInt(0,graffCount);
|
c = this.getRandomInt(0,graffCount);
|
||||||
} while (a == c || c == b);
|
} while (a == c || c == b);
|
||||||
console.log(a,b,c);
|
console.log(a,b,c);
|
||||||
this.items.push(this.graffs[a],this.graffs[b],this.graffs[c]);
|
this.randomItems.push({...this.graffs[a]},{...this.graffs[b]},{...this.graffs[c]});
|
||||||
},
|
},
|
||||||
generateContent(){
|
generateContent(){
|
||||||
console.log(this.items);
|
console.log("before gen:",this.items);
|
||||||
|
this.randomItems = structuredClone(toRaw(this.items)).sort(() => Math.random()-0.5);
|
||||||
this.selectRandomGraffs();
|
this.selectRandomGraffs();
|
||||||
this.randomItems = this.items.sort(() => Math.random()-0.5),
|
console.log("random + graff:",this.randomItems);
|
||||||
console.log(this.randomItems);
|
|
||||||
this.maxItemCount = this.randomItems.length;
|
this.maxItemCount = this.randomItems.length;
|
||||||
this.divideItem();
|
this.divideItem();
|
||||||
this.createEmptyArray();
|
this.createEmptyArray();
|
||||||
@@ -328,7 +328,7 @@ import { toRaw } from 'vue'
|
|||||||
this.genCoord(this.partOneItem);
|
this.genCoord(this.partOneItem);
|
||||||
this.genCoord(this.partTwoItem);
|
this.genCoord(this.partTwoItem);
|
||||||
this.genCoord(this.partThreeItem);
|
this.genCoord(this.partThreeItem);
|
||||||
console.log('Content has been generated!')
|
console.log('Content has been generated!');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data(){
|
data(){
|
||||||
@@ -338,20 +338,20 @@ import { toRaw } from 'vue'
|
|||||||
const graffData = Object.values(impGraff);
|
const graffData = Object.values(impGraff);
|
||||||
return{
|
return{
|
||||||
items: imgData.map((src, index) => ({
|
items: imgData.map((src, index) => ({
|
||||||
id: index,
|
id: "img-" + index,
|
||||||
src: src,
|
src: src,
|
||||||
x: 0,
|
x: 0,
|
||||||
y: 0,
|
y: 0,
|
||||||
isHighlight: 0
|
isHighlight: 0
|
||||||
})),
|
})),
|
||||||
graffs: graffData.map((src, index) => ({
|
graffs: graffData.map((src, index) => ({
|
||||||
id: index,
|
id: "graff-" + index,
|
||||||
src: src,
|
src: src,
|
||||||
x: 0,
|
x: 0,
|
||||||
y: 0,
|
y: 0,
|
||||||
isHighlight: 3
|
isHighlight: 3
|
||||||
})),
|
})),
|
||||||
isHighlight:[[2,1],[6,1],[11,2]],
|
isHighlight:[['img-2',1],['img-6',1],['img-11',2]],
|
||||||
randomItems: null,
|
randomItems: null,
|
||||||
maxItemCount: 0,
|
maxItemCount: 0,
|
||||||
marjTop:0,
|
marjTop:0,
|
||||||
|
|||||||
Reference in New Issue
Block a user