验证码: 看不清楚,换一张 查询 注册会员,免验证
  • {{ basic.site_slogan }}
  • 打开微信扫一扫,
    您还可以在这里找到我们哟

    关注我们

怎么使用html+css+js实现简易版ChatGPT聊天机器人

阅读:674 来源:乙速云 作者:代码code

怎么使用html+css+js实现简易版ChatGPT聊天机器人

代码如下:




	
	
	test
	
		@import url("https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600&family=Poppins:wght@200;300&display=swap");
		* {
		  margin: 0;
		  padding: 0;
		  box-sizing: border-box;
		  font-family: "Poppins", sans-serif;
		}
		body {
		  background: #4b5c66;
		}
		.container {
			--light-color: #fff;
			height: 580px;
			background: var(--light-color);
			bottom: 50px;
			right: 10px;
			box-shadow: 0px 0px 15px 0px black;
		}
		@media screen and (min-width:440px) {
			.container {
				position: fixed;
			}
		}
		.chat-header {
		  height: 60px;
		  display: flex;
		  align-items: center;
		  padding: 0px 30px;
		  background-color: #0652c0;
		  color: var(--light-color);
		  font-size: 1.5rem;
		}

		.chat-header .logo {
		  height: 35px;
		  width: 35px;
		  box-shadow: 0px 0px 10px 0px black;
		}
		.chat-header img {
		  height: 100%;
		  width: 100%;
		}
		.chat-header .title {
		  padding-left: 10px;
		}
		.chat-body {
		  height: 465px;
		  display: flex;
		  flex-direction: column;
		  padding: 8px 10px;
		  align-items: flex-end;
		  overflow-y: auto;
		}
		.chat-input {
		  height: 60px;
		  display: flex;
		  align-items: center;
		  border-top: 1px solid #ccc;
		}
		.input-sec {
		  flex: 9;
		}
		.send {
		  flex: 1;
		  padding-right: 4px;
		}
		#txtInput {
		  line-height: 30px;
		  padding: 8px 10px;
		  border: none;
		  outline: none;
		  caret-color: black;
		  font-size: 1rem;
		  width: 100%;
		}

		.chatbot-message,
		.user-message {
		  padding: 8px;
		  background: #ccc;
		  margin: 5px;
		  width: max-content;
		  border-radius: 10px 3px 10px 10px;
		}
		.chatbot-message {
		  background: #0652c0;
		  color: var(--light-color);
		  align-self: flex-start;
		  border-radius: 10px 10px 3px 10px;
		}

	


	
		
			
简易版Chat GPT
分享到:
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: hlamps#outlook.com (#换成@)。
相关文章
{{ v.title }}
{{ v.description||(cleanHtml(v.content)).substr(0,100)+'···' }}
你可能感兴趣
推荐阅读 更多>