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