-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcomponents.js
More file actions
177 lines (165 loc) · 4.49 KB
/
Copy pathcomponents.js
File metadata and controls
177 lines (165 loc) · 4.49 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
function component_qTB() {
const qTB = document.createElement('div');
qTB.id = 'quickTranslateButton';
qTB.textContent = '🌐';
applyStyles(qTB, {
position: 'fixed',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
fontSize: '1.5em',
width: '2.5em',
height: '2.5em',
borderRadius: '50%',
backgroundColor: '#007bff',
border: '1px solid #ffffff',
color: 'white',
zIndex: '10000',
cursor: 'pointer',
transition: 'all 0.3s ease-in-out',
boxShadow: '0px 4px 6px rgba(0, 0, 0, 0.1)',
});
return qTB;
}
function component_menu() {
const menu = document.createElement('div');
menu.id = 'contextMenu';
applyStyles(menu, {
position: 'absolute',
backgroundColor: '#ffffff',
border: '1px solid #ccc',
boxShadow: '0px 4px 6px rgba(0, 0, 0, 0.1)',
borderRadius: '4px',
display: 'none',
zIndex: '10001'
});
return menu;
}
function component_resetItem() {
const resetItem = document.createElement('div');
resetItem.textContent = 'Reset Position';
applyStyles(resetItem, {
padding: '10px',
cursor: 'pointer',
});
return resetItem;
}
function component_colorPicker() {
const colorPicker = document.createElement('div');
colorPicker.textContent = 'Change Color';
applyStyles(colorPicker, {
padding: '10px',
cursor: 'pointer',
});
return colorPicker;
}
function component_refreshItem() {
const refreshItem = document.createElement('div');
refreshItem.textContent = 'Refresh';
applyStyles(refreshItem, {
padding: '10px',
cursor: 'pointer',
});
return refreshItem;
}
function component_closeItem() {
const closeItem = document.createElement('div');
closeItem.textContent = 'Close';
applyStyles(closeItem, {
padding: '10px',
cursor: 'pointer',
});
return closeItem;
}
function component_container () {
const container = document.createElement('div');
applyStyles(container, {
position: 'fixed',
display: 'none',
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'center',
width: '20em',
backgroundColor: '#ffffff',
border: '1px solid #ccc',
padding: '1em',
zIndex: '10000',
boxShadow: '0px 0px 10px rgba(0, 0, 0, 0.1)',
borderRadius: '8px',
opacity: '0',
transform: 'translateY(-20px)',
transition: 'all 0.3s ease-in-out',
maxHeight: '80vh',
overflow: 'auto'
});
return container;
}
function component_selectContainer() {
const selectContainer = document.createElement('div');
applyStyles(selectContainer, {
display: 'flex',
flexDirection: 'column',
gap: '10px',
width: '100%',
});
return selectContainer;
}
function component_select() {
const select = document.createElement('select');
applyStyles(select, {
width: '100%',
padding: '0.5em',
borderRadius: '4px',
border: '1px solid #ccc',
boxSizing: 'border-box',
appearance: 'none',
cursor: 'pointer'
});
return select;
}
function component_arrow() {
const arrow = document.createElement('div');
applyStyles(arrow, {
position: 'absolute',
right: '10px',
top: '50%',
transform: 'translateY(-50%)',
pointerEvents: 'none',
fontSize: '0.8em',
color: '#555'
});
arrow.textContent = '▼';
return arrow;
}
function component_input() {
const input = document.createElement('textarea');
applyStyles(input, {
width: '100%',
height: '50px',
marginTop: '10px',
borderRadius: '4px',
border: '1px solid #ccc',
padding: '0.5em',
boxSizing: 'border-box',
resize: 'vertical',
maxHeight: '200px'
});
return input;
}
function component_result (){
const result = document.createElement('textarea');
applyStyles(result, {
width: '100%',
height: '50px',
marginTop: '10px',
borderRadius: '4px',
border: '1px solid #ccc',
padding: '0.5em',
boxSizing: 'border-box',
backgroundColor: '#f1f1f1',
color: '#000000',
resize: 'vertical',
maxHeight: '200px'
});
return result;
}