<div id="container" class="angled-top-left">
    <div class="content">
        <h1>لبه های زاویه دار</h1>
        <p>در اینجا نسخه نمایشی برای استفاده از لبه های زاویه دار را میبینید که با انتخاب هر جهت چگونگی تغییر شکل آن را میبینید</p>
        <select id="selectStyle" onchange="changeStyle()">
            <option value="angled-top-left">لبه بالا سمت چپ</option>
            <option value="angled-top-right">لبه بالا سمت راست</option>
            <option value="angled-bottom-left">لبه پایین سمت چپ</option>
            <option value="angled-bottom-right">لبه پایین سمت راست</option>
            <option value="angled-both-left">لبه هر دو سمت چپ</option>
            <option value="angled-both-right">لبه هر دو سمت راست </option>
            <option value="angled-both-left-right">لبه چپ به راست</option>
            <option value="angled-both-right-left">لبه راست به چپ</option>
        </select> 
    </div>
</div>

$color1: #011627; //rgba(1, 22, 39, 100)
$color2: #fdfffc; //rgba(253, 255, 252, 100)
$color3: #2ec4b6; //rgba(46, 196, 182, 100)
$color4: #e71d36; //rgba(231, 29, 54, 100)
$color5: #ff9f1c; //rgba(255, 159, 28, 100)

body{
    margin: 0;
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    color: #555;
}

#container{
  margin-top: 100px;
    height: 400px;
    width: 100%;
    position: relative;
}
.content{
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: rgba(#fff, 0.9);
    border-radius: 8px;
    width: 25%;
    padding: 40px;
    text-align: center;
    -webkit-box-shadow: 0 0 8px 0 rgba(0,0,0, 0.12);
    box-shadow: 0 0 8px 0 rgba(0,0,0, 0.12);
    h1{
        font-family: Georgia, serif;
        font-size: 40px;
        font-weight: normal;
    }
}
#selectStyle{
    margin-top: 20px;
}

@mixin angle-edge($pos-top:null, $angle-top:null, $pos-btm:null, $angle-btm:null){
    width: 100%;
    position: relative;
    background: linear-gradient(to right, rgba(241,231,103,1) 0%, rgba(254,182,69,1) 100%);
    &:before,
    &:after{
        content: '';
        width: 100%;
        height: 100%;
        position: absolute;
        background: inherit;
        z-index: -1;
        transition: ease all .5s;
    }

    @if $pos-top{
        &:before{
            @if $pos-top == 'topleft'{
                top: 0;
                transform-origin: right top;
                transform: skewY($angle-top);
            }
            @if $pos-top == 'topright' {
                top: 0;
                transform-origin: left top;
                transform: skewY(-$angle-top);
            } 
        }
    }

    @if $pos-btm{
        &:after{
            @if $pos-btm == 'bottomleft' {
                bottom: 0;
                transform-origin: right bottom;
                transform: skewY(-$angle-btm);
            } 

            @if $pos-btm == 'bottomright' {
                bottom: 0;
                transform-origin: left bottom;
                transform: skewY($angle-btm);
            } 
        }
    }


}

.angled-top-left{
    @include angle-edge($pos-top: topleft, $angle-top: 3deg);
}

.angled-top-right{
    @include angle-edge($pos-top: topright, $angle-top: 3deg);
}

.angled-bottom-left{
    @include angle-edge($pos-btm: bottomleft, $angle-btm: 3deg);
}

.angled-bottom-right{
    @include angle-edge($pos-btm: bottomright, $angle-btm: 3deg);
}

.angled-both-left{
    @include angle-edge(topleft, 3deg, bottomleft, 3deg);
}
.angled-both-right{
    @include angle-edge(topright, 3deg, bottomright, 3deg);
}
.angled-both-left-right{
    @include angle-edge(topleft, 3deg, bottomright, 3deg);
}
.angled-both-right-left{
    @include angle-edge(topright, 3deg, bottomleft, 3deg);
}
View Compiled
function changeStyle() {
    var x = document.getElementById("selectStyle").value;
    document.getElementById("container").className = "" + x;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.