-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
125 lines (109 loc) · 2.73 KB
/
Copy pathindex.html
File metadata and controls
125 lines (109 loc) · 2.73 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
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
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>YamScript</title>
<!-- YAML Parser -->
<script src="https://cdn.jsdelivr.net/npm/js-yaml@4.1.0/dist/js-yaml.min.js"></script>
<!-- Styles -->
<style>
body {
font-family: system-ui, sans-serif;
background: #1e1e1e;
color: #fff;
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
align-items: center;
}
header {
font-size: 2rem;
margin: 20px 0 10px;
font-weight: bold;
color: #ffdf6c;
}
#editor-container {
display: flex;
align-items: flex-start;
gap: 12px;
margin-bottom: 20px;
}
#editor {
width: 60vw;
height: 400px;
border-radius: 8px;
overflow: hidden;
}
button {
background: #ffdf6c;
color: #000;
border: none;
padding: 12px 16px;
font-size: 1rem;
border-radius: 6px;
cursor: pointer;
transition: background 0.2s ease-in-out;
display: block;
margin-bottom: 10px;
}
button:hover {
background: #ffe888;
}
#game-area {
width: 500px;
height: 400px;
background: #222;
position: relative;
margin-top: 20px;
border: 2px solid white;
}
.sprite {
background-size: cover;
transition: all 0.3s ease;
}
.speech-bubble {
box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
</style>
</head>
<body>
<header>YamScript</header>
<!-- Monaco Loader -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.45.0/min/vs/loader.min.js"></script>
<div id="editor-container">
<div id="editor"></div>
<div>
<button onclick="triggerImageUpload()">➕ Add Sprite</button>
<input type="file" id="image-upload" accept="image/*" style="display:none;">
<button id="run-button" onclick="runYamScript()">▶️ Run Game</button>
</div>
</div>
<div id="game-area"></div>
<script>
require.config({ paths: { 'vs': 'https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.45.0/min/vs' } });
require(['vs/editor/editor.main'], function () {
window.editor = monaco.editor.create(document.getElementById('editor'), {
value: [
'meta:',
' name: YamScript Game',
' author: ApplePair111',
'',
'sprites:',
' Cat: cat_img',
'',
'code:',
' Cat:',
' - motion-right: 10'
].join('\n'),
language: 'yaml',
theme: 'vs-dark',
fontSize: 14,
automaticLayout: true
});
});
</script>
<!-- Load engine logic -->
<script src="engine.js"></script>
</body>
</html>