This repository has been archived by the owner on Dec 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathindex.html
76 lines (68 loc) · 2 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
/>
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>PixiColorEffects</title>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.2/codemirror.min.css"
/>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.2/theme/dracula.min.css"
/>
<script src="./example/index.ts" type="module"></script>
</head>
<body>
<h1 class="page-title">PixiColorEffects</h1>
<div class="center">
<div class="playground-box">
<canvas id="playground"></canvas>
<div class="controls-box">
<label for="fileElem" id="upload">Upload an Img </label>
<button id="webcam">Use Webcam</button>
</div>
<input
type="file"
id="fileElem"
accept="image/*"
class="visually-hidden"
/>
</div>
<h1 style="margin-top: 24px">Preset</h1>
<div id="presetBox"></div>
<div class="demo">
<h2>Example Code</h2>
<textarea id="code">
import { Tint, Preset } from "pixi-color-effects";
const app = new Application({
// **
});
let filter = new Tint();
app.stage.filters = [filter];
// use Preset
filter = new Preset("aladin");
// change value
let num = 0;
app.ticker.add((delta) => {
num += 0.1;
filter.value = Math.sin(num) * 1;
});
</textarea>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.2/codemirror.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.2/mode/javascript/javascript.min.js"></script>
<script>
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
lineNumbers: true,
theme: "dracula",
});
</script>
</body>
</html>