-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path时间沙漏.html
185 lines (151 loc) · 6.81 KB
/
时间沙漏.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
<!DOCTYPE html>
<!-- saved from url=(0064)https://show.17sucai.com/preview/1424582/2018-11-09/sl/demo.html -->
<html><script id="youtube-hd-fjdmkanbdloodhegphphhklnjfngoffa">var ythdlog = () => {};;var ythderror = () => {};</script><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>时间沙漏</title>
<style>
body {
margin: 0;
overflow: hidden;
background: #2942b0;
}
button {
position: absolute;
top: 10%;
left: 50%;
transform: translateX(-50%);
z-index: 1;
width: 100px;
height: 40px;
border-radius: 5px;
font-size: 18px;
color: white;
background: transparent;
border: 1px solid white;
transition: all .3s ease-in-out;
cursor: pointer;
}
button:hover {
background: white;
color: #8785a2;
}
canvas {
transition: transform 1s ease;
}
canvas.flip {
transform: rotate(180deg);
}
</style>
<style id="m1nxu3mm.6gk">
@font-face {
font-family: 'MParrow';
src: url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAAQdAAoAAAAABPAAAQAAAAAAAAAAAAAAAAAAAAAECAAAABVPUy8yAAABYAAAAEQAAABgUc1dNGNtYXAAAAHEAAAARgAAAGAAcgFDZ2x5ZgAAAiAAAADwAAABNKukdSx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lez1k6mQeyyxJF7HYwtbW5OI0V1OpHzHBGhsYOGaJBrJ7/TlhiS2USgVLtYAg5WoJ854uWLGzZx2QtR7BHDHPGbspFi1b/rGoWQY5347OnGU4UW82mfwCMzM4HQB42mNgZkAGjAxoAAAAjgAFSExQRAEARkMJAAAAUGF3J1oAAAAA) format('woff');
}
#MPcanvas{position:fixed;top:0;left:0;z-index:10000000;}
#MPtips{all:initial!important;position:fixed!important;z-index:9999996!important;top:50%!important;left:50%!important;transform:translate(-50%,-50%)!important;font-family:MParrow,"Arial",sans-serif!important;color:white!important;white-space:nowrap!important;line-height:normal!important;text-shadow:1px 1px 5px rgba(0,0,0,0.8)!important;text-align:center!important;padding:25px 20px 20px 20px!important;border-radius:5px!important;font-weight:bold!important; }
</style></head>
<body>
<script src="./时间沙漏_files/matter.min.js.下载"></script>
<button onclick="app.flipCanvas()">翻转</button>
<script>
var app = app || {}
const boundaryStyle = {
fillStyle: 'white',
strokeStyle: 'transparent'
}
const colors = ['#D3F8E2', '#E4C1F9', '#F694C1', '#EDE7B1', '#A9DEF9']
app.init = function() {
// module aliases
const { Bodies, Body, Composite, Composites, Engine, Vector, World, Common } = Matter
// create an engine
const engine = Engine.create({
render: {
element: document.body,
options: {
height: window.innerHeight,
width: window.innerWidth,
background: '#2f2980',
wireframes: false
}
}
})
const originY = window.innerHeight / 2
const originX = window.innerWidth / 2
const rectTopLeft = Bodies.rectangle( originX, originY, 20, 200, {
angle: Math.PI / -6,
render: boundaryStyle,
isStatic: true
})
const rectTopRight = Bodies.rectangle( originX, originY, 20, 200, {
angle: Math.PI / 6,
render: boundaryStyle,
isStatic: true
})
const rectTop = Bodies.rectangle( originX, originY, 280, 25, {
render: boundaryStyle,
isStatic: true
})
const rectBottom = Bodies.rectangle( originX, originY, 280, 25, {
render: boundaryStyle,
isStatic: true
})
const rectLeft = Bodies.rectangle( originX, originY, 16, 30, {
render: boundaryStyle,
isStatic: true
})
const rectRight = Bodies.rectangle( originX, originY, 16, 30, {
render: boundaryStyle,
isStatic: true
})
const rectBottomLeft = Bodies.rectangle( originX, originY, 20, 200, {
angle: Math.PI / 6,
render: boundaryStyle,
isStatic: true
})
const rectBottomRight = Bodies.rectangle( originX, originY, 20, 200, {
angle: Math.PI / -6,
render: boundaryStyle,
isStatic: true
})
Body.translate(rectTopLeft, Vector.create(-70, -55 * Math.sqrt(3)))
Body.translate(rectTopRight, Vector.create(70, -55 * Math.sqrt(3)))
Body.translate(rectTop, Vector.create(0, 100 * Math.sqrt(3) + 10))
Body.translate(rectBottom, Vector.create(0, -100 * Math.sqrt(3) - 10))
Body.translate(rectBottomLeft, Vector.create(-70, 55 * Math.sqrt(3)))
Body.translate(rectBottomRight, Vector.create(70, 55 * Math.sqrt(3)))
Body.translate(rectLeft, Vector.create(-20, 0))
Body.translate(rectRight, Vector.create(20, 0))
const hourglassCompound = Body.create({
parts: [rectTop, rectTopLeft, rectTopRight, rectLeft, rectRight, rectBottomLeft, rectBottomRight, rectBottom],
isStatic: true
})
const balls = Composites.pyramid(originX, originY, 20, 20, 0, 0, function(x, y){
console.log(app.ballStyle)
return Bodies.circle(x, y, 5, {
render: {
fillStyle: Common.choose(colors),
strokeStyle: 'transparent'
},
friction: .09,
restitution: .15,
// isStatic: true
})
})
Composite.rotate(balls, Math.PI, Vector.create(originX, originY))
Composite.translate(balls, Vector.create(94, -40 * Math.sqrt(3)))
// add all of the bodies to the world
World.add(engine.world, [ hourglassCompound, balls ])
// run the engine
Engine.run(engine)
app.flipCanvas = function(){
const canvas = document.querySelector('canvas')
canvas.classList.toggle('flip')
engine.world.gravity.y *= -1
}
}
app.init()</script><canvas width="901" height="537" style="background: 0% 0% / contain rgb(47, 41, 128);"></canvas>
<div id="wrap" style="position:fixed;right:0px;top:0px;width:300px;background-color:rgba(255,255,255,0)!important;z-index:2147483647!important;"></div></body><div id="photoShowViewer" class="photoShow" style="opacity: 0; transition: 0.2s ease-out, transform-origin;"><div class="photoshow-viewer-shadow" style="transition: 0.2s ease-out, transform-origin;"></div>
<div class="photoshow-img-wrapper">
<img>
<div class="photoshow-view-mode-switch-tip">a</div>
</div>
<i class="photoshow-img-details"></i></div></html>