Check-in [73766584da]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Use presentation-support.fs
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 73766584dac6c7e52254b77e33a5ef2b519320d0
User & Date: bernd 2019-12-03 23:01:07.152
Context
2019-12-04
21:22
Show album viewer when clicked on thumbnail check-in: c8aeb0a95a user: bernd tags: trunk
2019-12-03
23:01
Use presentation-support.fs check-in: 73766584da user: bernd tags: trunk
2019-12-02
23:31
Work on album viewer check-in: b5c83311ad user: bernd tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to gui.fs.
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
    default-scale f* 1/f #56 fm*
    f/ fround to font-size#
    font-size# 133% f* fround to baseline#
    font-size# 32e f/ to pixelsize# ;

require minos2/text-style.fs
require minos2/md-viewer.fs


update-gsize#

glue new Constant glue-sleft
glue new Constant glue-sright
glue ' new static-a with-allocater Constant glue-left
glue ' new static-a with-allocater Constant glue-right

: glue0 ( -- ) 0e fdup
    [ glue-left  .hglue-c ]L df!
    [ glue-right .hglue-c ]L df! ;
glue0

Variable slides[]
Variable slide#

: >slides ( o -- ) slides[] >stack ;

: !slides ( nprev n -- )
    over slide# !
    slides[] $[] @ /flip drop
    slides[] $[] @ /flop drop glue0 ;
: anim!slides ( r0..1 n -- )
    slides[] $[] @ /flop drop
    fdup fnegate dpy-w @ fm* glue-left  .hglue-c df!
    -1e f+       dpy-w @ fm* glue-right .hglue-c df! ;

: prev-anim ( n r0..1 -- )
    dup 0<= IF  drop fdrop  EXIT  THEN
    fdup 1e f>= IF  fdrop
	dup 1- swap !slides +sync +resize  EXIT
    THEN
    1e fswap f- 1- sin-t anim!slides +sync +resize ;

: next-anim ( n r0..1 -- )
    dup slides[] $[]# 1- u>= IF  drop fdrop  EXIT  THEN
    fdup 1e f>= IF  fdrop
	dup 1+ swap !slides +sync +resize  EXIT
    THEN
    1+ sin-t anim!slides +sync +resize ;

0.4e FValue slide-time%

: prev-slide ( -- )
    slide-time% anims[] $@len IF  anim-end 50% f*  THEN
    slide# @ ['] prev-anim >animate +textures +lang ;
: next-slide ( -- )
    slide-time% anims[] $@len IF  anim-end 50% f*  THEN
    slide# @ ['] next-anim >animate +textures +lang ;

\ frames

0 Value pw-frame
0 Value id-frame
0 Value chat-frame
0 Value post-frame


\ password screen

0 Value pw-err
0 Value pw-num
0 Value phrase-unlock
0 Value create-new-id
0 Value phrase-first
0 Value phrase-again
0 Value plus-login
0 Value minus-login
0 Value nick-edit

: err-fade ( r addr -- )
    1e fover [ pi f2* ] Fliteral f* fcos 1e f+ f2/ f-
    2 tries# @ lshift s>f f* fdup 1e f> IF fdrop 1e ELSE +sync +resize THEN
    .fade fdrop ;




: shake-lr ( r addr -- )
    [ pi 16e f* ] FLiteral f* fsin f2/ 0.5e f+ \ 8 times shake
    font-size# f2/ f* font-size# f2/ fover f-
    glue-sleft  >o 0g fdup hglue-c glue! o>
    glue-sright >o 0g fdup hglue-c glue! o> +sync +resize drop ;

0e 0 shake-lr







>



<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
<
<
<
<
<
<
<







>


















>
>
>







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
    default-scale f* 1/f #56 fm*
    f/ fround to font-size#
    font-size# 133% f* fround to baseline#
    font-size# 32e f/ to pixelsize# ;

require minos2/text-style.fs
require minos2/md-viewer.fs
require minos2/presentation-support.fs

update-gsize#







































0.4e to slide-time%








\ frames

0 Value pw-frame
0 Value id-frame
0 Value chat-frame
0 Value post-frame
0 Value n2o-frame

\ password screen

0 Value pw-err
0 Value pw-num
0 Value phrase-unlock
0 Value create-new-id
0 Value phrase-first
0 Value phrase-again
0 Value plus-login
0 Value minus-login
0 Value nick-edit

: err-fade ( r addr -- )
    1e fover [ pi f2* ] Fliteral f* fcos 1e f+ f2/ f-
    2 tries# @ lshift s>f f* fdup 1e f> IF fdrop 1e ELSE +sync +resize THEN
    .fade fdrop ;

glue new Constant glue-sleft
glue new Constant glue-sright

: shake-lr ( r addr -- )
    [ pi 16e f* ] FLiteral f* fsin f2/ 0.5e f+ \ 8 times shake
    font-size# f2/ f* font-size# f2/ fover f-
    glue-sleft  >o 0g fdup hglue-c glue! o>
    glue-sright >o 0g fdup hglue-c glue! o> +sync +resize drop ;

0e 0 shake-lr
1059
1060
1061
1062
1063
1064
1065









1066
1067
1068
1069
1070
1071
1072
1073
1074

1075
1076
1077
1078

1079
1080
1081
1082
1083
1084
1085

