Skip to content

Instantly share code, notes, and snippets.

View jbrz0's full-sized avatar
🦾

jbrz0 jbrz0

🦾
View GitHub Profile
@jbrz0
jbrz0 / sass-mixin-breakpoints.scss
Last active April 18, 2020 03:26
Custom Sass mixin for using media queries
// Define the breakpoints
$breakpoint-small: 600px;
$breakpoint-med-small: 960px;
$breakpoint-med: 1175px;
@mixin screen($size, $type: max, $pixels: $breakpoint-small) {
@if $size == 'small' {
@media screen and ($type + -width: $breakpoint-small) {
@content;
}
@jbrz0
jbrz0 / jquery-horizontal-bg.js
Created April 4, 2016 02:57
jQuery horizontal background w/ cursor
$(window).mousemove(function (e) {
var mousePosX = (e.pageX / $(window).width()) * 100;
var mousePosY = (e.pageY / $(window).height()) * 100;
// console.log(mousePosY)
$('.thumbs-block').css('backgroundPosition', mousePosX + '% ' + mousePosY +'%');
});
@jbrz0
jbrz0 / jquery-random-colours.js
Created April 4, 2016 02:48
jQuery random colour div
// Requires jquery color
$(document).ready(function() {
spectrum();
function spectrum(){
var hue = 'rgb(' +
(Math.floor(Math.random() * 256)) +
',' + (Math.floor(Math.random() * 256))
+ ',' + (Math.floor(Math.random() * 256))
@jbrz0
jbrz0 / jquery-scroll.js
Last active December 11, 2017 11:40
Simple jQuery scroll function to scroll to an object and animate with time range
$('a[href^="#"]').on('click', function(event) {
var target = $( $(this).attr('href') );
if( target.length ) {
event.preventDefault();
$('html, body').animate({
scrollTop: target.offset().top
}, 6500);
}
});