技术男用来对妹子表白的百度首页


Posted in Javascript onJuly 23, 2014

有一天突发奇想,我要是能用我学的程序员技术给女朋友来表白的话,那岂不是高端大气上档次。

想到就立马去做,首先想到的是更改hosts文件,将浏览器的主页更改为自己设计的网页。

国内的女同学一般用百度首页,于是我就自己仿做了一个百度首页,具体的效果如下面:

技术男用来对妹子表白的百度首页

是不是看起来高大上,当然最后我失败了,程序员怎么可能会有女朋友呢?

但是为了广大?潘颗笥训母@??蚁衷诮?庑┐?敫??隼矗?退阌幸桓鋈顺晒α耍?乙彩巧畈毓τ朊??/p>

其中更改hosts文件的步骤请自行百度,这里为止不够就不详解了。

自己写的百度源码:

<style>

 html,body{height:100%}html{overflow-y:auto}#wrapper{position:relative;_position:;min-height:100%}#content{padding-bottom:100px;text-align:center}#ftCon{height:100px;position:absolute;bottom:44px;text-align:center;width:100%;margin:0

 auto;z-index:0;overflow:hidden}#ftConw{width:720px;margin:0 auto}

 body{font:12px arial;text-align:left;background:#fff}

 body,p,form,ul,li{margin:0;padding:0;list-style:none}

 body,form,#fm{position:relative}td{text-align:left}img{border:0}a{color:#00c}a:active{color:#f60}

 .bg{background-image:url(http://s1.bdstatic.com/r/www/cache/static/global/img/icons_aea40f46.png);background-repeat:no-repeat;_background-image:url(http://s1.bdstatic.com/r/www/cache/static/global/img/icons_cfa0bb3b.gif)}

 .c-icon{display:inline-block;width:14px;height:14px;vertical-align:text-bottom;font-style:normal;overflow:hidden;background:url(http://s1.bdstatic.com/r/www/cache/static/global/img/icons_aea40f46.png)no-repeat 0 0;_background-image:url(http://s1.bdstatic.com/r/www/cache/static/global/img/icons_cfa0bb3b.gif)}.c-icon-triangle-down-blue{background-position:-480px

 -24px}.c-icon-chevron-unfold2{background-position:-504px -24px}#u{color:#999;padding:4px

 10px 5px 0;text-align:right}#u a{margin:0 5px}#u .reg{margin:0}#m{width:720px;margin:0

 auto}#nv a,#nv b,.btn,#lk{font-size:14px}#fm{padding-left:130px;text-align:left;z-index:1}input{border:0;padding:0}#nv{height:19px;font-size:16px;margin:0

 0 4px;text-align:left;text-indent:137px}.s_ipt_wr{width:468px;height:30px;display:inline-block;margin-right:5px;background-position:0

 -288px;border:1px solid #b6b6b6;border-color:#9a9a9a #cdcdcd #cdcdcd #9a9a9a;vertical-align:top}.s_ipt{width:458px;height:22px;font:14px/22px

 arial;margin:5px 0 0 7px;background:#fff;outline:0;-webkit-appearance:none}.s_btn{width:95px;height:32px;padding-top:2px\9;font-size:14px;background-color:#ddd;background-position:0

 -240px;cursor:pointer}.s_btn_h{background-position:-240px -240px}.s_btn_wr{width:97px;height:34px;display:inline-block;background-position:-120px

 -240px;*position:relative;z-index:0;vertical-align:top}#lg img{vertical-align:top;margin-bottom:3px}#lk{margin:33px

 0}#lk span{font:14px "宋体"}#lm{height:60px;line-height:15px}#lh{margin:16px

 0 5px;word-spacing:3px}.tools{position:absolute;top:-4px;*top:10px;right:7px}#mHolder{width:62px;position:relative;z-index:296;display:none}#mCon{height:18px;line-height:18px;position:absolute;cursor:pointer}#mCon

 span{color:#00c;cursor:default;display:block}#mCon .hw{text-decoration:underline;cursor:pointer;display:inline-block}#mCon

 .pinyin{display:inline-block}#mCon .c-icon-chevron-unfold2{margin-left:5px}#mMenu

 a{width:100%;height:100%;display:block;line-height:22px;text-indent:6px;text-decoration:none;filter:none\9}#mMenu,#user

 ul{box-shadow:1px 1px 2px #ccc;-moz-box-shadow:1px 1px 2px #ccc;-webkit-box-shadow:1px

 1px 2px #ccc;filter:progid:DXImageTransform.Microsoft.Shadow(Strength=2,Direction=135,Color="#cccccc")\9}#mMenu{width:56px;border:1px

 solid #9b9b9b;list-style:none;position:absolute;right:27px;top:28px;display:none;background:#fff}#mMenu

 a:hover{background:#ebebeb}#mMenu .ln{height:1px;background:#ebebeb;overflow:hidden;font-size:1px;line-height:1px;margin-top:-1px}#cp,#cp

 a{color:#666}#seth{display:none;background:url(#default#homepage)}#setf{display:none}#sekj{margin-left:14px}#shouji{margin-right:14px}#u

 .last{margin-right:0}#u .un{font-weight:bold;margin-right:5px}#u ul{width:100%;background:#fff;border:1px

 solid #9b9b9b}#u li{height:25px}#u li a{width:100%;height:25px;line-height:25px;display:block;text-align:left;text-decoration:none;text-indent:6px;margin:0;filter:none\9}#u

 li a:hover{background:#ebebeb}#u li.nl{border-top:1px solid #ebebeb}#user_center{position:relative;display:inline-block}#user_center

 .user_center_btn{margin-right:5px}.userMenu{width:64px;position:absolute;right:7px;_right:2px;top:15px;top:14px\9;*top:15px;padding-top:4px;display:none;*background:#fff}#user{position:relative;display:inline-block}

</style>

<style>

    /*

        我的logo样式

    */

    #m{position: relative;padding: 50px 0 0 0;}

     #newYearEve{height:15px;position: absolute;top:250px;left:130px;width:510px;}

    #newYearEve li{cursor: pointer;width:20px;height:15px;margin:0 21px 0 0;float: left;}

    #newYearEve .icon-newyear0{background: url("//img.jbzj.com/file_images/article/201407/mylove.png") no-repeat center center;}

    #newYearEve .month-next{display: none!important;}

    #newYearEve .icon-newyear1{background: url("//img.jbzj.com/file_images/article/201407/mylove01.png") no-repeat center center;}

    #newYearEve li:hover{background: url("//img.jbzj.com/file_images/article/201407/mylove.gif") no-repeat -0 0; }

    #m{position: relative;}

    #play{position: absolute;top:135px;left:348px;width:25px;height:25px;cursor: pointer;}

    #newYearEve .icon-newyear2,#newYearEve .icon-newyear1:hover{background: url("//img.jbzj.com/file_images/article/201407/mylove01.png") no-repeat center center;}

 #newYearKw {color:#e203a9;position:absolute;top:212px;left:135px;width:300px;height:20px;color:#897883;z-index:100;font-family: "微软雅黑";text-align:left;font-weight: 700;font-size: 16px;overflow: hidden;}

 #newYearKw  i,#newYearKw  img{font-style: normal;position:absolute;width:20px;height:20px;top:0;}

 #newYearKw  .img01{left:0px;}

 #newYearKw  .img02{left:180px;}

 #newYearKw  .c1{color:#e203a9;left:20px;}

 #newYearKw  .c2{color:#e203a9;left:40px;}

 #newYearKw  .c3{color:#b60175;left:60px;}

 #newYearKw  .c4{color:#b60175;left:80px;}

 #newYearKw  .c5{color:#f460af;left:100px;}

 #newYearKw  .c6{color:#f460af;left:120px;}

 #newYearKw  .c7{color:#fd98a5;left:140px;}

 #newYearKw  .c8{color:#fec8db;left:160px;}

 #newYearKw  .c9{color:#fec8db;left:180px;}

 #newYearKw  .c11{color:#fec8db;}

 #newYearKw  .c12{color:#fec8db;}

 #newYearKw  .c13{color:#fec8db;}

 #newYearKw  .c14{color:#fec8db;}

 .word-box{position:relative;width:300px;height:20px;}

</style>

<div id="content">

<div id="m">

 <p id="lg">

  <img src="//img.jbzj.com/file_images/article/201407/mylove_logo.png" width="270" height="129"/>

 </p>

 <p id="nv">

  <a href="http://news.baidu.com/" rel="external nofollow" name="tj_news">

   新 闻

  </a>

   

  <b>

   网 页

  </b>

   

  <a href="http://tieba.baidu.com/" rel="external nofollow" name="tj_tieba">

   贴 吧

  </a>

   

  <a href="http://zhidao.baidu.com/" rel="external nofollow" name="tj_zhidao">

   知 道

  </a>

   

  <a href="http://music.baidu.com/" rel="external nofollow" name="tj_mp3">

   音 乐

  </a>

   

  <a href="http://image.baidu.com/" rel="external nofollow" name="tj_img">

   图 片

  </a>

   

  <a href="http://v.baidu.com/" rel="external nofollow" name="tj_video">

   视 频

  </a>

   

  <a href="http://map.baidu.com/" rel="external nofollow" name="tj_map">

   地 图

  </a>

 </p>

 <div id="fm">

  <form name="f" action="http://www.baidu.com/s" target="_blank">

   <span class="bg s_ipt_wr">

    <input type="text" name="wd" id="kw" maxlength="100" class="s_ipt" autocomplete="off"/>

   </span>

   <input type="hidden" name="rsv_bp" value="0"/>

   <input type="hidden" name="ch" value=""/>

   <input type="hidden" name="tn" value="sitehao123"/>

   <input type="hidden" name="bar" value=""/>

   <input type="hidden" name="rsv_spt" value="3"/>

   <input type="hidden" name="ie" value="utf-8"/>

   <span class="bg s_btn_wr">

    <input type="submit" value="百度一下" id="su" class="bg s_btn" onmousedown="this.className='bg s_btn s_btn_h'" onmouseout="this.className='bg s_btn'"/>

   </span>

   <div id="sd_1386659528033" style="display: none;">

   </div>

  </form>

  <span class="tools">

   <span id="mHolder">

    <div id="mCon">

     <span>

      输入法

     </span>

    </div>

   </span>

  </span>

 </div>

 <ul class="logo-new-year" id="newYearEve"><li class="icon-newyear0" i="0"></li><li class="icon-newyear1" i="1"></li></ul>

    <div id="play" style="display:none;"></div>

 <div id="newYearKw" style="width: 0px;">

 <div class="word-box">

 <img src="//img.jbzj.com/file_images/article/201407/mylove.gif" class="img01"/>

  <i class="c1">亲</i>

  <i class="c2">爱</i>

  <i class="c3">的</i>

  <i class="c4">,</i>

  <i class="c5">嫁</i>

  <i class="c6">给</i>

  <i class="c7">我</i>

  <i class="c8">吧</i>

  <img src="//img.jbzj.com/file_images/article/201407/mylove.gif" class="img02"/>

 </div>

 </div>

</div>

</div>

<script type="text/javascript">//< ![CDATA[

    var newYearEve = newYearEve||{};

    newYearEve.DOM = document;

    newYearEve.box=newYearEve.DOM.getElementById("newYearEve");

    newYearEve.kw=newYearEve.DOM.getElementById("kw");

    newYearEve.newYearKw=newYearEve.DOM.getElementById("newYearKw");

    //newYearEve.logo=newYearEve.DOM.getElementById("lg");

    //newYearEve.playDOM=newYearEve.DOM.getElementById("play");

    newYearEve.num=-1;

    newYearEve.time=0;

 newYearEve.wordWidth = 300;

 newYearEve.wordW = 0;

    newYearEve.newDay=false;

  newYearEve.dataArr = [{

    keyword : "2012年5月18日 第一次见面 你给我的感觉有些特别"

   }, {

    keyword : "2012年6月5日我们在一起了,从此这个平淡的日子对我们有了特殊的意义"

   }, {

    keyword : "2012年8月20日 第一次吵架 让你伤心了 对不起"

   }, {

    keyword : "2012年10月1日 香格里拉 属于我们的第一次旅行"

   }, {

    keyword : "2012年12月24日 平安夜 我们一起做了棵圣诞树"

   }, {

    keyword : "2013年2月14日 第一个情人节 虽然俗气还是送了玫瑰给你"

   }, {

    keyword : "2013年3月17日 陪你过的第一个生日"

   }, {

    keyword : "2013年6月1日 一起过儿童节也很开心"

   }, {

    keyword : "2013年6月5日 一周年纪念日 感谢有你陪在身边的一年"

   }, {

    keyword : "2013年8月4日 带你去吃我的家乡菜,看你吃得好开心"

   }, {

    keyword : "2013年9月19日 中秋节 第一次见你爸妈 有点紧张"

   }, {

    keyword : "2013年12月31日 希望以后每一次都是我陪你跨年。。。"

   }

  ];

    newYearEve.createHtml = function(num){

        var h = '';

        var n = 1;

         num=num-0;

        if(num<n+1){

            switch(num){

                case 0:

                    h='<li class="icon-newyear2" i="0">';

                    break;

                case 1:

                    h='<li class="icon-newyear0" i="0"></li><li class="icon-newyear1" i="1"></li>';

                    break;

            }

        }else{

            for(var i = 0 ;i < num-n;i++){

                h+='<li class="icon-no" i="'+i+'">';

            }

            for(var i = num-n;i < num+1;i++ ){

                var c = 'icon-newyear'+(i+n-num);

                h+='<li class="'+c+'" i="'+i+'">';

            }

        }

        if( newYearEve.box){

                 newYearEve.box.innerHTML=h;

        }

  newYearEve.kw.value= newYearEve.dataArr[num].keyword;

    }

     newYearEve.animate = function () {

  if (newYearEve.num < 11) {

   newYearEve.num++;

   newYearEve.createHtml(this.num);

  }

      newYearEve.time = setTimeout(function () {

        if (newYearEve.num < 11) {

         newYearEve.animate();

        } else {

     newYearEve.kw.value="";

     newYearEve.box.innerHTML="";

     newYearEve.wordAnimate();

        }

       }, 3000);

     }

  newYearEve.wordAnimate = function(){

  if(newYearEve.wordW<newYearEve.wordWidth){

   newYearEve.wordW=newYearEve.wordW+1;

   newYearEve.newYearKw.style.width=newYearEve.wordW+"px";

   setTimeout( function(){

   newYearEve.wordAnimate();},16);

  }else{

   newYearEve.rePlay();

  }

  }

 newYearEve.rePlay = function(num){

  newYearEve.time=setTimeout(function(){

  newYearEve.wordW=0;

  newYearEve.newYearKw.style.width=newYearEve.wordW+"px";

  newYearEve.kw.value="";

         newYearEve.num=-1;

  newYearEve.box.innerHTML="";

   newYearEve.animate();

   },3000);

    }

    newYearEve.box.onclick=function(event){

        var e = event.target||event.srcElement;

        var i = e.getAttribute("i");

        if(i!==null){

            newYearEve.newYearKw.style.width="0px";

            newYearEve.kw.value= newYearEve.dataArr[i].keyword;

            newYearEve.clickNum = i;

    newYearEve.createHtml(newYearEve.clickNum);

    clearTimeout( newYearEve.time);

                newYearEve.time=setTimeout(function(){

                    //newYearEve.createHtml(newYearEve.num);

     newYearEve.num=newYearEve.num==11? 10:newYearEve.num;

                    newYearEve.animate();

                    //newYearEve.kw.value= newYearEve.user||"";

                },3000)

        }

    }

 newYearEve.animate();

    //newYearEve.wordAnimate();

// ]]></script>

Javascript 相关文章推荐
Javascript string 扩展库代码
Apr 09 Javascript
左右悬浮可分组的网站QQ在线客服代码(可谓经典)
Dec 21 Javascript
javascript禁用Tab键脚本实例
Nov 22 Javascript
按下Enter焦点移至下一个控件的实现js代码
Dec 11 Javascript
jQuery中closest和parents的区别分析
May 07 Javascript
轻松学习jQuery插件EasyUI EasyUI实现树形网络基本操作(2)
Nov 30 Javascript
JavaScript黑洞数字之运算路线查找算法(递归算法)实例
Jan 28 Javascript
jQuery基础的工厂函数以及定时器的经典实例分析
May 20 Javascript
JavaScript模拟文件拖选框样式v1.0的实例
Aug 04 Javascript
Angularjs 1.3 中的$parse实例代码
Sep 14 Javascript
AngularJS中controller控制器继承的使用方法
Nov 03 Javascript
小程序清理本地缓存的方法
Aug 17 Javascript
JS中使用sort结合localeCompare实现中文排序实例
Jul 23 #Javascript
JS在IE下缺少标识符的错误
Jul 23 #Javascript
教你如何在 Javascript 文件里使用 .Net MVC Razor 语法
Jul 23 #Javascript
js监控IE火狐浏览器关闭、刷新、回退、前进事件
Jul 23 #Javascript
Javascript的&amp;&amp;和||的另类用法
Jul 23 #Javascript
jQuery获取节点和子节点文本的方法
Jul 22 #Javascript
jQuery打印图片pdf、txt示例代码
Jul 22 #Javascript
You might like
javascript 获取HTML DOM父、子、临近节点
2014/06/16 Javascript
javascript获取dom的下一个节点方法
2014/09/05 Javascript
JavaScript中string转换成number介绍
2014/12/31 Javascript
JavaScript对表格或元素按文本,数字或日期排序的方法
2015/05/26 Javascript
js实现Form栏显示全格式时间时钟效果代码
2015/08/19 Javascript
JQuery之proxy实现绑定代理方法
2016/08/01 Javascript
利用jQuery实现滑动开关按钮效果(附demo源码下载)
2017/02/07 Javascript
js实现简单的手风琴效果
2017/02/27 Javascript
javascript完美实现给定日期返回上月日期的方法
2017/06/15 Javascript
从零开始搭建webpack+react开发环境的详细步骤
2018/05/18 Javascript
bootstrapTable+ajax加载数据 refresh更新数据
2018/08/31 Javascript
如何获取vue单文件自身源码路径
2019/05/06 Javascript
小程序云开发如何实现图片上传及发表文字
2019/05/17 Javascript
Node Express用法详解【安装、使用、路由、中间件、模板引擎等】
2020/05/13 Javascript
JavaScript中Object、map、weakmap的区别分析
2020/12/15 Javascript
[02:32]【DOTA2亚洲邀请赛】iceice,梦开始的地方
2017/03/13 DOTA
[02:10]三分钟回顾完美世界城市挑战赛
2019/01/24 DOTA
打开电脑上的QQ的python代码
2013/02/10 Python
python提示No module named images的解决方法
2014/09/29 Python
Python数据结构与算法之图结构(Graph)实例分析
2017/09/05 Python
Django forms组件的使用教程
2018/10/08 Python
Python从list类型、range()序列简单认识类(class)【可迭代】
2019/05/31 Python
Python之time模块的时间戳,时间字符串格式化与转换方法(13位时间戳)
2019/08/12 Python
python 中的[:-1]和[::-1]的具体使用
2020/02/13 Python
python 已知平行四边形三个点,求第四个点的案例
2020/04/12 Python
Python在字符串中处理html和xml的方法
2020/07/31 Python
CSS3字体效果的设置方法小结
2016/06/13 HTML / CSS
Vans(范斯)德国官网:美国南加州的原创极限运动潮牌
2017/05/02 全球购物
口头翻译求职人自荐信
2013/12/07 职场文书
旅行社各个岗位职责
2014/03/15 职场文书
群众路线教育实践活动心得体会(教师)
2014/10/31 职场文书
2014年体育部工作总结
2014/11/13 职场文书
小班下学期幼儿评语
2014/12/30 职场文书
工作失职检讨书
2015/01/26 职场文书
Java数据开发辅助工具Docker与普通程序使用方法
2021/09/15 Java/Android
【海涛dota解说】DCG联赛第一周 LGD VS DH
2022/04/01 DOTA