Skip to content

Commit

Permalink
perf: 优化 autohue 渐变效果
Browse files Browse the repository at this point in the history
  • Loading branch information
LarryZhu-dev committed Feb 28, 2025
1 parent f673cc2 commit 0fe73c0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion autohue.js/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
.leftCover,
.rightCover {
height: 100%;
width: 30%;
width: 50%;
position: absolute;
}
.leftCover {
Expand Down
4 changes: 2 additions & 2 deletions autohue.js/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ <h2>autohue.js</h2>
autohue(dir + item, { threshold: { primary: 10, left: 1, right: 1 } }).then((res) => {
const bgColor = `linear-gradient(90deg, ${res.backgroundColor.left}, ${res.backgroundColor.right})`
const hueBox = document.getElementById(`${item}`)
hueBox.children[0].style.background = `linear-gradient(90deg,${res.backgroundColor.left},98%, transparent)`
hueBox.children[2].style.background = `linear-gradient(-90deg,${res.backgroundColor.right},98%, transparent)`
hueBox.children[0].style.background = `linear-gradient(90deg,${res.backgroundColor.left} 50%, transparent 60%)`
hueBox.children[2].style.background = `linear-gradient(-90deg,${res.backgroundColor.right} 50%, transparent 60%)`
})
}
</script>

0 comments on commit 0fe73c0

Please sign in to comment.