react实现hsl调色选择器代码

代码语言:html

所属分类:选择器

代码描述:react实现hsl调色选择器代码

代码标签: 调色 选择器

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开


<!DOCTYPE html>
<html lang="en" >

<head>

  <meta charset="UTF-8">
  

  
  
  
<style>
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300&display=swap");
body {
  margin: 0;
}
body .container {
  font-family: "Poppins", sans-serif;
  padding: 3rem;
  display: flex;
  flex-flow: column;
  align-items: center;
  height: 100vh;
  transition: all 1s;
}
body .container.dark {
  background: #333;
  color: white;
}
body .container .sample {
  padding: 1rem;
  margin: 1rem 1rem 2rem;
  width: 2rem;
  height: 2rem;
  box-shadow: 0 0 2rem #22222260;
  border: 5px solid white;
}
body .container .inputs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-gap: 1rem;
}
body .container .inputs label {
  display: flex;
  flex-flow: column;
  align-items: center;
}
</style>



</head>

<body >
  <!-- #CodePenChallenge: Lightness -->
<div id="app" />
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/react.production.17.1.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/react-dom.production.17.1.js"></script>
      <script >
const App = () => {
  const [h, setH] = React.useState(10);
  const [s, setS] = React.useState(100);
  const [l, setL] = React.useState(50);
  const color = "HSL(" + h + "," + s + "%, " + l + "%";
  const [dark, setDark] = React.useState(f.........完整代码请登录后点击上方下载按钮下载查看

网友评论0