@@ -23,90 +23,92 @@ struct CardContextMenuView: View {
2323
2424 var body : some View {
2525 NavigationView {
26- VStack ( spacing: 12 ) {
27- if ( news. imageURL != nil ) {
28- AsyncImage ( url: URL ( string: news. imageURL ?? " " ) ) { image in
29- Color . clear. overlay (
30- image
31- . resizable ( )
32- . aspectRatio ( contentMode: . fill)
26+ ScrollView {
27+ VStack ( spacing: 12 ) {
28+ if ( news. imageURL != nil ) {
29+ AsyncImage ( url: URL ( string: news. imageURL ?? " " ) ) { image in
30+ Color . clear. overlay (
31+ image
32+ . resizable ( )
33+ . aspectRatio ( contentMode: . fill)
34+ )
35+ . transition ( . opacity. animation ( . easeInOut( duration: 0.3 ) ) )
36+ } placeholder: {
37+ Color . black
38+ . opacity ( 0.2 )
39+ . overlay (
40+ ProgressView ( )
41+ . progressViewStyle ( . circular)
42+ . tint ( . white)
43+ )
44+ }
45+ . background ( Color ( uiColor: UIColor ( hex: news. tintColor ?? " 000000 " ) ) )
46+ . clipShape (
47+ RoundedRectangle ( cornerRadius: 12 , style: . continuous)
3348 )
34- . transition ( . opacity. animation ( . easeInOut( duration: 0.3 ) ) )
35- } placeholder: {
36- Color . black
37- . opacity ( 0.2 )
38- . overlay (
39- ProgressView ( )
40- . progressViewStyle ( . circular)
41- . tint ( . white)
49+ . overlay (
50+ LinearGradient (
51+ gradient: Gradient ( colors: [ . clear, . black. opacity ( 0.2 ) ] ) ,
52+ startPoint: . top,
53+ endPoint: . bottom
4254 )
43- }
44- . background ( Color ( uiColor: UIColor ( hex: news. tintColor ?? " 000000 " ) ) )
45- . clipShape (
46- RoundedRectangle ( cornerRadius: 12 , style: . continuous)
47- )
48- . overlay (
49- LinearGradient (
50- gradient: Gradient ( colors: [ . clear, . black. opacity ( 0.2 ) ] ) ,
51- startPoint: . top,
52- endPoint: . bottom
5355 )
54- )
55- . overlay (
56- RoundedRectangle ( cornerRadius: 12 , style: . continuous)
57- . stroke ( Color . white. opacity ( 0.15 ) , lineWidth: 2 )
58- )
59- . frame ( height: 250 )
60- }
61-
62- VStack ( alignment: . leading, spacing: 16 ) {
63- if let title = news. title {
64- Text ( title)
65- . font ( . title)
66- . fontWeight ( . bold)
67- . lineLimit ( 2 )
68- . foregroundStyle ( . primary)
69- . multilineTextAlignment ( . leading)
70- }
71-
72- if let caption = news. caption {
73- Text ( caption)
74- . font ( . headline)
75- . foregroundColor ( . secondary)
76- . multilineTextAlignment ( . leading)
56+ . overlay (
57+ RoundedRectangle ( cornerRadius: 12 , style: . continuous)
58+ . stroke ( Color . white. opacity ( 0.15 ) , lineWidth: 2 )
59+ )
60+ . frame ( height: 250 )
7761 }
7862
79- if ( news. url != nil ) {
80- Button ( action: {
81- UIApplication . shared. open ( news. url!)
82- } ) {
83- Label ( " Open URL " , systemImage: " arrow.up.right " )
84- . frame ( maxWidth: . infinity)
63+ VStack ( alignment: . leading, spacing: 16 ) {
64+ if let title = news. title {
65+ Text ( title)
66+ . font ( . title)
67+ . fontWeight ( . bold)
68+ . lineLimit ( 2 )
69+ . foregroundStyle ( . primary)
70+ . multilineTextAlignment ( . leading)
71+ }
72+
73+ if let caption = news. caption {
74+ Text ( caption)
75+ . font ( . headline)
76+ . foregroundColor ( . secondary)
77+ . multilineTextAlignment ( . leading)
8578 }
86- . padding ( )
87- . foregroundColor ( . accentColor)
88- . background ( Color ( uiColor: . secondarySystemBackground) )
89- . cornerRadius ( 10 )
79+
80+ if ( news. url != nil ) {
81+ Button ( action: {
82+ UIApplication . shared. open ( news. url!)
83+ } ) {
84+ Label ( " Open URL " , systemImage: " arrow.up.right " )
85+ . frame ( maxWidth: . infinity)
86+ }
87+ . padding ( )
88+ . foregroundColor ( . accentColor)
89+ . background ( Color ( uiColor: . secondarySystemBackground) )
90+ . cornerRadius ( 10 )
91+ }
92+
93+ Text ( formattedDate)
94+ . font ( . caption)
95+ . foregroundColor ( . secondary)
9096 }
97+ . frame ( maxWidth: . infinity)
9198
92- Text ( formattedDate)
93- . font ( . caption)
94- . foregroundColor ( . secondary)
99+ Spacer ( )
95100 }
96- . frame ( maxWidth: . infinity)
97-
98- Spacer ( )
101+ . frame (
102+ minWidth: 0 ,
103+ maxWidth: . infinity,
104+ minHeight: 0 ,
105+ maxHeight: . infinity,
106+ alignment: . topLeading
107+ )
108+ . padding ( )
109+ . background ( Color ( uiColor: . systemBackground) )
110+ . clipShape ( RoundedRectangle ( cornerRadius: 16 , style: . continuous) )
99111 }
100- . frame (
101- minWidth: 0 ,
102- maxWidth: . infinity,
103- minHeight: 0 ,
104- maxHeight: . infinity,
105- alignment: . topLeading
106- )
107- . padding ( )
108- . background ( Color ( uiColor: . systemBackground) )
109- . clipShape ( RoundedRectangle ( cornerRadius: 16 , style: . continuous) )
110112 . toolbar {
111113 ToolbarItem ( placement: . topBarLeading) {
112114 Button ( action: {
0 commit comments