diff --git a/client/index.js b/client/index.js index f998b110..a8f861dd 100644 --- a/client/index.js +++ b/client/index.js @@ -75,6 +75,10 @@ function submitted() { return setClass("error", "No valid theme detected."); } + if (theme.labelText) { + label = theme.labelText; + } + video.kill(); audio.pause(); @@ -237,7 +241,7 @@ function updateAudioFile() { } -function updateCaption() { +function updateCaption(label) { preview.caption(this.value); } @@ -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) { diff --git a/settings/themes.json b/settings/themes.json index 97bb7f52..9b6639f1 100644 --- a/settings/themes.json +++ b/settings/themes.json @@ -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, @@ -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" } }