Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Amp Slide-out side panel #2302

Closed
heatloss opened this issue Feb 26, 2016 · 5 comments
Closed

Implement Amp Slide-out side panel #2302

heatloss opened this issue Feb 26, 2016 · 5 comments
Assignees
Labels
INTENT TO IMPLEMENT Proposes implementation of a significant new feature. https://bit.ly/amp-contribute-code Type: Feature Request

Comments

@heatloss
Copy link

Overview

In order to maximize use of screen real-estate for page content, many mobile-optimized pages hide their main navigation in a slide-out panel, often invoked via a "hamburger" icon. This panel generally contains the global site navigation, site settings, and sometimes miscellaneous information that would normally go in a footer.

Many publications looking to port their existing mobile-optimized web pages to AMP are already using some variation of the slide-out panel, so providing AMP-native support for one should help lower the barrier to adoption.

Usage

<amp-panel-button />
<amp-panel>
        <nav>
                <ul>
                        <li><a href="/">Home</a></li>
                        <li><a href="section1">Section 1</a></li>
                        <li><a href="section2">Section 2</a></li>
                        <li><a href="section3">Section 3</a></li>
                </ul>
        </nav>
        <small>All rights reserved</small>
</amp-panel> 

Behavior

The <amp-panel-button> element becomes a <button> tag, while the element becomes a <div> tag which loads offscreen via transform: translateX() styles, or the browser-appropriate equivalent.

Tapping/clicking on the panel button reveals the panel via animation.

The panel does not obscure the content area completely. It leaves a portion of the content area visible but inert, i.e. links and widgets do not respond to interaction, and the content area should not scroll while the panel is open. (The disabling effect is usually achieved using an invisible or translucent "scrim" element that overlays the content, but could also be handled via JavaScript event interception.) Clicking or tapping in the visible portion of the content retracts the panel and restores the content area to its interactive state.

The panel contents scroll independently of the main content area.

Constraints

To enforce appropriate usage of the panel, the following constraints apply:

  • <amp-img> and <amp-iframe> tags are disallowed within <amp-panel>
  • Only one <amp-panel> is allowed per page.
  • <amp-panel-button> and <amp-panel> tags can only be placed inside the <header> tag.
  • The open <amp-panel> will expand to the width of the elements it contains, to a maximum of 85% of the width of the page.
@dvoytenko
Copy link
Contributor

/to @ericlindley-g

@camelburrito camelburrito changed the title Intent to Implement: Slide-out side panel Implement Amp Slide-out side panel Mar 6, 2016
@camelburrito camelburrito added the INTENT TO IMPLEMENT Proposes implementation of a significant new feature. https://bit.ly/amp-contribute-code label Mar 6, 2016
@ericlindley-g ericlindley-g added this to the Sprint 2016-03-31 [current] milestone Mar 24, 2016
@ericlindley-g
Copy link
Contributor

Sorry for the delayed response on this! We are currently working on a solution in amp-sidebar, informed in part by this ITI, in order to address this use case.

@dvoytenko
Copy link
Contributor

@ericlindley-g Could you please dedupe this issue?

@ericlindley-g
Copy link
Contributor

Closing as an effective duplicate of #2461

@ericlindley-g
Copy link
Contributor

Also dup'ing to: #827

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
INTENT TO IMPLEMENT Proposes implementation of a significant new feature. https://bit.ly/amp-contribute-code Type: Feature Request
Projects
None yet
Development

No branches or pull requests

4 participants