Browse Source

Updated the new post button with gradient fill.

Changelog-Changed: Added damus gradient to post button
Closes: #244
translations_damus-localizations-en-us-xcloc-localized-contents-en-us-xliff--master_es_419
Ben Weeks 2 years ago
committed by William Casarin
parent
commit
553dcb785c
  1. 38
      damus/Assets.xcassets/Colors/DamusBlue.colorset/Contents.json
  2. 38
      damus/Assets.xcassets/Colors/DamusPurple.colorset/Contents.json
  3. 11
      damus/Views/PostButton.swift

38
damus/Assets.xcassets/Colors/DamusBlue.colorset/Contents.json

@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xFF",
"green" : "0x4D",
"red" : "0x4B"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xFF",
"green" : "0x4D",
"red" : "0x4B"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

38
damus/Assets.xcassets/Colors/DamusPurple.colorset/Contents.json

@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xC5",
"green" : "0x43",
"red" : "0xCC"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xC5",
"green" : "0x43",
"red" : "0xCC"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

11
damus/Views/PostButton.swift

@ -8,13 +8,20 @@
import Foundation
import SwiftUI
let BUTTON_SIZE = 57.0
let LINEAR_GRADIENT = LinearGradient(gradient: Gradient(colors: [
Color("DamusPurple"),
Color("DamusBlue")
]), startPoint: .topTrailing, endPoint: .bottomTrailing)
func PostButton(action: @escaping () -> ()) -> some View {
return Button(action: action, label: {
Image(systemName: "plus")
.font(.system(.title2))
.foregroundColor(Color.white)
.frame(width: 57, height: 57, alignment: .center)
.background(Color.accentColor)
.frame(width: BUTTON_SIZE, height: BUTTON_SIZE, alignment: .center)
.background(LINEAR_GRADIENT)
.cornerRadius(38.5)
.padding()
.shadow(color: Color.black.opacity(0.3),

Loading…
Cancel
Save