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