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