Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Blur css applied to the video background, but shows blurred too on the edges like a "Glow"

Tags:

html

css

I have used css to apply some blur effect to my background video. But it shows as too blurred on the edges..... Is there any solution to apply flatten blur css for the video? or i want to remove that glow from video edges. Thanks in advance !

See my code below:

.project-col {
    display:inline-block;
    width:100%;
    position:relative;
    background:transparent;
    z-index:0
}
.video-col {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    z-index: -2;
}
.content {
    padding-right:50px;
    padding-left:50px;
}
.video-col video {
    width:100%;
    -webkit-filter: grayscale(100%) blur(5px);
    filter: grayscale(100%) blur(5px);
}
<div class="project-col">
    <div class="video-col">
        <video class="video" autoplay preload="auto" loop>
            <source src="https://0.s3.envato.com/h264-video-previews/052c2cb4-9997-4833-ad53-2384dca08706/17458620.mp4" type='video/mp4' />
        </video>
    </div>

    <div class="content">
    <h4>Lorem ipsum dolor sit amet, consectetur adipiscing elit</h4>
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem.</p>
    </div>

</div>
like image 503
vishnu Avatar asked Dec 28 '16 07:12

vishnu


1 Answers

You could add inset box shadow to video parent:

.video-col {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    z-index: -2;
    box-shadow:inset 5px 5px 15px #000000;
}

.project-col {
    display:inline-block;
    width:100%;
    position:relative;
    background:transparent;
    z-index:0
}
.video-col {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    z-index: -2;
    box-shadow:inset 15px 15px 50px #000000;
}
.content {
    padding-right:50px;
    padding-left:50px;
    color:white;
}
.video-col video {
    width:100%;
    -webkit-filter: grayscale(100%) blur(5px);
    filter: grayscale(100%) blur(5px);
  
}
<div class="project-col">
    <div class="video-col">
        <video class="video" autoplay preload="auto" loop>
            <source src="https://0.s3.envato.com/h264-video-previews/052c2cb4-9997-4833-ad53-2384dca08706/17458620.mp4" type='video/mp4' />
        </video>
    </div>

    <div class="content">
    <h4>Lorem ipsum dolor sit amet, consectetur adipiscing elit</h4>
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem.</p>
    </div>

</div>

Play with values a little - it could fix glowing edges...

like image 134
sinisake Avatar answered Nov 29 '22 16:11

sinisake