Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Implement example code blocks with preview in iframe (ampproject#2637)
* WIP: Implement iframe preview for inline examples * Add orientation for example tag and import iframe for frame modes * 🍱 Add new icons for orientation toggle molecule ampproject#2053 * ✨ Add new orientation-toggle molecule styling ampproject#2053 * 🎨 Include orientation-toggle styling and icons To docs-detail and components-detail templates, where inline examples exist ampproject#2053 * 🎨 Prepare orientation-toggle in code-preview template ampproject#2053 * ✨ Add and include FAB styling to templates where inline previews exist ampproject#2053 * 🎨 Properly implement reload and fab buttons * ♻️ Refactor top- and side-frame markup Implement orientation classes, set initial preview url, add dynamic source attr for realod, adjust amp-iframe attrs ampproject#2053 * 💄 Rebrush code-preview styling with new markup and features ampproject#2053 * 💄 Fix scss headers ampproject#2053 * 💄 Adjust code-snippets scrollbar styling Increase thickness like the horizontal scrollbar, fix glitch in scrollbar-corner ampproject#2053 * 💄 Fix docs-details styling issues Remove general margin from amp-iframe, add padding to all ap--content containers, not only the first ampproject#2053 * Add documentation for inline example with frame preview * Example preview orientation toggle with unique id * 🎨 Add preview mode class to code-preview Better handle preview specific styling ampproject#2053 * 💄 Slightly adjust top preview styling Add padding to iframe and remove shading background-color ampproject#2053 * 💄 Optimize spacing for code-preview ampproject#2053 * For now remove side-preview from editor documentation * Use top-frame preview for guides where inline is not possible for all * 🍱 Reduce orientation icons to one toggle icon Due to design review changes ampproject#2053 * 🍱 Update reload icon for code-preview Due to design review changes ampproject#2053 * ♻️ Rebuild orienation logic based on two options Since we have only one but for toggling, we have to adjust the code to boolean principle. This is also a change due to design review ampproject#2053 * 🐛 Add initial preview.url also to top-frame examples Might fixes sporadically loading issues ampproject#2053 * 🎨 Fix indention ampproject#2053 * ♻️ Remove orientation-toggle and add code-preview-controls Since now multiple elements are used as controls, the orientation-toggle itself makes no sense anymore. This combines reload-button and orientation-toggle to one and styles it via code-preview.scss ampproject#2053 * 💄 Use new hover effect for controls Due to design review changes ampproject#2053 * 💄 Add fade-strip to code-snippet Due to design review changes ampproject#2053 * 💄 Add stronger box-shadow to iframe Due to design review changes ampproject#2053 * 💄 Slightly adjust spacing ampproject#2053 * Remove responsive orientation from editor documentation * highlight some text in source code preview documentation * Some text changes in the source code preview documentation * 🐛 Add correct markup for example pages ampproject#2053 * 🐛 Fix dynamic src for example pages iframe ampproject#2053 * 🐛 Fix focus state for code-preview control buttons ampproject#2053 * 🔥 Remove styles for deprecated responsive class ampproject#2053 * ♻️ Refactor aspect ratio handling of code-preview Both orientations will have always the same size now, even on mobile. The space left and right is handled by padding of the parent container. Also enabled fading-strip for code-snippet on mobile. ampproject#2053 * 🐛 Fix typo in class and wrong spacing ampproject#2053 * Add missing format parameter to inline example playground url * 👌 Add transition to orientation change IMPORTANT: I know that `padding` and `max-width` are not part of the **white listed properties for keyframes**, but in this case it is necessary to get the desired effect and since it causes no amp validation error, I think we can shut one eye 👀 ampproject#2053 * 👌 Add orientation change animation After a long try getting the orientation change animation as intuitive and 'realistic' as on real-life devices, we decided sticking with this solution. See PR ampproject#2637 conversion for more info. ampproject#2053 * 👌 Move box-shadow to parent element To prevent cropping it from `overflow: hidden` property ampproject#2053 * 💄 Slightly decrease initial opacity of controls To have more contrast when hovering. ampproject#2053 * 👌 Remove transition for non-hardware accelerated properties ampproject#2053 * 👌 Adjust orientation change animation Disabling rotation of iframe and just morph a background container via transform scale ampproject#2637 * ♻️ Refactor orientation-toggle mechanism Split fade and morph animations; use two seperate buttons and play the same morph animation reverse on the second button; hide and show buttons to keep feeling of one toggle button; use toggleClass to prevent use of amp-bind. ampproject#2637 * 🐛 Fix validation error for auto-scroll Add overflow: auto; to nav
- Loading branch information