Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //#region Shape
- //Будющий конструктор
- function Shape(windowWidth, windowHeight, shape) {
- this.windowWidth = windowWidth;
- this.windowHeight = windowHeight;
- this.shape = shape;
- };
- Shape.prototype = {
- changeSizeOfShape : function () {
- return Math.round(this.windowWidth / 10);
- },
- skidShape : function () {
- return Math.ceil((this.changeSizeOfShape() * Math.sqrt(2) - this.changeSizeOfShape()) / 2);
- },
- shapePositionTop : function () {
- return this.skidShape();
- },
- shapePositionBot : function () {
- return this.windowHeight - (Math.ceil(this.changeSizeOfShape() * Math.sqrt(2)) - this.skidShape());
- },
- shapeStyle : function () {
- shape.css({ "width": this.changeSizeOfShape() + "px", "height": this.changeSizeOfShape() + "px" });
- shape.css("top", this.shapePositionTop() + "px");
- }
- };
- //#endregion
- //#region Comment Code
- // function changeSizeOfFigure() {
- // var windowWidth = $(window).width();
- // var resultWidth = Math.round(windowWidth / 10);
- // shape.css({ "width": resultWidth + "px", "height": resultWidth + "px" });
- // return resultWidth;
- // };
- // changeSizeOfFigure();
- // //Определяем вынос нашего кварата(ромба)
- // function skidShape() {
- // var side = changeSizeOfFigure();
- // return Math.ceil((side * Math.sqrt(2) - side) / 2);
- // };
- // skidShape();
- // function shapePositionBot() {
- // var side = skidShape();
- // return $(window).height() - (Math.ceil(changeSizeOfFigure() * Math.sqrt(2)) - side);
- // };
- // function shapePositionTop() {
- // var position = skidShape();
- // shape.css("top", position + "px");
- // return position;
- // };
- // shapePositionTop();
- //#endregion
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement