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 (39132B)


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