Skip to content

Instantly share code, notes, and snippets.

View jordangray's full-sized avatar
💭
I may be slow to respond.

Jordan Gray jordangray

💭
I may be slow to respond.
View GitHub Profile
@jordangray
jordangray / dabblet.css
Created June 19, 2017 16:26
Automasking
/**
* Automasking
*/
.mask-content {
position: relative;
padding: .2em 0;
width: 1.2em;
text-align: center;
}
@jordangray
jordangray / colorFromHexString.swift
Last active May 23, 2017 01:36 — forked from shadcn/gist:de147c42d7b3063ef7bc
Convert a string representing a CSS hex colour to a UIColor in Swift.
/// Get the UIColor corresponding to a CSS hex color code (RGB[A] or RRGGBB[AA])
///
/// - Parameter hex: A hexadecimal representation of the colou
/// - Returns: The UIColor represented by the hexidecimal color code, or UIColor.clear if parsing failed
func colorFromHexString (hex:String) -> UIColor {
// Remove padding, leading hash symbol etc.
let hex = hex.trimmingCharacters(in: NSCharacterSet.alphanumerics.inverted)
// Get numeric representation
body {
height: 3000em;
}
.parallax { perspective: 1px; height: 100vh; overflow-x: hidden; overflow-y: auto;}
.parallax__layer { position: absolute; top: 0; right: 0; bottom: 0; left: 0;}
.parallax__layer--base { transform: translateZ(0);}.parallax__layer--back { transform: translateZ(-1px);}
body {
height: 300%;
}
@jordangray
jordangray / dabblet.css
Last active May 8, 2016 01:04
Shirt pattern
/* Shirt pattern */
/* Colours seen from the top down */
background-image: /* 0 50 100 150 */
linear-gradient(to left, white 10%, transparent 10%), /* white: w w w w */
linear-gradient(to left, steelblue 50%, transparent 50%), /* light blue: llllllllll llllllllll */
linear-gradient(to left, maroon 50%, navy 50%); /* red & blue: rrrrrrrrrrrrrrrrrrrrbbbbbbbbbbbbbbbbbbbb */
background-size: 50px, 100px, 200px;
@jordangray
jordangray / dabblet.css
Last active October 16, 2015 14:09
Simple transition example
/* Simple transition example */
input {
transition: background 2s;
}
input:focus {
background: fuchsia;
}
@jordangray
jordangray / dabblet.css
Last active August 29, 2015 14:27
Untitled
html {
height: 100%;
background: url(http://api.thumbr.it/whitenoise-200x200.png?background=4ea6ca00&noise=626262&density=45&opacity=10),
linear-gradient(15deg, hsla(10, 100%, 50%, 0.6), transparent 40%),
linear-gradient(-15deg, hsla(100, 80%, 30%, 0.6), transparent 40%),
linear-gradient(135deg, hsl(48, 100%, 84%) 10%, hsl(100, 50%, 50%) 30%, hsl(204, 47%, 45%) 50%, hsl(244, 27%, 55%) 80%);
}
body {
font-family: Segoe UI;
@jordangray
jordangray / dabblet.css
Last active August 29, 2015 14:26
Disc nav on rainbow bg
/**
* Disc nav on rainbow bg
*/
html,
body {
background: #222 url(http://api.thumbr.it/whitenoise-200x200.png?background=22222200&noise=444444&density=20&opacity=20);
font-family: Segoe UI;
color: #fff;
margin: 0;
html {
height: 100%;
}
body {
box-sizing: border-box;
font-family: "Open Sans";
height: 100%;
margin: 0;
padding: 10px 20px;
@jordangray
jordangray / dabblet.css
Last active August 29, 2015 14:25
Untitled
html {
height: 100%;
}
body {
box-sizing: border-box;
font-family: "Open Sans";
height: 100%;
margin: 0;
padding: 10px 20px;