update.
This commit is contained in:
parent
23b09e069f
commit
3f5ef14ff2
2 changed files with 298 additions and 276 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -29,6 +29,11 @@ function preload() {
|
||||||
|
|
||||||
function setup() {
|
function setup() {
|
||||||
noCanvas();
|
noCanvas();
|
||||||
|
if (windowWidth > 1500 && windowWidth > windowHeight) {
|
||||||
|
fr = 30;
|
||||||
|
} else {
|
||||||
|
fr =20;
|
||||||
|
}
|
||||||
frameRate(fr);
|
frameRate(fr);
|
||||||
voice[0] = loadSound("./audio/018.mp3");
|
voice[0] = loadSound("./audio/018.mp3");
|
||||||
voice[1] = loadSound("./audio/011.mp3");
|
voice[1] = loadSound("./audio/011.mp3");
|
||||||
|
|
@ -99,7 +104,7 @@ socket.on("connect", function() {
|
||||||
windowWidth / 2 - windowWidth/10,
|
windowWidth / 2 - windowWidth/10,
|
||||||
windowHeight / 2
|
windowHeight / 2
|
||||||
);
|
);
|
||||||
}, 500);
|
}, 1000);
|
||||||
} else {
|
} else {
|
||||||
console.log("rejected!");
|
console.log("rejected!");
|
||||||
}
|
}
|
||||||
|
|
@ -138,8 +143,24 @@ socket.on("post", function(post) {
|
||||||
|
|
||||||
var img = createImg(object.src, object.alt, "", function(im) {
|
var img = createImg(object.src, object.alt, "", function(im) {
|
||||||
im.show();
|
im.show();
|
||||||
|
if (windowWidth > windowHeight) {
|
||||||
im.size(
|
im.size(
|
||||||
(windowHeight * (object.size.base + object.size.random * Math.random())) /
|
(windowHeight *
|
||||||
|
(object.size.base * 1.4 + object.size.random * Math.random())) /
|
||||||
|
100,
|
||||||
|
AUTO
|
||||||
|
);
|
||||||
|
im.position(
|
||||||
|
windowWidth,
|
||||||
|
(windowHeight *
|
||||||
|
(object.y.base + object.y.random * Math.random()) *
|
||||||
|
0.5) /
|
||||||
|
100
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
im.size(
|
||||||
|
(windowHeight *
|
||||||
|
(object.size.base + object.size.random * Math.random())) /
|
||||||
100,
|
100,
|
||||||
AUTO
|
AUTO
|
||||||
);
|
);
|
||||||
|
|
@ -147,6 +168,7 @@ socket.on("post", function(post) {
|
||||||
windowWidth,
|
windowWidth,
|
||||||
(windowHeight * (object.y.base + object.y.random * Math.random())) / 100
|
(windowHeight * (object.y.base + object.y.random * Math.random())) / 100
|
||||||
);
|
);
|
||||||
|
}
|
||||||
im.attribute("data-type", object.type);
|
im.attribute("data-type", object.type);
|
||||||
im.attribute("data-showtime", object.showtime / 1000); //milli-sec. -> seconds.
|
im.attribute("data-showtime", object.showtime / 1000); //milli-sec. -> seconds.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue