-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.html
More file actions
55 lines (55 loc) · 1.67 KB
/
Copy pathtest.html
File metadata and controls
55 lines (55 loc) · 1.67 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
<!DOCTYPE html>
<html>
<head>
<title>Ghost Hunter</title>
<style>
body { margin: 0; overflow: hidden; }
#game {
width: 100vw;
height: 100vh;
position: relative;
overflow: hidden;
}
#background {
width: 200vw; /* Double width for seamless loop */
height: 100vh;
background: url('https://cdn.glitch.global/dacc699f-e499-49cc-a99e-62079fdfadf6/background-test.png?v=1749046089706') repeat-x;
background-size: auto 100%;
position: absolute;
animation: scrollBackground 20s linear infinite;
}
#player {
width: 80px;
height: 80px;
background: url('https://cdn.glitch.global/dacc699f-e499-49cc-a99e-62079fdfadf6/exorcist-profile.PNG?v=1749035012684') no-repeat center/cover;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
z-index: 10;
}
.ghost {
width: 60px;
height: 60px;
background: url('ghost.png') no-repeat center/cover;
position: absolute;
right: -60px; /* Start off-screen */
top: 30%;
z-index: 5;
cursor: pointer;
}
@keyframes scrollBackground {
0% { transform: translateX(0); }
100% { transform: translateX(-50%); } /* Loop half-way */
}
</style>
</head>
<body>
<div id="game">
<div id="background"></div>
<div id="player"></div>
<!-- Ghosts spawn here -->
</div>
<script src="game.js"></script>
</body>
</html>