Skip to content

Instantly share code, notes, and snippets.

View vikrantnegi's full-sized avatar
Focusing

Vikrant Negi vikrantnegi

Focusing
View GitHub Profile
@vikrantnegi
vikrantnegi / full-video.html
Created December 2, 2015 12:44
Full screen Video with an Overlay
<div class="container">
<video poster="poster.png" autoplay="true" loop>
<source src="video.mp4" type="video/mp4">
<source src="video.webm" type="video/webm">
</video>
<div class="overlay">lorem </div>
</div>
@vikrantnegi
vikrantnegi / layers.css
Created December 21, 2015 07:46
Select all the layers
div[class*="layer-"] {
position: absolute;
top: -10px; left: -10px;
right: -10px; bottom: -10px;
background-size: 100% auto;
background-repeat: no-repeat;
background-position: 0 0;
transition:0.1s;
}
@vikrantnegi
vikrantnegi / responsive-video.css
Last active January 13, 2016 07:40
Responsive embedded video
.video-wrapper {
position: relative;
padding-bottom: 56.25%;
}
.video-wrapper iframe {
position: absolute;
width: 100%;
height: 100%;
top: 0;
@vikrantnegi
vikrantnegi / index.html
Last active April 27, 2016 05:32
Links inside links
<a href="#url1">When the crisis was over,
<object><a href="#url2>Hello world</a></object>
</a>
ref: https://speakerdeck.com/smashingmag/dirty-tricks-from-the-dark-corners-of-front-end
@vikrantnegi
vikrantnegi / resize.js
Last active October 21, 2016 09:16
Resize div according to window size
jQuery(window).resize(function(){
resizeNav();
});
resizeNav();
function resizeNav(){
var windowWidth = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
if(windowWidth < 767) {
@vikrantnegi
vikrantnegi / sr-text.css
Last active October 22, 2016 14:44
Visually hide some text while keeping it accessible
/* For only text */
.sr-only {
border: 0 !important;
clip: rect(1px, 1px, 1px, 1px) !important;
-webkit-clip-path: inset(50%) !important;
clip-path: inset(50%) !important;
height: 1px !important;
overflow: hidden !important;
padding: 0 !important;
position: absolute !important;
@vikrantnegi
vikrantnegi / google-maps.json
Created October 24, 2016 13:17
google map custom styles
[
{
"featureType": "administrative",
"elementType": "all",
"stylers": [
{
"visibility": "off"
}
]
},
@vikrantnegi
vikrantnegi / new-tab-link.html
Last active February 24, 2017 05:13
LInk In New Tab
@vikrantnegi
vikrantnegi / mac-voshts.md
Created December 15, 2016 10:20
Mac vhosts
sudo nano /etc/apache2/extra/httpd-vhosts.conf
<VirtualHost *:80>
    ServerName example.dev
    ServerAlias www.example.dev
 
@vikrantnegi
vikrantnegi / 0_reuse_code.js
Created December 21, 2016 07:51
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console