-
Notifications
You must be signed in to change notification settings - Fork 0
/
ui.html
112 lines (100 loc) · 2.75 KB
/
ui.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
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://static.figma.com/api/figma-extension-api-0.0.1.css">
<style>
body {
font-family: "IBM Plex Mono", monospace;
margin: 0;
padding: 20px;
color: #1D1D1D;
border-radius: 8px;
}
form {
background-color: #FFFFFF;
}
.logo {
width: 50px;
border-radius: 2px;
margin-bottom: 20px;
}
.fields {
display: flex;
flex-direction: column;
}
h2 {
font-size: 20px;
font-weight: 800;
margin-bottom: 16px;
color: #333333;
}
label {
margin: 0 0 12px 0;
font-size: 10px;
font-weight: 700;
text-transform: uppercase;
color: #a1a1a1;
}
input {
width: 100%;
padding: 10px;
margin-top: 4px;
border: 1px solid #CCCCCC;
border-radius: 4px;
box-sizing: border-box;
font-size: 14px;
color: #333333;
}
button {
background-color: #00712D;
color: #FFFBE6;
border: none;
letter-spacing: -0.05rem;
text-transform: uppercase;
font-weight: 700;
padding: 10px 30px;
border-radius: 4px;
cursor: pointer;
font-size: 12px;
transition: background-color 0.3s ease;
}
button#create {
box-shadow: 0 4px 50px 5px rgba(0, 113, 45, 0.2);
}
button#cancel {
background-color: transparent;
margin-left: 12px;
color: #FF9100;
}
.ctas {
display: flex;
margin-top: 20px;
}
</style>
</head>
<body>
<form>
<img class="logo" src="https://raw.githubusercontent.com/YsarocK/figma-image-divider/master/logo.png">
<h2>Instagram Multi Post Divider</h2>
<div class="fields">
<label>Number of posts: <input id="post_counts" value="3"></label>
<label>Posts sizes (px): <input id="post_size" value="2000"></label>
</div>
<div class="ctas">
<button id="create" type="button">Create</button>
</div>
</form>
<script>
document.getElementById('create').onclick = () => {
const post_counts = document.getElementById('post_counts');
const count = parseInt(post_counts.value, 10);
const post_size = document.getElementById('post_size');
const size = parseInt(post_size.value, 10);
parent.postMessage({ pluginMessage: { type: 'image-divider', count, size } }, '*');
}
document.getElementById('cancel').onclick = () => {
parent.postMessage({ pluginMessage: { type: 'cancel' } }, '*');
}
</script>
</body>
</html>