Commit 4acdce8
committed
feat(docs): hide marketing hero when the demo is embedded in an iframe
When the demo is loaded in an iframe (it is embedded on roxyapi.com/ui) or opened with ?embed, hide the hero so the host page owns that chrome and the embed starts at the theme and Customize controls. Detect via window.self versus window.top in a head script that sets is-iframed on the html element before paint, so the hero never flashes. The toolbar already carries its own top padding, and direct visits stay unchanged.1 parent 7163f23 commit 4acdce8
1 file changed
Lines changed: 31 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
40 | 44 | | |
41 | 45 | | |
42 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
43 | 50 | | |
44 | 51 | | |
45 | 52 | | |
| |||
590 | 597 | | |
591 | 598 | | |
592 | 599 | | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
593 | 620 | | |
594 | 621 | | |
595 | 622 | | |
| |||
0 commit comments