GithubHelp home page GithubHelp logo

itaibn9 / dragandscaleboilerplate Goto Github PK

View Code? Open in Web Editor NEW

This project forked from suvelocity/dragandscaleboilerplate

0.0 0.0 0.0 647 KB

Drag and scale challenge

CSS 3.11% HTML 1.50% JavaScript 95.39%

dragandscaleboilerplate's Introduction

Drag & Scale Challenge

Show your dominance in front end vanilla JavaScript by creating a movable scaleable object!

Instructions

Clone this repository to your computer, which contains the following:

  • index.html - a ready div with the id playground for you and a div with the id of main which includes another div inside with the id header.

  • stlye.css - ready css that styles our playground.

  • index.js - Where the fun happens!!!

The playground as you get it:

playground

Your mission, if you choose to accept it, is to make the div main moveabble and resizeable by dragging it's edges with mouse.

Example:

Example

Write your solution in the file index.js. You are allowed to add code also to index.html and style.css, but it is important you do not change any of our code, only add yours below (or tests might fail).

Requirements

  • I am able to drag the div main when clicking the div header and moving the mouse around.

  • I am able to resize the div main horrizonally or vertically by dragging it's edges (the black stripes inside div main in the gif).

  • I am able to resize the div main horrizonally and vertically by dragging it's corners (the pink squares inside div main in the gif).

  • When dragging main's left or right border only the width should be affected.

  • When dragging main's top or bottom border only the height should be affected.

  • div main should have a minimum of 150x150 size and can not be resized to less.

  • The resizers must be inside the div main.

  • The resizing areas must be at least 5px thick.

  • Dragging and resizing should not happen simultaneously!

  • The div main shouldn't cross the playground borders at any situation.

  • When the mouse isn't preesed nothing should happen.

dragandscaleboilerplate's People

Contributors

listguy avatar itaibn9 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.