Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function () {
- let PIXELSIZE = 2;
- let REPEATSX = 20;
- let REPEATSY = 15;
- let DIMENSION = 25;
- let canvas = id('mycanvas');
- let ctx = canvas.getContext("2d");
- let canvasWidth = DIMENSION * REPEATSX * PIXELSIZE;
- let canvasHeight = DIMENSION * REPEATSY * PIXELSIZE;
- let selectedBox = null;
- canvas.width = canvasWidth;
- canvas.height = canvasHeight;
- // Your web app's Firebase configuration
- var firebaseConfig = {
- apiKey: "AIzaSyDjLFcsO92KpwLiFe7Hsp4gVd51w61WIsk",
- authDomain: "canvasgamedemo.firebaseapp.com",
- databaseURL: "https://canvasgamedemo.firebaseio.com",
- projectId: "canvasgamedemo",
- storageBucket: "canvasgamedemo.appspot.com",
- messagingSenderId: "258751262925",
- appId: "1:258751262925:web:50cdf23c2265aa7ae07984"
- };
- // Initialize Firebase
- firebase.initializeApp(firebaseConfig);
- let db = firebase.firestore();
- db.collection('app').onSnapshot(function (grid) {
- console.log(grid);
- for(let change of grid.docChanges()) {
- console.log(change);
- if (!change.doc) continue;
- let key = change.doc.id;
- let data = change.doc.data().data;
- if (key == 'grid') continue;
- }
- });
- // ...
Add Comment
Please, Sign In to add comment