forked from HebeDich/awesome-midjourney-prompts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.html
56 lines (52 loc) · 1.3 KB
/
demo.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
<!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>测试Demo</title>
<script src="./iframe-share.js"></script>
<style>
button {
outline: none;
border: none;
background-color: red;
font-size: 18px;
color: white;
padding: 1rem;
}
#Prompts {
width: 400px;
height: 200px;
}
</style>
</head>
<body>
<div>
<button class="btn-target">点击打开抽屉</button>
<div><textarea id="Prompts" placeholder="这里输出指令"></textarea></div>
</div>
<img src="./images/6-res.png" width="30%" alt="">
</body>
<script>
IframeShare(
{
btnEl: 'btn-target',
url: "https://punk.openai1s.com/aiimg/prompt?nohead=1&postmsg=1",
mode: "slider",
position: 'right',
width: '650px',
preload: true,
defaultOpen: false,
allowRepeatSubmit: true
});
//监听prompt参数
const prompts = document.getElementById('Prompts')
window.addEventListener('message', function (event) {
if (event.origin === 'https://punk.openai1s.com') {
console.log(event.data, '打印加工后的prompt')
prompts.innerHTML = event.data
}
});
</script>
</html>