Skip to content

Commit

Permalink
Only do pixellated rendering for very short verses in gallery view
Browse files Browse the repository at this point in the history
  • Loading branch information
colinmorris committed Mar 7, 2017
1 parent ac423aa commit bc10a23
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
3 changes: 3 additions & 0 deletions src/Gallery.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
background-color: rgb(250, 250, 255);
border: 1px solid hsl(0, 0%, 75%);
width: 100%;
}

.galleryFrame img.mini {
image-rendering: pixelated;
}

Expand Down
6 changes: 5 additions & 1 deletion src/Gallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,14 @@ class Gallery extends Component {
}

renderCanned = (c, i) => {
let kls = "img-responsive";
if (c.mini) {
kls += " mini";
}
return (
<div key={c.slug} className="col-xs-4 col-lg-3">
<div className="galleryFrame">
<img className="img-responsive"
<img className={kls}
alt={`Self-similarity matrix of ${c.title} by ${c.artist}`}
onClick={(e) => {
this.setState({lightbox_index: i})
Expand Down
14 changes: 7 additions & 7 deletions src/canned-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var CANNED_SONGS = [
{slug: "allthesmallthings", artist: "Blink-182", title: "All The Small Things", group: NINETIES.slug, dropdown: true},
{slug: "allyouneedislove", artist: "The Beatles", title: "All You Need Is Love", group: SIXTIES.slug, dropdown: true, dropdown: true},
{slug: "anthems", artist: "Broken Social Scene", title: "Anthems For A Seventeen-Year Old Girl", group: NAUGHTS.slug},
{slug: "baabaa", artist: "", title: "Baa Baa Black Sheep", group: NR.slug, dropdown: true},
{slug: "baabaa", artist: "", title: "Baa Baa Black Sheep", group: NR.slug, dropdown: true, mini: true},
{slug: "bad", artist: "Michael Jackson", title: "Bad", group: EIGHTIES.slug},
{slug: "badblood", artist: "Taylor Swift", title: "Bad Blood", group: CONTEMP.slug},
{slug: "badgirls", artist: "M.I.A.", title: "Bad Girls", group: CONTEMP.slug},
Expand Down Expand Up @@ -55,7 +55,7 @@ var CANNED_SONGS = [
{slug: "foolish", artist: "Ashanti", title: "Foolish", group: NAUGHTS.slug},
{slug: "formation", artist: "Beyonce", title: "Formation", group: CONTEMP.slug},
{slug: "freefalling", artist: "Florrie", title: "Free Falling", group: CONTEMP.slug, hidden: true},
{slug: "frerejacques", artist: "", title: "Frere Jacques", group: NR.slug},
{slug: "frerejacques", artist: "", title: "Frere Jacques", group: NR.slug, mini: true},
{slug: "geniusoflove", artist: "Tom Tom Club", title: "Genius Of Love", group: EIGHTIES.slug},
{slug: "getlucky", artist: "Daft Punk ft. Pharrell Williams", title: "Get Lucky", group: CONTEMP.slug},
{slug: "getthepartystarted", artist: "Pink", title: "Get The Party Started", group: NAUGHTS.slug, dropdown: true},
Expand All @@ -67,7 +67,7 @@ var CANNED_SONGS = [
{slug: "gutfeeling", artist: "Devo", title: "Gut Feeling", group: SEVENTIES.slug},
{slug: "harderbetterfasterstronger", artist: "Daft Punk", title: "Harder, Better, Faster, Stronger", group: NAUGHTS.slug},
{slug: "hardestbutton", artist: "The White Stripes", title: "The Hardest Button To Button", group: NAUGHTS.slug, dropdown: true},
{slug: "hotcrossbuns", artist: "", title: "Hot Cross Buns", group: NR.slug, dropdown: true},
{slug: "hotcrossbuns", artist: "", title: "Hot Cross Buns", group: NR.slug, dropdown: true, mini: true},
{slug: "hotlinebling", artist: "Drake", title: "Hotling Bling", group: CONTEMP.slug, dropdown: true},
{slug: "humps", artist: "The Black-eyed Peas", title: "My Humps", group: NAUGHTS.slug},
{slug: "ibleed", artist: "The Pixies", title: "I Bleed", group: NINETIES.slug},
Expand Down Expand Up @@ -128,9 +128,9 @@ var CANNED_SONGS = [
{slug: "theechoinggreen", artist: "William Blake", title: "The Echoing Green", group: POETRY.slug},
{slug: "thelamb", artist: "William Blake", title: "The Lamb", group: POETRY.slug},
{slug: "theowlandthepussycat", artist: "Edward Lear", title: "The Owl And The Pussycat", group: POETRY.slug},
{slug: "thepasture", artist: "Robert Frost", title: "The Pasture", group: POETRY.slug, dropdown: true},
{slug: "thepasture", artist: "Robert Frost", title: "The Pasture", group: POETRY.slug, dropdown: true, mini: true},
{slug: "thetyger", artist: "William Blake", title: "The Tyger", group: POETRY.slug, dropdown: true},
{slug: "threeblindmice", artist: "", title: "Three Blind Mice", group: NR.slug},
{slug: "threeblindmice", artist: "", title: "Three Blind Mice", group: NR.slug, mini: true},
{slug: "thriller", artist: "Michael Jackson", title: "Thriller", group: EIGHTIES.slug, dropdown: true},
{slug: "tiktok", artist: "Kesha", title: "Tik Tok", group: CONTEMP.slug},
{slug: "totheend", artist: "Florrie", title: "To The End", group: CONTEMP.slug, hidden: true},
Expand All @@ -144,7 +144,7 @@ var CANNED_SONGS = [
{slug: "whenafelon", artist: "Gilbert And Sullivan", title: "When A Felon's Not Engaged In His Employment", group: MISC.slug},
{slug: "whenineededyou", artist: "Carly Rae Jepsen", title: "When I Needed You", group: CONTEMP.slug, hidden: true},
{slug: "whenitrains", artist: "They Might Be Giants", title: "When It Rains It Snows", group: EIGHTIES.slug},
{slug: "wheniwasoneandtwenty", artist: "A.E. Housman", title: "When I Was One-and-Twenty", group: POETRY.slug},
{slug: "wheniwasoneandtwenty", artist: "A.E. Housman", title: "When I Was One-and-Twenty", group: POETRY.slug, mini: true},
{slug: "whereismymind", artist: "The Pixies", title: "Where Is My Mind?", group: EIGHTIES.slug, dropdown: true},
{slug: "whipit", artist: "Devo", title: "Whip It", group: EIGHTIES.slug},
{slug: "wordyrappinghood", artist: "Tom Tom Club", title: "Wordy Rappinghood", group: EIGHTIES.slug},
Expand All @@ -156,7 +156,7 @@ var CANNED_SONGS = [
{slug: "goodvibrations", artist: "The Beach Boys", title: "Good Vibrations", group: SIXTIES.slug},
{slug: "jimmymack", artist: "Martha & The Vandellas", title: "Jimmy Mack", group: SIXTIES.slug},
{slug: "moreperfect", artist: "Barack Obama", title: "A More Perfect Union (excerpt)", group: MISC.slug},
{slug: "ocanada", artist: "", title: "O Canada", group: MISC.slug, dropdown: true},
{slug: "ocanada", artist: "", title: "O Canada", group: MISC.slug, dropdown: true, mini: true},
{slug: "onthebeaches", artist: "Winston Churchill", title: "We Shall Fight On The Beaches (excerpt)", group: MISC.slug, dropdown: true},
{slug: "sohappytogether", artist: "The Turtles", title: "So Happy Together", group: SIXTIES.slug},
{slug: "starspangled", artist: "", title: "The Star-Spangled Banner", group: MISC.slug},
Expand Down
2 changes: 1 addition & 1 deletion src/canned.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ class Canned {
this.title = o.title;
this.group = o.group;
this.dropdown = o.dropdown;
// deprectated?
this.hidden = o.hidden;
this.mini = o.mini;
}

get tagline() {
Expand Down

0 comments on commit bc10a23

Please sign in to comment.