jquery.orgchart.css 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437
  1. /*
  2. * jQuery OrgChart Plugin
  3. * https://github.com/dabeng/OrgChart
  4. *
  5. * Copyright 2016, dabeng
  6. * https://github.com/dabeng
  7. *
  8. * Licensed under the MIT license:
  9. * http://www.opensource.org/licenses/MIT
  10. */
  11. .orgchart {
  12. box-sizing: border-box;
  13. display: inline-block;
  14. min-height: 202px;
  15. min-width: 202px;
  16. -webkit-touch-callout: none;
  17. -webkit-user-select: none;
  18. -khtml-user-select: none;
  19. -moz-user-select: none;
  20. -ms-user-select: none;
  21. user-select: none;
  22. background-image: linear-gradient(90deg, rgba(200, 0, 0, 0.15) 10%, rgba(0, 0, 0, 0) 10%), linear-gradient(rgba(200, 0, 0, 0.15) 10%, rgba(0, 0, 0, 0) 10%);
  23. background-size: 10px 10px;
  24. border: 1px dashed rgba(0,0,0,0);
  25. padding: 20px;
  26. }
  27. .orgchart .hidden, .orgchart~.hidden {
  28. display: none;
  29. }
  30. .orgchart.b2t {
  31. transform: rotate(180deg);
  32. }
  33. .orgchart.l2r {
  34. position: absolute;
  35. transform: rotate(-90deg) rotateY(180deg);
  36. transform-origin: left top;
  37. }
  38. .orgchart .verticalNodes ul {
  39. list-style: none;
  40. margin: 0;
  41. padding-left: 18px;
  42. text-align: left;
  43. }
  44. .orgchart .verticalNodes ul:first-child {
  45. margin-top: 2px;
  46. }
  47. .orgchart .verticalNodes>td::before {
  48. content: '';
  49. border: 1px solid rgba(217, 83, 79, 0.8);
  50. }
  51. .orgchart .verticalNodes>td>ul>li:first-child::before {
  52. box-sizing: border-box;
  53. top: -4px;
  54. height: 30px;
  55. width: calc(50% - 2px);
  56. border-width: 2px 0 0 2px;
  57. }
  58. .orgchart .verticalNodes ul>li {
  59. position: relative;
  60. }
  61. .orgchart .verticalNodes ul>li::before,
  62. .orgchart .verticalNodes ul>li::after {
  63. box-sizing: border-box;
  64. content: '';
  65. position: absolute;
  66. left: -6px;
  67. border-color: rgba(217, 83, 79, 0.8);
  68. border-style: solid;
  69. border-width: 0 0 2px 2px;
  70. }
  71. .orgchart .verticalNodes ul>li::before {
  72. top: -4px;
  73. height: 30px;
  74. width: 11px;
  75. }
  76. .orgchart .verticalNodes ul>li::after {
  77. top: 1px;
  78. height: 100%;
  79. }
  80. .orgchart .verticalNodes ul>li:first-child::after {
  81. box-sizing: border-box;
  82. top: 24px;
  83. width: 11px;
  84. border-width: 2px 0 0 2px;
  85. }
  86. .orgchart .verticalNodes ul>li:last-child::after {
  87. box-sizing: border-box;
  88. border-width: 2px 0 0;
  89. }
  90. .orgchart.r2l {
  91. position: absolute;
  92. transform: rotate(90deg);
  93. transform-origin: left top;
  94. }
  95. .orgchart>.spinner {
  96. font-size: 100px;
  97. margin-top: 30px;
  98. color: rgba(68, 157, 68, 0.8);
  99. }
  100. .orgchart table {
  101. border-spacing: 0;
  102. border-collapse: separate;
  103. }
  104. .orgchart>table:first-child{
  105. margin: 20px auto;
  106. }
  107. .orgchart td {
  108. text-align: center;
  109. vertical-align: top;
  110. padding: 0;
  111. }
  112. .orgchart .lines:nth-child(3) td {
  113. box-sizing: border-box;
  114. height: 20px;
  115. }
  116. .orgchart .lines .topLine {
  117. border-top: 2px solid rgba(217, 83, 79, 0.8);
  118. }
  119. .orgchart .lines .rightLine {
  120. border-right: 1px solid rgba(217, 83, 79, 0.8);
  121. float: none;
  122. border-radius: 0;
  123. }
  124. .orgchart .lines .leftLine {
  125. border-left: 1px solid rgba(217, 83, 79, 0.8);
  126. float: none;
  127. border-radius: 0;
  128. }
  129. .orgchart .lines .downLine {
  130. background-color: rgba(217, 83, 79, 0.8);
  131. margin: 0 auto;
  132. height: 20px;
  133. width: 2px;
  134. float: none;
  135. }
  136. /* node styling */
  137. .orgchart .node {
  138. box-sizing: border-box;
  139. display: inline-block;
  140. position: relative;
  141. margin: 0;
  142. padding: 3px;
  143. border: 2px dashed transparent;
  144. text-align: center;
  145. width: 130px;
  146. }
  147. .orgchart.l2r .node, .orgchart.r2l .node {
  148. width: 50px;
  149. height: 130px;
  150. }
  151. .orgchart .node>.spinner {
  152. position: absolute;
  153. top: calc(50% - 15px);
  154. left: calc(50% - 15px);
  155. vertical-align: middle;
  156. font-size: 30px;
  157. color: rgba(68, 157, 68, 0.8);
  158. }
  159. .orgchart .node:hover {
  160. background-color: rgba(238, 217, 54, 0.5);
  161. transition: .5s;
  162. cursor: default;
  163. z-index: 20;
  164. }
  165. .orgchart .node.focused {
  166. background-color: rgba(238, 217, 54, 0.5);
  167. }
  168. .orgchart .ghost-node {
  169. position: fixed;
  170. left: -10000px;
  171. top: -10000px;
  172. }
  173. .orgchart .ghost-node rect {
  174. fill: #ffffff;
  175. stroke: #bf0000;
  176. }
  177. .orgchart .node.allowedDrop {
  178. border-color: rgba(68, 157, 68, 0.9);
  179. }
  180. .orgchart .node .title {
  181. text-align: center;
  182. font-size: 12px;
  183. font-weight: bold;
  184. height: 20px;
  185. line-height: 20px;
  186. overflow: hidden;
  187. text-overflow: ellipsis;
  188. white-space: nowrap;
  189. background-color: rgba(217, 83, 79, 0.8);
  190. color: #fff;
  191. border-radius: 4px 4px 0 0;
  192. }
  193. .orgchart.b2t .node .title {
  194. transform: rotate(-180deg);
  195. transform-origin: center bottom;
  196. }
  197. .orgchart.l2r .node .title {
  198. transform: rotate(-90deg) translate(-40px, -40px) rotateY(180deg);
  199. transform-origin: bottom center;
  200. width: 120px;
  201. }
  202. .orgchart.r2l .node .title {
  203. transform: rotate(-90deg) translate(-40px, -40px);
  204. transform-origin: bottom center;
  205. width: 120px;
  206. }
  207. .orgchart .node .title .symbol {
  208. float: left;
  209. margin-top: 4px;
  210. margin-left: 2px;
  211. }
  212. .orgchart .node .content {
  213. box-sizing: border-box;
  214. width: 100%;
  215. height: 20px;
  216. font-size: 11px;
  217. line-height: 18px;
  218. border: 1px solid rgba(217, 83, 79, 0.8);
  219. border-radius: 0 0 4px 4px;
  220. text-align: center;
  221. background-color: #fff;
  222. color: #333;
  223. overflow: hidden;
  224. text-overflow: ellipsis;
  225. white-space: nowrap;
  226. }
  227. .orgchart.b2t .node .content {
  228. transform: rotate(180deg);
  229. transform-origin: center top;
  230. }
  231. .orgchart.l2r .node .content {
  232. transform: rotate(-90deg) translate(-40px, -40px) rotateY(180deg);
  233. transform-origin: top center;
  234. width: 120px;
  235. }
  236. .orgchart.r2l .node .content {
  237. transform: rotate(-90deg) translate(-40px, -40px);
  238. transform-origin: top center;
  239. width: 120px;
  240. }
  241. .orgchart .node .edge {
  242. font-size: 15px;
  243. position: absolute;
  244. color: rgba(68, 157, 68, 0.5);
  245. cursor: default;
  246. transition: .2s;
  247. }
  248. .orgchart.noncollapsable .node .edge {
  249. display: none;
  250. }
  251. .orgchart .edge:hover {
  252. color: #449d44;
  253. cursor: pointer;
  254. }
  255. .orgchart .node .verticalEdge {
  256. width: calc(100% - 10px);
  257. width: -webkit-calc(100% - 10px);
  258. width: -moz-calc(100% - 10px);
  259. left: 5px;
  260. }
  261. .orgchart .node .topEdge {
  262. top: -4px;
  263. }
  264. .orgchart .node .bottomEdge {
  265. bottom: -4px;
  266. }
  267. .orgchart .node .horizontalEdge {
  268. width: 15px;
  269. height: calc(100% - 10px);
  270. height: -webkit-calc(100% - 10px);
  271. height: -moz-calc(100% - 10px);
  272. top: 5px;
  273. }
  274. .orgchart .node .rightEdge {
  275. right: -4px;
  276. }
  277. .orgchart .node .leftEdge {
  278. left: -4px;
  279. }
  280. .orgchart .node .horizontalEdge::before {
  281. position: absolute;
  282. top: calc(50% - 7px);
  283. }
  284. .orgchart .node .rightEdge::before {
  285. right: 3px;
  286. }
  287. .orgchart .node .leftEdge::before {
  288. left: 3px;
  289. }
  290. .orgchart .node .toggleBtn {
  291. position: absolute;
  292. left: 5px;
  293. bottom: -2px;
  294. color: rgba(68, 157, 68, 0.6);
  295. }
  296. .orgchart .node .toggleBtn:hover {
  297. color: rgba(68, 157, 68, 0.8);
  298. }
  299. .oc-export-btn {
  300. display: inline-block;
  301. position: absolute;
  302. right: 5px;
  303. top: 5px;
  304. padding: 6px 12px;
  305. margin-bottom: 0;
  306. font-size: 14px;
  307. font-weight: 400;
  308. line-height: 1.42857143;
  309. text-align: center;
  310. white-space: nowrap;
  311. vertical-align: middle;
  312. touch-action: manipulation;
  313. cursor: pointer;
  314. user-select: none;
  315. color: #fff;
  316. background-color: #5cb85c;
  317. border: 1px solid transparent;
  318. border-color: #4cae4c;
  319. border-radius: 4px;
  320. }
  321. .oc-export-btn[disabled] {
  322. cursor: not-allowed;
  323. box-shadow: none;
  324. opacity: 0.3;
  325. }
  326. .oc-export-btn:hover,.oc-export-btn:focus,.oc-export-btn:active {
  327. background-color: #449d44;
  328. border-color: #347a34;
  329. }
  330. .orgchart~.mask {
  331. position: absolute;
  332. top: 0;
  333. right: 0;
  334. bottom: 0;
  335. left: 0;
  336. z-index: 999;
  337. text-align: center;
  338. background-color: rgba(0,0,0,0.3);
  339. }
  340. .orgchart~.mask .spinner {
  341. position: absolute;
  342. top: calc(50% - 54px);
  343. left: calc(50% - 54px);
  344. color: rgba(255,255,255,0.8);
  345. font-size: 108px;
  346. }
  347. .orgchart .node {
  348. transition: transform 0.3s, opacity 0.3s;
  349. }
  350. .orgchart .slide-down {
  351. opacity: 0;
  352. transform: translateY(40px);
  353. }
  354. .orgchart.l2r .node.slide-down, .orgchart.r2l .node.slide-down {
  355. transform: translateY(130px);
  356. }
  357. .orgchart .slide-up {
  358. opacity: 0;
  359. transform: translateY(-40px);
  360. }
  361. .orgchart.l2r .node.slide-up, .orgchart.r2l .node.slide-up {
  362. transform: translateY(-130px);
  363. }
  364. .orgchart .slide-right {
  365. opacity: 0;
  366. transform: translateX(130px);
  367. }
  368. .orgchart.l2r .node.slide-right, .orgchart.r2l .node.slide-right {
  369. transform: translateX(40px);
  370. }
  371. .orgchart .slide-left {
  372. opacity: 0;
  373. transform: translateX(-130px);
  374. }
  375. .orgchart.l2r .node.slide-left, .orgchart.r2l .node.slide-left {
  376. transform: translateX(-40px);
  377. }