Вместо того, чтобы рисовать риты в (this.x, this.y)
, вы можете нарисовать их в 0,0 и перевести их в (this.x, this.y)
;
// author: Nicholas Fazzolari
var canvas = document.querySelector('canvas');
var ctx = canvas.getContext('2d');
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
var xCenterCanvas = innerWidth/2;
var yCenterCanvas = innerHeight/2;
// custom rectangle object
function RectangleCustom(x, y, w, h, color) {
this.w = w;
this.h = h;
this.x = x;
this.y = y;
this.color = color;
this.radians = (Math.PI/180) * 2; // change the last value to change speed
this.rotation = 0;
// draws a rectangle at given coordinates
this.draw = function() {
this.rotation += this.radians;
ctx.save();
ctx.fillStyle = this.color;
ctx.translate(this.x, this.y);
ctx.rotate(this.rotation);
ctx.fillRect(0,0, this.w, this.h);
ctx.restore();
}
this.update = function() {
// animation updates
}
}
// singleton rectangles
var bkgRectangle = new RectangleCustom(0, 0, innerWidth, innerHeight, "#212121");
var redRectangle = new RectangleCustom(xCenterCanvas - 64, yCenterCanvas - 64, 128, 128, "#F44336");
// main animation loop
function mainAnimationLoop() {
// runs animation and clears the canvas each call
requestAnimationFrame(mainAnimationLoop);
ctx.clearRect(0, 0, innerWidth, innerHeight);
bkgRectangle.draw();
redRectangle.draw();
}
mainAnimationLoop();
<canvas></canvas>
Можно импортировать .ics файлы к Google Calender и просмотреть его там. Прошлым вечером я экспортировал Каландр из MS Outlook в формате CSV и Импортированный, что в Google Calender и я смог совместно использовать то же со своими Коллегами.
Процедура, хотя не очень видимо в интерфейсе. Я должен был искать Other Calenders
раздел по левой панели и нажимает на Настройки. Я нашел опцию, которая сказала, что Импорт на нем, который при нажатии, я мог загрузить MS Outlook, экспортировал файл формата CSV, и посмотрите Каландр онлайн на Google.