corpus.scss 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. // @Author: Bachir Soussi Chiadmi <bach>
  2. // @Date: 18-12-2017
  3. // @Email: bachir@figureslibres.io
  4. // @Filename: corpus.scss
  5. // @Last modified by: bach
  6. // @Last modified time: 20-12-2017
  7. // @License: GPL-V3
  8. canvas#corpus-map{
  9. &.de-activated{
  10. background-color: rgb(244, 244, 244);
  11. }
  12. position: absolute;
  13. box-sizing: border-box;
  14. top:0; left:0;
  15. // width:100%; height:100%;
  16. z-index:0;
  17. }
  18. // _ _ _ ___ _ _
  19. // | \| |___ __| |___| _ \___ _ __| | | |_ __
  20. // | .` / _ \/ _` / -_) _/ _ \ '_ \ |_| | '_ \
  21. // |_|\_\___/\__,_\___|_| \___/ .__/\___/| .__/
  22. // |_| |_|
  23. div.node-popup{
  24. // display:none;
  25. z-index: 10;
  26. position: absolute;
  27. box-sizing: content-box;
  28. width:300px; min-height: 30px;
  29. pointer-events: none;
  30. top:60%; left:30%;
  31. pointer-events: none;
  32. .inner{
  33. padding:0.6em;
  34. outline: 1px solid red;
  35. background-color: white;
  36. }
  37. $w:60px; // diagonal length
  38. $s:($w *1.4)*0.5; // side given the diagonal (1.4 is the square root of 2)
  39. &:before{
  40. content:"";
  41. position: absolute;
  42. width: $w; height:0;
  43. border-top: 1px solid red;
  44. }
  45. // pos attributes refers to where the popup appears
  46. &[pos="bottom-right"]{
  47. transform: translateY($s) translateX($s);
  48. &:before{
  49. top:-1px;
  50. left: -$w - 1px;
  51. transform-origin: bottom right;
  52. transform: rotateZ(45deg);
  53. }
  54. }
  55. &[pos="bottom-left"]{
  56. transform: translateX(-100%) translateY($s) translateX(-$s);
  57. &:before{
  58. top:calc(100% +1px);
  59. left: 100%;
  60. transform-origin: top left;
  61. transform: rotateZ(-45deg);
  62. }
  63. }
  64. &[pos="top-left"]{
  65. transform: translateY(-100%) translateX(-100%) translateY(-$s) translateX(-$s);
  66. &:before{
  67. bottom:0;
  68. left: 100%;
  69. transform-origin: top left;
  70. transform: rotateZ(45deg);
  71. }
  72. }
  73. &[pos="top-right"]{
  74. transform: translateY(-100%) translateY(-$s) translateX($s);
  75. &:before{
  76. top:calc(100% + 1px);
  77. left: - ($w +1px);
  78. transform-origin: top right;
  79. transform: rotateZ(-45deg);
  80. }
  81. }
  82. }