--- a/web/index.html Mon Dec 10 20:55:18 2012 +0100
+++ b/web/index.html Mon Dec 10 22:19:35 2012 +0100
@@ -102,9 +102,12 @@
incResize.init("content", "top", "mosaic", "bottom", "footer", 130, 1800/750, null, incMosaic.registerPostNewCanvasSize);
// Set mosaic pair of images
- incMosaic.addPairImages("static/res/img/accueil-00.jpg", "static/res/img/accueil-01.jpg");
- incMosaic.addPairImages("static/res/img/accueil-02.jpg", "static/res/img/accueil-03.jpg");
- incMosaic.addPairImages("static/res/img/accueil-04.jpg", "static/res/img/accueil-05.jpg");
+ incMosaic.addImageUrl("static/res/img/accueil-00.jpg");
+ incMosaic.addImageUrl("static/res/img/accueil-01.jpg");
+ incMosaic.addImageUrl("static/res/img/accueil-02.jpg");
+ incMosaic.addImageUrl("static/res/img/accueil-03.jpg");
+ incMosaic.addImageUrl("static/res/img/accueil-04.jpg");
+ incMosaic.addImageUrl("static/res/img/accueil-05.jpg");
// Start mosaic effect
incMosaic.start("mosaic", 9, 5);
--- a/web/inter_choix.html Mon Dec 10 20:55:18 2012 +0100
+++ b/web/inter_choix.html Mon Dec 10 22:19:35 2012 +0100
@@ -23,7 +23,8 @@
<div class="strut"></div><!--
this comment corrects the white-space (display: inline);
--><section class="fullScreen_vcentering container_vcentering">
- <div class="box_vcentering">
+ <!-- pour changer la tranparance tu accedes à la class ="box_transparance" et tu changes 'opacity: 0;' maintenat c'est 'opacity : 1;' -->
+ <div class="box_vcentering box_transparance">
<p class="big_txt">3 ÉCRANS</p>
<p class="big_txt">CHOISISSEZ UN MOT PAR ÉCRANS</p>
<p class="big_txt">COMPOSEZ VOTRE FILM</p>
--- a/web/static/res/js/incmosaic.js Mon Dec 10 20:55:18 2012 +0100
+++ b/web/static/res/js/incmosaic.js Mon Dec 10 22:19:35 2012 +0100
@@ -11,7 +11,8 @@
this.imageData;
/// Images
- this.pairUrl = [];
+ this.imageUrls = [];
+ this.listeUrls = []; // The images list to blend
this.pairImages = [];
this.imagesLoaded = 0;
this.imageWidth;
@@ -34,10 +35,9 @@
// Functions
// --------------------------------------------------------------------------------------------------------------------
- this.addPairImages = function(url1, url2)
+ this.addImageUrl = function(url)
{
- var urls = new IncPairUrl(url1, url2);
- this.pairUrl.push(urls);
+ this.imageUrls.push(url);
};
this.start = function(canvasId, squareCountX, squareCountY)
@@ -94,15 +94,44 @@
incMosaic.squareHeight = Math.floor(newCanvasHeight / incMosaic.squareCountY);
};
+ this.fillListUrl = function()
+ {
+ var urls = [];
+ for (var i = 1; i < this.imageUrls.length; ++i) {
+ urls.push(this.imageUrls[i]);
+ }
+
+ // Set random url
+
+ // The first images is always the first in this array
+ this.listeUrls.push(this.imageUrls[0]);
+
+ while (urls.length > 0) {
+ var randInd = this.randomInt(0, urls.length);
+ this.listeUrls.push(urls[randInd]);
+ urls.remove(randInd);
+ }
+ };
+
this.setRandomPairImages = function()
{
- this.imagesLoaded = 0;
- var randInd = this.randomInt(0, this.pairUrl.length);
- var pairUrl = this.pairUrl[randInd];
+ if (this.listeUrls.length == 0) {
+ this.fillListUrl();
+ }
- this.pairImages.length = 0;
- this.pairImages.push(this.getImageFromUrl(pairUrl.imageUrl1));
- this.pairImages.push(this.getImageFromUrl(pairUrl.imageUrl2));
+ if (this.pairImages.length == 0) {
+ this.imagesLoaded = 0;
+ this.pairImages.push(this.getImageFromUrl(this.listeUrls[0]));
+ this.pairImages.push(this.getImageFromUrl(this.listeUrls[1]));
+ this.listeUrls.remove(0);
+ } else {
+ this.imagesLoaded = 1;
+ this.pairImages[0] = this.pairImages[1]; // Swap
+ this.pairImages[1] = this.getImageFromUrl(this.listeUrls[0])
+ }
+ this.listeUrls.remove(0);
+
+ // Todo preload the next image
};
this.setRandomSquareEffect = function()
@@ -288,12 +317,6 @@
};
}
-function IncPairUrl(url1, url2)
-{
- this.imageUrl1 = url1;
- this.imageUrl2 = url2;
-}
-
// --------------------------------------------------------------------------------------------------------------------
// Effects
// --------------------------------------------------------------------------------------------------------------------
@@ -443,5 +466,11 @@
};
})();
+Array.prototype.remove = function(from, to) {
+ var rest = this.slice((to || from) + 1 || this.length);
+ this.length = from < 0 ? this.length + from : from;
+ return this.push.apply(this, rest);
+};
+
var incMosaic = new IncMosaic();