-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtext.html
More file actions
97 lines (92 loc) · 2.74 KB
/
text.html
File metadata and controls
97 lines (92 loc) · 2.74 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
*{
padding: 0;
margin: 0;
box-sizing: border-box;
}
body{
height: 100vh;
transition: all 1s;
}
.kaiguan{
position: absolute;
top: 20px;
right: 50px;
width: 40px;
height: 20px;
border: 2px solid black;
border-radius: 20px;
cursor: pointer;
transition: all 3s;
}
.bai{
position: absolute;
top: 1.5px;
left: 2px;
height: 13px;
width: 13px;
background-color: rgb(0, 0, 0);
border-radius: 50%;
transition: all 1s;
}
.hei{
position: absolute;
top: 1.5px;
right: 2px;
height: 13px;
width: 13px;
background-color: rgb(11, 243, 81);
border-radius: 50%;
transition: all 1s;
}
h1{
margin: 100px auto;
width: 1000px;
text-align: center;
}
p{
margin: -60px auto;
width: 1100px;
text-align-last:center;
}
</style>
</head>
<body id='body'>
<div class="kaiguan" >
<div class="bai" id="anniu"></div>
</div>
<h1>Life of Pi</h1>
<p >
    He lives in Scarborough. He's a small, slim man – nomore than five foot five. Dark hair, dark eyes. Hair greyingat the temples. Can't be older than forty. leasingcoffee-coloured complexion1. Mild fall weather, yet puts on abig winter parka with fur-lined hood2 for the walk to thediner.
He lives in Scarborough. He's a small, slim man – nomore than five foot
</p >
</body>
<script>
var anniu=document.getElementById('anniu')
var kaiguan=document.querySelector('kaiguan')
var body=document.getElementById('body')
var temp=1
anniu.addEventListener('click',function(){
if(temp==1){
this.className='hei'
temp=0
kaiguan.style.border='2px solid rgb(11, 243, 81)'
body.style.backgroundColor='rgb(7,7,29)'
body.style.color='white'
}else{
this.className='bai'
temp=1
kaiguan.style.border='2px solid black'
body.style. backgroundColor= 'white'
body.style.color = 'black'
}
})
</script>
</html>