Skip to content

Commit

Permalink
Image Lightbox: spec, styling, activation and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Dima Voytenko committed Sep 27, 2015
1 parent a28575e commit e6006f9
Show file tree
Hide file tree
Showing 8 changed files with 1,098 additions and 0 deletions.
4 changes: 4 additions & 0 deletions css/amp.css
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ i-amp-sizer {
display: none;
}

.-amp-ghost {
visibility: hidden !important;
}

.-amp-layout {
/* Just state. */
}
Expand Down
1 change: 1 addition & 0 deletions examples/everything.amp.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<script custom-element="amp-fit-text" src="../dist/v0/amp-fit-text-0.1.max.js" async></script>
<script custom-element="amp-iframe" src="../dist/v0/amp-iframe-0.1.max.js" async></script>
<script custom-element="amp-instagram" src="../dist/v0/amp-instagram-0.1.max.js" async></script>
<script custom-element="amp-image-lightbox" src="../dist/v0/amp-image-lightbox-0.1.max.js" async></script>
<script custom-element="amp-lightbox" src="../dist/v0/amp-lightbox-0.1.max.js" async></script>
<script custom-element="amp-slides" src="../dist/v0/amp-slides-0.1.max.js" async></script>
<script custom-element="amp-twitter" src="../dist/v0/amp-twitter-0.1.max.js" async></script>
Expand Down
105 changes: 105 additions & 0 deletions extensions/amp-image-lightbox/0.1/amp-image-lightbox.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
/**
* Copyright 2015 The AMP HTML Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS-IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/


/* Non-overridable properties */
amp-image-lightbox {
position: fixed !important;
z-index: 1000 !important;
top: 0 !important;
left: 0 !important;
bottom: 0 !important;
right: 0 !important;
margin: 0 !important;
padding: 0 !important;
/* This is necessary due to crbug/248522 where touch events fail after
transform */
overflow: hidden;
transform: translate3d(0, 0, 0);
}

/* Overridable properties */
amp-image-lightbox {
background: #222;
color: #eee;
}


.-amp-image-lightbox-container {
position: absolute;
z-index: 0;
top: 0;
left: 0;
right: 0;
bottom: 0;
/* This is necessary due to crbug/248522 where touch events fail after
transform */
overflow: hidden;
transform: translate3d(0, 0, 0);
}


.-amp-image-lightbox-trans {
pointer-events: none !important;
position: fixed;
z-index: 1001;
top: 0;
left: 0;
bottom: 0;
right: 0;
}


.-amp-image-lightbox-caption {
position: absolute !important;
z-index: 2 !important;
bottom: 0 !important;
left: 0 !important;
right: 0 !important;
}

.-amp-image-lightbox-view-mode .-amp-image-lightbox-caption {
visibility: hidden;
}

/* Overridable properties */
.amp-image-lightbox-caption {
background: rgba(0, 0, 0, 0.2);
max-height: 25%;
padding: 8px;
}


.-amp-image-lightbox-viewer {
position: absolute;
z-index: 1;
top: 0;
left: 0;
right: 0;
bottom: 0;
/* This is necessary due to crbug/248522 where touch events fail after
transform */
overflow: hidden;
transform: translate3d(0, 0, 0);
}


.-amp-image-lightbox-viewer-image {
position: absolute;
z-index: 1;
display: block;
transform-origin: 50% 50%;
}
Loading

0 comments on commit e6006f9

Please sign in to comment.