Skip to content

Instantly share code, notes, and snippets.

View himynameisdave's full-sized avatar
✌️
livin' the dream...

Dave Lunny himynameisdave

✌️
livin' the dream...
View GitHub Profile
@himynameisdave
himynameisdave / verbosify
Created November 27, 2014 04:35
Trying to make a mixin that verbosifies a shorthand margin property.
/*
Verbose Margin:
returns a margin value in 'long form',
also alphabatized (breaking the t-r-b-l rule).
Expects paramaters like normal (i.e: 'margin: 1px 2px 3px 4px = .vmar(1px, 2px, 3px, 4px)')
*/
.vmar(@mt, @mr, @mb, @ml ){
margin-bottom: @mb;
margin-left: @ml;
@himynameisdave
himynameisdave / Ultra-Clean-UI-Contact-Us-Form.markdown
Created December 14, 2014 00:51
Ultra-Clean UI 'Contact Us' Form
@himynameisdave
himynameisdave / Enlarge-Images-CSS3.markdown
Last active August 29, 2015 14:11
Enlarge Images CSS3

Enlarge Images CSS3

Just a dumb little dead-simple photo enlarger thingy, done purely with CSS3/LESS.

A Pen by Dave Lunny on CodePen.

License.

@himynameisdave
himynameisdave / gradient-animation.less
Last active May 23, 2023 01:45
Mixins for Animating Between Gradients
.gradient-animation( @start, @end, @transTime ){
background-size: 100%;
background-image: linear-gradient(@start, @end);
position: relative;
z-index: 100;
&:before {
background-image: linear-gradient(@end, @start);
content: '';
display: block;
height: 100%;
@himynameisdave
himynameisdave / broken-gradient-animation.less
Created April 10, 2015 01:12
broken gradient animation
// For brevity, vendor prefixes have been removed.
// This does not work as expected; instead of a smooth transition
// what you get is a hard swap from one gradient to the next
.super-cool-background-that-SHOULD-animate-on-hover {
background: linear-gradient( #fff, #ccc );
transition: all 0.45s;
&:hover{
background: linear-gradient( #ccc, #fff );
}
}
@himynameisdave
himynameisdave / button.html
Last active August 29, 2015 14:18
Basic styles for the animated gradient button
<div class="button">
Wow! Such :hover!
</div>
@himynameisdave
himynameisdave / button-psudo.less
Last active August 29, 2015 14:18
Basic styles plus the psudo element
.button {
background-size: 100%;
background-image: linear-gradient(#fff, #ccc);
border-radius: 0.45rem;
border: 1px solid #ddd;
cursor: pointer;
color: #333;
display: inline-block;
font-size: 1.25rem;
font-weight: 300;
@himynameisdave
himynameisdave / button-animated.less
Last active March 7, 2019 21:12
Animated CSS Gradient Complete
.button {
background-size: 100%;
background-image: linear-gradient(#fff, #ccc);
border-radius: 0.45rem;
border: 1px solid #ddd;
cursor: pointer;
color: #333;
display: inline-block;
font-size: 1.25rem;
font-weight: 300;
@himynameisdave
himynameisdave / juice.js
Created June 15, 2015 15:49
Object Literal w/this keyword
var juicer = {
fruit: "oranges",
amount: 5,
juice: function(){
alert( "You have juiced " + this.amount +" "+ this.fruit );
}
};
// Calling juicer.juice():
// -> "You have juiced 5 oranges"