Skip to content

Instantly share code, notes, and snippets.

@phyng
Created August 21, 2015 09:13
Show Gist options
  • Save phyng/51fdbd2f1b1ee8a624df to your computer and use it in GitHub Desktop.
Save phyng/51fdbd2f1b1ee8a624df to your computer and use it in GitHub Desktop.

Revisions

  1. phyng created this gist Aug 21, 2015.
    7 changes: 7 additions & 0 deletions crop-box.markdown
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    crop-box
    --------


    A [Pen](http://codepen.io/phyng/pen/EjBLrO) by [Phyng](http://codepen.io/phyng) on [CodePen](http://codepen.io/).

    [License](http://codepen.io/phyng/pen/EjBLrO/license).
    18 changes: 18 additions & 0 deletions index.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    <div class="s-holder">
    <div class="s-container">
    <div class="s-box">
    <div class="ord-n jcrop-dragbar" style="cursor: n-resize; position: absolute; z-index: 370;"></div>
    <div class="ord-s jcrop-dragbar" style="cursor: s-resize; position: absolute; z-index: 371;"></div>
    <div class="ord-e jcrop-dragbar" style="cursor: e-resize; position: absolute; z-index: 372;"></div>
    <div class="ord-w jcrop-dragbar" style="cursor: w-resize; position: absolute; z-index: 373;"></div>
    <div class="ord-n jcrop-handle" style="cursor: n-resize; position: absolute; z-index: 374; opacity: 0.5;"></div>
    <div class="ord-s jcrop-handle" style="cursor: s-resize; position: absolute; z-index: 375; opacity: 0.5;"></div>
    <div class="ord-e jcrop-handle" style="cursor: e-resize; position: absolute; z-index: 376; opacity: 0.5;"></div>
    <div class="ord-w jcrop-handle" style="cursor: w-resize; position: absolute; z-index: 377; opacity: 0.5;"></div>
    <div class="ord-nw jcrop-handle" style="cursor: nw-resize; position: absolute; z-index: 378; opacity: 0.5;"></div>
    <div class="ord-ne jcrop-handle" style="cursor: ne-resize; position: absolute; z-index: 379; opacity: 0.5;"></div>
    <div class="ord-se jcrop-handle" style="cursor: se-resize; position: absolute; z-index: 380; opacity: 0.5;"></div>
    <div class="ord-sw jcrop-handle" style="cursor: sw-resize; position: absolute; z-index: 381; opacity: 0.5;"></div>
    </div>
    </div>
    </div>
    110 changes: 110 additions & 0 deletions style.css
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,110 @@
    .s-holder {}

    .s-container {
    position: relative;
    }

    .s-box {
    background-color: red;
    position: absolute;
    top: 100px;
    left: 100px;
    width: 200px;
    height: 200px;
    }
    /* Selection Handles */

    .jcrop-handle {
    background-color: #333333;
    border: 1px #eeeeee solid;
    width: 7px;
    height: 7px;
    font-size: 1px;
    }

    .jcrop-handle.ord-n {
    left: 50%;
    margin-left: -4px;
    margin-top: -4px;
    top: 0;
    }

    .jcrop-handle.ord-s {
    bottom: 0;
    left: 50%;
    margin-bottom: -4px;
    margin-left: -4px;
    }

    .jcrop-handle.ord-e {
    margin-right: -4px;
    margin-top: -4px;
    right: 0;
    top: 50%;
    }

    .jcrop-handle.ord-w {
    left: 0;
    margin-left: -4px;
    margin-top: -4px;
    top: 50%;
    }

    .jcrop-handle.ord-nw {
    left: 0;
    margin-left: -4px;
    margin-top: -4px;
    top: 0;
    }

    .jcrop-handle.ord-ne {
    margin-right: -4px;
    margin-top: -4px;
    right: 0;
    top: 0;
    }

    .jcrop-handle.ord-se {
    bottom: 0;
    margin-bottom: -4px;
    margin-right: -4px;
    right: 0;
    }

    .jcrop-handle.ord-sw {
    bottom: 0;
    left: 0;
    margin-bottom: -4px;
    margin-left: -4px;
    }
    /* Dragbars */

    .jcrop-dragbar.ord-n,
    .jcrop-dragbar.ord-s {
    height: 7px;
    width: 100%;
    }

    .jcrop-dragbar.ord-e,
    .jcrop-dragbar.ord-w {
    height: 100%;
    width: 7px;
    }

    .jcrop-dragbar.ord-n {
    margin-top: -4px;
    }

    .jcrop-dragbar.ord-s {
    bottom: 0;
    margin-bottom: -4px;
    }

    .jcrop-dragbar.ord-e {
    margin-right: -4px;
    right: 0;
    }

    .jcrop-dragbar.ord-w {
    margin-left: -4px;
    }