Нет описания

index.html 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <!DOCTYPE html> <title>Hide Visual Test</title>
  2. <style>
  3. @import '/reset.css';
  4. .scroll {
  5. overflow: scroll;
  6. width: 300px;
  7. height: 300px;
  8. background-color: grey;
  9. }
  10. .scroll2 {
  11. width: 600px;
  12. height: 600px;
  13. background-color: darkgrey;
  14. position: relative;
  15. }
  16. .scroll3 {
  17. width: 400px;
  18. height: 400px;
  19. background-color: lightgray;
  20. }
  21. .scroll::before {
  22. content: 'before';
  23. display: block;
  24. height: 300px;
  25. width: 1px;
  26. }
  27. .scroll::after {
  28. content: 'after';
  29. display: block;
  30. height: 300px;
  31. width: 1px;
  32. }
  33. #reference {
  34. width: 200px;
  35. height: 200px;
  36. background-color: red;
  37. box-shadow: inset 0 0 0 1px black;
  38. }
  39. #popper {
  40. width: 100px;
  41. height: 100px;
  42. background-color: rebeccapurple;
  43. box-shadow: inset 0 0 0 1px black;
  44. }
  45. #popper[data-popper-escaped] {
  46. background-color: white;
  47. }
  48. #popper[data-popper-reference-hidden] {
  49. opacity: 0.4;
  50. background-color: yellow;
  51. }
  52. #arrow {
  53. width: 20px;
  54. height: 20px;
  55. background-color: yellow;
  56. }
  57. </style>
  58. <div class="scroll scroll2">
  59. <div class="scroll scroll3">
  60. <div class="scroll scroll1">
  61. <div id="reference">Reference Box</div>
  62. <div id="popper">Popper Box</div>
  63. </div>
  64. </div>
  65. </div>
  66. <script type="module">
  67. import { createPopper } from '../../dist/popper.js';
  68. import hide from '../../dist/modifiers/hide.js';
  69. const reference = document.querySelector('#reference');
  70. const popper = document.querySelector('#popper');
  71. window.instance = createPopper(reference, popper, {
  72. placement: 'right',
  73. modifiers: [
  74. hide,
  75. {
  76. name: 'offset',
  77. options: {
  78. offset: [20, 20],
  79. },
  80. },
  81. ],
  82. });
  83. </script>