This commit is contained in:
Dooho Yi 2020-11-13 13:47:53 +09:00
parent 23b09e069f
commit 3f5ef14ff2
2 changed files with 298 additions and 276 deletions

File diff suppressed because it is too large Load diff

View file

@ -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,15 +143,32 @@ 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();
im.size( if (windowWidth > windowHeight) {
(windowHeight * (object.size.base + object.size.random * Math.random())) / im.size(
100, (windowHeight *
AUTO (object.size.base * 1.4 + object.size.random * Math.random())) /
); 100,
im.position( AUTO
windowWidth, );
(windowHeight * (object.y.base + object.y.random * Math.random())) / 100 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,
AUTO
);
im.position(
windowWidth,
(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.