feat: 메인 홈
- 라이브, 인기 크리, 최신 콘텐츠, 이벤트 배너 UI 추가
This commit is contained in:
		
							
								
								
									
										85
									
								
								SodaLive/Sources/Home/HomeCreatorRankingItemView.swift
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										85
									
								
								SodaLive/Sources/Home/HomeCreatorRankingItemView.swift
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,85 @@
 | 
			
		||||
//
 | 
			
		||||
//  HomeCreatorRankingItemView.swift
 | 
			
		||||
//  SodaLive
 | 
			
		||||
//
 | 
			
		||||
//  Created by klaus on 7/11/25.
 | 
			
		||||
//
 | 
			
		||||
 | 
			
		||||
import SwiftUI
 | 
			
		||||
import Kingfisher
 | 
			
		||||
 | 
			
		||||
struct HomeCreatorRankingItemView: View {
 | 
			
		||||
    
 | 
			
		||||
    let rank: Int
 | 
			
		||||
    let item: GetExplorerSectionCreatorResponse
 | 
			
		||||
    
 | 
			
		||||
    let crowns = ["rank_1", "rank_2", "rank_3"]
 | 
			
		||||
    
 | 
			
		||||
    var body: some View {
 | 
			
		||||
        ZStack(alignment: .topLeading) {
 | 
			
		||||
            VStack(spacing: 0) {
 | 
			
		||||
                KFImage(URL(string: item.profileImageUrl))
 | 
			
		||||
                    .cancelOnDisappear(true)
 | 
			
		||||
                    .resizable()
 | 
			
		||||
                    .frame(width: 56, height: 56)
 | 
			
		||||
                    .clipShape(Circle())
 | 
			
		||||
                
 | 
			
		||||
                Text(item.nickname)
 | 
			
		||||
                    .font(.custom(Font.preRegular.rawValue, size: 18))
 | 
			
		||||
                    .foregroundColor(.white)
 | 
			
		||||
                    .padding(.top, 8)
 | 
			
		||||
                
 | 
			
		||||
                Text("팔로워")
 | 
			
		||||
                    .font(.custom(Font.preBold.rawValue, size: 14))
 | 
			
		||||
                    .foregroundColor(Color(hex: "78909C"))
 | 
			
		||||
                    .padding(.top, 12)
 | 
			
		||||
                
 | 
			
		||||
                Text("\(item.followerCount)")
 | 
			
		||||
                    .font(.custom(Font.preRegular.rawValue, size: 14))
 | 
			
		||||
                    .foregroundColor(Color(hex: "78909C"))
 | 
			
		||||
                    .padding(.top, 4)
 | 
			
		||||
            }
 | 
			
		||||
            .frame(width: 133, height: 188)
 | 
			
		||||
            .background(
 | 
			
		||||
                LinearGradient(
 | 
			
		||||
                    gradient: Gradient(colors: [Color(hex: "5ACDE1"), Color(hex: "2A339D")]),
 | 
			
		||||
                    startPoint: .topLeading,
 | 
			
		||||
                    endPoint: .bottom
 | 
			
		||||
                )
 | 
			
		||||
            )
 | 
			
		||||
            .cornerRadius(16)
 | 
			
		||||
            .overlay {
 | 
			
		||||
                RoundedRectangle(cornerRadius: 16)
 | 
			
		||||
                    .strokeBorder(
 | 
			
		||||
                        LinearGradient(
 | 
			
		||||
                            gradient: Gradient(colors: [Color(hex: "9AE2F6"), .white.opacity(0)]),
 | 
			
		||||
                            startPoint: .top,
 | 
			
		||||
                            endPoint: .bottom
 | 
			
		||||
                        ),
 | 
			
		||||
                        lineWidth: 1
 | 
			
		||||
                    )
 | 
			
		||||
            }
 | 
			
		||||
            .padding(.top, 20)
 | 
			
		||||
            
 | 
			
		||||
            if rank <= 3 {
 | 
			
		||||
                Image(crowns[rank - 1])
 | 
			
		||||
                    .resizable()
 | 
			
		||||
                    .frame(width: 40, height: 40)
 | 
			
		||||
                    .padding(.leading, 10)
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#Preview {
 | 
			
		||||
    HomeCreatorRankingItemView(
 | 
			
		||||
        rank: 1,
 | 
			
		||||
        item: GetExplorerSectionCreatorResponse(
 | 
			
		||||
            id: 1,
 | 
			
		||||
            nickname: "유빈ASMR",
 | 
			
		||||
            tags: "",
 | 
			
		||||
            profileImageUrl: "https://cf.sodalive.net/profile/34806/34806-profile-49db6b45-bb1e-4dc7-917e-1a614a853f5f-4232-1752158072656",
 | 
			
		||||
            followerCount: 1000
 | 
			
		||||
        )
 | 
			
		||||
    )
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user