TwBackgrounds.vue 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <script setup>
  2. import useBackgrounds from '../../hooks/useBackgrounds.js'
  3. const { BackgroundAttachment, BackgroundClip, BackgroundColor, BackgroundOrigin, BackgroundPosition, BackgroundRepeat, BackgroundSize, BackgroundImage, GradientColorStops } = useBackgrounds()
  4. </script>
  5. <template>
  6. <view>
  7. <JcDemo v-bind="BackgroundAttachment"></JcDemo>
  8. <JcDemo v-bind="BackgroundClip"></JcDemo>
  9. <JcDemo v-bind="BackgroundColor">
  10. <view class="gap-4 grid grid-cols-2">
  11. <view class="h-14 text-white flex items-center justify-center shadow-lg rounded-lg bg-black">bg-black</view>
  12. <view class="h-14 text-white flex items-center justify-center shadow-lg rounded-lg bg-black__50"><text class="text-white">bg-black__50</text></view>
  13. <view class="h-14 flex text-white shadow-lg rounded-lg bg-black">
  14. <view class="flex-1 m-2 text-black flex items-center justify-center shadow-lg rounded-lg bg-white">bg-white</view>
  15. </view>
  16. <view class="h-14 flex text-white shadow-lg rounded-lg bg-black">
  17. <view class="flex-1 m-2 text-black flex items-center justify-center shadow-lg rounded-lg bg-white__50">bg-white__50</view>
  18. </view>
  19. <template v-for="d, i in ['slate','gray','zinc','neutral','stone','red','orange','amber','yellow','lime','green','emerald','teal','cyan','sky','blue','indigo','violet','purple','fuchsia','pink','rose']" :key="i">
  20. <view class="h-14 text-white flex items-center justify-center shadow-lg rounded-lg" :class="`bg-${d}-500`">bg-{{d}}-500</view>
  21. </template>
  22. <view class="h-14 flex items-center justify-center shadow-lg rounded-lg bg-stripes-indigo">bg-stripes-indigo</view>
  23. <view class="h-14 flex items-center justify-center bg-indigo-500 bg-stripes-white rounded-lg text-white"></view>
  24. </view>
  25. </JcDemo>
  26. <JcDemo v-bind="BackgroundOrigin"></JcDemo>
  27. <JcDemo v-bind="BackgroundPosition"></JcDemo>
  28. <JcDemo v-bind="BackgroundRepeat"></JcDemo>
  29. <JcDemo v-bind="BackgroundSize"></JcDemo>
  30. <JcDemo v-bind="BackgroundImage">
  31. <view class="space-y-4">
  32. <view class="h-14 rounded-lg bg-gradient-to-r from-cyan-500 to-blue-500"></view>
  33. <view class="h-14 rounded-lg bg-gradient-to-r from-sky-500 to-indigo-500"></view>
  34. <view class="h-14 rounded-lg bg-gradient-to-r from-violet-500 to-fuchsia-500"></view>
  35. <view class="h-14 rounded-lg bg-gradient-to-r from-purple-500 to-pink-500"></view>
  36. </view>
  37. <view class="space-y-4 mt-4">
  38. <view class="h-14 rounded-lg bg-gradient-to-t from-pink-500 to-blue-500 from-0-5 to-0-5"></view>
  39. <view class="h-14 rounded-lg bg-gradient-to-tr from-pink-500 to-blue-500 from-0-5 to-0-5"></view>
  40. <view class="h-14 rounded-lg bg-gradient-to-r from-pink-500 to-blue-500 from-0-5 to-0-5"></view>
  41. <view class="h-14 rounded-lg bg-gradient-to-br from-pink-500 to-blue-500 from-0-5 to-0-5"></view>
  42. <view class="h-14 rounded-lg bg-gradient-to-b from-pink-500 to-blue-500 from-0-5 to-0-5"></view>
  43. <view class="h-14 rounded-lg bg-gradient-to-bl from-pink-500 to-blue-500 from-0-5 to-0-5"></view>
  44. <view class="h-14 rounded-lg bg-gradient-to-l from-pink-500 to-blue-500 from-0-5 to-0-5"></view>
  45. <view class="h-14 rounded-lg bg-gradient-to-tl from-pink-500 to-blue-500 from-0-5 to-0-5"></view>
  46. </view>
  47. </JcDemo>
  48. <JcDemo v-bind="GradientColorStops">
  49. <view class="space-y-4">
  50. <view class="h-10 rounded-lg bg-gradient-to-r from-blue-500"></view>
  51. <view class="h-10 rounded-lg bg-gradient-to-r from-red-500 to-blue-500 to-0-2"></view>
  52. <view class="h-10 rounded-lg bg-gradient-to-r from-red-500 to-blue-500 to-0-3"></view>
  53. <view class="h-10 rounded-lg bg-gradient-to-r from-red-500 to-blue-500 to-0-4"></view>
  54. <view class="h-10 rounded-lg bg-gradient-to-r from-red-500 to-blue-500 to-0-5"></view>
  55. <view class="h-10 rounded-lg bg-gradient-to-r from-red-500 to-blue-500 to-0-6"></view>
  56. <view class="h-10 rounded-lg bg-gradient-to-r from-red-500 to-blue-500 to-0-7"></view>
  57. <view class="h-10 rounded-lg bg-gradient-to-r from-red-500 to-blue-500 to-0-8"></view>
  58. <view class="h-10 rounded-lg bg-gradient-to-r from-red-500 to-blue-500 to-0-9"></view>
  59. </view>
  60. </JcDemo>
  61. </view>
  62. </template>
  63. <style>
  64. </style>