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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
|
/* Copyright (c) 2011 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.
*
* This is the stylesheet used by the touch-enabled new tab page
*/
html {
/* It's necessary to put this here instead of in body in order to get the
background-size of 100% to work properly */
height: 100%;
}
body {
/* This newer linear-gradient form works on Chrome but not mobile Safari */
/*background: -webkit-linear-gradient(top,#252c39,#3e485b,#252c39); */
background: -webkit-gradient(linear, left top, left bottom, from(#252c39),
color-stop(0.5,#3e485b), to(#252c39));
background-size: auto 100%;
font-family: segoe ui, arial, helvetica, sans-serif;
font-size: 14px;
color: white;
margin: 0;
/* Don't highlight links when they're tapped. Safari has bugs here that
show up as flicker when dragging in some situations */
-webkit-tap-highlight-color: transparent;
/* Don't allow selecting text - can occur when dragging */
-webkit-user-select: none;
}
/* The frame is what the slider fits into
*/
#apps-frame {
/* We want this to fill the window except for the region used
by footer
*/
position: fixed;
width: 100%;
top: 0;
bottom: 60px; /* must match #footer height */
overflow: hidden;
}
/* The list holds all the pages and is what the touch events are attached to
*/
#apps-page-list {
/* fill the apps-frame */
height: 100%;
display: -webkit-box;
}
/* The apps-page is the slider card that is moved.
*/
.apps-page {
-webkit-box-sizing: border-box;
padding: 29px;
/* TODO(rbyers): Don't want the final row centered, but would like all rows
* centered. Really I want the page-content width determined by the boxes
* inside of it, but perhaps webkit-box doesn't support that.
* Note that instead of display:inline-block for the apps, I could use
* float:left and have a .app-container:first-child { clear:both; } rule,
* but I'd have to figure out some way to get the vertical position reset.
text-align:center; */
}
.app-container {
width: 128px;
height: 128px;
padding: 16px;
display: inline-block;
vertical-align: top;
}
.app {
text-align: center;
width: 128px;
height: 128px;
/* Animate effects to/from the grabbed state, and the position when drop
is cancelled. I'd like to also animate movement when an app is
re-positioned, but since chrome is doing the layout there is no property
to animate.
TODO(rbyers): Should we take over responsibility for app layout ourself
like the classic NTP's most-visited icons? Or should we extend webkit
somehow to support animation of the position of browser laid-out
elements. */
-webkit-transition-property: -webkit-transform, opacity, zIndex;
-webkit-transition-duration: 200ms;
/* Don't offer the context menu on long-press. */
-webkit-touch-callout: none;
/* Work-around regression bug 74802 */
-webkit-transform: scale3d(1, 1, 1);
}
.app span {
text-decoration: none;
/* TODO(rbyers): why isn't ellipsis working? */
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
color: white;
}
.app img {
display: block;
width: 96px;
height: 96px;
margin-left: auto;
margin-right: auto;
/* -webkit-mask-image set by JavaScript to the image source */
-webkit-mask-size: 100% 100%;
}
/* Pressed is set when an app is first touched.
By using the mask, pressing causes a darkening effect of just the image */
.app.grabber-pressed img {
opacity: 0.8;
}
/* Grabbed is set (and pressed is cleared) when the app has been held. */
.grabber-grabbed {
opacity: 0.8;
-webkit-transform: scale3d(1.4, 1.4, 1);
}
/* Dragging is set (without grabbed being cleared) when a grabbed app is
moved */
.grabber-dragging {
/* We need to ensure there is no animation applied to its position
(or the drag touch may stop being over top of it */
-webkit-transition: none !important;
/* Ensure the element has a large z-index so that we can get events
for it as it moves over other elements. This is animated as the
element flys back, so we want a large value that will stay large until
its almost home. */
z-index: 100;
}
#footer {
width: 100%;
position: absolute;
bottom: 0;
height: 60px; /* must match #apps-frame bottom */
overflow: hidden;
}
#dot-list {
text-align: center;
margin: 0;
padding: 0;
bottom: 0;
list-style-type: none;
margin-top: 20px;
}
.dot {
display: inline-block;
margin: 10px;
width: 10px;
height: 10px;
background-color: #3d465f;
-webkit-box-sizing: border-box;
border: 1px solid black;
-webkit-border-radius: 2px;
-webkit-transition-property: width, height, margin, -webkit-transform;
-webkit-transition-duration: 500ms;
/* Work-around regression bug 74802 */
-webkit-transform: translate3d(0, 0, 0);
}
#footer.rearrange-mode .dot {
margin: 0px 20px;
width: 30px;
height: 30px;
}
.dot.selected {
background-color: #b3bbd3;
}
.dot.new {
-webkit-transform: translate3d(0, 40px, 0);
}
#trash {
position: absolute;
width: 110px;
height: 100%;
right: 0px;
bottom: 0px;
background-image: url('trash.png');
background-size: 40px 40px;
background-repeat: no-repeat;
background-position: 40px 12px;
/* Work-around chromium bug 74730 by using translate instead of the
GPU-accelerated translate3d */
-webkit-transform: translate(80px, 0);
-webkit-transition-property: -webkit-transform;
-webkit-transition-duration: 500ms;
}
#trash.hover {
background-image: url('trash-open.png');
}
.app.trashing img {
opacity: 0.3;
}
#footer.rearrange-mode #trash {
-webkit-transform: translate(0, 0);
}
/* Ensure template items are never drawn when the page initially loads */
#app-template {
display: none;
}
|