wysiwyg.css 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583
  1. /* WYSIWYG Editor Styles */
  2. .wysiwyg-container {
  3. position: relative;
  4. }
  5. .wysiwyg-editor {
  6. min-height: 400px;
  7. border: 1px solid #d1d5db;
  8. border-radius: 6px;
  9. background-color: white;
  10. }
  11. .wysiwyg-toolbar {
  12. border: 1px solid #d1d5db;
  13. border-bottom: none;
  14. border-radius: 6px 6px 0 0;
  15. background-color: #f9fafb;
  16. padding: 8px;
  17. display: flex;
  18. flex-wrap: wrap;
  19. gap: 4px;
  20. }
  21. .wysiwyg-btn {
  22. padding: 6px 10px;
  23. border: 1px solid #d1d5db;
  24. border-radius: 4px;
  25. background-color: white;
  26. cursor: pointer;
  27. font-size: 12px;
  28. transition: all 0.2s;
  29. }
  30. .wysiwyg-btn:hover {
  31. background-color: #f3f4f6;
  32. border-color: #9ca3af;
  33. }
  34. .wysiwyg-btn.active {
  35. background-color: #3b82f6;
  36. color: white;
  37. border-color: #3b82f6;
  38. }
  39. .wysiwyg-separator {
  40. width: 1px;
  41. height: 24px;
  42. background-color: #d1d5db;
  43. margin: 0 4px;
  44. }
  45. .wysiwyg-select {
  46. padding: 4px 8px;
  47. border: 1px solid #d1d5db;
  48. border-radius: 4px;
  49. background-color: white;
  50. font-size: 12px;
  51. }
  52. .wysiwyg-content {
  53. padding: 12px;
  54. min-height: 350px;
  55. font-family: inherit;
  56. font-size: 14px;
  57. line-height: 1.5;
  58. border: none;
  59. outline: none;
  60. resize: vertical;
  61. }
  62. .wysiwyg-content:focus {
  63. outline: 2px solid #3b82f6;
  64. outline-offset: -2px;
  65. }
  66. /* Form integration */
  67. .publication-form .form-group:has(.wysiwyg-container) {
  68. margin-bottom: 20px;
  69. }
  70. .wysiwyg-label {
  71. display: block;
  72. margin-bottom: 8px;
  73. font-weight: 600;
  74. color: #374151;
  75. }
  76. /* Character count */
  77. .wysiwyg-char-count {
  78. margin-top: 8px;
  79. font-size: 12px;
  80. color: #6b7280;
  81. text-align: right;
  82. }
  83. /* Image Gallery */
  84. .image-gallery {
  85. display: none;
  86. position: fixed;
  87. top: 0;
  88. left: 0;
  89. width: 100%;
  90. height: 100%;
  91. background: rgba(0, 0, 0, 0.8);
  92. z-index: 1000;
  93. overflow-y: auto;
  94. }
  95. .image-gallery.open {
  96. display: block;
  97. }
  98. .gallery-container {
  99. max-width: 1200px;
  100. margin: 50px auto;
  101. background: white;
  102. border-radius: 8px;
  103. box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  104. }
  105. .gallery-header {
  106. padding: 20px;
  107. border-bottom: 1px solid #ddd;
  108. display: flex;
  109. justify-content: space-between;
  110. align-items: center;
  111. }
  112. .gallery-title {
  113. font-size: 18px;
  114. font-weight: bold;
  115. margin: 0;
  116. }
  117. .gallery-close {
  118. background: #dc3545;
  119. color: white;
  120. border: none;
  121. padding: 8px 16px;
  122. border-radius: 4px;
  123. cursor: pointer;
  124. font-size: 14px;
  125. }
  126. .gallery-close:hover {
  127. background: #c82333;
  128. }
  129. .gallery-content {
  130. padding: 20px;
  131. }
  132. .gallery-tabs {
  133. display: flex;
  134. margin-bottom: 20px;
  135. border-bottom: 1px solid #ddd;
  136. }
  137. .gallery-tab {
  138. padding: 10px 20px;
  139. background: none;
  140. border: none;
  141. border-bottom: 2px solid transparent;
  142. cursor: pointer;
  143. font-size: 14px;
  144. font-weight: 500;
  145. }
  146. .gallery-tab.active {
  147. border-bottom-color: #007bff;
  148. color: #007bff;
  149. }
  150. .gallery-tab:hover {
  151. color: #007bff;
  152. }
  153. .gallery-upload {
  154. display: none;
  155. padding: 20px;
  156. border: 2px dashed #ddd;
  157. border-radius: 4px;
  158. text-align: center;
  159. }
  160. .gallery-upload.active {
  161. display: block;
  162. }
  163. .upload-area {
  164. padding: 40px;
  165. border: 2px dashed #007bff;
  166. border-radius: 4px;
  167. background: #f8f9fa;
  168. cursor: pointer;
  169. transition: all 0.3s ease;
  170. }
  171. .upload-area:hover {
  172. background: #e3f2fd;
  173. border-color: #0056b3;
  174. }
  175. .upload-area.dragover {
  176. background: #e3f2fd;
  177. border-color: #0056b3;
  178. }
  179. .upload-icon {
  180. font-size: 48px;
  181. color: #007bff;
  182. margin-bottom: 10px;
  183. }
  184. .upload-text {
  185. font-size: 16px;
  186. color: #333;
  187. margin-bottom: 10px;
  188. }
  189. .upload-hint {
  190. font-size: 14px;
  191. color: #666;
  192. }
  193. .file-input {
  194. display: none;
  195. }
  196. .gallery-grid {
  197. display: grid;
  198. grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  199. gap: 15px;
  200. max-height: 400px;
  201. overflow-y: auto;
  202. }
  203. .gallery-item {
  204. position: relative;
  205. border: 1px solid #ddd;
  206. border-radius: 4px;
  207. overflow: hidden;
  208. cursor: pointer;
  209. transition: all 0.3s ease;
  210. }
  211. .gallery-item:hover {
  212. border-color: #007bff;
  213. box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
  214. }
  215. .gallery-item.selected {
  216. border-color: #007bff;
  217. box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.5);
  218. }
  219. .gallery-image {
  220. width: 100%;
  221. height: 120px;
  222. object-fit: cover;
  223. display: block;
  224. }
  225. .gallery-info {
  226. padding: 8px;
  227. font-size: 12px;
  228. color: #666;
  229. background: #f8f9fa;
  230. }
  231. .gallery-name {
  232. font-weight: 500;
  233. color: #333;
  234. white-space: nowrap;
  235. overflow: hidden;
  236. text-overflow: ellipsis;
  237. }
  238. .gallery-size {
  239. color: #666;
  240. }
  241. .gallery-actions {
  242. padding: 15px;
  243. border-top: 1px solid #ddd;
  244. display: flex;
  245. justify-content: space-between;
  246. align-items: center;
  247. }
  248. .gallery-insert {
  249. background: #007bff;
  250. color: white;
  251. border: none;
  252. padding: 10px 20px;
  253. border-radius: 4px;
  254. cursor: pointer;
  255. font-size: 14px;
  256. }
  257. .gallery-insert:hover:not(:disabled) {
  258. background: #0056b3;
  259. }
  260. .gallery-insert:disabled {
  261. background: #6c757d;
  262. cursor: not-allowed;
  263. }
  264. .gallery-upload-btn {
  265. background: #28a745;
  266. color: white;
  267. border: none;
  268. padding: 10px 20px;
  269. border-radius: 4px;
  270. cursor: pointer;
  271. font-size: 14px;
  272. }
  273. .gallery-upload-btn:hover {
  274. background: #218838;
  275. }
  276. .upload-progress {
  277. margin-top: 15px;
  278. display: none;
  279. }
  280. .upload-progress.active {
  281. display: block;
  282. }
  283. .progress-bar {
  284. width: 100%;
  285. height: 8px;
  286. background: #e9ecef;
  287. border-radius: 4px;
  288. overflow: hidden;
  289. }
  290. .progress-fill {
  291. height: 100%;
  292. background: #007bff;
  293. width: 0%;
  294. transition: width 0.3s ease;
  295. }
  296. .upload-status {
  297. margin-top: 10px;
  298. font-size: 14px;
  299. color: #666;
  300. }
  301. .upload-status.success {
  302. color: #28a745;
  303. }
  304. .upload-status.error {
  305. color: #dc3545;
  306. }
  307. /* Responsive Design */
  308. @media (max-width: 768px) {
  309. .gallery-container {
  310. margin: 20px;
  311. max-width: none;
  312. }
  313. .gallery-grid {
  314. grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  315. gap: 10px;
  316. }
  317. .gallery-image {
  318. height: 80px;
  319. }
  320. .gallery-header {
  321. flex-direction: column;
  322. gap: 10px;
  323. text-align: center;
  324. }
  325. .gallery-actions {
  326. flex-direction: column;
  327. gap: 10px;
  328. }
  329. .gallery-insert,
  330. .gallery-upload-btn {
  331. width: 100%;
  332. }
  333. }
  334. @media (max-width: 768px) {
  335. .wysiwyg-toolbar {
  336. padding: 6px;
  337. gap: 2px;
  338. }
  339. .wysiwyg-btn {
  340. padding: 4px 6px;
  341. font-size: 11px;
  342. }
  343. .wysiwyg-content {
  344. padding: 8px;
  345. min-height: 300px;
  346. }
  347. }
  348. /* Image Resizing */
  349. .wysiwyg-content img {
  350. max-width: 100%;
  351. height: auto;
  352. display: inline-block;
  353. cursor: move;
  354. }
  355. .wysiwyg-content img.resizing {
  356. outline: 2px solid #007bff;
  357. outline-offset: 2px;
  358. }
  359. .resize-container {
  360. position: relative;
  361. display: inline-block;
  362. cursor: move;
  363. }
  364. .resize-container.resizing {
  365. outline: 2px solid #007bff;
  366. outline-offset: 2px;
  367. }
  368. .resize-handle {
  369. position: absolute;
  370. background: #007bff;
  371. border: 1px solid #fff;
  372. border-radius: 50%;
  373. width: 8px;
  374. height: 8px;
  375. z-index: 1000;
  376. }
  377. .resize-handle:hover {
  378. background: #0056b3;
  379. transform: scale(1.2);
  380. }
  381. .resize-handle.nw {
  382. top: -4px;
  383. left: -4px;
  384. cursor: nw-resize;
  385. }
  386. .resize-handle.ne {
  387. top: -4px;
  388. right: -4px;
  389. cursor: ne-resize;
  390. }
  391. .resize-handle.sw {
  392. bottom: -4px;
  393. left: -4px;
  394. cursor: sw-resize;
  395. }
  396. .resize-handle.se {
  397. bottom: -4px;
  398. right: -4px;
  399. cursor: se-resize;
  400. }
  401. .resize-handle.n {
  402. top: -4px;
  403. left: 50%;
  404. transform: translateX(-50%);
  405. cursor: n-resize;
  406. }
  407. .resize-handle.s {
  408. bottom: -4px;
  409. left: 50%;
  410. transform: translateX(-50%);
  411. cursor: s-resize;
  412. }
  413. .resize-handle.w {
  414. top: 50%;
  415. left: -4px;
  416. transform: translateY(-50%);
  417. cursor: w-resize;
  418. }
  419. .resize-handle.e {
  420. top: 50%;
  421. right: -4px;
  422. transform: translateY(-50%);
  423. cursor: e-resize;
  424. }
  425. .resize-handle.nw:hover,
  426. .resize-handle.ne:hover,
  427. .resize-handle.sw:hover,
  428. .resize-handle.se:hover {
  429. transform: scale(1.2);
  430. }
  431. .resize-handle.n:hover,
  432. .resize-handle.s:hover {
  433. transform: translateX(-50%) scale(1.2);
  434. }
  435. .resize-handle.w:hover,
  436. .resize-handle.e:hover {
  437. transform: translateY(-50%) scale(1.2);
  438. }
  439. .size-display {
  440. position: absolute;
  441. bottom: -25px;
  442. left: 50%;
  443. transform: translateX(-50%);
  444. background: rgba(0, 0, 0, 0.8);
  445. color: white;
  446. padding: 2px 6px;
  447. border-radius: 3px;
  448. font-size: 11px;
  449. font-family: monospace;
  450. pointer-events: none;
  451. z-index: 1001;
  452. white-space: nowrap;
  453. }
  454. .aspect-ratio-toggle {
  455. position: absolute;
  456. top: -30px;
  457. right: 0;
  458. background: #007bff;
  459. color: white;
  460. border: none;
  461. padding: 4px 8px;
  462. border-radius: 3px;
  463. font-size: 11px;
  464. cursor: pointer;
  465. z-index: 1001;
  466. }
  467. .aspect-ratio-toggle:hover {
  468. background: #0056b3;
  469. }
  470. .aspect-ratio-toggle.locked {
  471. background: #28a745;
  472. }
  473. .aspect-ratio-toggle.locked:hover {
  474. background: #218838;
  475. }
  476. @media (max-width: 768px) {
  477. .wysiwyg-toolbar {
  478. padding: 6px;
  479. gap: 2px;
  480. }
  481. .wysiwyg-btn {
  482. padding: 4px 6px;
  483. font-size: 11px;
  484. }
  485. .resize-handle {
  486. width: 10px;
  487. height: 10px;
  488. }
  489. .size-display {
  490. font-size: 10px;
  491. bottom: -20px;
  492. }
  493. }