Skip to content

Instantly share code, notes, and snippets.

View johhansantana's full-sized avatar

Johhan Santana johhansantana

View GitHub Profile
@johhansantana
johhansantana / gruntfile.js
Created November 18, 2015 00:27
gruntfile.js
// Generated on 2015-11-18 using generator-angular 0.14.0
'use strict';
// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to recursively match all subfolders:
// 'test/spec/**/*.js'
module.exports = function (grunt) {
@johhansantana
johhansantana / shownavbarafterscrollingdown.js
Last active November 18, 2015 19:28
show navbar after scrolling down
$(function(){
$(window).scroll(function(){
var windscroll = $(window).scrollTop();
if ($('#navbar').position().top < windscroll) {
$('#navbar').fadeIn();
}else{
$('#navbar').fadeOut();
};
});
});
@johhansantana
johhansantana / scrolltotop.js
Created November 19, 2015 20:01
scroll to top ui-router angular
$rootScope.$on('$stateChangeSuccess',function(){
$("html, body").animate({ scrollTop: 0 }, 200);
});
@johhansantana
johhansantana / style.css
Created November 24, 2015 16:27
Multiple background images css
.multi_bg_example {
background-image : url(https://mdn.mozillademos.org/files/11305/firefox.png),
url(https://mdn.mozillademos.org/files/11307/bubbles.png),
linear-gradient(to right, rgba(30, 75, 115, 1), rgba(255, 255, 255, 0));
background-repeat : no-repeat,
no-repeat,
no-repeat;
background-position: bottom right,
@johhansantana
johhansantana / style.css
Created November 24, 2015 16:29
Transparent background image
footer {
min-height: 300px;
background-color: #013378;
color: white;
padding-top: 30px;
position: relative;
}
footer::after {
content: "";
@johhansantana
johhansantana / index.html
Created December 2, 2015 13:50
auto height youtube iframe videos
<!-- source: https://css-tricks.com/NetMag/FluidWidthVideo/Article-FluidWidthVideo.php -->
<div class="videoWrapper">
<!-- Copy & Pasted from YouTube -->
<iframe width="560" height="349" src="http://www.youtube.com/embed/n_dZNLr2cME?rel=0&hd=1" frameborder="0" allowfullscreen></iframe>
</div>
<style>
.videoWrapper {
position: relative;
@johhansantana
johhansantana / script.js
Created December 8, 2015 19:33
smoothscroll to anchor
// smoothscroll anchor function
$(function() {
$('a[href*=#]:not([href=#])').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
$('html,body').animate({
scrollTop: target.offset().top - 50
}, 1000);
@johhansantana
johhansantana / style.css
Created December 26, 2015 17:54
collapse navbar on higher width
@media (min-width: 768px) and (max-width: 1175px) {
.navbar-collapse.collapse {
display: none !important;
}
.navbar-collapse.collapse.in {
display: block !important;
}
.navbar-header .collapse, .navbar-toggle {
display:block !important;
}
@johhansantana
johhansantana / style.css
Created January 4, 2016 17:55
bootstrap dropdown on hover navbar
ul.nav li.dropdown:hover > ul.dropdown-menu {
display: block;
}
@johhansantana
johhansantana / style.css
Created January 15, 2016 20:52
delay css ng-if
.slide-up{
position:relative;
--webkit-transition: 0.5s ease-in-out all;
-moz-transition: 0.5s ease-in-out all;
-o-transition: 0.5s ease-in-out all;
transition: 0.5s ease-in-out all;
}
.slide-up.ng-enter{
--webkit-transition-delay: 0.5s;
-moz-transition-delay: 0.5s;