-
Notifications
You must be signed in to change notification settings - Fork 5
/
mockup.red
160 lines (143 loc) · 3.1 KB
/
mockup.red
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
Red[]
draw-bar: func [
size [pair!]
offset [pair!] "<offset from edge>x<position offset>"
radius [integer!]
][
compose [
move (as-pair offset/x radius + offset/y)
arc (as-pair size/x - offset/x - 1 radius + offset/y) (radius) (radius) 0 sweep
vline (size/y - radius - offset/x - 1)
arc (as-pair offset/x size/y - radius - offset/x - 1) (radius) (radius) 0 sweep
]
]
win: layout [
backdrop 54.57.62
style circle: base 20x20 on-create [
face/extra: context [
pen: face/color
bright-pen: face/color * 1.5
]
face/draw: compose [
pen off
fill-pen (face/extra/pen)
circle (face/size / 2) (face/size/x / 2 - 2)
]
face/color: none
] on-over [
face/draw/4: pick reduce [face/extra/pen face/extra/bright-pen] event/away?
]
style hamburger: base 20x20 draw [
line-width 2
pen white
line 3x5 17x5
line 3x10 17x10
line 3x15 17x15
] on-create [
face/color: none
]
style bar: base 300x1 on-create [
face/extra: context [
pen: face/color
]
face/draw: compose [
pen (face/extra/pen)
line 0x0 (as-pair face/size/x 0)
]
face/color: none
]
style shadow-bar: base 300x3 on-create [
face/extra: context [
pen: face/color
]
face/draw: compose [
pen (face/extra/pen)
line 0x0 (as-pair face/size/x 0)
pen (face/extra/pen + 15)
line 0x1 (as-pair face/size/x 1)
line 0x2 (as-pair face/size/x 2)
]
face/color: none
]
style draw-field: base 280x50 on-create [
face/color: none
face/draw: compose [
pen 218.221.223
line-width 2
box 2x2 (face/size - 2)
translate 5x5 [
pen 116.127.141
line 15x28 10x28
line 10x28 10x10
line 10x10 30x10
line 30x10 30x28
line 30x28 25x28
line 20x32 20x17
line 15x23 20x17
line 20x17 25x23
]
text 50x5 "Chat in general..."
]
]
style avatar: base 50x50 on-create [
print type? face/image
face/extra: context [
image: face/image
redraw: func [face][
face/draw: compose [
pen off
fill-pen bitmap image 0x0 64x64
circle (face/size / 2) (face/size/x / 2 - 2)
]
]
]
face/image: none
face/color: none
face/extra/redraw face
]
style scroller: base 20x200 on-create [
face/color: none
face/extra: context [
offset: 2
start: 20
height: 50
radius: face/size/x / 2 - offset
redraw: func [face][
face/draw: compose/deep [
pen white
fill-pen 218.221.223
shape [(draw-bar face/size as-pair offset offset radius)]
line-width 3
pen white
fill-pen 116.127.141
shape [(draw-bar as-pair face/size/x height as-pair offset start radius)]
]
]
]
face/extra/redraw face
]
; ------------------------------------------------------------------------- ;
space 0x0
panel 100x300 40.43.48 [
circle 187.80.77
circle 188.145.59
circle 47.152.65
return
circle 10x10 187.80.77
circle 15x15 188.145.59
circle 18x18 47.152.65
return
a: avatar %avatar1.png 50x50
]
panel 200x300 54.57.62 [
below
at 180x5 hamburger
at 0x30 bar 49.52.56
]
panel 300x300 white [
at 0x30 shadow-bar 236.236.236
at 10x240 draw-field 280x50
at 280x35 scroller 15x200
]
]
view win