基于Ajax的聊天机器人

  <img src="img/person01.png" alt="icon" />
</div>
<!-- 中间 聊天内容区域 -->
<div class="main">
  <ul class="talk_list" style="top: 0px;" id="talk_list">
    <li class="left_word">
      <img src="img/person01.png" /> <span>嗨,最近想我没有?</span>
    </li>
    <!-- <li class="right_word">
        <img src="img/person02.png" /> <span>你好哦</span>
      </li> -->
  </ul>
  <div class="drag_bar" style="display: none;">
    <div class="drager ui-draggable ui-draggable-handle" style="display: none; height: 412.628px;"></div>
  </div>
</div>
<!-- 底部 消息编辑区域 -->
<div class="footer">
  <img src="img/person02.png" alt="icon" />
  <input type="text" placeholder="说的什么吧..." class="input_txt" id="ipt" />
  <input type="button" value="发 送" class="input_sub" id="btnSend" />
</div>

这里的音频播放标签,一定要添加autoplay属性,自动播放,不过不添加这个属性,播放机器人的功能就不能实现哟

main.css

body {

font-family: 'Microsoft YaHei';

}

.wrap {

position: fixed;
width: 450px;
left: 50%;
margin-left: -225px;
top: 20px;
bottom: 20px;
border: 1px solid #ebebeb;
background-color: #fff;
border-radius: 10px;
box-shadow: 0 0 30px rgba(0, 0, 0, 0.1);
overflow: hidden;

}

.header {

height: 55px;
background: linear-gradient(90deg, rgba(246, 60, 47, 0.6), rgba(128, 58, 242, 0.6));
overflow: hidden;

}

.header h3 {

color: #faf3fc;
line-height: 55px;
font-weight: normal;
float: left;
letter-spacing: 2px;
margin-left: 25px;
font-size: 18px;
text-shadow: 0px 0px 5px #944846;

}

.header img {

float: right;
margin: 7px 25px 0 0;
border-radius: 20px;
box-shadow: 0 0 5px #f7f2fe;

}

.main {

position: absolute;
left: 0;
right: 0;
top: 55px;
bottom: 55px;
background-color: #f4f3f3;
box-sizing: border-box;
padding: 10px 0;
overflow:hidden;

}

.talk_list{

position: absolute;
width:100%;
left:0px;
top:0px;

}

.talk_list li {

overflow: hidden;
margin: 20px 0px 30px;

}

.talk_list .left_word img {

float: left;
margin-left: 20px;

}

.talk_list .left_word span {

float: left;
background-color: #fe9697;
padding: 10px 15px;
max-width: 290px;
border-radius: 12px;
font-size: 16px;
color: #fff;
margin-left: 13px;
position: relative;
line-height: 24px;

}

.talk_list .left_word span:before {

content: '';
position: absolute;
left: -8px;
top: 3px;
width: 13px;
height: 12px;
background: url('../img/corner01.png') no-repeat;

}

.talk_list .right_word img {

float: right;
margin-right: 20px;

}

.talk_list .right_word span {

float: right;
background-color: #fff;
padding: 10px 15px;
max-width: 290px;
border-radius: 12px;
font-size: 16px;
color: #000;
margin-right: 13px;
position: relative;
line-height: 24px;

}

.talk_list .right_word span:before {

content: '';
position: absolute;
right: -8px;
top: 3px;
width: 13px;
height: 12px;
background: url('../img/corner02.png') no-repeat;

}

.drag_bar{

position:absolute;
right:0px;
top:0px;
background-color: #fff;
height:100%;
width:6px;
box-sizing:border-box;
border-bottom:1px solid #f4f3f3;

}

.drager{

position:absolute;
left:0px;
top:0px;
background-color: #cdcdcd;
height:100px;
width:6px;
border-radius:3px;
cursor: pointer;

}

.footer{

width:100%;
height: 55px;
left:0px;
bottom:0px;
background-color:#fff;
position: absolute;

}

.footer img{

float: left;
margin:8px 0 0 20px;

}

.input_txt{

float: left;
width:270px;
height:37px;
border:0px;
background-color: #f4f3f3;
margin:9px 0 0 20px;
border-radius:8px;
padding:0px;
outline:none;
text-indent:15px;

}

.input_sub{

float: left;
width:70px;
height:37px;
border:0px;
background-color: #fe9697;
margin:9px 0 0 15px;
border-radius:8px;
padding:0px;
outline:none;
color:#fff;
cursor: pointer;    

}

reset.css部分

body,ul,h1,h2,h3,h4,h5,h6{

margin: 0;
padding: 0;

}

h1,h2,h3,h4,h5,h6{

font-size:100%;
font-weight:normal;

}

a{

text-decoration:none;

}

ul{

list-style:none;

}

img{

border:0px;

}

/* 清除浮动,解决margin-top塌陷 */

.clearfix:before,.clearfix:after{

content:'';
display:table;    

}

.clearfix:after{

clear:both;

}

.clearfix{

zoom:1;

}

.fl{

float:left;

}

.fr{

float:right;

}

最后

自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。

深知大多数初中级Android工程师,想要提升技能,往往是自己摸索成长,自己不成体系的自学效果低效漫长且无助。

因此收集整理了一份《2024年Web前端开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。

img

既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上Android开发知识点!不论你是刚入门Android开发的新手,还是希望在技术上不断提升的资深开发者,这些资料都将为你打开新的学习之门!

如果你觉得这些内容对你有帮助,需要这份全套学习资料的朋友可以戳我获取!!

由于文件比较大,这里只是将部分目录截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且会持续更新!
**

因此收集整理了一份《2024年Web前端开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。

[外链图片转存中…(img-JVIvmOyc-1715152690048)]

[外链图片转存中…(img-TM33Bva7-1715152690048)]

[外链图片转存中…(img-pVO5Xb7V-1715152690049)]

既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上Android开发知识点!不论你是刚入门Android开发的新手,还是希望在技术上不断提升的资深开发者,这些资料都将为你打开新的学习之门!

如果你觉得这些内容对你有帮助,需要这份全套学习资料的朋友可以戳我获取!!

由于文件比较大,这里只是将部分目录截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且会持续更新!

  • 14
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值