logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://anongit.hacktivis.me/git/pleroma-fe.git/

theme_tab.vue (38036B)


  1. <template>
  2. <div class="theme-tab">
  3. <div class="alert warning deprecation-warning">
  4. {{ $t("settings.style.themes2_outdated") }}
  5. </div>
  6. <div class="presets-container">
  7. <div class="save-load">
  8. <div
  9. v-if="themeWarning"
  10. class="theme-warning"
  11. >
  12. <div class="alert warning">
  13. {{ themeWarningHelp }}
  14. </div>
  15. <div class="buttons">
  16. <template v-if="themeWarning.type === 'snapshot_source_mismatch'">
  17. <button
  18. class="btn button-default"
  19. @click="forceLoad"
  20. >
  21. {{ $t('settings.style.switcher.use_source') }}
  22. </button>
  23. <button
  24. class="btn button-default"
  25. @click="forceSnapshot"
  26. >
  27. {{ $t('settings.style.switcher.use_snapshot') }}
  28. </button>
  29. </template>
  30. <template v-else-if="themeWarning.noActionsPossible">
  31. <button
  32. class="btn button-default"
  33. @click="dismissWarning"
  34. >
  35. {{ $t('general.dismiss') }}
  36. </button>
  37. </template>
  38. <template v-else>
  39. <button
  40. class="btn button-default"
  41. @click="forceLoad"
  42. >
  43. {{ $t('settings.style.switcher.load_theme') }}
  44. </button>
  45. <button
  46. class="btn button-default"
  47. @click="dismissWarning"
  48. >
  49. {{ $t('settings.style.switcher.keep_as_is') }}
  50. </button>
  51. </template>
  52. </div>
  53. </div>
  54. <div class="top">
  55. <div class="presets">
  56. {{ $t('settings.presets') }}
  57. <label
  58. for="preset-switcher"
  59. class="select"
  60. >
  61. <Select
  62. id="preset-switcher"
  63. v-model="selected"
  64. class="preset-switcher"
  65. >
  66. <option
  67. v-for="style in availableStyles"
  68. :key="style.name"
  69. :value="style.name || style[0]"
  70. :style="{
  71. backgroundColor: style[1] || (style.theme || style.source).colors.bg,
  72. color: style[3] || (style.theme || style.source).colors.text
  73. }"
  74. >
  75. {{ style[0] || style.name }}
  76. </option>
  77. </Select>
  78. </label>
  79. </div>
  80. <div class="export-import">
  81. <button
  82. class="btn button-default"
  83. @click="importTheme"
  84. >
  85. {{ $t(&quot;settings.import_theme&quot;) }}
  86. </button>
  87. <button
  88. class="btn button-default"
  89. @click="exportTheme"
  90. >
  91. {{ $t(&quot;settings.export_theme&quot;) }}
  92. </button>
  93. </div>
  94. </div>
  95. </div>
  96. <div class="save-load-options">
  97. <span class="keep-option">
  98. <Checkbox v-model="keepColor">
  99. {{ $t('settings.style.switcher.keep_color') }}
  100. </Checkbox>
  101. </span>
  102. <span class="keep-option">
  103. <Checkbox v-model="keepShadows">
  104. {{ $t('settings.style.switcher.keep_shadows') }}
  105. </Checkbox>
  106. </span>
  107. <span class="keep-option">
  108. <Checkbox v-model="keepOpacity">
  109. {{ $t('settings.style.switcher.keep_opacity') }}
  110. </Checkbox>
  111. </span>
  112. <span class="keep-option">
  113. <Checkbox v-model="keepRoundness">
  114. {{ $t('settings.style.switcher.keep_roundness') }}
  115. </Checkbox>
  116. </span>
  117. <span class="keep-option">
  118. <Checkbox v-model="keepFonts">
  119. {{ $t('settings.style.switcher.keep_fonts') }}
  120. </Checkbox>
  121. </span>
  122. <p>{{ $t('settings.style.switcher.save_load_hint') }}</p>
  123. </div>
  124. </div>
  125. <!-- eslint-disable vue/no-v-html vue/no-v-text-v-html-on-component -->
  126. <component
  127. :is="'style'"
  128. v-html="themeV3Preview"
  129. />
  130. <!-- eslint-enable vue/no-v-html vue/no-v-text-v-html-on-component -->
  131. <preview id="theme-preview" />
  132. <div>
  133. <button
  134. class="btn button-default"
  135. @click="updateTheme3Preview"
  136. >
  137. {{ $t("settings.style.update_preview") }}
  138. </button>
  139. </div>
  140. <keep-alive>
  141. <tab-switcher key="style-tweak">
  142. <div
  143. :label="$t('settings.style.common_colors._tab_label')"
  144. class="color-container"
  145. >
  146. <div class="tab-header">
  147. <p>{{ $t('settings.theme_help') }}</p>
  148. <div class="tab-header-buttons">
  149. <button
  150. class="btn button-default"
  151. @click="clearOpacity"
  152. >
  153. {{ $t('settings.style.switcher.clear_opacity') }}
  154. </button>
  155. <button
  156. class="btn button-default"
  157. @click="clearV1"
  158. >
  159. {{ $t('settings.style.switcher.clear_all') }}
  160. </button>
  161. </div>
  162. </div>
  163. <p>{{ $t('settings.theme_help_v2_1') }}</p>
  164. <h4>{{ $t('settings.style.common_colors.main') }}</h4>
  165. <div class="color-item">
  166. <ColorInput
  167. v-model="bgColorLocal"
  168. name="bgColor"
  169. :label="$t('settings.background')"
  170. />
  171. <OpacityInput
  172. v-model="bgOpacityLocal"
  173. name="bgOpacity"
  174. :fallback="previewTheme.opacity?.bg"
  175. />
  176. <ColorInput
  177. v-model="textColorLocal"
  178. name="textColor"
  179. :label="$t('settings.text')"
  180. />
  181. <ContrastRatio :contrast="previewContrast.bgText" />
  182. <ColorInput
  183. v-model="accentColorLocal"
  184. name="accentColor"
  185. :fallback="previewTheme.colors?.link"
  186. :label="$t('settings.accent')"
  187. :show-optional-checkbox="typeof linkColorLocal !== 'undefined'"
  188. />
  189. <ColorInput
  190. v-model="linkColorLocal"
  191. name="linkColor"
  192. :fallback="previewTheme.colors?.accent"
  193. :label="$t('settings.links')"
  194. :show-optional-checkbox="typeof accentColorLocal !== 'undefined'"
  195. />
  196. <ContrastRatio :contrast="previewContrast.bgLink" />
  197. </div>
  198. <div class="color-item">
  199. <ColorInput
  200. v-model="fgColorLocal"
  201. name="fgColor"
  202. :label="$t('settings.foreground')"
  203. />
  204. <ColorInput
  205. v-model="fgTextColorLocal"
  206. name="fgTextColor"
  207. :label="$t('settings.text')"
  208. :fallback="previewTheme.colors?.fgText"
  209. />
  210. <ColorInput
  211. v-model="fgLinkColorLocal"
  212. name="fgLinkColor"
  213. :label="$t('settings.links')"
  214. :fallback="previewTheme.colors?.fgLink"
  215. />
  216. <p>{{ $t('settings.style.common_colors.foreground_hint') }}</p>
  217. </div>
  218. <h4>{{ $t('settings.style.common_colors.rgbo') }}</h4>
  219. <div class="color-item">
  220. <ColorInput
  221. v-model="cRedColorLocal"
  222. name="cRedColor"
  223. :label="$t('settings.cRed')"
  224. />
  225. <ContrastRatio :contrast="previewContrast.bgCRed" />
  226. <ColorInput
  227. v-model="cBlueColorLocal"
  228. name="cBlueColor"
  229. :label="$t('settings.cBlue')"
  230. />
  231. <ContrastRatio :contrast="previewContrast.bgCBlue" />
  232. </div>
  233. <div class="color-item">
  234. <ColorInput
  235. v-model="cGreenColorLocal"
  236. name="cGreenColor"
  237. :label="$t('settings.cGreen')"
  238. />
  239. <ContrastRatio :contrast="previewContrast.bgCGreen" />
  240. <ColorInput
  241. v-model="cOrangeColorLocal"
  242. name="cOrangeColor"
  243. :label="$t('settings.cOrange')"
  244. />
  245. <ContrastRatio :contrast="previewContrast.bgCOrange" />
  246. </div>
  247. <p>{{ $t('settings.theme_help_v2_2') }}</p>
  248. </div>
  249. <div
  250. :label="$t('settings.style.advanced_colors._tab_label')"
  251. class="color-container"
  252. >
  253. <div class="tab-header">
  254. <p>{{ $t('settings.theme_help') }}</p>
  255. <button
  256. class="btn button-default"
  257. @click="clearOpacity"
  258. >
  259. {{ $t('settings.style.switcher.clear_opacity') }}
  260. </button>
  261. <button
  262. class="btn button-default"
  263. @click="clearV1"
  264. >
  265. {{ $t('settings.style.switcher.clear_all') }}
  266. </button>
  267. </div>
  268. <div class="color-item">
  269. <h4>{{ $t('settings.style.advanced_colors.post') }}</h4>
  270. <ColorInput
  271. v-model="postLinkColorLocal"
  272. name="postLinkColor"
  273. :fallback="previewTheme.colors?.accent"
  274. :label="$t('settings.links')"
  275. />
  276. <ContrastRatio :contrast="previewContrast.postLink" />
  277. <ColorInput
  278. v-model="postGreentextColorLocal"
  279. name="postGreentextColor"
  280. :fallback="previewTheme.colors?.cGreen"
  281. :label="$t('settings.greentext')"
  282. />
  283. <ContrastRatio :contrast="previewContrast.postGreentext" />
  284. <h4>{{ $t('settings.style.advanced_colors.alert') }}</h4>
  285. <ColorInput
  286. v-model="alertErrorColorLocal"
  287. name="alertError"
  288. :label="$t('settings.style.advanced_colors.alert_error')"
  289. :fallback="previewTheme.colors?.alertError"
  290. />
  291. <ColorInput
  292. v-model="alertErrorTextColorLocal"
  293. name="alertErrorText"
  294. :label="$t('settings.text')"
  295. :fallback="previewTheme.colors?.alertErrorText"
  296. />
  297. <ContrastRatio
  298. :contrast="previewContrast.alertErrorText"
  299. large
  300. />
  301. <ColorInput
  302. v-model="alertWarningColorLocal"
  303. name="alertWarning"
  304. :label="$t('settings.style.advanced_colors.alert_warning')"
  305. :fallback="previewTheme.colors?.alertWarning"
  306. />
  307. <ColorInput
  308. v-model="alertWarningTextColorLocal"
  309. name="alertWarningText"
  310. :label="$t('settings.text')"
  311. :fallback="previewTheme.colors?.alertWarningText"
  312. />
  313. <ContrastRatio
  314. :contrast="previewContrast.alertWarningText"
  315. large
  316. />
  317. <ColorInput
  318. v-model="alertNeutralColorLocal"
  319. name="alertNeutral"
  320. :label="$t('settings.style.advanced_colors.alert_neutral')"
  321. :fallback="previewTheme.colors?.alertNeutral"
  322. />
  323. <ColorInput
  324. v-model="alertNeutralTextColorLocal"
  325. name="alertNeutralText"
  326. :label="$t('settings.text')"
  327. :fallback="previewTheme.colors?.alertNeutralText"
  328. />
  329. <ContrastRatio
  330. :contrast="previewContrast.alertNeutralText"
  331. large
  332. />
  333. <OpacityInput
  334. v-model="alertOpacityLocal"
  335. name="alertOpacity"
  336. :fallback="previewTheme.opacity?.alert"
  337. />
  338. </div>
  339. <div class="color-item">
  340. <h4>{{ $t('settings.style.advanced_colors.badge') }}</h4>
  341. <ColorInput
  342. v-model="badgeNotificationColorLocal"
  343. name="badgeNotification"
  344. :label="$t('settings.style.advanced_colors.badge_notification')"
  345. :fallback="previewTheme.colors?.badgeNotification"
  346. />
  347. <ColorInput
  348. v-model="badgeNotificationTextColorLocal"
  349. name="badgeNotificationText"
  350. :label="$t('settings.text')"
  351. :fallback="previewTheme.colors?.badgeNotificationText"
  352. />
  353. <ContrastRatio
  354. :contrast="previewContrast.badgeNotificationText"
  355. large
  356. />
  357. </div>
  358. <div class="color-item">
  359. <h4>{{ $t('settings.style.advanced_colors.panel_header') }}</h4>
  360. <ColorInput
  361. v-model="panelColorLocal"
  362. name="panelColor"
  363. :fallback="previewTheme.colors?.panel"
  364. :label="$t('settings.background')"
  365. />
  366. <OpacityInput
  367. v-model="panelOpacityLocal"
  368. name="panelOpacity"
  369. :fallback="previewTheme.opacity?.panel"
  370. :disabled="panelColorLocal === 'transparent'"
  371. />
  372. <ColorInput
  373. v-model="panelTextColorLocal"
  374. name="panelTextColor"
  375. :fallback="previewTheme.colors?.panelText"
  376. :label="$t('settings.text')"
  377. />
  378. <ContrastRatio
  379. :contrast="previewContrast.panelText"
  380. large
  381. />
  382. <ColorInput
  383. v-model="panelLinkColorLocal"
  384. name="panelLinkColor"
  385. :fallback="previewTheme.colors?.panelLink"
  386. :label="$t('settings.links')"
  387. />
  388. <ContrastRatio
  389. :contrast="previewContrast.panelLink"
  390. large
  391. />
  392. </div>
  393. <div class="color-item">
  394. <h4>{{ $t('settings.style.advanced_colors.top_bar') }}</h4>
  395. <ColorInput
  396. v-model="topBarColorLocal"
  397. name="topBarColor"
  398. :fallback="previewTheme.colors?.topBar"
  399. :label="$t('settings.background')"
  400. />
  401. <ColorInput
  402. v-model="topBarTextColorLocal"
  403. name="topBarTextColor"
  404. :fallback="previewTheme.colors?.topBarText"
  405. :label="$t('settings.text')"
  406. />
  407. <ContrastRatio :contrast="previewContrast.topBarText" />
  408. <ColorInput
  409. v-model="topBarLinkColorLocal"
  410. name="topBarLinkColor"
  411. :fallback="previewTheme.colors?.topBarLink"
  412. :label="$t('settings.links')"
  413. />
  414. <ContrastRatio :contrast="previewContrast.topBarLink" />
  415. </div>
  416. <div class="color-item">
  417. <h4>{{ $t('settings.style.advanced_colors.inputs') }}</h4>
  418. <ColorInput
  419. v-model="inputColorLocal"
  420. name="inputColor"
  421. :fallback="previewTheme.colors?.input"
  422. :label="$t('settings.background')"
  423. />
  424. <OpacityInput
  425. v-model="inputOpacityLocal"
  426. name="inputOpacity"
  427. :fallback="previewTheme.opacity?.input"
  428. :disabled="inputColorLocal === 'transparent'"
  429. />
  430. <ColorInput
  431. v-model="inputTextColorLocal"
  432. name="inputTextColor"
  433. :fallback="previewTheme.colors?.inputText"
  434. :label="$t('settings.text')"
  435. />
  436. <ContrastRatio :contrast="previewContrast.inputText" />
  437. </div>
  438. <div class="color-item">
  439. <h4>{{ $t('settings.style.advanced_colors.buttons') }}</h4>
  440. <ColorInput
  441. v-model="btnColorLocal"
  442. name="btnColor"
  443. :fallback="previewTheme.colors?.btn"
  444. :label="$t('settings.background')"
  445. />
  446. <OpacityInput
  447. v-model="btnOpacityLocal"
  448. name="btnOpacity"
  449. :fallback="previewTheme.opacity?.btn"
  450. :disabled="btnColorLocal === 'transparent'"
  451. />
  452. <ColorInput
  453. v-model="btnTextColorLocal"
  454. name="btnTextColor"
  455. :fallback="previewTheme.colors?.btnText"
  456. :label="$t('settings.text')"
  457. />
  458. <ContrastRatio :contrast="previewContrast.btnText" />
  459. <ColorInput
  460. v-model="btnPanelTextColorLocal"
  461. name="btnPanelTextColor"
  462. :fallback="previewTheme.colors?.btnPanelText"
  463. :label="$t('settings.style.advanced_colors.panel_header')"
  464. />
  465. <ContrastRatio :contrast="previewContrast.btnPanelText" />
  466. <ColorInput
  467. v-model="btnTopBarTextColorLocal"
  468. name="btnTopBarTextColor"
  469. :fallback="previewTheme.colors?.btnTopBarText"
  470. :label="$t('settings.style.advanced_colors.top_bar')"
  471. />
  472. <ContrastRatio :contrast="previewContrast.btnTopBarText" />
  473. <h5>{{ $t('settings.style.advanced_colors.pressed') }}</h5>
  474. <ColorInput
  475. v-model="btnPressedColorLocal"
  476. name="btnPressedColor"
  477. :fallback="previewTheme.colors?.btnPressed"
  478. :label="$t('settings.background')"
  479. />
  480. <ColorInput
  481. v-model="btnPressedTextColorLocal"
  482. name="btnPressedTextColor"
  483. :fallback="previewTheme.colors?.btnPressedText"
  484. :label="$t('settings.text')"
  485. />
  486. <ContrastRatio :contrast="previewContrast.btnPressedText" />
  487. <ColorInput
  488. v-model="btnPressedPanelTextColorLocal"
  489. name="btnPressedPanelTextColor"
  490. :fallback="previewTheme.colors?.btnPressedPanelText"
  491. :label="$t('settings.style.advanced_colors.panel_header')"
  492. />
  493. <ContrastRatio :contrast="previewContrast.btnPressedPanelText" />
  494. <ColorInput
  495. v-model="btnPressedTopBarTextColorLocal"
  496. name="btnPressedTopBarTextColor"
  497. :fallback="previewTheme.colors?.btnPressedTopBarText"
  498. :label="$t('settings.style.advanced_colors.top_bar')"
  499. />
  500. <ContrastRatio :contrast="previewContrast.btnPressedTopBarText" />
  501. <h5>{{ $t('settings.style.advanced_colors.disabled') }}</h5>
  502. <ColorInput
  503. v-model="btnDisabledColorLocal"
  504. name="btnDisabledColor"
  505. :fallback="previewTheme.colors?.btnDisabled"
  506. :label="$t('settings.background')"
  507. />
  508. <ColorInput
  509. v-model="btnDisabledTextColorLocal"
  510. name="btnDisabledTextColor"
  511. :fallback="previewTheme.colors?.btnDisabledText"
  512. :label="$t('settings.text')"
  513. />
  514. <ColorInput
  515. v-model="btnDisabledPanelTextColorLocal"
  516. name="btnDisabledPanelTextColor"
  517. :fallback="previewTheme.colors?.btnDisabledPanelText"
  518. :label="$t('settings.style.advanced_colors.panel_header')"
  519. />
  520. <ColorInput
  521. v-model="btnDisabledTopBarTextColorLocal"
  522. name="btnDisabledTopBarTextColor"
  523. :fallback="previewTheme.colors?.btnDisabledTopBarText"
  524. :label="$t('settings.style.advanced_colors.top_bar')"
  525. />
  526. <h5>{{ $t('settings.style.advanced_colors.toggled') }}</h5>
  527. <ColorInput
  528. v-model="btnToggledColorLocal"
  529. name="btnToggledColor"
  530. :fallback="previewTheme.colors?.btnToggled"
  531. :label="$t('settings.background')"
  532. />
  533. <ColorInput
  534. v-model="btnToggledTextColorLocal"
  535. name="btnToggledTextColor"
  536. :fallback="previewTheme.colors?.btnToggledText"
  537. :label="$t('settings.text')"
  538. />
  539. <ContrastRatio :contrast="previewContrast.btnToggledText" />
  540. <ColorInput
  541. v-model="btnToggledPanelTextColorLocal"
  542. name="btnToggledPanelTextColor"
  543. :fallback="previewTheme.colors?.btnToggledPanelText"
  544. :label="$t('settings.style.advanced_colors.panel_header')"
  545. />
  546. <ContrastRatio :contrast="previewContrast.btnToggledPanelText" />
  547. <ColorInput
  548. v-model="btnToggledTopBarTextColorLocal"
  549. name="btnToggledTopBarTextColor"
  550. :fallback="previewTheme.colors?.btnToggledTopBarText"
  551. :label="$t('settings.style.advanced_colors.top_bar')"
  552. />
  553. <ContrastRatio :contrast="previewContrast.btnToggledTopBarText" />
  554. </div>
  555. <div class="color-item">
  556. <h4>{{ $t('settings.style.advanced_colors.tabs') }}</h4>
  557. <ColorInput
  558. v-model="tabColorLocal"
  559. name="tabColor"
  560. :fallback="previewTheme.colors?.tab"
  561. :label="$t('settings.background')"
  562. />
  563. <ColorInput
  564. v-model="tabTextColorLocal"
  565. name="tabTextColor"
  566. :fallback="previewTheme.colors?.tabText"
  567. :label="$t('settings.text')"
  568. />
  569. <ContrastRatio :contrast="previewContrast.tabText" />
  570. <ColorInput
  571. v-model="tabActiveTextColorLocal"
  572. name="tabActiveTextColor"
  573. :fallback="previewTheme.colors?.tabActiveText"
  574. :label="$t('settings.text')"
  575. />
  576. <ContrastRatio :contrast="previewContrast.tabActiveText" />
  577. </div>
  578. <div class="color-item">
  579. <h4>{{ $t('settings.style.advanced_colors.borders') }}</h4>
  580. <ColorInput
  581. v-model="borderColorLocal"
  582. name="borderColor"
  583. :fallback="previewTheme.colors?.border"
  584. :label="$t('settings.style.common.color')"
  585. />
  586. <OpacityInput
  587. v-model="borderOpacityLocal"
  588. name="borderOpacity"
  589. :fallback="previewTheme.opacity?.border"
  590. :disabled="borderColorLocal === 'transparent'"
  591. />
  592. </div>
  593. <div class="color-item">
  594. <h4>{{ $t('settings.style.advanced_colors.faint_text') }}</h4>
  595. <ColorInput
  596. v-model="faintColorLocal"
  597. name="faintColor"
  598. :fallback="previewTheme.colors?.faint"
  599. :label="$t('settings.text')"
  600. />
  601. <ColorInput
  602. v-model="faintLinkColorLocal"
  603. name="faintLinkColor"
  604. :fallback="previewTheme.colors?.faintLink"
  605. :label="$t('settings.links')"
  606. />
  607. <ColorInput
  608. v-model="panelFaintColorLocal"
  609. name="panelFaintColor"
  610. :fallback="previewTheme.colors?.panelFaint"
  611. :label="$t('settings.style.advanced_colors.panel_header')"
  612. />
  613. <OpacityInput
  614. v-model="faintOpacityLocal"
  615. name="faintOpacity"
  616. :fallback="previewTheme.opacity?.faint"
  617. />
  618. </div>
  619. <div class="color-item">
  620. <h4>{{ $t('settings.style.advanced_colors.underlay') }}</h4>
  621. <ColorInput
  622. v-model="underlayColorLocal"
  623. name="underlay"
  624. :label="$t('settings.style.advanced_colors.underlay')"
  625. :fallback="previewTheme.colors?.underlay"
  626. />
  627. <OpacityInput
  628. v-model="underlayOpacityLocal"
  629. name="underlayOpacity"
  630. :fallback="previewTheme.opacity?.underlay"
  631. :disabled="underlayOpacityLocal === 'transparent'"
  632. />
  633. </div>
  634. <div class="color-item">
  635. <h4>{{ $t('settings.style.advanced_colors.wallpaper') }}</h4>
  636. <ColorInput
  637. v-model="wallpaperColorLocal"
  638. name="wallpaper"
  639. :label="$t('settings.style.advanced_colors.wallpaper')"
  640. :fallback="previewTheme.colors?.wallpaper"
  641. />
  642. </div>
  643. <div class="color-item">
  644. <h4>{{ $t('settings.style.advanced_colors.poll') }}</h4>
  645. <ColorInput
  646. v-model="pollColorLocal"
  647. name="poll"
  648. :label="$t('settings.background')"
  649. :fallback="previewTheme.colors?.poll"
  650. />
  651. <ColorInput
  652. v-model="pollTextColorLocal"
  653. name="pollText"
  654. :label="$t('settings.text')"
  655. :fallback="previewTheme.colors?.pollText"
  656. />
  657. </div>
  658. <div class="color-item">
  659. <h4>{{ $t('settings.style.advanced_colors.icons') }}</h4>
  660. <ColorInput
  661. v-model="iconColorLocal"
  662. name="icon"
  663. :label="$t('settings.style.advanced_colors.icons')"
  664. :fallback="previewTheme.colors?.icon"
  665. />
  666. </div>
  667. <div class="color-item">
  668. <h4>{{ $t('settings.style.advanced_colors.highlight') }}</h4>
  669. <ColorInput
  670. v-model="highlightColorLocal"
  671. name="highlight"
  672. :label="$t('settings.background')"
  673. :fallback="previewTheme.colors?.highlight"
  674. />
  675. <ColorInput
  676. v-model="highlightTextColorLocal"
  677. name="highlightText"
  678. :label="$t('settings.text')"
  679. :fallback="previewTheme.colors?.highlightText"
  680. />
  681. <ContrastRatio :contrast="previewContrast.highlightText" />
  682. <ColorInput
  683. v-model="highlightLinkColorLocal"
  684. name="highlightLink"
  685. :label="$t('settings.links')"
  686. :fallback="previewTheme.colors?.highlightLink"
  687. />
  688. <ContrastRatio :contrast="previewContrast.highlightLink" />
  689. </div>
  690. <div class="color-item">
  691. <h4>{{ $t('settings.style.advanced_colors.popover') }}</h4>
  692. <ColorInput
  693. v-model="popoverColorLocal"
  694. name="popover"
  695. :label="$t('settings.background')"
  696. :fallback="previewTheme.colors?.popover"
  697. />
  698. <OpacityInput
  699. v-model="popoverOpacityLocal"
  700. name="popoverOpacity"
  701. :fallback="previewTheme.opacity?.popover"
  702. :disabled="popoverOpacityLocal === 'transparent'"
  703. />
  704. <ColorInput
  705. v-model="popoverTextColorLocal"
  706. name="popoverText"
  707. :label="$t('settings.text')"
  708. :fallback="previewTheme.colors?.popoverText"
  709. />
  710. <ContrastRatio :contrast="previewContrast.popoverText" />
  711. <ColorInput
  712. v-model="popoverLinkColorLocal"
  713. name="popoverLink"
  714. :label="$t('settings.links')"
  715. :fallback="previewTheme.colors?.popoverLink"
  716. />
  717. <ContrastRatio :contrast="previewContrast.popoverLink" />
  718. </div>
  719. <div class="color-item">
  720. <h4>{{ $t('settings.style.advanced_colors.selectedPost') }}</h4>
  721. <ColorInput
  722. v-model="selectedPostColorLocal"
  723. name="selectedPost"
  724. :label="$t('settings.background')"
  725. :fallback="previewTheme.colors?.selectedPost"
  726. />
  727. <ColorInput
  728. v-model="selectedPostTextColorLocal"
  729. name="selectedPostText"
  730. :label="$t('settings.text')"
  731. :fallback="previewTheme.colors?.selectedPostText"
  732. />
  733. <ContrastRatio :contrast="previewContrast.selectedPostText" />
  734. <ColorInput
  735. v-model="selectedPostLinkColorLocal"
  736. name="selectedPostLink"
  737. :label="$t('settings.links')"
  738. :fallback="previewTheme.colors?.selectedPostLink"
  739. />
  740. <ContrastRatio :contrast="previewContrast.selectedPostLink" />
  741. </div>
  742. <div class="color-item">
  743. <h4>{{ $t('settings.style.advanced_colors.selectedMenu') }}</h4>
  744. <ColorInput
  745. v-model="selectedMenuColorLocal"
  746. name="selectedMenu"
  747. :label="$t('settings.background')"
  748. :fallback="previewTheme.colors?.selectedMenu"
  749. />
  750. <ColorInput
  751. v-model="selectedMenuTextColorLocal"
  752. name="selectedMenuText"
  753. :label="$t('settings.text')"
  754. :fallback="previewTheme.colors?.selectedMenuText"
  755. />
  756. <ContrastRatio :contrast="previewContrast.selectedMenuText" />
  757. <ColorInput
  758. v-model="selectedMenuLinkColorLocal"
  759. name="selectedMenuLink"
  760. :label="$t('settings.links')"
  761. :fallback="previewTheme.colors?.selectedMenuLink"
  762. />
  763. <ContrastRatio :contrast="previewContrast.selectedMenuLink" />
  764. </div>
  765. <div class="color-item">
  766. <h4>{{ $t('chats.chats') }}</h4>
  767. <ColorInput
  768. v-model="chatBgColorLocal"
  769. name="chatBgColor"
  770. :fallback="previewTheme.colors?.bg"
  771. :label="$t('settings.background')"
  772. />
  773. <h5>{{ $t('settings.style.advanced_colors.chat.incoming') }}</h5>
  774. <ColorInput
  775. v-model="chatMessageIncomingBgColorLocal"
  776. name="chatMessageIncomingBgColor"
  777. :fallback="previewTheme.colors?.bg"
  778. :label="$t('settings.background')"
  779. />
  780. <ColorInput
  781. v-model="chatMessageIncomingTextColorLocal"
  782. name="chatMessageIncomingTextColor"
  783. :fallback="previewTheme.colors?.text"
  784. :label="$t('settings.text')"
  785. />
  786. <ColorInput
  787. v-model="chatMessageIncomingLinkColorLocal"
  788. name="chatMessageIncomingLinkColor"
  789. :fallback="previewTheme.colors?.link"
  790. :label="$t('settings.links')"
  791. />
  792. <ColorInput
  793. v-model="chatMessageIncomingBorderColorLocal"
  794. name="chatMessageIncomingBorderLinkColor"
  795. :fallback="previewTheme.colors?.fg"
  796. :label="$t('settings.style.advanced_colors.chat.border')"
  797. />
  798. <h5>{{ $t('settings.style.advanced_colors.chat.outgoing') }}</h5>
  799. <ColorInput
  800. v-model="chatMessageOutgoingBgColorLocal"
  801. name="chatMessageOutgoingBgColor"
  802. :fallback="previewTheme.colors?.bg"
  803. :label="$t('settings.background')"
  804. />
  805. <ColorInput
  806. v-model="chatMessageOutgoingTextColorLocal"
  807. name="chatMessageOutgoingTextColor"
  808. :fallback="previewTheme.colors?.text"
  809. :label="$t('settings.text')"
  810. />
  811. <ColorInput
  812. v-model="chatMessageOutgoingLinkColorLocal"
  813. name="chatMessageOutgoingLinkColor"
  814. :fallback="previewTheme.colors?.link"
  815. :label="$t('settings.links')"
  816. />
  817. <ColorInput
  818. v-model="chatMessageOutgoingBorderColorLocal"
  819. name="chatMessageOutgoingBorderLinkColor"
  820. :fallback="previewTheme.colors?.bg"
  821. :label="$t('settings.style.advanced_colors.chat.border')"
  822. />
  823. </div>
  824. </div>
  825. <div
  826. :label="$t('settings.style.radii._tab_label')"
  827. class="radius-container"
  828. >
  829. <div class="tab-header">
  830. <p>{{ $t('settings.radii_help') }}</p>
  831. <button
  832. class="btn button-default"
  833. @click="clearRoundness"
  834. >
  835. {{ $t('settings.style.switcher.clear_all') }}
  836. </button>
  837. </div>
  838. <RangeInput
  839. v-model="btnRadiusLocal"
  840. name="btnRadius"
  841. :label="$t('settings.btnRadius')"
  842. :fallback="previewTheme.radii?.btn"
  843. max="16"
  844. hard-min="0"
  845. />
  846. <RangeInput
  847. v-model="inputRadiusLocal"
  848. name="inputRadius"
  849. :label="$t('settings.inputRadius')"
  850. :fallback="previewTheme.radii?.input"
  851. max="9"
  852. hard-min="0"
  853. />
  854. <RangeInput
  855. v-model="checkboxRadiusLocal"
  856. name="checkboxRadius"
  857. :label="$t('settings.checkboxRadius')"
  858. :fallback="previewTheme.radii?.checkbox"
  859. max="16"
  860. hard-min="0"
  861. />
  862. <RangeInput
  863. v-model="panelRadiusLocal"
  864. name="panelRadius"
  865. :label="$t('settings.panelRadius')"
  866. :fallback="previewTheme.radii?.panel"
  867. max="50"
  868. hard-min="0"
  869. />
  870. <RangeInput
  871. v-model="avatarRadiusLocal"
  872. name="avatarRadius"
  873. :label="$t('settings.avatarRadius')"
  874. :fallback="previewTheme.radii?.avatar"
  875. max="28"
  876. hard-min="0"
  877. />
  878. <RangeInput
  879. v-model="avatarAltRadiusLocal"
  880. name="avatarAltRadius"
  881. :label="$t('settings.avatarAltRadius')"
  882. :fallback="previewTheme.radii?.avatarAlt"
  883. max="28"
  884. hard-min="0"
  885. />
  886. <RangeInput
  887. v-model="attachmentRadiusLocal"
  888. name="attachmentRadius"
  889. :label="$t('settings.attachmentRadius')"
  890. :fallback="previewTheme.radii?.attachment"
  891. max="50"
  892. hard-min="0"
  893. />
  894. <RangeInput
  895. v-model="tooltipRadiusLocal"
  896. name="tooltipRadius"
  897. :label="$t('settings.tooltipRadius')"
  898. :fallback="previewTheme.radii?.tooltip"
  899. max="50"
  900. hard-min="0"
  901. />
  902. <RangeInput
  903. v-model="chatMessageRadiusLocal"
  904. name="chatMessageRadius"
  905. :label="$t('settings.chatMessageRadius')"
  906. :fallback="previewTheme.radii?.chatMessage || 2"
  907. max="50"
  908. hard-min="0"
  909. />
  910. </div>
  911. <div
  912. :label="$t('settings.style.shadows._tab_label')"
  913. class="shadow-container"
  914. >
  915. <div class="tab-header shadow-selector">
  916. <div class="select-container">
  917. {{ $t('settings.style.shadows.component') }}
  918. {{ ' ' }}
  919. <Select
  920. id="shadow-switcher"
  921. v-model="shadowSelected"
  922. class="shadow-switcher"
  923. >
  924. <option
  925. v-for="shadow in shadowsAvailable"
  926. :key="shadow"
  927. :value="shadow"
  928. >
  929. {{ $t('settings.style.shadows.components.' + shadow) }}
  930. </option>
  931. </Select>
  932. </div>
  933. <div class="override">
  934. <Checkbox
  935. id="override"
  936. v-model="currentShadowOverriden"
  937. name="override"
  938. class="input-override"
  939. >
  940. {{ $t('settings.style.shadows.override') }}
  941. </Checkbox>
  942. </div>
  943. <button
  944. class="btn button-default"
  945. @click="clearShadows"
  946. >
  947. {{ $t('settings.style.switcher.clear_all') }}
  948. </button>
  949. </div>
  950. <ShadowControl
  951. v-model="currentShadow"
  952. :separate-inset="shadowSelected === 'avatar' || shadowSelected === 'avatarStatus'"
  953. :fallback="currentShadowFallback"
  954. :static-vars="previewTheme.colors"
  955. :compact="true"
  956. />
  957. </div>
  958. <div
  959. :label="$t('settings.style.fonts._tab_label')"
  960. class="fonts-container"
  961. >
  962. <div class="tab-header">
  963. <p>{{ $t('settings.style.fonts.help') }}</p>
  964. <button
  965. class="btn button-default"
  966. @click="clearFonts"
  967. >
  968. {{ $t('settings.style.switcher.clear_all') }}
  969. </button>
  970. </div>
  971. <FontControl
  972. v-model="fontsLocal.interface"
  973. name="ui"
  974. :label="$t('settings.style.fonts.components.interface')"
  975. :fallback="previewTheme.fonts?.interface"
  976. no-inherit="1"
  977. />
  978. <FontControl
  979. v-model="fontsLocal.input"
  980. name="input"
  981. :label="$t('settings.style.fonts.components.input')"
  982. :fallback="previewTheme.fonts?.input"
  983. />
  984. <FontControl
  985. v-model="fontsLocal.post"
  986. name="post"
  987. :label="$t('settings.style.fonts.components.post')"
  988. :fallback="previewTheme.fonts?.post"
  989. />
  990. <FontControl
  991. v-model="fontsLocal.postCode"
  992. name="postCode"
  993. :label="$t('settings.style.fonts.components.postCode')"
  994. :fallback="previewTheme.fonts?.postCode"
  995. />
  996. </div>
  997. </tab-switcher>
  998. </keep-alive>
  999. <teleport
  1000. v-if="isActive"
  1001. to="#unscrolled-content"
  1002. >
  1003. <div class="apply-container">
  1004. <button
  1005. class="btn button-default submit"
  1006. :disabled="!themeValid"
  1007. @click="setCustomTheme"
  1008. >
  1009. {{ $t('general.apply') }}
  1010. </button>
  1011. <button
  1012. class="btn button-default"
  1013. @click="clearAll"
  1014. >
  1015. {{ $t('settings.style.switcher.reset') }}
  1016. </button>
  1017. </div>
  1018. </teleport>
  1019. </div>
  1020. </template>
  1021. <script src="./theme_tab.js"></script>
  1022. <style src="./theme_tab.scss" lang="scss"></style>