Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Commit

Permalink
Label changes sync with theme changes. themes.json cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
parisminton committed May 10, 2017
1 parent 337afbb commit 7297446
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 53 deletions.
25 changes: 23 additions & 2 deletions client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ function submitted() {
return setClass("error", "No valid theme detected.");
}

if (theme.labelText) {
label = theme.labelText;
}

video.kill();
audio.pause();

Expand Down Expand Up @@ -237,7 +241,7 @@ function updateAudioFile() {

}

function updateCaption() {
function updateCaption(label) {
preview.caption(this.value);
}

Expand All @@ -246,7 +250,24 @@ function updateLabel() {
}

function updateTheme() {
preview.theme(d3.select(this.options[this.selectedIndex]).datum());
var theme_obj = d3.select(this.options[this.selectedIndex]).datum(),
that = this;

// Automatically set the label for themes that have them
preview.theme(theme_obj);
if (theme_obj.labelText) {
preview.label(theme_obj.labelText);
$('#input-label').children().each(function (i, c) {
if (c.value === that.options[that.selectedIndex].value) {
$(c).prop('selected', true);
return false;
}
});
$('#input-label').prop('disabled', true);
}
else {
$('#input-label').prop('disabled', false);
}
}

function preloadImages(themes) {
Expand Down
65 changes: 14 additions & 51 deletions settings/themes.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
{
"default": {
"width": 1280,
"height": 720,
"width": 1000,
"height": 560,
"framesPerSecond": 20,
"maxDuration": 300,
"samplesPerFrame": 128,
"pattern": "wave",
"pattern": "halfbars",
"waveTop": 150,
"waveBottom": 420,
"captionTop": 470,
"captionFont": "300 52px 'Source Sans Pro'",
"captionLineHeight": 52,
"waveBottom": 710,
"captionAlign": "left",
"captionTop": 70,
"captionLeft": 50,
"captionRight": 860,
"captionFont": "300 71px 'NYT Franklin Light'",
"captionLineHeight": 80,
"captionLineSpacing": 7,
"captionLeft": 200,
"captionRight": 1080,
"labelFont": "44px 'NYT Karnak'",
"labelAlign": "left",
"labelTop": 470,
Expand All @@ -22,70 +23,32 @@
"labelLineSpacing": 4
},
"NYT Light": {
"width": 1000,
"height": 560,
"pattern": "halfbars",
"waveColor": "#d9d9d9",
"waveBottom": 710,
"foregroundColor": "#000",
"captionFont": "300 71px 'NYT Franklin Light'",
"captionLineHeight": 80,
"captionAlign": "left",
"captionTop": 70,
"captionLeft": 50,
"captionRight": 860,
"backgroundImage": "t_logo_light.png",
"labelColor": "#000"
},
"NYT Dark": {
"width": 1000,
"height": 560,
"pattern": "halfbars",
"backgroundColor": "#000",
"waveColor": "#4d4d4d",
"waveBottom": 710,
"foregroundColor": "#fff",
"captionFont": "300 71px 'NYT Franklin Light'",
"captionLineHeight": 80,
"captionAlign": "left",
"captionTop": 70,
"captionLeft": 50,
"captionRight": 860,
"backgroundImage": "t_logo_dark.png",
"labelColor": "#fff"
},
"Still Processing": {
"width": 1000,
"height": 560,
"pattern": "halfbars",
"waveColor": "rgba(102, 80, 62, 0.25)",
"waveBottom": 710,
"foregroundColor": "#66503e",
"backgroundColor": "#f4d7b9",
"captionFont": "300 71px 'NYT Franklin Light'",
"captionLineHeight": 80,
"captionAlign": "left",
"captionTop": 70,
"captionLeft": 50,
"captionRight": 860,
"backgroundImage": "t_logo_white_alpha.png",
"labelColor": "#fff"
"labelColor": "#fff",
"labelText": "Still Processing"
},
"The Daily": {
"width": 1000,
"height": 560,
"pattern": "halfbars",
"waveColor": "rgba(102, 102, 102, 0.25)",
"waveBottom": 710,
"foregroundColor": "#fff",
"backgroundColor": "#f4d7b9",
"captionFont": "300 71px 'NYT Franklin Light'",
"captionLineHeight": 80,
"captionAlign": "left",
"captionTop": 70,
"captionLeft": 50,
"captionRight": 860,
"backgroundImage": "the_daily_audiogram_background.png",
"labelColor": "#fff"
"labelColor": "#fff",
"labelText": "The Daily"
}
}

0 comments on commit 7297446

Please sign in to comment.