1086
1087
1088
1089
1090
1091
1092
	128 128 glue*thumb dummy-thumb }}thumb >r
	r@ [n:h update-thumb ;] { w^ xt } xt cell hash key| fetch-finish# #!
	hash key| ?fetch
    THEN  {{ glue*ll }}glue r> }}v 40%bv box[] ;

hash: imgs# \ hash of tables of










: prev-img ;
: next-img ;

: /mid ( o -- o' )
    >r {{ glue*l }}glue r> /center glue*l }}glue }}v box[] >bl ;

{{
    glue*wh album-bg-col# slide-frame dup .button1
    {{

	tex: img0 ' img0 "doc/thumb.png" 0.666e }}image-file drop /mid
	tex: img1 ' img1 "doc/thumb.png" 0.666e }}image-file drop /mid /hflip
	tex: img2 ' img2 "doc/thumb.png" 0.666e }}image-file drop /mid /hflip
	tex: img3 ' img3 "doc/thumb.png" 0.666e }}image-file drop /mid /hflip

    }}h
    {{
	glue*ll }}glue
	{{  \large
	    "" }}text ' prev-img 0 click[]
	    glue*ll }}glue
	    "" }}text ' next-img 0 click[]

	}}h box[]
	glue*ll }}glue
    }}v box[]
}}z box[] Constant album-viewer

: .imgs ( -- )
    imgs# [: dup $. ." :" cr







>
>
>
>
>
>
>
>
>









>




>
|



|

|
>







1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
	128 128 glue*thumb dummy-thumb }}thumb >r
	r@ [n:h update-thumb ;] { w^ xt } xt cell hash key| fetch-finish# #!
	hash key| ?fetch
    THEN  {{ glue*ll }}glue r> }}v 40%bv box[] ;

hash: imgs# \ hash of tables of

0 Value imgs-box
0 Value n2o-frame

glue ' new static-a with-allocater Constant iglue-left
glue ' new static-a with-allocater Constant iglue-right

: swap-images ( -- )
    imgs-box .childs[] dup >r get-stack >r 2swap r> r> set-stack ;

: prev-img ;
: next-img ;

: /mid ( o -- o' )
    >r {{ glue*l }}glue r> /center glue*l }}glue }}v box[] >bl ;

{{
    glue*wh album-bg-col# slide-frame dup .button1
    {{
	iglue-left }}glue
	tex: img0 ' img0 "doc/thumb.png" 0.666e }}image-file drop /mid
	tex: img1 ' img1 "doc/thumb.png" 0.666e }}image-file drop /mid /hflip
	tex: img2 ' img2 "doc/thumb.png" 0.666e }}image-file drop /mid /hflip
	tex: img3 ' img3 "doc/thumb.png" 0.666e }}image-file drop /mid /hflip
	iglue-right }}glue
    }}h dup to imgs-box
    {{
	glue*ll }}glue
	{{  \large
	    "" }}text ' prev-img 0 click[]
	    glue*ll }}glue
	    "" }}text ' next-img 0 click[]
	    \normal
	}}h box[]
	glue*ll }}glue
    }}v box[]
}}z box[] Constant album-viewer

: .imgs ( -- )
    imgs# [: dup $. ." :" cr
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
    invitations-notify /flop drop +resize
    o> r> free throw ;

' add-invitation is do-invite

{{
    {{
	glue-left }}glue
	pw-frame          dup >slides
	id-frame   /flip  dup >slides
	chat-frame /flip  dup >slides
	post-frame /flip  dup >slides
	glue-right }}glue
    }}h box[]
    {{
	{{
	    glue*lll }}glue
	    \large
	    {{
		'user-plus' ' xemit $tmp }}text
	    }}h ' invitations-s/h 0 toggle[] /flip dup to invitations-notify







|




|
|







1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
    invitations-notify /flop drop +resize
    o> r> free throw ;

' add-invitation is do-invite

{{
    {{
	glue-left @ }}glue
	pw-frame          dup >slides
	id-frame   /flip  dup >slides
	chat-frame /flip  dup >slides
	post-frame /flip  dup >slides
	glue-right @ }}glue
    }}h box[] \ main slides
    {{
	{{
	    glue*lll }}glue
	    \large
	    {{
		'user-plus' ' xemit $tmp }}text
	    }}h ' invitations-s/h 0 toggle[] /flip dup to invitations-notify
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
		    \normal blackish
		    !i18n l" Invitations" }}text' /center 25%b
		}}v box[] dup to invitations-list
	    }}z box[]
	}}h box[]
	/flip dup to invitations
	glue*lll }}glue
    }}v box[]
}}z net2o[]
Value n2o-frame

\ top widgets

: !widgets ( -- )
\    1 set-compose-hint
    top-widget .htop-resize
    pw-field engage







|
|
<







1303
1304
1305
1306
1307
1308
1309
1310
1311

1312
1313
1314
1315
1316
1317
1318
		    \normal blackish
		    !i18n l" Invitations" }}text' /center 25%b
		}}v box[] dup to invitations-list
	    }}z box[]
	}}h box[]
	/flip dup to invitations
	glue*lll }}glue
    }}v box[] \ notifications
}}z net2o[] to n2o-frame


\ top widgets

: !widgets ( -- )
\    1 set-compose-hint
    top-widget .htop-resize
    pw-field engage