forked from ampproject/amphtml
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨[story ads] Introduce new progress bar (ampproject#33972)
* works * test * z index
- Loading branch information
1 parent
0c1b1f5
commit 583a733
Showing
5 changed files
with
163 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
extensions/amp-story-auto-ads/0.1/amp-story-auto-ads-progress-bar.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/** | ||
* Copyright 2021 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. | ||
*/ | ||
|
||
.i-amphtml-story-ad-progress-background { | ||
background: hsla(0, 0%, 100%, 0.4) !important; | ||
border-radius: 1px !important; | ||
height: 2px !important; | ||
left: 4px !important; | ||
margin: 4px auto !important; | ||
opacity: 0 !important; | ||
position: absolute !important; | ||
width: calc(100% - 8px) !important; | ||
visibility: hidden !important; | ||
z-index: 100001 !important; | ||
} | ||
|
||
.i-amphtml-story-ad-progress-background[ad-showing] { | ||
opacity: 1 !important; | ||
visibility: visible !important; | ||
} | ||
|
||
.i-amphtml-story-ad-progress-background[desktop-panels] { | ||
/* On desktop a story page has a width of 45vh. */ | ||
/* And a height of 75 vh. */ | ||
left: calc(50vw - 22.5vh + 4px) !important; | ||
top: 12.5vh !important; | ||
width: calc(45vh - 8px) !important; | ||
/* Have to wait for page to slide in. */ | ||
transition: opacity 0.1s linear 0.3s; | ||
} | ||
|
||
.i-amphtml-story-ad-progress-bar { | ||
background: #fff !important; | ||
height: 2px !important; | ||
} | ||
|
||
[ad-showing] .i-amphtml-story-ad-progress-bar { | ||
animation: grow linear; | ||
} | ||
|
||
@keyframes grow { | ||
from { | ||
width: 0%; | ||
} | ||
to { | ||
width: 100%; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters