@@ -51,58 +51,77 @@ export const OperationCard = ({
51
51
< Card
52
52
interactive = { true }
53
53
elevation = { Elevation . TWO }
54
- className = "mb-2 last:mb-0"
54
+ className = "mb-4 sm:mb- 2 last:mb-0"
55
55
onClick = { ( ) => setDrawerOpen ( true ) }
56
56
>
57
- < div className = "flex items-start" >
58
- < H4 className = "inline-block pb-1 border-b-2 border-zinc-200 border-solid mb-2 mr-2" >
59
- { operationDoc . doc . title }
60
- </ H4 >
61
- < Tooltip2
62
- placement = "bottom"
63
- content = { < div className = "max-w-sm dark:text-slate-900" > 下载原 JSON</ div > }
64
- >
65
- < Button
66
- small
67
- className = "mr-2 mb-2"
68
- icon = "download"
69
- onClick = { ( e ) => {
70
- e . stopPropagation ( )
71
- handleDownloadJSON ( operationDoc )
72
- } }
73
- />
74
- </ Tooltip2 >
75
- < Tooltip2
76
- placement = "bottom"
77
- content = { < div className = "max-w-sm dark:text-slate-900" > 复制神秘代码</ div > }
78
- >
79
- < Button
80
- small
81
- className = "mb-2"
82
- icon = "clipboard"
83
- onClick = { ( e ) => {
84
- e . stopPropagation ( )
85
- handleCopyShortCode ( operation )
86
- } }
87
- />
88
- </ Tooltip2 >
89
- < div className = "flex-1" />
90
- < div className = "flex flex-col items-end whitespace-nowrap" >
91
- < div className = "w-full flex justify-end text-zinc-500" >
92
- < div className = "flex items-center mr-4" >
93
- < Icon icon = "star" className = "mr-1.5" />
57
+ < div className = "flex flex-wrap mb-4 sm:mb-2" >
58
+ { /* title */ }
59
+ < div className = "flex flex-col gap-3" >
60
+ < div className = "flex gap-2" >
61
+ < H4 className = "inline-block pb-1 border-b-2 border-zinc-200 border-solid mb-2" >
62
+ { operationDoc . doc . title }
63
+ </ H4 >
64
+ < Tooltip2
65
+ placement = "bottom"
66
+ content = {
67
+ < div className = "max-w-sm dark:text-slate-900" >
68
+ 下载原 JSON
69
+ </ div >
70
+ }
71
+ >
72
+ < Button
73
+ small
74
+ icon = "download"
75
+ onClick = { ( e ) => {
76
+ e . stopPropagation ( )
77
+ handleDownloadJSON ( operationDoc )
78
+ } }
79
+ />
80
+ </ Tooltip2 >
81
+ < Tooltip2
82
+ placement = "bottom"
83
+ content = {
84
+ < div className = "max-w-sm dark:text-slate-900" >
85
+ 复制神秘代码
86
+ </ div >
87
+ }
88
+ >
89
+ < Button
90
+ small
91
+ icon = "clipboard"
92
+ onClick = { ( e ) => {
93
+ e . stopPropagation ( )
94
+ handleCopyShortCode ( operation )
95
+ } }
96
+ />
97
+ </ Tooltip2 >
98
+ </ div >
99
+ < H5 className = "flex items-center text-slate-900 -mt-3" >
100
+ < EDifficultyLevel
101
+ level = {
102
+ findLevelByStageName ( levels , operationDoc . stageName ) ||
103
+ createCustomLevel ( operationDoc . stageName )
104
+ }
105
+ difficulty = { operationDoc . difficulty }
106
+ />
107
+ </ H5 >
108
+ </ div >
109
+
110
+ < div className = "lg:flex-1 hidden" />
111
+
112
+ { /* meta */ }
113
+ < div className = "flex flex-col flex-1 gap-y-1.5 gap-x-4" >
114
+ < div className = "flex flex-wrap sm:justify-end items-center gap-x-4 gap-y-1 text-zinc-500" >
115
+ < div className = "flex items-center gap-1.5" >
116
+ < Icon icon = "star" />
94
117
< OperationRating
95
118
className = "text-sm"
96
119
operation = { operation }
97
120
layout = "horizontal"
98
121
/>
99
122
</ div >
100
123
101
- < Tooltip2
102
- className = "mr-4"
103
- placement = "top"
104
- content = { `访问量:${ operation . views } ` }
105
- >
124
+ < Tooltip2 placement = "top" content = { `访问量:${ operation . views } ` } >
106
125
< div >
107
126
< Icon icon = "eye-open" className = "mr-1.5" />
108
127
< span > { operation . views } </ span >
@@ -117,8 +136,7 @@ export const OperationCard = ({
117
136
/>
118
137
</ div >
119
138
</ div >
120
-
121
- < div className = "w-full flex justify-end text-zinc-500 mt-1.5" >
139
+ < div className = "text-zinc-500 self-end" >
122
140
< Tooltip2 placement = "top" content = { `作者:${ operation . uploader } ` } >
123
141
< div >
124
142
< Icon icon = "user" className = "mr-1.5" />
@@ -128,24 +146,15 @@ export const OperationCard = ({
128
146
</ div >
129
147
</ div >
130
148
</ div >
131
- < H5 className = "flex items-center text-slate-900 -mt-3" >
132
- < EDifficultyLevel
133
- level = {
134
- findLevelByStageName ( levels , operationDoc . stageName ) ||
135
- createCustomLevel ( operationDoc . stageName )
136
- }
137
- difficulty = { operationDoc . difficulty }
138
- />
139
- </ H5 >
140
- < div className = "flex" >
141
- < div className = "text-gray-700 leading-normal w-1/2" >
149
+ < div className = "flex md:flex-row flex-col gap-4" >
150
+ < div className = "text-gray-700 leading-normal md:w-1/2" >
142
151
{ /* <div className="text-sm text-zinc-600 mb-2 font-bold">作业描述</div> */ }
143
152
< Paragraphs
144
153
content = { operationDoc . doc . details }
145
154
limitHeight = { 21 * 13.5 } // 13 lines, 21px per line; the extra 0.5 line is intentional so the `mask` effect is obvious
146
155
/>
147
156
</ div >
148
- < div className = "w-1/2 ml-4 " >
157
+ < div className = "md: w-1/2" >
149
158
< div className = "text-sm text-zinc-600 mb-2 font-bold" >
150
159
干员/干员组
151
160
</ div >
0 commit comments