HTML+CSS+JavaScript七夕情人节表白网页【樱花雨3D相册】超好看

article/2025/10/12 12:47:24

这是程序员表白系列中的100款网站表白之一,旨在让任何人都能使用并创建自己的表白网站给心爱的人看。 此波共有100个表白网站,可以任意修改和使用,很多人会希望向心爱的男孩女孩告白,生性腼腆的人即使那个TA站在眼前都不敢向前表白。说不出口的话就用短视频告诉TA吧~制作一个表白网页告诉TA你的心意,演示如下。

文章目录

  • 一、网页介绍
  • 一、网页效果
  • 二、代码展示
    • 1.HTML代码
    • 2.CSS代码
  • 三、精彩专栏推荐:

一、网页介绍

1 网页简介:基于 HTML+CSS+JavaScript 制作七夕情人节表白网页、生日祝福、七夕告白、 求婚、浪漫爱情3D相册、炫酷代码 ,快来制作一款高端的表白网页送(他/她)浪漫的告白,制作修改简单,可自行更换背景音乐,文字和图片即可使用

2.网页编辑:任意HTML编辑软件(如:Dreamweaver、HBuilder、Vscode 、Sublime 、Webstorm、Text 、Notepad++ 等任意html编辑软件进行运行及修改编辑等操作)。


一、网页效果

在这里插入图片描述

在这里插入图片描述

二、代码展示

1.HTML代码

代码如下(示例):以下仅展示部分代码供参考~

