送给女朋友的小礼物(程序员)

送给女朋友的小礼物

    • 程序员还有女朋友?(没错,就是有)
      • 四个模块
        • 一、主页
          • 1.导航栏
          • 2.轮播图
          • 3.页面锚点
          • 4.部分内容展示
        • 二、照片墙
        • 三、我想对她说的话
        • 四、历程
      • 相关代码

程序员还有女朋友?(没错,就是有)

这是我们在一起的第一个七夕,曾经也想过自己写一个东西送给她(一直认为亲手做礼物是最有意义的),现在终于实现了。虽然不是还有很多不足的地方。但女朋友看了还是很开心的。不过她第一反应居然是问我怎么写的hhh。狗粮喂足了,现在开始认真了。

四个模块

一、主页

1.导航栏

这个没啥说的li标签而已
导航栏

2.轮播图

直接用Bootstrap框架
送给女朋友的小礼物(程序员)_第1张图片

3.页面锚点

恋爱天数用js自动算 点击相应的模块定位到对应的部分内容展示
送给女朋友的小礼物(程序员)_第2张图片

4.部分内容展示

这部分图片+日期 我觉得还蛮好看的
送给女朋友的小礼物(程序员)_第3张图片

二、照片墙

照片墙就不展示了 发挥自己的想象摆hhh

三、我想对她说的话

表达你们的爱意吧!hhh

四、历程

用Bootstrap框架稍微改动一下
送给女朋友的小礼物(程序员)_第4张图片

相关代码

1.计算恋爱天数的js


2.鼠标变成小爱心
注意是ico格式

body{
	cursor:url('../img/aixin.ico'),auto;
}

3.点击一直出现爱心的js

!function(e, t, a) {
    function r() {
        for (var e = 0; e < s.length; e++) s[e].alpha <= 0 ? (t.body.removeChild(s[e].el), s.splice(e, 1)) : (s[e].y--, s[e].scale += .004, s[e].alpha -= .013, s[e].el.style.cssText = "left:" + s[e].x + "px;top:" + s[e].y + "px;opacity:" + s[e].alpha + ";transform:scale(" + s[e].scale + "," + s[e].scale + ") rotate(45deg);background:" + s[e].color + ";z-index:99999");
        requestAnimationFrame(r)
    }
    function n() {
        var t = "function" == typeof e.onclick && e.onclick;
        e.onclick = function(e) {
            t && t(),
            o(e)
        }
    }
    function o(e) {
        var a = t.createElement("div");
        a.className = "heart",
        s.push({
            el: a,
            x: e.clientX - 5,
            y: e.clientY - 5,
            scale: 1,
            alpha: 1,
            color: c()
        }),
        t.body.appendChild(a)
    }
    function i(e) {
        var a = t.createElement("style");
        a.type = "text/css";
        try {
            a.appendChild(t.createTextNode(e))
        } catch(t) {
            a.styleSheet.cssText = e
        }
        t.getElementsByTagName("head")[0].appendChild(a)
    }
    function c() {
        return "rgb(" + ~~ (255 * Math.random()) + "," + ~~ (255 * Math.random()) + "," + ~~ (255 * Math.random()) + ")"
    }
    var s = [];
    e.requestAnimationFrame = e.requestAnimationFrame || e.webkitRequestAnimationFrame || e.mozRequestAnimationFrame || e.oRequestAnimationFrame || e.msRequestAnimationFrame ||
    function(e) {
        setTimeout(e, 1e3 / 60)
    },
    i(".heart{width: 10px;height: 10px;position: fixed;background: #f00;transform: rotate(45deg);-webkit-transform: rotate(45deg);-moz-transform: rotate(45deg);}.heart:after,.heart:before{content: '';width: inherit;height: inherit;background: inherit;border-radius: 50%;-webkit-border-radius: 50%;-moz-border-radius: 50%;position: fixed;}.heart:after{top: -5px;}.heart:before{left: -5px;}"),
    n(),
    r()
} (window, document);

最后附上下载链接
https://download.csdn.net/download/qq_44795706/12045981

你可能感兴趣的:(撒浪嘿)