//列表页标签显示<br>const tagColors = [<br> // 蓝色系<br> { bg: 'linear-gradient(140deg, #b3d7ff 20%, #0051ff 80%)', textColor: '#ffffff' },<br> { bg: 'linear-gradient(140deg, #66b3ff 30%, #004de6 70%)', textColor: '#ffffff' },<br> { bg: 'linear-gradient(140deg, #1a8cff 40%, #0047cc 60%)', textColor: '#ffffff' },<br> // 黄色系<br>// { bg: 'linear-gradient(140deg, #fff0b3 15%, #ffd900 85%)', textColor: '#ffffff' },<br>// { bg: 'linear-gradient(140deg, #ffe680 25%, #ffcc00 75%)', textColor: '#ffffff' },<br>// { bg: 'linear-gradient(140deg, #ffd94d 35%, #ffbf00 65%)', textColor: '#ffffff' },<br> // 棕色系<br>// { bg: 'linear-gradient(140deg, #d9c3b3 25%, #a67c52 75%)', textColor: '#ffffff' }, <br>// { bg: 'linear-gradient(140deg, #c2a38f 35%, #8c6239 65%)', textColor: '#ffffff' },<br>// { bg: 'linear-gradient(140deg, #ab8a73 45%, #754c24 55%)', textColor: '#ffffff' },<br> // 灰色系 <br>// { bg: 'linear-gradient(140deg, #e6e6e6 15%, #a6a6a6 85%)', textColor: '#ffffff' },<br>// { bg: 'linear-gradient(140deg, #cccccc 30%, #8c8c8c 70%)', textColor: '#ffffff' },<br>// { bg: 'linear-gradient(140deg, #b3b3b3 45%, #737373 55%)', textColor: '#ffffff' },<br> // 黑色系<br> { bg: 'linear-gradient(140deg, #737373 20%, #262626 80%)', textColor: '#ffffff' }, <br> { bg: 'linear-gradient(140deg, #595959 30%, #0d0d0d 70%)', textColor: '#ffffff' },<br> { bg: 'linear-gradient(140deg, #404040 40%, #000000 60%)', textColor: '#ffffff' },<br> // 绿色系<br> { bg: 'linear-gradient(140deg, #b3f0d1 15%, #33cc77 85%)', textColor: '#ffffff' },<br> { bg: 'linear-gradient(140deg, #8ae8b1 25%, #20c267 75%)', textColor: '#ffffff' },<br> { bg: 'linear-gradient(140deg, #66e6a1 35%, #0eab53 65%)', textColor: '#ffffff' },<br> // 紫色系<br>// { bg: 'linear-gradient(140deg, #d9c2ff 20%, #9933ff 80%)', textColor: '#ffffff' },<br>// { bg: 'linear-gradient(140deg, #bf9eff 30%, #8000ff 70%)', textColor: '#ffffff' },<br>// { bg: 'linear-gradient(140deg, #a673ff 40%, #6600cc 60%)', textColor: '#ffffff' },<br> // 粉色系<br>// { bg: 'linear-gradient(140deg, #ffd6ec 15%, #ff80bf 85%)', textColor: '#ffffff' },<br>// { bg: 'linear-gradient(140deg, #ffbfdf 25%, #ff4d94 75%)', textColor: '#ffffff' },<br>// { bg: 'linear-gradient(140deg, #ffa6d2 35%, #ff0066 65%)', textColor: '#ffffff' },<br> // 橙色系 <br>// { bg: 'linear-gradient(140deg, #ffd9b3 20%, #ff9900 80%)', textColor: '#ffffff' },<br>// { bg: 'linear-gradient(140deg, #ffbf80 30%, #ff8000 70%)', textColor: '#ffffff' },<br>// { bg: 'linear-gradient(140deg, #ffa64d 40%, #ff6600 60%)', textColor: '#ffffff' },<br> // 青色系<br>// { bg: 'linear-gradient(140deg, #b3fff5 15%, #00bfb3 85%)', textColor: '#ffffff' },<br>// { bg: 'linear-gradient(140deg, #80ffed 25%, #00a6a6 75%)', textColor: '#ffffff' },<br>// { bg: 'linear-gradient(140deg, #4dfff2 35%, #008080 65%)', textColor: '#ffffff' },<br> // 红色系<br>// { bg: 'linear-gradient(140deg, #ffb3b3 20%, #ff1a1a 80%)', textColor: '#ffffff' }, <br>// { bg: 'linear-gradient(140deg, #ff8080 30%, #e60000 70%)', textColor: '#ffffff' },<br>// { bg: 'linear-gradient(140deg, #ff4d4d 40%, #cc0000 60%)', textColor: '#ffffff' },<br>// // 纯色<br>// { bg: '#e6a23c', textColor: '#ffffff' },<br>// { bg: '#6ecc71', textColor: '#ffffff' },<br>// { bg: '#e74f5e', textColor: '#ffffff' },<br>// { bg: '#ae5ac6', textColor: '#ffffff' },<br>// { bg: '#177ddc', textColor: '#ffffff' },<br>// { bg: '#686465', textColor: '#ffffff' },<br>// { bg: '#a1624f', textColor: '#ffffff' },<br>// { bg: '#c01d2f', textColor: '#ffffff' },<br>// { bg: '#333147', textColor: '#ffffff' },<br>// { bg: '#903539', textColor: '#ffffff' },<br>// // 高饱和度纯色 <br>// { bg: '#ff4500', textColor: '#ffffff' },<br>// { bg: '#ff8c00', textColor: '#ffffff' },<br>// { bg: '#ffd700', textColor: '#ffffff' },<br>// { bg: '#90ee90', textColor: '#ffffff' },<br>// { bg: '#00ced1', textColor: '#ffffff' },<br>// { bg: '#1e90ff', textColor: '#ffffff' },<br>// { bg: '#c71585', textColor: '#ffffff' },<br>// { bg: '#00bfff', textColor: '#ffffff' },<br>// { bg: '#00ff7f', textColor: '#ffffff' },<br>// { bg: '#ff1493', textColor: '#ffffff' }<br>];<br><br>let tagsInitialized = false;<br><br>function applyRandomColor(tag) {<br> if (tag.dataset.colorApplied) return;<br> const randomColor = tagColors[Math.floor(Math.random() * tagColors.length)];<br> tag.style.setProperty('background', randomColor.bg, 'important');<br> tag.style.setProperty('color', randomColor.textColor, 'important');<br> tag.style.setProperty('text-shadow', '0 1px 2px rgba(0, 0, 0, 0.1)', 'important');<br> tag.dataset.colorApplied = 'true';<br>}<br><br>function setupTagDrawer() {<br> const tagWrappers = document.querySelectorAll('.tag-wrapper');<br> const isMobile = window.innerWidth <= 768; // 定义移动设备的阈值<br> const defaultVisibleTags = isMobile ? 1 : 2; // 根据设备类型设置默认可见标签数<br> <br> tagWrappers.forEach(wrapper => {<br> const container = wrapper.querySelector('.ta
没有回复内容