<!DOCTYPE html>
<html><head><meta charset="utf-8" /><title></title><script src="js/jquery.min.js"></script><link type="text/css" href="./css/style.css" rel="stylesheet" /><style>html,body {width: 100%;height: 100%;margin: 0;padding: 0;overflow: hidden;}.container {width: 100%;height: 100%;margin: 0;padding: 0;background-color: #000000;}</style></head><body><audio autoplay="autopaly"><source src="renxi.mp3" type="audio/mp3" loop="loop"/></audio><div id="jsi-cherry-container" class="container"><div class="box"><ul class="minbox"><li></li><li></li><li></li><li></li><li></li><li></li></ul><ol class="maxbox"><li></li><li></li><li></li><li></li><li></li><li></li></ol></div></div><script>var RENDERER = {INIT_CHERRY_BLOSSOM_COUNT: 30,MAX_ADDING_INTERVAL: 10,init: function() {this.setParameters();this.reconstructMethods();this.createCherries();this.render();if (navigator.userAgent.match(/(phone|pod|iPhone|iPod|ios|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)) {var box = document.querySelectorAll('.box')[0];console.log(box, '移动端');box.style.marginTop = '65%';}},setParameters: function() {this.$container = $('#jsi-cherry-container');this.width = this.$container.width();this.height = this.$container.height();this.context = $('<canvas />').attr({ width: this.width, height: this.height }).appendTo(this.$container).get(0).getContext('2d');this.cherries = [];this.maxAddingInterval = Math.round((this.MAX_ADDING_INTERVAL * 1000) / this.width);this.addingInterval = this.maxAddingInterval;},reconstructMethods: function() {this.render = this.render.bind(this);},createCherries: function() {for (var i = 0,length = Math.round((this.INIT_CHERRY_BLOSSOM_COUNT * this.width) / 1000);i < length;i++) {this.cherries.push(new CHERRY_BLOSSOM(this, true));}},render: function() {requestAnimationFrame(this.render);this.context.clearRect(0, 0, this.width, this.height);this.cherries.sort(function(cherry1, cherry2) {return cherry1.z - cherry2.z;});for (var i = this.cherries.length - 1; i >= 0; i--) {if (!this.cherries[i].render(this.context)) {this.cherries.splice(i, 1);}}if (--this.addingInterval == 0) {this.addingInterval = this.maxAddingInterval;this.cherries.push(new CHERRY_BLOSSOM(this, false));}}};var CHERRY_BLOSSOM = function(renderer, isRandom) {this.renderer = renderer;this.init(isRandom);};CHERRY_BLOSSOM.prototype = {FOCUS_POSITION: 300,FAR_LIMIT: 600,MAX_RIPPLE_COUNT: 100,RIPPLE_RADIUS: 100,SURFACE_RATE: 0.5,SINK_OFFSET: 20,init: function(isRandom) {this.x = this.getRandomValue(-this.renderer.width,this.renderer.width);this.y = isRandom? this.getRandomValue(0, this.renderer.height): this.renderer.height * 1.5;this.z = this.getRandomValue(0, this.FAR_LIMIT);this.vx = this.getRandomValue(-2, 2);this.vy = -2;this.theta = this.getRandomValue(0, Math.PI * 2);this.phi = this.getRandomValue(0, Math.PI * 2);this.psi = 0;this.dpsi = this.getRandomValue(Math.PI / 600, Math.PI / 300);this.opacity = 0;this.endTheta = false;this.endPhi = false;this.rippleCount = 0;var axis = this.getAxis(),theta =this.theta +(Math.ceil(-(this.y + this.renderer.height * this.SURFACE_RATE) / this.vy) *Math.PI) /500;theta %= Math.PI * 2;this.offsetY =40 * (theta <= Math.PI / 2 || theta >= (Math.PI * 3) / 2 ? -1 : 1);this.thresholdY =this.renderer.height / 2 +this.renderer.height * this.SURFACE_RATE * axis.rate;this.entityColor = this.renderer.context.createRadialGradient(0,40,0,0,40,80);this.entityColor.addColorStop(0,'hsl(330, 70%, ' + 50 * (0.3 + axis.rate) + '%)');this.entityColor.addColorStop(0.05,'hsl(330, 40%,' + 55 * (0.3 + axis.rate) + '%)');this.entityColor.addColorStop(1,'hsl(330, 20%, ' + 70 * (0.3 + axis.rate) + '%)');this.shadowColor = this.renderer.context.createRadialGradient(0,40,0,0,40,80);this.shadowColor.addColorStop(0,'hsl(330, 40%, ' + 30 * (0.3 + axis.rate) + '%)');this.shadowColor.addColorStop(0.05,'hsl(330, 40%,' + 30 * (0.3 + axis.rate) + '%)');this.shadowColor.addColorStop(1,'hsl(330, 20%, ' + 40 * (0.3 + axis.rate) + '%)');},getRandomValue: function(min, max) {return min + (max - min) * Math.random();},getAxis: function() {var rate = this.FOCUS_POSITION / (this.z + this.FOCUS_POSITION),x = this.renderer.width / 2 + this.x * rate,y = this.renderer.height / 2 - this.y * rate;return { rate: rate, x: x, y: y };},renderCherry: function(context, axis) {context.beginPath();context.moveTo(0, 40);context.bezierCurveTo(-60, 20, -10, -60, 0, -20);context.bezierCurveTo(10, -60, 60, 20, 0, 40);context.fill();for (var i = -4; i < 4; i++) {context.beginPath();context.moveTo(0, 40);context.quadraticCurveTo(i * 12, 10, i * 4, -24 + Math.abs(i) * 2);context.stroke();}},render: function(context) {var axis = this.getAxis();if (axis.y == this.thresholdY &&this.rippleCount < this.MAX_RIPPLE_COUNT) {context.save();context.lineWidth = 2;context.strokeStyle ='hsla(0, 0%, 100%, ' +(this.MAX_RIPPLE_COUNT - this.rippleCount) /this.MAX_RIPPLE_COUNT +')';context.translate(axis.x +this.offsetY * axis.rate * (this.theta <= Math.PI ? -1 : 1),axis.y);context.scale(1, 0.3);context.beginPath();context.arc(0,0,(this.rippleCount / this.MAX_RIPPLE_COUNT) *this.RIPPLE_RADIUS *axis.rate,0,Math.PI * 2,false);context.stroke();context.restore();this.rippleCount++;}if (axis.y < this.thresholdY || !this.endTheta || !this.endPhi) {if (this.y <= 0) {this.opacity = Math.min(this.opacity + 0.01, 1);}context.save();context.globalAlpha = this.opacity;context.fillStyle = this.shadowColor;context.strokeStyle ='hsl(330, 30%,' + 40 * (0.3 + axis.rate) + '%)';context.translate(axis.x,Math.max(axis.y, this.thresholdY + this.thresholdY - axis.y));context.rotate(Math.PI - this.theta);context.scale(axis.rate * -Math.sin(this.phi), axis.rate);context.translate(0, this.offsetY);this.renderCherry(context, axis);context.restore();}context.save();context.fillStyle = this.entityColor;context.strokeStyle = 'hsl(330, 40%,' + 70 * (0.3 + axis.rate) + '%)';context.translate(axis.x,axis.y + Math.abs(this.SINK_OFFSET * Math.sin(this.psi) * axis.rate));context.rotate(this.theta);context.scale(axis.rate * Math.sin(this.phi), axis.rate);context.translate(0, this.offsetY);this.renderCherry(context, axis);context.restore();if (this.y <= -this.renderer.height / 4) {if (!this.endTheta) {for (var theta = Math.PI / 2, end = (Math.PI * 3) / 2;theta <= end;theta += Math.PI) {if (this.theta < theta && this.theta + Math.PI / 200 > theta) {this.theta = theta;this.endTheta = true;break;}}}if (!this.endPhi) {for (var phi = Math.PI / 8, end = (Math.PI * 7) / 8;phi <= end;phi += (Math.PI * 3) / 4) {if (this.phi < phi && this.phi + Math.PI / 200 > phi) {this.phi = Math.PI / 8;this.endPhi = true;break;}}}}if (!this.endTheta) {if (axis.y == this.thresholdY) {this.theta +=(Math.PI / 200) *(this.theta < Math.PI / 2 ||(this.theta >= Math.PI && this.theta < (Math.PI * 3) / 2)? 1: -1);} else {this.theta += Math.PI / 500;}this.theta %= Math.PI * 2;}if (this.endPhi) {if (this.rippleCount == this.MAX_RIPPLE_COUNT) {this.psi += this.dpsi;this.psi %= Math.PI * 2;}} else {this.phi += Math.PI / (axis.y == this.thresholdY ? 200 : 500);this.phi %= Math.PI;}if (this.y <= -this.renderer.height * this.SURFACE_RATE) {this.x += 2;this.y = -this.renderer.height * this.SURFACE_RATE;} else {this.x += this.vx;this.y += this.vy;}return (this.z > -this.FOCUS_POSITION &&this.z < this.FAR_LIMIT &&this.x < this.renderer.width * 1.5);}};$(function() {RENDERER.init();});</script></body>
</html>

2.CSS代码

@charset "utf-8";
* {margin: 0;padding: 0;
}
body {max-width: 100%;min-width: 100%;height: 100%;background-size: cover;background-repeat: no-repeat;background-attachment: fixed;background-size: 100% 100%;position: absolute;margin-left: auto;margin-right: auto;
}
li {list-style: none;
}
.box {width: 200px;height: 200px;background-size: cover;background-repeat: no-repeat;background-attachment: fixed;background-size: 100% 100%;position: absolute;margin-left: 42%;margin-top: 22%;-webkit-transform-style: preserve-3d;-webkit-transform: rotateX(13deg);-webkit-animation: move 5s linear infinite;
}
.minbox {width: 100px;height: 100px;position: absolute;left: 50px;top: 30px;-webkit-transform-style: preserve-3d;
}
.minbox li {width: 100px;height: 100px;position: absolute;left: 0;top: 0;/* 背景颜色 */background-color: rgb(0, 183, 255);/* opacity: 0.45; */outline: rgb(40, 226, 240) solid thick;box-shadow: rgba(17, 123, 194, 0.712) 0 0 50px 50px;
}
.minbox li:nth-child(1) {background: url(../images/01.png) no-repeat 0 0;-webkit-transform: translateZ(50px);
}
.minbox li:nth-child(2) {background: url(../images/02.png) no-repeat 0 0;-webkit-transform: rotateX(180deg) translateZ(50px);
}
.minbox li:nth-child(3) {background: url(../images/03.png) no-repeat 0 0;-webkit-transform: rotateX(-90deg) translateZ(50px);
}
.minbox li:nth-child(4) {background: url(../images/04.png) no-repeat 0 0;-webkit-transform: rotateX(90deg) translateZ(50px);
}
.minbox li:nth-child(5) {background: url(../images/05.png) no-repeat 0 0;-webkit-transform: rotateY(-90deg) translateZ(50px);
}
.minbox li:nth-child(6) {background: url(../images/06.png) no-repeat 0 0;-webkit-transform: rotateY(90deg) translateZ(50px);
}
.maxbox li:nth-child(1) {background: url(../images/1.png) no-repeat 0 0;-webkit-transform: translateZ(50px);
}
.maxbox li:nth-child(2) {background: url(../images/2.png) no-repeat 0 0;-webkit-transform: translateZ(50px);
}
.maxbox li:nth-child(3) {background: url(../images/3.png) no-repeat 0 0;-webkit-transform: rotateX(-90deg) translateZ(50px);
}
.maxbox li:nth-child(4) {background: url(../images/4.png) no-repeat 0 0;-webkit-transform: rotateX(90deg) translateZ(50px);
}
.maxbox li:nth-child(5) {background: url(../images/5.png) no-repeat 0 0;-webkit-transform: rotateY(-90deg) translateZ(50px);
}
.maxbox li:nth-child(6) {background: url(../images/6.png) no-repeat 0 0;-webkit-transform: rotateY(90deg) translateZ(50px);
}
.maxbox {width: 800px;height: 400px;position: absolute;left: 0;top: -20px;-webkit-transform-style: preserve-3d;
}
.maxbox li {width: 200px;height: 200px;background: #fff;border: 1px solid #ccc;position: absolute;left: 0;top: 0;opacity: 0.2;-webkit-transition: all 1s ease;
}
.maxbox li:nth-child(1) {-webkit-transform: translateZ(100px);
}
.maxbox li:nth-child(2) {-webkit-transform: rotateX(180deg) translateZ(100px);
}
.maxbox li:nth-child(3) {-webkit-transform: rotateX(-90deg) translateZ(100px);
}
.maxbox li:nth-child(4) {-webkit-transform: rotateX(90deg) translateZ(100px);
}
.maxbox li:nth-child(5) {-webkit-transform: rotateY(-90deg) translateZ(100px);
}
.maxbox li:nth-child(6) {-webkit-transform: rotateY(90deg) translateZ(100px);
}
.box:hover ol li:nth-child(1) {-webkit-transform: translateZ(300px);width: 400px;height: 400px;opacity: 0.8;left: -100px;top: -100px;
}
.box:hover ol li:nth-child(2) {-webkit-transform: rotateX(180deg) translateZ(300px);width: 400px;height: 400px;opacity: 0.8;left: -100px;top: -100px;
}
.box:hover ol li:nth-child(3) {-webkit-transform: rotateX(-90deg) translateZ(300px);width: 400px;height: 400px;opacity: 0.8;left: -100px;top: -100px;
}
.box:hover ol li:nth-child(4) {-webkit-transform: rotateX(90deg) translateZ(300px);width: 400px;height: 400px;opacity: 0.8;left: -100px;top: -100px;
}
.box:hover ol li:nth-child(5) {-webkit-transform: rotateY(-90deg) translateZ(300px);width: 400px;height: 400px;opacity: 0.8;left: -100px;top: -100px;
}
.box:hover ol li:nth-child(6) {-webkit-transform: rotateY(90deg) translateZ(300px);width: 400px;height: 400px;opacity: 0.8;left: -100px;top: -100px;
}
@keyframes move {0% {-webkit-transform: rotateX(13deg) rotateY(0deg);}100% {-webkit-transform: rotateX(13deg) rotateY(360deg);}
}

三、精彩专栏推荐:

看到这里了就 【点赞,好评,收藏】 三连 支持下吧,你的支持是我创作的动力。


http://chatgpt.dhexx.cn/article/88TlV5Dq.shtml

相关文章

制作简易的3D相册

今天介绍一下3D相册&#xff0c;用到了开源的FeatureCoverFlow控件&#xff0c;之前的几个作品用的也全都是开源的控件&#xff0c;为什么要用开源的控件呢&#xff0c;因为...他稳定啊&#xff01; 1.准备 仍然是&#xff0c;去掉标题栏&#xff0c;然后导库&#xff1a; impl…

HTML5、css3、js实现3D相册

目录 想法 实现 一、基础知识 1.3D转换 transform-style: preserve-3d; ①简述 ②使用 ③3D转换方法 2.onmouseover 事件 ①解释 ②具体语法 3.onmouseout事件 ①解释 ②具体语法 **本例通过在div的class中设置相同的类名&#xff0c;然后在js方法中通过document…

前端CSS3实现3D相册小案例

前端CSS3实现3D相册小案例 HTML代码部分&#xff1a; <!DOCTYPE html> <html lang"en"> <head> <meta charset"UTF-8"> <title>3D相册</title> <link type"text/css" href"css/style.css&qu…

制作一个简单3D相册

- 用到的点&#xff1a; 旋转 2D 旋转 transform: rotate(值deg) deg 角度的单位 3D 旋转 transform:rotateX rotateY roteteZ 如果让一个块实现3D效果&#xff0c;必须做两件事&#xff1a; 1、在要实现3D效果的块上 加transform-style:preserve-3D (声明) 2、在要实现3D效…

html结合css实现浏览器展示3D相册

最近写了一个在浏览器展示3D相册效果&#xff0c;通过html文件结合css实现。 1.html详细代码如下&#xff1a; <!DOCTYPE html> <html> <head> <meta charset"UTF-8"> <title>3D相册</title> <script src"../js/jquer…

python3d相册源代码_js和CSS3炫酷3D相册展示

js和CSS3炫酷3D相册展示 *{margin:0;padding:0;} body{background:url(img/bg.jpg);width:100%;height:100%;overflow:hidden;}; h1{width:277;height:76px;margin:30px auto 0;} .xc-3D{width:100%;height:300px;background:#fff;margin-top:100px;position:relative;transfor…

three.js 制作3D相册

效果图&#xff1a; 由于博客限制了图片大小&#xff0c;动画质量不太好&#xff0c; 在线效果&#xff1a; https://static-mp-df787464-d77c-4180-83c3-6e7add40073e.next.bspapp.com/ 参考了three.js 官方代码 <!-- 源码下载地址 https://pan.baidu.com/s/1AVB71Aj…

3d相册

页面脚本 我的图片是是本地的&#xff0c;大家可以放上自己喜爱的图片 <!DOCTYPE html> <html><head><meta charset"utf-8" /><title>3d相册</title></head><style>#box1 {/* 宽 */width: 300px;/* 高 */height: …

HTML实现3D相册

今天&#xff0c;我给大家分享一个3D相册的代码 废话不说先上效果图&#xff1a; 先新建两个文件夹&#xff0c;一个叫css&#xff0c;另一个叫img&#xff0c;如下图&#xff1a; 先新建一个文本文档&#xff0c;输入下面的代码&#xff1a; <!DOCTYPE html> <html…

教你零基础制作3D旋转相册(送给那个她~)

3D立体相册&#xff1f;   是的&#xff0c;相信大家或多或少的会在一些地方看到某些程序员用代码给自己女朋友写3D立体相册&#xff0c;那么你会不会也想自己手动敲出那些炫酷的代码呢&#xff1f;   那你是找对地方了。废话不多说&#xff0c;今天为大家分享利用html实现…

【3D相册】零基础完成3D相册并配上背景音乐

文章目录 一、前言二、准备工作1、新建文件夹2、准备素材对于图片的处理对于音乐的处理 三、代码工作1、python处理6张图片1.1代码运行1.2 放入背景图片 2、写html文件2.1 更换音乐素材 3、运行main.html 四、推荐阅读 一、前言 帮助好哥们整的一个小相册&#xff0c;给他写个…

斐波那契数列求和公式

斐波那契数列指的是这样一个数列&#xff1a;1、1、2、3、5、8、13、21、……    这个数列从第三项开始&#xff0c;每一项都等于前两项之和。它的通项公式为:(见下图)&#xff08;又叫“比内公式”&#xff0c;是用无理数表示有理数的一个范例。&#xff09; 斐波那契数列求…

斐波那契数列之python(5种方法)

斐波那契数列&#xff08;Fibonacci sequence&#xff09;&#xff0c;又称黄金分割数列、因数学家列昂纳多斐波那契&#xff08;Leonardoda Fibonacci&#xff09;以兔子繁殖为例子而引入&#xff0c;故又称为“兔子数列”&#xff0c;指的是这样一个数列&#xff1a;1、1、2、…

斐波那契数列(C/C++)

目录 背景介绍 解法1&#xff1a;非数组非递归 解法2&#xff1a;数组非递归 解法3&#xff1a;非数组递归 解法4&#xff1a;数组递归 背景介绍 斐波那契数列&#xff0c;又称黄金分割数列&#xff0c;指的是这样一个数列&#xff1a;0、1、1、2、3、5、8、13、21、34、…

关于斐波那契数列通项公式证明以及推广

在我们中学的时候老师都会举一个著名的兔子繁殖的例子&#xff1a;一般而言&#xff0c;兔子在出生两个月后&#xff0c;就有繁殖能力&#xff0c;一对兔子每个月能生出一对小兔子来。如果所有兔子都不死&#xff0c;那么一年以后可以繁殖多少对兔子&#xff1f;而这个问题就是…

斐波那契数列的四种解法

题目描述 斐波那契数列&#xff08;Fibonacci sequence&#xff09;&#xff0c;又称黄金分割数列&#xff0c;因数学家莱昂纳多斐波那契&#xff08;Leonardo Fibonacci&#xff09;以兔子繁殖为例子而引入&#xff0c;故又称为“兔子数列”&#xff0c;指的是这样一个数列&a…

斐波那契数列通项公式的求法

以下两种方法其实是一样的 1、方法一 其实所有人都知道T(n) T(n-1) T(n-2), T(1) T(2)1,T(n)也是一个斐波那契数列&#xff0c;求解时间复杂度的本质也就是求数列通项&#xff0c;结果MB的一个通项就把我难住了&#xff0c;只好回来google一下&#xff0c;把高中数学用的求…

【算法】斐波那契数列通项公式

特征方程和通项公式 如果数列 a n a_n an​的递推公式&#xff1a; a n c 1 a n − 1 c 2 a n − 2 a_nc_1a_{n-1}c_2a_{n-2} an​c1​an−1​c2​an−2​------(1) 根据待定系数法&#xff0c;假设 a n − x a n − 1 y ( a n − 1 − x a n − 2 ) a_n-xa_{n-1}y(a_{n-1…

斐波那契数列通项公式的推导证明----举一反三

斐波那契数列通项公式的推导证明----举一反三 1-前言2-斐波那契2-1-什么是斐波那契2-2-通项公式的证明2-3-举一反三 1-前言 2021年5月20号的那天&#xff0c;有对象的都忙着约会秀恩爱&#xff0c;而我这样的单身狗&#xff0c;只能自己学习沉淀自己&#xff0c;为梦想而奔波&a…