-
Notifications
You must be signed in to change notification settings - Fork 694
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 example code blocks with preview in iframe #2637
Conversation
To docs-detail and components-detail templates, where inline examples exist #2053
where inline previews exist #2053
Implement orientation classes, set initial preview url, add dynamic source attr for realod, adjust amp-iframe attrs #2053
with new markup and features #2053
Increase thickness like the horizontal scrollbar, fix glitch in scrollbar-corner #2053
Remove general margin from amp-iframe, add padding to all ap--content containers, not only the first #2053
Better handle preview specific styling #2053
…ject/docs into feature/example_preview_in_iframe
Add padding to iframe and remove shading background-color #2053
Due to design review changes #2053
Due to design review changes #2053
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 #2053
Might fixes sporadically loading issues #2053
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 #2053
Due to design review changes #2053
Due to design review changes #2053
…ject/docs into feature/example_preview_in_iframe
Hi @sebastianbenz , after a long try getting the preview rotate animation as intuitive and 'realistic' as on real-life devices, we decided sticking with this solution. (See screen capture below) What I basically did is fading and rotating the IMPORTANT NOTE: To morph the size of the preview I had to transition P.S. the other thing is also fixed now, so the preview should keep it's dimensions anytime on any resolution. P.P.S. I also got a fallback solution, if you don't like the rotation. It's just morphing the size of the preview, without fading and rotating anything. But I hope you like it 👍
|
Impressive! Thanks for trying! However, we shouldn't use non-hardware accelerated properties for the animation (we have to be a good example :-) ). What does the fallback look like? |
The fallback looks like this, but unfortunately it also uses non-hardware accelerated properties: The Both elements have the I'll try a new solution with just transform and opacity. |
Okay, 2 new solutions:
Screen captures: |
Awesome! I think the first one is perfect! The jumping code block is not a problem. |
I'm glad you like it! |
@sebastianbenz This PR is ready for official review now. Don't be suprised, I just renamed it. |
@sebastianbenz, I wouldn't recommend that compromise. without the animation of the iframe container between the two states, the rotation of only the content makes the example feels broken and not meaningful anymore. Although we put some effort to it, wouldn't it be better for the user if we do not have an animation at all? |
Hey @sebastianbenz I could achieve a morphing effect for the iframe container by adding a background div and change its This method brings two major issues with it: Sometimes the iframe is flickering and if you do a stress-test by rapidly clicking the button, it doesn't behave like expected. It looks broken, see screen captures below So @LongoOfficial and I wouldn't recommend this solution and we should rather stick without an animation then. What do you think? |
I agree, this doesn't work too well. One thing I'd be curious about: what if we remove the morph animation from iframe and speedup the rotation? |
I think |
Disabling rotation of iframe and just morph a background container via transform scale #2637
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. #2637
Add overflow: auto; to nav
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoop! Whoop! Thanks a lot Sebil!
A Googler has manually verified that the CLAs look good. (Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.) ℹ️ Googlers: Go here for more info. |
Are we good to merge or is anything missing? |
From my side we are ready. The only things that are missing are planned for the next steps, eg. the 'side-frame' preview, update for the sampler, etc. |
We now support example code blocks in markdown files with preview in iframe:
[example preview="top-frame" orientation="portrait"]
This PR contains:
inline
preview mode now usetop-frame
(see attachments)Closes: #2053