Skip to content

Instantly share code, notes, and snippets.

💭
I may be slow to respond.

Jordan Gray jordangray

💭
I may be slow to respond.
View GitHub Profile
View dabblet.css
/**
* Automasking
*/
.mask-content {
position: relative;
padding: .2em 0;
width: 1.2em;
text-align: center;
}
@jordangray
jordangray / colorFromHexString.swift
Last active May 23, 2017 — forked from arshad/gist:de147c42d7b3063ef7bc
Convert a string representing a CSS hex colour to a UIColor in Swift.
View colorFromHexString.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
View dabblet.css
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);}
View dabblet.css
body {
height: 300%;
}
View dabblet.css
/* 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 Oct 16, 2015
Simple transition example
View dabblet.css
/* Simple transition example */
input {
transition: background 2s;
}
input:focus {
background: fuchsia;
}
View dabblet.css
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 Aug 29, 2015
Disc nav on rainbow bg
View dabblet.css
/**
* 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;
View dabblet.css
html {
height: 100%;
}
body {
box-sizing: border-box;
font-family: "Open Sans";
height: 100%;
margin: 0;
padding: 10px 20px;
View dabblet.css
html {
height: 100%;
}
body {
box-sizing: border-box;
font-family: "Open Sans";
height: 100%;
margin: 0;
padding: 10px 20px;
You can’t perform that action at this time.