| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 | 5 |
| 6 /** | 6 /** |
| 7 * @fileoverview Specifications for NTP design. | 7 * @fileoverview Specifications for NTP design. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 var THUMBNAIL_FALLBACK = { | 10 var THUMBNAIL_FALLBACK = { |
| 11 DOT: 'dot' // Draw single dot. | 11 DOT: 'dot' // Draw single dot. |
| 12 }; | 12 }; |
| 13 | 13 |
| 14 /** | 14 /** |
| 15 * Specifications for an NTP design (not comprehensive). | 15 * Specifications for an NTP design (not comprehensive). |
| 16 * | 16 * |
| 17 * fontFamily: Font family to use for title and thumbnail iframes. | 17 * fontFamily: Font family to use for title and thumbnail iframes. |
| 18 * fontSize: Font size to use for the iframes, in px. | 18 * fontSize: Font size to use for the iframes, in px. |
| 19 * tileWidth: The width of each suggestion tile, in px. | 19 * tileWidth: The width of each suggestion tile, in px. |
| 20 * tileMargin: Spacing between successive tiles, in px. | 20 * tileMargin: Spacing between successive tiles, in px. |
| 21 * titleColor: The RRGGBBAA color of title text. | 21 * titleColor: The 4-component color of title text. |
| 22 * titleColorAgainstDark: The RRGGBBAA color of title text against a dark theme. | 22 * titleColorAgainstDark: The 4-component color of title text against a dark |
| 23 * theme. |
| 23 * titleTextAlign: (Optional) The alignment of title text. If unspecified, the | 24 * titleTextAlign: (Optional) The alignment of title text. If unspecified, the |
| 24 * default value is 'center'. | 25 * default value is 'center'. |
| 25 * titleTextFade: (Optional) The number of pixels beyond which title | 26 * titleTextFade: (Optional) The number of pixels beyond which title |
| 26 * text begins to fade. This overrides the default ellipsis style. | 27 * text begins to fade. This overrides the default ellipsis style. |
| 27 * thumbnailTextColor: The RRGGBBAA color that thumbnail iframe may use to | 28 * thumbnailTextColor: The 4-component color that thumbnail iframe may use to |
| 28 * display text message in place of missing thumbnail. | 29 * display text message in place of missing thumbnail. |
| 29 * thumbnailFallback: (Optional) A value in THUMBNAIL_FALLBACK to specify the | 30 * thumbnailFallback: (Optional) A value in THUMBNAIL_FALLBACK to specify the |
| 30 * thumbnail fallback strategy. If unassigned, then the thumbnail.html | 31 * thumbnail fallback strategy. If unassigned, then the thumbnail.html |
| 31 * iframe would handle the fallback. | 32 * iframe would handle the fallback. |
| 32 * | 33 * |
| 33 * @const {{ | 34 * @const {{ |
| 34 * fontFamily: string, | 35 * fontFamily: string, |
| 35 * fontSize: number, | 36 * fontSize: number, |
| 36 * tileWidth: number, | 37 * tileWidth: number, |
| 37 * tileMargin: number, | 38 * tileMargin: number, |
| 38 * titleColor: string, | 39 * titleColor: string, |
| 39 * titleColorAgainstDark: string, | 40 * titleColorAgainstDark: string, |
| 40 * titleTextAlign: string|null|undefined, | 41 * titleTextAlign: string|null|undefined, |
| 41 * TODO(huangs): Clean-up certain parameters once previous design is no longer | 42 * TODO(huangs): Clean-up certain parameters once previous design is no longer |
| 42 * used on server. | 43 * used on server. |
| 43 * titleTextFade: number|null|undefined, | 44 * titleTextFade: number|null|undefined, |
| 44 * thumbnailTextColor: string, | 45 * thumbnailTextColor: string, |
| 45 * thumbnailFallback: string|null|undefined | 46 * thumbnailFallback: string|null|undefined |
| 46 * }} | 47 * }} |
| 47 */ | 48 */ |
| 48 var NTP_DESIGN = { | 49 var NTP_DESIGN = { |
| 49 fontFamily: 'arial, sans-serif', | 50 fontFamily: 'arial, sans-serif', |
| 50 fontSize: 12, | 51 fontSize: 12, |
| 51 tileWidth: 156, | 52 tileWidth: 156, |
| 52 tileMargin: 16, | 53 tileMargin: 16, |
| 53 titleColor: '323232ff', | 54 titleColor: [50, 50, 50, 255], |
| 54 titleColorAgainstDark: 'd2d2d2ff', | 55 titleColorAgainstDark: [210, 210, 210, 255], |
| 55 titleTextAlign: 'inherit', | 56 titleTextAlign: 'inherit', |
| 56 titleTextFade: 122 - 36, // 112px wide title with 32 pixel fade at end. | 57 titleTextFade: 122 - 36, // 112px wide title with 32 pixel fade at end. |
| 57 thumbnailTextColor: '323232ff', // Unused. | 58 thumbnailTextColor: [50, 50, 50, 255], |
| 58 thumbnailFallback: THUMBNAIL_FALLBACK.DOT | 59 thumbnailFallback: THUMBNAIL_FALLBACK.DOT |
| 59 }; | 60 }; |
| OLD | NEW |