Skip to content

Commit

Permalink
Splash and layer adjustment for light mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ruixhuang committed Jan 14, 2025
1 parent 304a432 commit 199dc49
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 263 deletions.
2 changes: 1 addition & 1 deletion dydx/dydxViews/dydxViews/Shared/LeverageRisk.swift
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public class LeverageRiskModel: PlatformViewModel {
.themeColor(foreground: self.level.foregroundColor)
.padding(.horizontal, 6)
.padding(.vertical, 4)
.background(self.level.backgroundColor.color.opacity(0.3))
.background(self.level.backgroundColor.color.opacity(0.1))
.cornerRadius(6, corners: .allCorners)
.themeStyle(style: style)
.lineLimit(1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public class dydxLineChartViewModel: PlatformViewModel {
}

private var chartGradient: Gradient {
Gradient(colors: [lineColor.opacity(0.5),
Gradient(colors: [lineColor.opacity(0.3),
lineColor.opacity(0)])
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public class dydxSimpleUIMarketsHeaderViewModel: PlatformViewModel {
PlatformView(viewModel: self, parentStyle: parentStyle, styleKey: styleKey) { [weak self] style in
guard let self = self else { return AnyView(PlatformView.nilView) }

let view = HStack(alignment: .center) {
let view = HStack(alignment: .center, spacing: 16) {
Spacer()

if self.depositAction != nil {
Expand All @@ -85,15 +85,17 @@ public class dydxSimpleUIMarketsHeaderViewModel: PlatformViewModel {

self.createMenuButton(parentStyle: style)
}

return AnyView(view)
}
}

private func createDepositButton(parentStyle: ThemeStyle) -> some View {
let iconName = "icon_transfer_deposit"
let content = PlatformIconViewModel(type: .asset(name: iconName, bundle: .dydxView),
clip: .circle(background: .layer4, spacing: 16),
size: CGSize(width: 36, height: 36))
clip: .circle(background: .layer5, spacing: 16, borderColor: .layer6),
size: CGSize(width: 36, height: 36),
templateColor: .textPrimary)
return PlatformButtonViewModel(content: content,
type: .iconType) { [weak self] in
self?.depositAction?()
Expand All @@ -104,8 +106,9 @@ public class dydxSimpleUIMarketsHeaderViewModel: PlatformViewModel {
private func createWithdrawButton(parentStyle: ThemeStyle) -> some View {
let iconName = "icon_transfer_withdrawal"
let content = PlatformIconViewModel(type: .asset(name: iconName, bundle: .dydxView),
clip: .circle(background: .layer4, spacing: 16),
size: CGSize(width: 36, height: 36))
clip: .circle(background: .layer5, spacing: 16, borderColor: .layer6),
size: CGSize(width: 36, height: 36),
templateColor: .textPrimary)
return PlatformButtonViewModel(content: content,
type: .iconType) { [weak self] in
self?.withdrawAction?()
Expand All @@ -116,8 +119,9 @@ public class dydxSimpleUIMarketsHeaderViewModel: PlatformViewModel {
private func createMenuButton(parentStyle: ThemeStyle) -> some View {
let iconName = "icon_list"
let content = PlatformIconViewModel(type: .asset(name: iconName, bundle: .dydxView),
clip: .circle(background: .layer4, spacing: 16),
size: CGSize(width: 36, height: 36))
clip: .circle(background: .layer5, spacing: 16, borderColor: .layer6),
size: CGSize(width: 36, height: 36),
templateColor: .textPrimary)
return PlatformButtonViewModel(content: content,
type: .iconType) { [weak self] in
withAnimation(Animation.easeInOut) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public class dydxSimpleUIPortfolioPeriodViewModel: PlatformViewModel {
.themeColor(foreground: .textPrimary)
.padding(.horizontal, 8)
.padding(.vertical, 4)
.themeColor(background: .layer4)
.themeColor(background: .layer5)
.cornerRadius(7, corners: .allCorners)
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ public class dydxSimpleUIPortfolioViewModel: PlatformViewModel {
private func createPortfolioView(style: ThemeStyle) -> some View {
ZStack {
chart.createView(parentStyle: style)
.opacity(0.6)
.padding(.top, 78)

VStack(spacing: 16) {
Expand All @@ -115,16 +116,14 @@ public class dydxSimpleUIPortfolioViewModel: PlatformViewModel {
Spacer()

HStack(alignment: .center, spacing: 16) {
HStack(alignment: .center, spacing: 16) {
HStack(alignment: .center, spacing: 8) {
Text(DataLocalizer.localize(path: "APP.GENERAL.BUYING_POWER"))
.themeColor(foreground: .textTertiary)
Text(sharedAccountViewModel?.buyingPower ?? "-")
.themeColor(foreground: .textSecondary)
}
.themeFont(fontSize: .small)

Spacer()
DividerModel().createView(parentStyle: style)
Spacer()

HStack(alignment: .center, spacing: 8) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "Splash.svg",
"filename" : "dYdX Logo (3) 1.svg",
"idiom" : "universal"
}
],
Expand Down
242 changes: 0 additions & 242 deletions dydxV4/dydxV4/Assets.xcassets/splash.imageset/Splash.svg

This file was deleted.

28 changes: 28 additions & 0 deletions dydxV4/dydxV4/Assets.xcassets/splash.imageset/dYdX Logo (3) 1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 8 additions & 7 deletions dydxV4/dydxV4/Launch Screen.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
Expand All @@ -17,18 +18,18 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="center" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="splash" translatesAutoresizingMaskIntoConstraints="NO" id="GaP-Yn-Pfc">
<rect key="frame" x="-229.66666666666666" y="0.0" width="852.33333333333337" height="852"/>
<rect key="frame" x="96" y="325.66666666666669" width="201" height="201.00000000000006"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="width" secondItem="GaP-Yn-Pfc" secondAttribute="height" multiplier="1:1" id="ARa-Kw-BLD"/>
<constraint firstAttribute="width" secondItem="GaP-Yn-Pfc" secondAttribute="height" multiplier="1:1" id="Nzo-oG-Esg"/>
</constraints>
</imageView>
</subviews>
<viewLayoutGuide key="safeArea" id="Bcu-3y-fUS"/>
<color key="backgroundColor" systemColor="darkTextColor"/>
<color key="backgroundColor" name="Purple"/>
<constraints>
<constraint firstItem="GaP-Yn-Pfc" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="7FS-E4-VRT"/>
<constraint firstItem="GaP-Yn-Pfc" firstAttribute="width" secondItem="GaP-Yn-Pfc" secondAttribute="height" multiplier="1:1" id="ARa-Kw-BLD"/>
<constraint firstItem="GaP-Yn-Pfc" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="C5Y-CJ-Cd0"/>
</constraints>
</view>
Expand All @@ -39,9 +40,9 @@
</scene>
</scenes>
<resources>
<image name="splash" width="393" height="852"/>
<systemColor name="darkTextColor">
<color white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
<image name="splash" width="201" height="62"/>
<namedColor name="Purple">
<color red="0.41200000047683716" green="0.40000000596046448" blue="1" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
</namedColor>
</resources>
</document>

0 comments on commit 199dc49

Please sign in to comment.