OLD | NEW |
(Empty) | |
| 1 /* Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 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 background-size of 100% to work properly */ |
| 11 height: 100%; |
| 12 } |
| 13 |
| 14 body { |
| 15 /* This newer linear-gradient form works on Chrome but not mobile Safari */ |
| 16 /*background: -webkit-linear-gradient(top,#252c39,#3e485b,#252c39); */ |
| 17 background: -webkit-gradient(linear, left top, left bottom, from(#252c39), ba
ckground: -webkit-linear-gradient(top,#252c39,#3e485b,#252c39); |
| 18 background-size: auto 100%; |
| 19 font-family: segoe ui, arial, helvetica, sans-serif; |
| 20 font-size: 14px; |
| 21 color: white; |
| 22 margin: 0; |
| 23 /* Don't highlight links when they're tapped. Safari has bugs here that |
| 24 show up as flicker when dragging in some situations */ |
| 25 -webkit-tap-highlight-color: transparent; |
| 26 /* Don't allow selecting text - can occur when dragging */ |
| 27 -webkit-user-select: none; |
| 28 } |
| 29 |
| 30 /* The frame is what the slider fits into |
| 31 */ |
| 32 #apps-frame { |
| 33 /* We want this to fill the window except for the region used |
| 34 by footer |
| 35 */ |
| 36 position: fixed; |
| 37 width: 100%; |
| 38 top: 0; |
| 39 bottom: 60px; /* must match #footer height */ |
| 40 overflow: hidden; |
| 41 } |
| 42 |
| 43 /* The list holds all the pages and is what the touch events are attached to |
| 44 */ |
| 45 #apps-page-list { |
| 46 /* fill the apps-frame */ |
| 47 height: 100%; |
| 48 display: -webkit-box; |
| 49 } |
| 50 |
| 51 /* The apps-page is the slider card that is moved. |
| 52 */ |
| 53 .apps-page { |
| 54 -webkit-box-sizing: border-box; |
| 55 padding: 29px; |
| 56 /* TODO(rbyers): Don't want the final row centered, but would like all rows |
| 57 * centered. Really I want the page-content width determined by the boxes |
| 58 * inside of it, but perhaps webkit-box doesn't support that. |
| 59 * Note that instead of display:inline-block for the apps, I could use |
| 60 * float:left and have a .app-container:first-child { clear:both; } rule, |
| 61 * but I'd have to figure out some way to get the vertical position reset. |
| 62 text-align:center; */ |
| 63 } |
| 64 |
| 65 .app-container { |
| 66 width: 128px; |
| 67 height: 128px; |
| 68 padding: 16px; |
| 69 display: inline-block; |
| 70 vertical-align: top; |
| 71 } |
| 72 |
| 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 |
| 93 .app span { |
| 94 text-decoration: none; |
| 95 /* TODO(rbyers): why isn't ellipsis working? */ |
| 96 text-overflow: ellipsis; |
| 97 white-space: nowrap; |
| 98 overflow: hidden; |
| 99 color: white; |
| 100 } |
| 101 |
| 102 .app img { |
| 103 display: block; |
| 104 width: 96px; |
| 105 height: 96px; |
| 106 margin-left: auto; |
| 107 margin-right: auto; |
| 108 /* -webkit-mask-image set by JavaScript to the image source */ |
| 109 -webkit-mask-size: 100% 100%; |
| 110 } |
| 111 |
| 112 /* Pressed is set when an app is first touched. |
| 113 By using the mask, pressing causes a darkening effect of just the image */ |
| 114 .app.grabber-pressed img { |
| 115 opacity: 0.8; |
| 116 } |
| 117 |
| 118 /* Grabbed is set (and pressed is cleared) when the app has been held. */ |
| 119 .grabber-grabbed { |
| 120 opacity: 0.8; |
| 121 -webkit-transform: scale3d(1.4, 1.4, 1); |
| 122 } |
| 123 |
| 124 /* Dragging is set (without grabbed being cleared) when a grabbed app is |
| 125 moved */ |
| 126 .grabber-dragging { |
| 127 /* We need to ensure there is no animation applied to its position |
| 128 (or the drag touch may stop being over top of it */ |
| 129 -webkit-transition: none !important; |
| 130 |
| 131 /* Ensure the element has a large z-index so that we can get events |
| 132 for it as it moves over other elements. This is animated as the |
| 133 element flys back, so we want a large value that will stay large until |
| 134 its almost home. */ |
| 135 z-index: 100; |
| 136 } |
| 137 |
| 138 #footer { |
| 139 width: 100%; |
| 140 position: absolute; |
| 141 bottom: 0; |
| 142 height: 60px; /* must match #apps-frame bottom */ |
| 143 overflow: hidden; |
| 144 } |
| 145 |
| 146 #dot-list { |
| 147 text-align: center; |
| 148 margin: 0; |
| 149 padding: 0; |
| 150 bottom: 0; |
| 151 list-style-type: none; |
| 152 margin-top: 20px; |
| 153 } |
| 154 |
| 155 .dot { |
| 156 display: inline-block; |
| 157 margin: 10px; |
| 158 width: 10px; |
| 159 height: 10px; |
| 160 background-color: #3d465f; |
| 161 -webkit-box-sizing: border-box; |
| 162 border: 1px solid black; |
| 163 -webkit-border-radius: 2px; |
| 164 -webkit-transition-property: width, height, margin, -webkit-transform; |
| 165 -webkit-transition-duration: 500ms; |
| 166 /* Work-around regression bug 74802 */ |
| 167 -webkit-transform: translate3d(0, 0, 0); |
| 168 } |
| 169 |
| 170 #footer.rearrange-mode .dot { |
| 171 margin: 0px 20px; |
| 172 width: 30px; |
| 173 height: 30px; |
| 174 } |
| 175 |
| 176 .dot.selected { |
| 177 background-color: #b3bbd3; |
| 178 } |
| 179 |
| 180 .dot.new { |
| 181 -webkit-transform: translate3d(0, 40px, 0); |
| 182 } |
| 183 |
| 184 #trash { |
| 185 position: absolute; |
| 186 width: 110px; |
| 187 height: 100%; |
| 188 right: 0px; |
| 189 bottom: 0px; |
| 190 background-image: url('trash.png'); |
| 191 background-size: 40px 40px; |
| 192 background-repeat: no-repeat; |
| 193 background-position: 40px 12px; |
| 194 /* Work-around chromium bug 74730 by using translate instead of the |
| 195 GPU-accelerated translate3d */ |
| 196 -webkit-transform: translate(80px, 0); |
| 197 -webkit-transition-property: -webkit-transform; |
| 198 -webkit-transition-duration: 500ms; |
| 199 } |
| 200 |
| 201 #trash.hover { |
| 202 background-image: url('trash-open.png'); |
| 203 } |
| 204 |
| 205 .app.trashing img { |
| 206 opacity: 0.3; |
| 207 } |
| 208 |
| 209 #footer.rearrange-mode #trash { |
| 210 -webkit-transform: translate(0, 0); |
| 211 } |
| 212 |
| 213 /* Ensure template items are never drawn when the page initially loads */ |
| 214 #app-template { |
| 215 display: none; |
| 216 } |
OLD | NEW |