<> A simple website home page

Mainly by html+css+js make

<>1. Picture display

This is the top half of the home page , The main contents are : Top header , Top navigation bar , Picture rotation .

This is the second half of the home page , The main contents are : Main contents of home page , bottom .

<>2. Code display

index.html
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8">
<title> Our love cabin </title> <embed src="images/1.mp3" hidden="true" autostart="true"
loop="true"/> <audio src="images/1.mp3" hidden="true" autostart="true"
loop="true"></audio> <link rel="stylesheet" href="css/style.css"> <script
type="text/javascript"> window.onload=function(){ var
wrap=document.getElementById('wrap'),
pic=document.getElementById('pic').getElementsByTagName("li"),
list=document.getElementById('list').getElementsByTagName('li'), index=0,
timer=null; // Define and call the autoplay function timer = setInterval(autoPlay, 2000); //
Stop automatic playback when the mouse crosses the entire container wrap.onmouseover = function () { clearInterval(timer); } //
When the mouse leaves the whole container, continue to play to the next one wrap.onmouseout = function () { timer = setInterval(autoPlay,
2000); } // Traverse all digital navigation to switch to the corresponding picture for (var i = 0; i < list.length; i++) {
list[i].onmouseover = function () { clearInterval(timer); index =
this.innerText - 1; changePic(index); }; }; function autoPlay () { if (++index
>= pic.length) index = 0; changePic(index); } // Define picture switching function function changePic
(curIndex) { for (var i = 0; i < pic.length; ++i) { pic[i].style.display =
"none"; list[i].className = ""; } pic[curIndex].style.display = "block";
list[curIndex].className = "on"; } }; </script> </head> <body> <!-- Top --> <div
class="top"> <div class="context1"> <h3 class="welcom"> Welcome, baby </h3> <div
class="mmd"><img src="images/mmd.gif"></div> <h1 class="what"> Our love cabin </h1> <img
src="images/zuo.jpg"> </div> </div> <!-- Top navigation bar --> <div class="header"> <div
class="context2"> <ul class="mulu"> <li><a href="#"> My home page </a></li> <li><a
href="record.html"> Memorial log </a></li> <li><a href="#"> Love agreement </a></li> <li><a
href="#"> Service Mall </a></li> <li><a href="#"> Growth log </a></li> <li><a
href="#"> About us </a></li> </ul> </div> </div> <!-- Rotation map --> <div class="wrap"> <ul
id="pic"> <li><img src="images/1.jpg" alt=""></li> <li><img src="images/2.jpg"
alt=""></li> <li><img src="images/3.jpg" alt=""></li> <li><img
src="images/4.jpg" alt=""></li> <li><img src="images/5.jpg" alt=""></li> </ul>
<ol id="list"> <li class="on">1</li> <li>2</li> <li>3</li> <li>4</li>
<li>5</li> </ol> </div> <!-- Intermediate content --> <div class="mid"> <div class="left"> <div
class="left_top"><img src="images/dd.png"> Love dictionary </div> <div class="left-bottom">
<div class="leftt"> <div class="name1"><strong> Ordinary world </strong></div> <div
class="name11"><img src="images/world.jpg"></div> <div
class="words1"> Even if one day I want to go far away , I wish I could come back here again in my dream …—— Rotel 《 Ordinary world 》</div> </div> <div
class="rightt"> <div class="name1"><strong> Jane Eyre </strong></div> <div
class="name11"><img src="images/love.jpg"></div> <div
class="words1"> I can't control my eyes , I can't help going to see him , It's like a thirsty person who knows that the water is poisonous but still wants to drink it . I didn't mean to love him , I also tried to nip off the bud of love , But when I saw him again , The love from the bottom of my heart is resurrected .
—— Charlotte Bronte 《 Jane Eyre 》</div> </div> </div> </div> <div class="right"> <div
class="wenzhang"> <div class="wz"><img src="images/word.png"> Good article </div> <ul
class="ul1"> <li><a href="#"> article 1</a></li> <li><a href="#"> article 2</a></li> <li><a
href="#"> article 3</a></li> <li><a href="#"> article 4</a></li> <li><a href="#"> article 5</a></li>
<li><a href="#"> article 6</a></li> <li><a href="#"> article 7</a></li> <li><a
href="#"> article 8</a></li> </ul> </div> <div class="ours"> <div class="our"><img
src="images/call.png"> contact us </div> </div> </div> </div> <!-- Bottom navigation bar --> <div
class="end"> <div class="endd">@right: Bai Yan & Welcome your contribution </div> </div> <script
type="text/javascript" src="js/canvas-nest.js"> // Defines the width and height of the canvas and the number of generated points var WIDTH =
window.innerWidth, HEIGHT = window.innerHeight, POINT = 35; var canvas =
document.getElementById('Mycanvas'); canvas.width = WIDTH, canvas.height =
HEIGHT; var context = canvas.getContext('2d'); context.strokeStyle =
'rgba(255,255,255,255.255)', context.strokeWidth = 1, context.fillStyle =
'rgba(255,255,255,255.255)'; var circleArr = []; // line : start xy coordinate , end xy coordinate , Line transparency
function Line(x, y, _x, _y, o) { this.beginX = x, this.beginY = y, this.closeX
= _x, this.closeY = _y, this.o = o; } // spot : center of a circle xy coordinate , radius , Move per frame xy Distance function
Circle(x, y, r, moveX, moveY) { this.x = x, this.y = y, this.r = r, this.moveX
= moveX, this.moveY = moveY; } // generate max and min Random number between function num(max, _min) { var
min = arguments[1] || 0; return Math.floor(Math.random() * (max - min + 1) +
min); } // Draw origin function drawCricle(cxt, x, y, r, moveX, moveY) { var circle =
new Circle(x, y, r, moveX, moveY) cxt.beginPath() cxt.arc(circle.x, circle.y,
circle.r, 0, 2 * Math.PI) cxt.closePath() cxt.fill(); return circle; } // Draw line
function drawLine(cxt, x, y, _x, _y, o) { var line = new Line(x, y, _x, _y, o)
cxt.beginPath() cxt.strokeStyle = 'rgba(255,255,255,' + o + ')'
cxt.moveTo(line.beginX, line.beginY) cxt.lineTo(line.closeX, line.closeY)
cxt.closePath() cxt.stroke(); } // Draw per frame function draw() { context.clearRect(0,
0, canvas.width, canvas.height); for(var i = 0; i < POINT; i++) {
drawCricle(context, circleArr[i].x, circleArr[i].y, circleArr[i].r); } for(var
i = 0; i < POINT; i++) { for(var j = 0; j < POINT; j++) { if(i + j < POINT) {
var A = Math.abs(circleArr[i + j].x - circleArr[i].x), B = Math.abs(circleArr[i
+ j].y - circleArr[i].y); var lineLength = Math.sqrt(A * A + B * B); var C = 1
/ lineLength * 7 - 0.009; var lineOpacity = C > 0.03 ? 0.03 : C; if(lineOpacity
> 0) { drawLine(context, circleArr[i].x, circleArr[i].y, circleArr[i + j].x,
circleArr[i + j].y, lineOpacity); } } } } } // Initialize generation origin function init() {
circleArr = []; for(var i = 0; i < POINT; i++) {
circleArr.push(drawCricle(context, num(WIDTH), num(HEIGHT), num(15, 2), num(10,
-10) / 40, num(10, -10) / 40)); } draw(); } // Call execution window.onload = function() {
init(); setInterval(function() { for(var i = 0; i < POINT; i++) { var cir =
circleArr[i]; cir.x += cir.moveX; cir.y += cir.moveY; if(cir.x > WIDTH) cir.x =
0; else if(cir.x < 0) cir.x = WIDTH; if(cir.y > HEIGHT) cir.y = 0; else
if(cir.y < 0) cir.y = HEIGHT; } draw(); }, 10); } </script> </body> </html>
record_style.css
* { margin:0px; padding:0px; } .context { width: 1200px; height: 5730px;
background-color: plum; margin: auto; } .kiss { position: fixed; left: 0px;
top: 700px; } .top { width: 1200px; height: 60px; font-family: " Hua wencaiyun ";
background-color: salmon; margin: auto; font-size: 35px; text-align: center;
line-height: 60px; } .first { margin-left: 25px; margin-top: 10px; width:500px;
height: 5660px; border: 2px dashed salmon; float: left; } .im1>img { width:
50px; height: 50px; float: left; margin-left: 20px; margin-top: 5px; } .year {
width:490px; height:50px; font-size :30px; padding-top: 6px; margin-left: 4px;
background-color: salmon; } .y2016_first,.y2017_first { width:500px; height:
300px; } .year_first>ol { margin-left: 50px; font-size: 30px;; } .photo {
width: 600px; height: 5660px; margin-right: 25px; float: right; margin-top:
10px; border: 2px dashed salmon; } .p17_6_6>img,.p18_9_22>img,.p18_10_26>img,
.p18_12_31>img,.p19_4_5>img,.p19_4_13>img, .p19_8_31>img,.p20_1_20>img { width:
300px; height: 400px; float: left; } .words_1 { width: 280px; height: 400px;
margin-left: 20px; font-size: 26px; float: left; } .words_2 { width: 280px;
height: 400px; margin-left: 20px; font-size: 26px; float: left; } .p19_3_23>img
{ width: 300px; height: 150px; } .words_new { width: 550px; height: 100px;
margin-left: 20px; font-size: 26px; } .p19_5_19>img { width: 300px; height:
300px; float: left; } .words_3 { width: 280px; height: 300px; margin-left:
20px; font-size: 26px; float: left; } .p19_10_5>img { width: 600px; height:
300px; } .p19_10_18>img { width: 300px; height: 500px; float: left; } .words_11
{ width: 280px; height: 500px; margin-left: 20px; font-size: 26px; float: left;
} .words_22 { width: 180px; height: 300px; margin-left: 20px; font-size: 26px;
float: left; } .p19_10_27>img { width: 400px; height: 300px; float: left; }
.p19_12_8>img { width: 300px; height: 300px; } .p20_4_4>img { width: 300px;
height: 300px; float: left; }
style.css
margin:0; padding:0; } /* Top */ .top { height: 100px; background-color:
#DCDCDC; } .context1 { width: 1200px; height: 100px; margin: auto; } .welcom {
width: 100px; height: 30px; margin-left: 20px; margin-top: 40px; float: left; }
.what { color: #778899; width:300px; height: 50px; margin-top: 25px;
margin-left: 260px; float: left; } .context1>img { width: 100px; height: 100px;
margin-left: 250px; margin-top: 0px; float: left; } .mmd>img { width: 100px;
height: 100px; margin-left: 20px; float: left; } /* Top navigation bar */ .header { height:
80px; margin-top: 10px; } .context2 { width: 1200px; height:60px; margin: auto;
border-radius: 20px; background-color:thistle; } .context2>ul { list-style:
none; } .mulu a { color: black; text-decoration: none; } .mulu>li { border:1px
solid black; border-radius: 20px; width:120px; height:40px; float: left;
padding-top: 5px; padding-left: 20px; margin-top: 7px; margin-left:45px;
font-size: 25px;; } /* Rotation map */ .wrap { width: 1200px; height:600px; margin-left:
360px; overflow: hidden; position: relative; } .wrap ul { list-style: none;
position: absolute; } .wrap ul li { height: 550px; position: absolute; } .wrap
ol { list-style: none; position: absolute; right: 5px; bottom: 10px; } .wrap ol
li { height: 20px; width: 20px; background-color: #ccc; border: 1px solid #666;
margin-left: 5px; color: #000; float: left; line-height: 20px; text-align:
center; cursor: pointer; } .wrap ol .on { background-color: thistle; color:
#fff; } /* Intermediate content */ .mid { width: 1210px; height: 530px; margin: auto; } .left {
width:900px; height: 500px; margin-top: 20px;; float: left; } .name1 {
margin-top: 20px; margin-left:160px; font-size: 26px; } .name11>img { width:
250px; height:340px; margin-left:30px; margin-top:30px; float: left; } .words1
{ margin-left: 310px; margin-top:50px; margin-right: 10px; } .right {
width:300px; height: 510px; margin-top: 20px; margin-left: 10px;
background-color: #ADADAD; float: left; } .left_top { width: 900px; height:
50px; font-size: 30px; background-color: thistle; float: left; color: #515151;
} .wz { width: 300px; height:50px; font-size: 30px; background-color: thistle;
color: #515151; } .our { width: 300px; height:50px; margin-top:50px; font-size:
30px; background-color: thistle; color: #515151; }
.left_top>img,.our>img,.wz>img { width :50px; height: 50px; float: left; }
.leftt { width: 445px; height: 450px; margin-top: 10px; background-color:
#ADADAD; float: left; } .rightt { width: 445px; height: 450px; margin-top:
10px; margin-left: 10px; background-color: #ADADAD; float: left; } .ul1>li {
font-size: 24px; margin-left:40px; } /* Bottom navigation bar */ .end { background-color:
#DCDCDC ; margin-top: 20px; height:30px; } .endd { height:30px; width:1200px;
color: gray; font-size:20px; margin-left:800px; }
canvas-net.js
! function() { // Packaging method , Reduce file size after compression function get_attribute(node, attr,
default_value) { return node.getAttribute(attr) || default_value; }
// Packaging method , Reduce file size after compression function get_by_tagname(name) { return
document.getElementsByTagName(name); } // Get configuration parameters function get_config_option() {
var scripts = get_by_tagname("script"), script_len = scripts.length, script =
scripts[script_len - 1]; // Currently loaded script return { l: script_len, // length , Used to generate id use z:
get_attribute(script, "zIndex", -1), //z-index o: get_attribute(script,
"opacity", 0.5), //opacity c: get_attribute(script, "color", "0,0,0"), //color
n: get_attribute(script, "count", 99) //count }; } // set up canvas Height and width of function
set_canvas_size() { canvas_width = the_canvas.width = window.innerWidth ||
document.documentElement.clientWidth || document.body.clientWidth,
canvas_height = the_canvas.height = window.innerHeight ||
document.documentElement.clientHeight || document.body.clientHeight; } // Drawing process
function draw_canvas() { context.clearRect(0, 0, canvas_width, canvas_height);
// Random line and current position union array var e, i, d, x_dist, y_dist, dist; // Temporary node // Traverse each point
random_lines.forEach(function(r, idx) { r.x += r.xa, r.y += r.ya, // move r.xa *=
r.x > canvas_width || r.x < 0 ? -1 : 1, r.ya *= r.y > canvas_height || r.y < 0
? -1 : 1, // Encounter boundary , Reverse rebound context.fillRect(r.x - 0.5, r.y - 0.5, 1, 1);
// Draw a with width and height 1 Point of // Start at the next point for (i = idx + 1; i < all_array.length; i++) { e =
all_array[i]; // Not the current point if (null !== e.x && null !== e.y) { x_dist = r.x - e.x,
//x Axis distance l y_dist = r.y - e.y, //y Axis distance n dist = x_dist * x_dist + y_dist * y_dist;
// Total distance , m dist < e.max && (e === current_point && dist >= e.max / 2 && (r.x -=
0.03 * x_dist, r.y -= 0.03 * y_dist), // Accelerate as you approach d = (e.max - dist) / e.max,
context.beginPath(), context.lineWidth = d / 2, context.strokeStyle = "rgba(" +
config.c + "," + (d + 0.2) + ")", context.moveTo(r.x, r.y), context.lineTo(e.x,
e.y), context.stroke()); } } }), frame_func(draw_canvas); } // Create canvas , And add to body in
var the_canvas = document.createElement("canvas"), // canvas config =
get_config_option(), // to configure canvas_id = "c_n" + config.l, //canvas id context =
the_canvas.getContext("2d"), canvas_width, canvas_height, frame_func =
window.requestAnimationFrame || window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame || window.oRequestAnimationFrame ||
window.msRequestAnimationFrame || function(func) { window.setTimeout(func, 1000
/ 45); }, random = Math.random, current_point = { x: null, // Current mouse x y: null,
// Current mouse y max: 20000 }, all_array; the_canvas.id = canvas_id;
the_canvas.style.cssText = "position:fixed;top:0;left:0;z-index:" + config.z +
";opacity:" + config.o; get_by_tagname("body")[0].appendChild(the_canvas);
// Initialize canvas size set_canvas_size(), window.onresize = set_canvas_size;
// Current mouse position storage , When I left , Release current location information window.onmousemove = function(e) { e = e ||
window.event, current_point.x = e.clientX, current_point.y = e.clientY; },
window.onmouseout = function() { current_point.x = null, current_point.y =
null; }; // Random generation config.n Line position information for (var random_lines = [], i = 0; config.n > i;
i++) { var x = random() * canvas_width, // Random location y = random() * canvas_height, xa
= 2 * random() - 1, // Random motion direction ya = 2 * random() - 1; random_lines.push({ x: x,
y: y, xa: xa, ya: ya, max: 6000 // Adhesion distance }); } all_array =
random_lines.concat([current_point]); //0.1 Draw in seconds setTimeout(function() {
draw_canvas(); }, 100); }();

Technology
©2019-2020 Toolsou All rights reserved,
Final review of database : Summary of comprehensive application questions Laplance operator ( Second derivative ) Simple learning of computer composition principle pyqt Button call python program _PyQt: Link button to function in program How much can you go up once you change jobs ? Today, I saw the ceiling of job hopping python in str Function usage _python in str Usage Summary of built-in functions MySQL trigger web The server nginx---linux Installation and deployment C++ Chapter V polymorphism exercises :( It's coming to an end )python Check built-in functions , How to check python Built in function