• HTML5七夕情人节表白网页制作【唯美3D相册】HTML+CSS+JavaScript


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

    一、网页介绍

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

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


    一、网页效果

    在这里插入图片描述

    在这里插入图片描述

    二、代码展示

    1.HTML代码

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

    
    DOCTYPE html>
    <html>
    	<head>
    		<title>3d相册title>
    		<meta charset="utf-8">
    		<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
    		<style>
    			html, body {
    				height: 100%;
    			}
    
    			body {
    				background-color: #000000;
    				margin: 0;
    				font-family: Helvetica, sans-serif;;
    				overflow: hidden;
    			}
    
    			a {
    				color: #ffffff;
    			}
    
    			#info {
    				position: absolute;
    				width: 100%;
    				color: #ffffff;
    				padding: 5px;
    				font-family: Monospace;
    				font-size: 13px;
    				font-weight: bold;
    				text-align: center;
    				z-index: 1;
    			}
    
    			#menu {
    				position: absolute;
    				bottom: 20px;
    				width: 100%;
    				text-align: center;
    			}
    
    			.element {
    				width: 100px;/* 120 160 */
    				height: 100px;
    				box-shadow: 0px 0px 12px rgba(0,255,255,0.5);
    				border: 1px solid rgba(127,255,255,0.25);
    				text-align: center;
    				cursor: default;
    			}
    
    			.element:hover {
    				box-shadow: 0px 0px 12px rgba(0,255,255,0.75);
    				border: 1px solid rgba(127,255,255,0.75);
    			}
    				.element img{
    					width:100px;
    					height:100px;
    				}
    
    				.element .number {
    					position: absolute;
    					top: 20px;
    					right: 20px;
    					font-size: 12px;
    					color: rgba(127,255,255,0.75);
    				}
    
    				.element .symbol {
    					position: absolute;
    					top: 40px;
    					left: 0px;
    					right: 0px;
    					font-size: 60px;
    					font-weight: bold;
    					color: rgba(255,255,255,0.75);
    					text-shadow: 0 0 10px rgba(0,255,255,0.95);
    				}
    
    				.element .details {
    					position: absolute;
    					bottom: 15px;
    					left: 0px;
    					right: 0px;
    					font-size: 12px;
    					color: rgba(127,255,255,0.75);
    				}
    
    			button {
    				color: rgba(127,255,255,0.75);
    				background: transparent;
    			
    				border: 0px;
    				padding: 5px 10px;
    				cursor: pointer;
    			}
    			button:hover {
    				background-color: rgba(0,255,255,0.5);
    			}
    			button:active {
    				color: #000000;
    				background-color: rgba(0,255,255,0.75);
    			}
    			.show_info{position:fixed;background-color:rgba(0,0,0,.6);padding:10px;width:300px;margin:0 auto;left: 0;right:0;border-radius: 5px;box-shadow: 0 0 10px 0 #fff;top:30%;}
    			.show_info img{display:block;margin:auto;border-radius: 5px;box-shadow: 0 0 10px 0 #888;}
    			.show_info .intro{color:#fff;text-indent:20px;margin-top:10px;height:65px;overflow:hidden;display: -webkit-box;-webkit-line-clamp: 3;-webkit-box-orient: vertical;}
    			.show_info .info_my{text-align: center;}
    			.show_info .info_my > *{display:inline-block !important;vertical-align: middle;}
    			.show_info .info_my .info_mem{color:#fff;max-width:120px;}
    			.show_info .info_my .info_mem > div{text-align: left;}
    			.show_info .info_my .info_mem > div.nickname{max-width: 120px;text-overflow: ellipsis;overflow: hidden;white-space: nowrap;}
    		style>
    		<link rel="stylesheet" href="css/animate.min.css">
    	head>
    	<body>
    		<script src="js/jquery.min.js">script>
    		<script src="js/three.js">script>
    		<script src="js/tween.min.js">script>
    		<script src="js/TrackballControls.js">script>
    		<script src="js/CSS3DRenderer.js">script>
    
    		<div id="container">div>
    		<div id="info">div>
    		
    <div id="menu">
    			<button id="table">button>
    			<button id="sphere">button>
    			<button id="helix">button>
    			<button id="grid">button>
      <div style="display:none";class="music"><audio controls="controls" autoplay="autoplay" loop=-1><source src="http://music.163.com/song/media/outer/url?id=1311319058.mp3" type="audio/mpeg" />audio>div>
    
    		div>
    		
    		<script>
    			var personArray = new Array;
        		var CurPersonNum = 0;
        		// animate
        		var _in = ['bounceIn','bounceInDown','bounceInLeft','bounceInRight','bounceInUp','fadeIn','fadeInDown','fadeInDownBig','fadeInLeft','fadeInLeftBig','fadeInRight','fadeInRightBig','fadeInUp','fadeInUpBig','rotateIn','rotateInDownLeft','rotateInDownRight','rotateInUpLeft','rotateInUpRight','slideInDown','slideInLeft','slideInRight'];
        		var _out = ['bounceOut','bounceOutDown','bounceOutLeft','bounceOutRight','bounceOutUp','fadeOut','fadeOutDown','fadeOutDownBig','fadeOutLeft','fadeOutLeftBig','fadeOutRight','fadeOutRightBig','fadeOutUp','fadeOutUpBig','rotateOut','rotateOutDownLeft','rotateOutDownRight','rotateOutUpLeft','rotateOutUpRight','slideOutDown','slideOutLeft','slideOutRight'];
        		var count=1;
        		// 模拟推送数据
    			var s = setInterval(function(){
    				// get animate
    				var rand_in = parseInt(Math.random() * _in.length,10);
        			var rand_out = parseInt(Math.random() * _out.length,10);
    				
    				if(CurPersonNum >= personArray.length){
    					CurPersonNum = 0;
    					count=1;
    				}
    				$('.show_info').show();
    				$('.show_info').addClass(_in[rand_in]);
    				setTimeout(function(){
    					$('.show_info').removeClass(_in[rand_in]);
    					// 更改展示的图片
    					var img = document.getElementsByClassName('element')[CurPersonNum].getElementsByTagName('img')[0];
    					if(CurPersonNum == count*20){
    						++count;
    					}
    					img.setAttribute('src','img/a'+count+'.jpg');
    					++CurPersonNum;
    					setTimeout(function(){
    						$('.show_info').addClass(_out[rand_out]);
    						setTimeout(function(){
    							$('.show_info').removeClass(_out[rand_out]);
    							$('.show_info').hide();
    						},1000);
    					},1500);
    				},1000);
    			},100);
    
    			// 生成虚拟数据
    	        for(var i=0;i<199;i++){
    				personArray.push({
    		            image: "img/a.png"
    		        });
    	        }
    
    	        var table = new Array;
    		    for (var i = 0; i < personArray.length; i++) {
    		        table[i] = new Object();
    		        if (i < personArray.length) {
    		            table[i] = personArray[i];
    		            table[i].src = personArray[i].thumb_image;
    		        } 
    		        table[i].p_x = i % 20 + 1;
    		        table[i].p_y = Math.floor(i / 20) + 1;
    		    }
    
    
    			var targets = { table: [], sphere: [], helix: [], grid: [] };
    
    			init();
    			animate();
    
    			function init() {
    
    				camera = new THREE.PerspectiveCamera( 40, window.innerWidth / window.innerHeight, 1, 10000 );
    				camera.position.z = 3000;
    
    				scene = new THREE.Scene();
    
    				// table
    
    				for ( var i = 0; i < table.length; i ++ ) {
    
    					var element = document.createElement( 'div' );
    					element.className = 'element';
    					element.style.backgroundColor = 'rgba(0,127,127,' + ( Math.random() * 0.5 + 0.25 ) + ')';
    
    					var img = document.createElement('img');
    					img.src = table[ i ].image;
    					element.appendChild( img );
    
    
    					/*var number = document.createElement( 'div' );
    					number.className = 'number';
    					number.textContent = (i/5) + 1;
    					element.appendChild( number );
    
    					var symbol = document.createElement( 'div' );
    					symbol.className = 'symbol';
    					symbol.textContent = table[ i ];
    					element.appendChild( symbol );
    
    					var details = document.createElement( 'div' );
    					details.className = 'details';
    					details.innerHTML = table[ i + 1 ] + '
    ' + table[ i + 2 ]; element.appendChild( details );*/
    var object = new THREE.CSS3DObject( element ); object.position.x = Math.random() * 4000 - 2000; object.position.y = Math.random() * 4000 - 2000; object.position.z = Math.random() * 4000 - 2000; scene.add( object ); objects.push( object ); // 表格需要坐标进行排序的 var object = new THREE.Object3D(); // object.position.x = ( table[ i + 3 ] * 140 ) - 1330; // object.position.y = - ( table[ i + 4 ] * 180 ) + 990; object.position.x = ( table[ i ].p_x * 140 ) - 1330; object.position.y = - ( table[ i ].p_y * 180 ) + 990; targets.table.push( object ); } // sphere var vector = new THREE.Vector3(); var spherical = new THREE.Spherical(); for ( var i = 0, l = objects.length; i < l; i ++ ) { var phi = Math.acos( -1 + ( 2 * i ) / l ); var theta = Math.sqrt( l * Math.PI ) * phi; var object = new THREE.Object3D(); spherical.set( 800, phi, theta ); object.position.setFromSpherical( spherical ); vector.copy( object.position ).multiplyScalar( 2 ); object.lookAt( vector ); targets.sphere.push( object ); } // 鼠标控制 controls = new THREE.TrackballControls( camera, renderer.domElement ); controls.rotateSpeed = 0.5; controls.minDistance = 500; controls.maxDistance = 6000; controls.addEventListener( 'change', render ); // 自动更换 var ini = 0; setInterval(function(){ ini = ini >= 3 ? 0 : ini; ++ini; switch(ini){ case 1: transform( targets.sphere, 1000 ); break; case 2: transform( targets.helix, 1000 ); break; case 3: transform( targets.grid, 1000 ); break; } },8000); var button = document.getElementById( 'table' ); button.addEventListener( 'click', function ( event ) { transform( targets.table, 1000 ); }, false ); var button = document.getElementById( 'sphere' ); button.addEventListener( 'click', function ( event ) { transform( targets.sphere, 2000 ); }, false ); var button = document.getElementById( 'helix' ); button.addEventListener( 'click', function ( event ) { transform( targets.helix, 2000 ); }, false ); var button = document.getElementById( 'grid' ); button.addEventListener( 'click', function ( event ) { transform( targets.grid, 2000 ); }, false ); transform( targets.table, 2000 ); // window.addEventListener( 'resize', onWindowResize, false ); } function transform( targets, duration ) { TWEEN.removeAll(); for ( var i = 0; i < objects.length; i ++ ) { var object = objects[ i ]; var target = targets[ i ]; new TWEEN.Tween( object.position ) .to( { x: target.position.x, y: target.position.y, z: target.position.z }, Math.random() * duration + duration ) .easing( TWEEN.Easing.Exponential.InOut ) .start(); new TWEEN.Tween( object.rotation ) .to( { x: target.rotation.x, y: target.rotation.y, z: target.rotation.z }, Math.random() * duration + duration ) .easing( TWEEN.Easing.Exponential.InOut ) .start(); } new TWEEN.Tween( this ) .to( {}, duration * 2 ) .onUpdate( render ) .start(); } function onWindowResize() { camera.aspect = window.innerWidth / window.innerHeight; camera.updateProjectionMatrix(); renderer.setSize( window.innerWidth, window.innerHeight ); render(); } function animate() { // 让场景通过x轴或者y轴旋转 & z // scene.rotation.x += 0.011; scene.rotation.y += 0.008; requestAnimationFrame( animate ); TWEEN.update(); controls.update(); // 渲染循环 render(); } function render() { renderer.render( scene, camera ); }
    script> body> html>
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
    • 91
    • 92
    • 93
    • 94
    • 95
    • 96
    • 97
    • 98
    • 99
    • 100
    • 101
    • 102
    • 103
    • 104
    • 105
    • 106
    • 107
    • 108
    • 109
    • 110
    • 111
    • 112
    • 113
    • 114
    • 115
    • 116
    • 117
    • 118
    • 119
    • 120
    • 121
    • 122
    • 123
    • 124
    • 125
    • 126
    • 127
    • 128
    • 129
    • 130
    • 131
    • 132
    • 133
    • 134
    • 135
    • 136
    • 137
    • 138
    • 139
    • 140
    • 141
    • 142
    • 143
    • 144
    • 145
    • 146
    • 147
    • 148
    • 149
    • 150
    • 151
    • 152
    • 153
    • 154
    • 155
    • 156
    • 157
    • 158
    • 159
    • 160
    • 161
    • 162
    • 163
    • 164
    • 165
    • 166
    • 167
    • 168
    • 169
    • 170
    • 171
    • 172
    • 173
    • 174
    • 175
    • 176
    • 177
    • 178
    • 179
    • 180
    • 181
    • 182
    • 183
    • 184
    • 185
    • 186
    • 187
    • 188
    • 189
    • 190
    • 191
    • 192
    • 193
    • 194
    • 195
    • 196
    • 197
    • 198
    • 199
    • 200
    • 201
    • 202
    • 203
    • 204
    • 205
    • 206
    • 207
    • 208
    • 209
    • 210
    • 211
    • 212
    • 213
    • 214
    • 215
    • 216
    • 217
    • 218
    • 219
    • 220
    • 221
    • 222
    • 223
    • 224
    • 225
    • 226
    • 227
    • 228
    • 229
    • 230
    • 231
    • 232
    • 233
    • 234
    • 235
    • 236
    • 237
    • 238
    • 239
    • 240
    • 241
    • 242
    • 243
    • 244
    • 245
    • 246
    • 247
    • 248
    • 249
    • 250
    • 251
    • 252
    • 253
    • 254
    • 255
    • 256
    • 257
    • 258
    • 259
    • 260
    • 261
    • 262
    • 263
    • 264
    • 265
    • 266
    • 267
    • 268
    • 269
    • 270
    • 271
    • 272
    • 273
    • 274
    • 275
    • 276
    • 277
    • 278
    • 279
    • 280
    • 281
    • 282
    • 283
    • 284
    • 285
    • 286
    • 287
    • 288
    • 289
    • 290
    • 291
    • 292
    • 293
    • 294
    • 295
    • 296
    • 297
    • 298
    • 299
    • 300
    • 301
    • 302
    • 303
    • 304
    • 305
    • 306
    • 307
    • 308
    • 309
    • 310
    • 311
    • 312
    • 313
    • 314
    • 315
    • 316
    • 317
    • 318
    • 319
    • 320
    • 321
    • 322
    • 323
    • 324
    • 325
    • 326
    • 327
    • 328
    • 329
    • 330
    • 331
    • 332
    • 333
    • 334
    • 335
    • 336
    • 337
    • 338
    • 339
    • 340
    • 341
    • 342
    • 343
    • 344
    • 345
    • 346
    • 347
    • 348
    • 349
    • 350
    • 351
    • 352
    • 353
    • 354
    • 355
    • 356
    • 357
    • 358
    • 359
    • 360
    • 361
    • 362
    • 363
    • 364
    • 365
    • 366
    • 367
    • 368
    • 369
    • 370
    • 371
    • 372
    • 373
    • 374
    • 375
    • 376
    • 377
    • 378
    • 379
    • 380
    • 381
    • 382
    • 383
    • 384
    • 385
    • 386
    • 387
    • 388
    • 389
    • 390
    • 391
    • 392
    • 393
    • 394

    三、精彩专栏

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

  • 相关阅读:
    用 p5.js 写个五子棋
    网络安全—自学笔记
    【spring cloud】(四)服务网关——gateway
    深信服安全GPT 2.0升级,开启安全运营“智能驾驶”旅程
    Unity中的场景加载
    classification_report加入topk计算
    proteus仿真-51单片机定时器程序
    SWIG教程-对C++语言的封装《三》
    STL容器——vector
    聚合多个电商API接口平台
  • 原文地址:https://blog.csdn.net/QQ_____365392777/article/details/126199526