html css留言板特效,JS模拟留言板 部分动画效果使用了 animate.css
*{
margin: 0;
padding: 0;
}
#warp{
background: url(img/14.jpg) no-repeat center fixed;
margin: 0 auto;
width: 500px;
/*height: 350px;*/
padding: 30px;
position: relative;
}
#text,#word{
display: flex;
}
#text p,#word p{
width: 50px;
height: 40px;
font-size: 20px;
line-height: 40px;
}
#text input{
width: 450px;
height: 40px;
font-size: 20px;
outline-style:none;
opacity: 0.5;
}
#word{
margin-top: 20px;
}
#word textarea{
width: 450px;
height: 200px;
font-size: 20px;
outline-style:none;
opacity: 0.5;
color: black;
}
#btn{
margin: 20px 0px 20px 50px;
width: 70px;
height: 30px;
border-radius: 50%;
font-size: 15px;
box-shadow: 5px 5px 2px 2px cadetblue;
/*border: 1px solid black;*/
background: lightblue;
text-align: center;
}
#btn2{
width: 50px;
height: 50px;
border-radius: 50%;
font-size: 15px;
background: black;
color: white;
border: 1px solid black;
}
#deleteall{
width: 100px;
height: 50px;
border-radius: 50%;
background: burlywood;
border: 1px solid royalblue;
/*opacity: 0.7;*/
font-size: 15px;
color: cadetblue;
box-shadow: 5px 5px 5px 5px cadetblue;
}
.active{
/*width: 400px;*/
/*height: 400px;*/
background: linear-gradient(to right bottom,
blue 10%,green 30%,red 50%,yellow 60%,pink 80%,purple 90%);
border-radius: 10px;
color: white;
}
.active2{
border-radius: 100px;
background: linear-gradient(to bottom,
red 10%,wheat 30%,green 50%,yellow 60%,orange 80%,pink 90%);
}
/*设置的删除按键*/
.active3{
background: white;
color: darkred;
width: 90px;
height: 30px;
border-radius: 50%;
border: 1px solid darkgreen;
/*float:right;*/
margin-top: 60px;
position:absolute;
right:0;
font-size: 15px;
}
/*#content{
width: 500px;
background: url(img/7.jpg) no-repeat center scroll;
}*/
QQ:
留言:
显示留言
var warp=document.getElementById('warp')
var qq=document.getElementById('inp');
var wo=document.getElementById('wo');
var btn=document.getElementById('btn');
var btn2=document.getElementById('btn2');
// var ul=document.getElementById('ul1');
var content=document.getElementById('content');
var deleteall=document.getElementById('deleteall');
var index=0;
var ind=0;
var arr=[];
var x=0;
btn2.style.float="right";
//点击开始变身模式
btn2.οnclick=function () {
wo.className='active';
qq.className='active2';
// btn.className='active3';
}
//提交的点击操作
btn.οnclick=function () {
if (qq.value==""wo.value=="") {
alert('笨');
return;
}
//获取删除按钮的下标
for(i=0;i<=ind;i++){
if (ind<=index) {
arr[i]=ind;
var x=0;
x=arr[i];
ind++;
}
}
//获取系统时间
var now = new Date ();
// alert(now);
var year=now.getFullYear();//只获取年份
var month=now.getMonth();//获取月份 月份是0-11来代表1-12月
var today=now.getDate();//获取当天,例如30号
var day=now.getDay();//获取星期几 1代表星期一
var hour=now.getHours();//获取小时
var minute=now.getMinutes();//获取分钟
var secounds=now.getSeconds();//获取秒
// alert(hour+':'+minute+':'+secounds);
var nowTime=now.getTime();//时间戳 以毫秒为单位,1970.1.1距离现在的毫秒数字
index++;
var top1=document.createElement('div');
var bottom1=document.createElement('div');
var deleteBtn=document.createElement('button');
bottom1.appendChild(deleteBtn);
wo.style.color="palevioletred";
qq.style.color="cornflowerblue"
deleteBtn.innerHTML='第'+index+"个删除"
deleteBtn.className="active3";
deleteBtn.style.zIndex='10000';
top1.style.padding='10px';
top1.style.backgroundColor='antiquewhite';
top1.style.opacity="0.8";
top1.style.transition="all"+' '+"2s";
top1.className="animated fadeInDownBig" ;
bottom1.style.padding='10px';
bottom1.style.backgroundColor='wheat';
bottom1.style.opacity="0.8";
bottom1.style.transition="all"+' '+"2s";
bottom1.className="animated fadeInUpBig" ;
top1.style.marginTop='5px';
if (index>1) {
content.insertBefore(top1,content.children[0]);
content.insertBefore(bottom1,content.children[1]);
content.insertBefore(deleteBtn,content.children[0]);
top1.innerHTML='留言对象:'+qq.value;
bottom1.innerHTML='第'+index+'条留言:'+wo.value+'
'
+year+'年'+month+'月'+today+'日'+hour+'点'+minute+'分'+secounds+'秒'
+'留下来过的脚印'+'
';
}else{
content.insertBefore(deleteBtn,content.children[0]);
top1.innerHTML='留言对象:'+qq.value;
bottom1.innerHTML='第'+index+'条留言:'+wo.value+'
'
+year+'年'+month+'月'+today+'日'+hour+'点'+minute+'分'+secounds+'秒'
+'留下来过的痕迹'+'
';
content.appendChild(top1);
content.appendChild(bottom1);
}
wo.value="";
qq.value=""
//全部删除的点击事件
deleteall.οnclick=function () {
content.remove(content);
}
//删除按钮的点击事件
deleteBtn.οnclick=function () {
this.remove();
bottom1.className="animated rotateInDownLeft" ;
top1.className="animated rotateInDownRight" ;
top1.style.opacity="0";
bottom1.style.opacity="0";
// alert('恭喜你成功删除第'+(x+1)+'个留言');
setInterval(function(){
top1.remove();
bottom1.remove();
},1000);
}
}
html css留言板特效,JS模拟留言板 部分动画效果使用了 animate.css相关推荐
- 【前端实例代码】霓虹灯按钮动画效果悬停2| html CSS特效 惊艳| 前端开发 网页制作 基础入门教程
b站视频演示效果: [web前端特效源码]霓虹灯按钮动画效果悬停2| html CSS特效 惊艳| 前端开发 网页制作 基础入门教程 效果图: 完整代码: <!DOCTYPE html> ...
- 使用HTML+CSS+JS模拟比赛晋级的动画功能
使用HTML+CSS+JS模拟比赛晋级的动画功能 1.需求描述 2.代码实现 3.效果演示 系统:Win10 Chrome:106.0.5249.119 演示视频:[英雄联盟]S12全球总决赛冠军预测 ...
- [css] 请使用css3来模拟中/英文打字的效果
[css] 请使用css3来模拟中/英文打字的效果 :after 加个竖条闪啊闪,至于文字一个个出现嘛,text-indent 需要知道字数,clip-path 需要知道宽高,好像也没有特别好的办法. ...
- php加入js动态效果,js怎么给输入框增加动画效果
这次给大家带来js怎么给输入框增加动画效果,js给输入框增加动画效果的注意事项有哪些,下面就是实战案例,一起来看一下. (function() { function p() { window.requ ...
- php 3d animation,CSS_纯CSS实现菜单、导航栏的3D翻转动画效果,我曾经向大家展示过闪光的logo - phpStudy...
纯CSS实现菜单.导航栏的3D翻转动画效果 我曾经向大家展示过闪光的logo,燃烧的火狐狸,多重嵌套动画等例子,今天,我们将要制作一个简单但非常酷的3D翻转菜单.大家可以先看看实际效果,下面有效果截图 ...
- js实现下拉菜单动画效果
js实现下拉菜单动画效果 <!DOCTYPE html> <html lang="en"> <head><meta charset=&qu ...
- html摩天轮效果,用CSS3 animation模拟摩天轮旋转动画效果
这次我们来实现一个简单又很有意思的动画效果,完全由CSS 的animation来实现,素材和源码来自于其他网站,个人对源码做了一些改动优化 完成后的效果--旋转效果 (github pages打开特别 ...
- 动态效果html wow,WOW.js轻松让网页实现动画效果
给大家分享一个小插件,名字叫做WOW.js,这个插件是基于animate.css,animate.css是现在很流行的css动画库.这款插件作用很简单,可以及时实现网页中任意部分动画切入的效果.但是有 ...
- html怎么帮图片占位,css+html实现Skeleton Screen 加载占位图动画效果(带动画)
效果 自上而下渐隐渐现 源码 html,用的angular语法,只要做简单的修改就可以成为你需要的语法 css .skeletonItem { padding: 16px; border-bottom ...
最新文章
- Python SimpleHTTPServer 简单开发
- Python零碎知识(2):强大的zip
- 题目1049:字符串去特定字符
- qstring转qchar_Qt 对QString操作
- 01.query的分类-条件查询和组合查询
- 使用 C# 捕获进程输出
- VueJS组件之全局组件与局部组件
- hql中获取前一天的数据_PostgreSql 怎么获取数据库中关键系统信息(一)
- php内容管理器是什么原因,有什么好的php内容管理后台吗?打算试水接单的大三狗提问...
- android手机分享app,Android Pie如何快捷分享文件至特定App
- python应用系列教程——python使用scapy监听网络数据包、按TCP/IP协议进行解析
- 基于氢探PowerECU的燃料电池控制系统开发经验
- matlab rgb转色温,如何将RGB值转换为色温?
- 2022高教社杯 国赛数学建模 A题思路
- 代理自动配置PAC学习
- 遗传算法(GA)学习 || 原理、本质、代码、例题
- 设计师不可缺少的6款设计软件,用了立马升职加薪
- 【Python入门教程】第57篇 循环进阶之模拟do…while语句
- Kubernetes 集群基于 Rook 的 Ceph 存储之块设备、文件系统、对象存储
- 《汇编语言》——王爽