説明なし

main.html 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <!DOCTYPE html> <title>Arrow 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. }
  15. .scroll3 {
  16. width: 400px;
  17. height: 400px;
  18. background-color: lightgray;
  19. }
  20. .scroll::before {
  21. content: 'before';
  22. display: block;
  23. height: 300px;
  24. width: 1px;
  25. }
  26. .scroll::after {
  27. content: 'after';
  28. display: block;
  29. height: 300px;
  30. width: 1px;
  31. }
  32. #reference {
  33. width: 200px;
  34. height: 200px;
  35. background-color: red;
  36. box-shadow: inset 0 0 0 1px black;
  37. }
  38. #popper {
  39. width: 100px;
  40. height: 100px;
  41. background-color: rebeccapurple;
  42. box-shadow: inset 0 0 0 1px black;
  43. border: 10px solid;
  44. }
  45. #arrow::before {
  46. content: '';
  47. display: block;
  48. width: 20px;
  49. height: 20px;
  50. width: 20px;
  51. height: 20px;
  52. background-color: yellow;
  53. }
  54. </style>
  55. <div class="scroll scroll2">
  56. <div class="scroll scroll3">
  57. <div class="scroll scroll1"><div id="reference">Reference Box</div></div>
  58. <div id="popper">
  59. Popper Box
  60. <div id="arrow" data-popper-arrow></div>
  61. </div>
  62. </div>
  63. </div>
  64. <script type="module">
  65. import { createPopper } from '../../dist/popper.js';
  66. const reference = document.querySelector('#reference');
  67. const popper = document.querySelector('#popper');
  68. window.instance = createPopper(reference, popper, {
  69. placement: 'right',
  70. });
  71. </script>