fffiloni commited on
Commit
eb05599
1 Parent(s): cd3710e

responsive adj

Browse files
Files changed (1) hide show
  1. public/sketch.js +13 -1
public/sketch.js CHANGED
@@ -62,9 +62,21 @@ function call_api(socket, instructions){
62
  socket.emit("ask_api", data);
63
  }
64
 
 
 
 
 
 
 
 
 
65
  function setup() {
66
  pixelDensity(1)
67
- myCanvas = createCanvas(576, 320);
 
 
 
 
68
  background(220)
69
  myCanvas.id('myCanvas')
70
  myCanvas.parent("canvas-container")
 
62
  socket.emit("ask_api", data);
63
  }
64
 
65
+ function windowResized() {
66
+ if(windowWidth <= 430){
67
+ resizeCanvas(400, 400*320/576);
68
+ } else {
69
+ resizeCanvas(576, 320);
70
+ }
71
+ }
72
+
73
  function setup() {
74
  pixelDensity(1)
75
+ if(windowWidth <= 430){
76
+ myCanvas = createCanvas(400, 400*320/576);
77
+ } else {
78
+ myCanvas = createCanvas(576, 320);
79
+ }
80
  background(220)
81
  myCanvas.id('myCanvas')
82
  myCanvas.parent("canvas-container")