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 nested menu for sidebar 2.0 #24570

Merged
merged 6 commits into from
Sep 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
101 changes: 101 additions & 0 deletions build-system/server/routes/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,105 @@ router.get('/infinite-scroll-state', function(req, res) {
res.json(results);
});

router.get('/ecommerce-nested-menu', function(req, res) {
res.json({
'menu': [
{
'title': 'Clothing, Shoes, Jewelry \u0026 Watches',
'image': 'https://cdn.orvis.com/images/082119_w_new.jpg',
'content': [
{
'title': 'Clothing, Shoes, Jewelry \u0026 Watches',
'content': [
'Women',
'Men',
'Girls',
'Boys',
'Baby',
'Luggage',
'Accessories',
],
},
{'title': 'More to Explore', 'content': ['Our Brands']},
],
},
{
'title': 'Movies, Music \u0026 Games',
'image': 'http://dvmedia.in/images/media-corner-banner.jpg',
'content': [
{
'title': 'Movies, Music \u0026 Games',
'content': [
'Movies \u0026 TV',
'Blue-ray',
'CDs \u0026 Vinyl',
'Digital Music',
'Video Games',
'Headphones',
'Musical Instruments',
'Entertainment Collectibles',
],
},
],
},
{
'title': 'Sports \u0026 Outdoors',
'image': 'http://vivaplex.co.za/wp-content/uploads/2015/06/sports.jpg',
'content': [
{
'title': 'Sports',
'content': [
'Athletic Clothing',
'Exercise \u0026 Fitness',
'Hunting \u0026 Fishing',
'Team Sports',
'Sports Collectibles',
],
},
{
'title': 'Outdoors',
'content': [
'Camping \u0026 Hiking',
'Cycling',
'Outdoor Clothing',
'Climbing',
'Accessories',
],
},
],
},
{
'title': 'Home, Garden \u0026 Tools',
'image':
'https://i.pinimg.com/originals/21/b5/0f/21b50faf0decf0ea59e6030438e03ccc.jpg',
'content': [
{
'title': 'Home, Garden \u0026 Pets',
'content': [
'Furniture',
'Kitchen \u0026 Dining',
'Bed \u0026 Bath',
'Garden \u0026 Outdoor',
'Mattresses',
'Lighting',
'Appliances',
'Pet Supplies',
],
},
{
'title': 'Tools, Home Improvement',
'content': [
'Home Improvment',
'Power \u0026 Hand Tools',
'Cookware',
'Hardware',
'Smart Home',
],
},
],
},
],
});
});

module.exports = router;
7 changes: 7 additions & 0 deletions bundles.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,13 @@ exports.extensionBundles = [
latestVersion: '0.2',
type: TYPES.MISC,
},
{
name: 'amp-drilldown',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like historically 'drilldown menus' refer to this type of menu:
image
I'd recommend finding a better name for this, also we probably want to add amp-sidebar-* as a prefix for it since it doesn't seem to make sense outside of amp-sidebar if I'm right

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is under experiment, and we have an ongoing discussion about naming, let's not block on this as we can find/replace the name once we reach an agreement.

version: '0.1',
latestVersion: '0.1',
options: {hasCss: true},
type: TYPES.MISC,
},
{
name: 'amp-next-page',
version: '0.1',
Expand Down
49 changes: 49 additions & 0 deletions extensions/amp-drilldown/0.1/amp-drilldown.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/**
* Copyright 2019 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.
*/

amp-drilldown,
amp-drilldown [amp-drilldown-submenu] {
position: absolute !important;
top: 0 !important;
width: 100% !important;
height: 100vh !important;
transform: translateX(0) !important;
}

amp-drilldown.i-amphtml-layout-size-defined {
overflow: visible !important;
}

amp-drilldown [amp-drilldown-submenu] {
left: 100% !important;
opacity: 0 !important;
visibility: hidden !important;
transition: transform 233ms, opacity 233ms, visibility 0s 233ms;
}

amp-drilldown,
amp-drilldown [amp-drilldown-submenu][open] {
opacity: 1 !important;
visibility: visible !important;
transition: transform 233ms;
}

amp-drilldown[child-open],
amp-drilldown [amp-drilldown-submenu][child-open] {
transform: translateX(-100%) !important;
visibility: hidden !important;
transition: transform 233ms, visibility 0s 233ms;
}