diff --git a/FrontEnd/styles/home.scss b/FrontEnd/styles/home.scss index 447ef0121..31ffba3b3 100644 --- a/FrontEnd/styles/home.scss +++ b/FrontEnd/styles/home.scss @@ -71,3 +71,22 @@ body.home { } } } + +.ccta-availability { + padding: 15px; + font-size: 13px; + background-color: var(--panel-button-background); + + p { + margin: 5px 0; + } + + .support { + margin: 0 0 5px; + font-weight: bold; + } + + .cta { + text-align: right; + } +} diff --git a/Public/images/sponsors/contextsdk.png b/Public/images/sponsors/contextsdk.png deleted file mode 100644 index 2ddcaf94a..000000000 Binary files a/Public/images/sponsors/contextsdk.png and /dev/null differ diff --git a/Public/images/sponsors/contextsdk~dark.png b/Public/images/sponsors/contextsdk~dark.png deleted file mode 100644 index 1aaf4e018..000000000 Binary files a/Public/images/sponsors/contextsdk~dark.png and /dev/null differ diff --git a/Sources/App/Core/ExternalURL.swift b/Sources/App/Core/ExternalURL.swift index 138476f9a..769a6ae72 100644 --- a/Sources/App/Core/ExternalURL.swift +++ b/Sources/App/Core/ExternalURL.swift @@ -15,28 +15,30 @@ import Plot enum ExternalURL: URLRepresentable { + case addNewPackage(_ owner: String, _ repository: String) + case contactMailto case mastodon + case podcast case projectGitHub case projectSponsorship case raiseNewIssue - case podcast - case addNewPackage(_ owner: String, _ repository: String) - var description: String { switch(self) { + case let .addNewPackage(owner, repository): + return "https://github.com/SwiftPackageIndex/PackageList/issues/new?labels=Add+Package&template=add_package.yml&title=Add+\(repository)&list=https%3A%2F%2Fgithub.com%2F\(owner)%2F\(repository).git" + case .contactMailto: + return "mailto:contact@swiftpackageindex.com" case .mastodon: return "https://mas.to/@SwiftPackageIndex" + case .podcast: + return "https://swiftpackageindexing.transistor.fm" case .projectGitHub: return "https://github.com/SwiftPackageIndex/SwiftPackageIndex-Server" case .projectSponsorship: return "https://github.com/sponsors/SwiftPackageIndex" case .raiseNewIssue: return "https://github.com/SwiftPackageIndex/SwiftPackageIndex-Server/issues/new/choose" - case .podcast: - return "https://swiftpackageindexing.transistor.fm" - case let .addNewPackage(owner, repository): - return "https://github.com/SwiftPackageIndex/PackageList/issues/new?labels=Add+Package&template=add_package.yml&title=Add+\(repository)&list=https%3A%2F%2Fgithub.com%2F\(owner)%2F\(repository).git" } } } diff --git a/Sources/App/Core/Supporters.swift b/Sources/App/Core/Supporters.swift index 4b8375dcc..5a8975fca 100644 --- a/Sources/App/Core/Supporters.swift +++ b/Sources/App/Core/Supporters.swift @@ -25,11 +25,6 @@ enum Supporters { darkModeUrl: "/images/sponsors/emerge~dark.png"), url: "https://www.emergetools.com/?utm_source=spi2&utm_medium=sponsor&utm_campaign=emerge", advertisingCopy: "Join the future of mobile development. Trusted by top companies like Duolingo, Square, DoorDash & more…"), - .init(name: "ContextSDK", - logo: .init(lightModeUrl: "/images/sponsors/contextsdk.png", - darkModeUrl: "/images/sponsors/contextsdk~dark.png"), - url: "https://contextsdk.com", - advertisingCopy: "Intent detection with real-world context. Lean, lightweight and GDPR compliant out of the box."), ] nonisolated(unsafe) static var infrastructure: [Corporate] = [ diff --git a/Sources/App/Views/Home/HomeIndex+View.swift b/Sources/App/Views/Home/HomeIndex+View.swift index fb30a7f10..97c013344 100644 --- a/Sources/App/Views/Home/HomeIndex+View.swift +++ b/Sources/App/Views/Home/HomeIndex+View.swift @@ -109,7 +109,24 @@ enum HomeIndex { analyticsEvent: "Home - Supporters CTA"), .group( Supporters.corporate.shuffled().map(\.advertisementNode) - ) + ), + .if(Supporters.corporate.count < 2, .div( + .class("ccta-availability"), + .p( + .class("support"), + .text("Support the Swift Package Index") + ), + .p( + .text("We have one homepage sponsorship spot available. Support the project while promoting your company.") + ), + .p( + .class("cta"), + .a( + .href(ExternalURL.contactMailto), + .text("Get in touch for details →") + ) + ) + )) ) }