text
stringlengths
2
104M
meta
dict
import { useState } from "react"; export function useInput() { const [v, setValue] = useState(""); const input = <input onChange={(e) => setValue(e.target.value)} type="text" />; return [v, input]; }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
/* https://usehooks.com/useDebounce/ used as a base */ import { useState, useEffect } from "react"; export function useDebounce<T>(value: T, delay: number): T { // State and setters for debounced value const [debouncedValue, setDebouncedValue] = useState<T>(value); useEffect( () => { // Update debounced value after delay const handler = setTimeout(() => { setDebouncedValue(value); }, delay); // Cancel the timeout if value changes (also on delay change or unmount) // This is how we prevent debounced value from updating if value is changed ... // .. within the delay period. Timeout gets cleared and restarted. return () => { clearTimeout(handler); }; }, [value, delay] // Only re-call effect if value or delay changes ); return debouncedValue; }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
import { useEffect, useState } from "react"; import * as fcl from '@onflow/fcl'; export function useCurrentUser() { const [user, setUser] = useState({ addr: null, loggedIn: null, cid: null }) useEffect(() => { fcl.currentUser().subscribe(setUser), [setUser] }) return [user.addr, user.addr != null] }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
# NPM Module We exposed an interface to the catalog via a consumable NPM module. This library will expose a number of methods that can be called to interact with the catalog. ## Methods Method signatures and their associating parameters/responses can be found in the `cadence/` folder of this repo. ### Scripts ``` checkForRecommendedV1Views genTx getAllNftsInAccount getExamplenftCollectionLength getExamplenftType getNftCatalog getNftCatalogProposals getNftCollectionsForNftType getNftIdsInAccount getNftInAccount getNftInAccountFromPath getNftMetadataForCollectionIdentifier getNftProposalForId getNftsCountInAccount getNftsInAccount getNftsInAccountFromIds getNftsInAccountFromPath getSupportedGeneratedTransactions hasAdminProxy isCatalogAdmin ``` ### Transactions ``` addToNftCatalog addToNftCatalogAdmin approveNftCatalogProposal mintExampleNft mintNonstandardNft proposeNftToCatalog rejectNftCatalogProposal removeFromNftCatalog removeNftCatalogProposal sendAdminCapabilityToProxy setupExamplenftCollection setupNftCatalogAdminProxy setupNonstandardnftCollection setupStorefront transferExamplenft updateNftCatalogEntry withdrawNftProposalFromCatalog ``` ## Installation ``` npm install flow-catalog ``` or ``` yarn add flow-catalog ``` ## Usage Methods can be imported as follows, all nested methods live under the `scripts` or `transactions` variable. NOTE: In order to properly bootstrap the method, you will need to run and `await` on the `getAddressMaps()` method, passing it into all of the methods as shown below. ``` import { getAddressMaps, scripts } from "flow-catalog"; const main = async () => { const addressMap = await getAddressMaps(); console.log(await scripts.getNftCatalog(addressMap)); }; main(); ``` The response of any method is a tuple-array, with the first element being the result, and the second being the error (if applicable). For example, the result of the method above would look like - ``` [ { BILPlayerCollection: { contractName: 'Player', contractAddress: '0x9e6cdb88e34fa1f3', nftType: [Object], collectionData: [Object], collectionDisplay: [Object] }, ... SoulMadeComponent: { contractName: 'SoulMadeComponent', contractAddress: '0x421c19b7dc122357', nftType: [Object], collectionData: [Object], collectionDisplay: [Object] } }, null ] ```
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
# Composability Chronicles #1: How to build your Flow NFT for composability ## Overview NFT composability refers to the ability of different Non-Fungible Tokens (NFTs) to be combined, linked, and interact with each other in a meaningful way. This allows NFTs to be used as building blocks to create new and more complex NFTs, or to be integrated into various decentralized applications, marketplaces, games, and platforms. In this guide, we will walk through the process of building a composable NFT contract. We will cover setting up the development environment, writing the contracts, supporting transactions and scripts, along with how to deploy the contract to testnet. By the end of this guide, you will have a solid understanding of how to build a composable NFT on Flow. This guide will assume that you have a beginner level understanding of cadence. All of the resulting code from this guide is available [here](https://github.com/bshahid331/my-nft-project). ## Preparation Before we begin building our composable NFT, we need to set up the development environment. 1. To start, download and install the Flow CLI [here](https://developers.flow.com/tools/flow-cli/install) 2. It is highly recommended to go through the basic NFT tutorial [here](https://developers.flow.com/cadence/tutorial/05-non-fungible-tokens-1). This is a more advanced one. 3. Using git, clone the [https://github.com/bshahid331/my-nft-project/tree/skeleton](https://github.com/bshahid331/my-nft-project/tree/skeleton) repository as a starting point. 4. Navigate to the newly created my-nft-project folder, the my-nft-project folder with a text editor of your choice (i.e. VSCode) The repo has multiple folder which will provide us with a starting point for all needed boilerplate to build a Flow NFT - `/flow.json` - Configuration file to help manage local, testnet, and mainnet flow deployments of contracts from the `/cadence` folder - `/cadence` - `/contracts` - Smart contracts that can be deployed to the Flow chain - `/transactions` - Transactions that can perform changes to data on the Flow blockchain - `/scripts` - Scripts that can provide read-only access to data on the Flow blockchain ### Standard Contracts The starter code includes important standard contracts that we will use to build our NFT. Make sure you add them to your project in the `contracts` The contracts are: 1. `FungibleToken.cdc` - This is a standard Flow smart contract that represents Fungible Tokens 2. `NonFungibleToken.cdc` - This is a standard Flow smart contract that represents NFTs. We will use this to implement our custom NFT 3. `MetadataViews.cdc` - This contract is used to make our NFT interoperable. We will implement the metadata views specified in this contract so any Dapp can interact with our NFT! ## Basic NFT Setup Let’s start with a basic NFT 1. Let’s create a new file called `MyFunNFT.cdc` ```go import NonFungibleToken from "./NonFungibleToken.cdc" pub contract MyFunNFT: NonFungibleToken { pub event ContractInitialized() pub event Withdraw(id: UInt64, from: Address?) pub event Deposit(id: UInt64, to: Address?) pub event Minted(id: UInt64, editionID: UInt64, serialNumber: UInt64) pub event Burned(id: UInt64) pub let CollectionStoragePath: StoragePath pub let CollectionPublicPath: PublicPath pub let CollectionPrivatePath: PrivatePath /// The total number of NFTs that have been minted. /// pub var totalSupply: UInt64 pub resource NFT: NonFungibleToken.INFT { pub let id: UInt64 init( ) { self.id = self.uuid } destroy() { MyFunNFT.totalSupply = MyFunNFT.totalSupply - (1 as UInt64) emit Burned(id: self.id) } } pub resource interface MyFunNFTCollectionPublic { pub fun deposit(token: @NonFungibleToken.NFT) pub fun getIDs(): [UInt64] pub fun borrowNFT(id: UInt64): &NonFungibleToken.NFT pub fun borrowMyFunNFT(id: UInt64): &MyFunNFT.NFT? { post { (result == nil) || (result?.id == id): "Cannot borrow MyFunNFT reference: The ID of the returned reference is incorrect" } } } pub resource Collection: MyFunNFTCollectionPublic, NonFungibleToken.Provider, NonFungibleToken.Receiver, NonFungibleToken.CollectionPublic { /// A dictionary of all NFTs in this collection indexed by ID. /// pub var ownedNFTs: @{UInt64: NonFungibleToken.NFT} init () { self.ownedNFTs <- {} } /// Remove an NFT from the collection and move it to the caller. /// pub fun withdraw(withdrawID: UInt64): @NonFungibleToken.NFT { let token <- self.ownedNFTs.remove(key: withdrawID) ?? panic("Requested NFT to withdraw does not exist in this collection") emit Withdraw(id: token.id, from: self.owner?.address) return <- token } /// Deposit an NFT into this collection. /// pub fun deposit(token: @NonFungibleToken.NFT) { let token <- token as! @MyFunNFT.NFT let id: UInt64 = token.id // add the new token to the dictionary which removes the old one let oldToken <- self.ownedNFTs[id] <- token emit Deposit(id: id, to: self.owner?.address) destroy oldToken } /// Return an array of the NFT IDs in this collection. /// pub fun getIDs(): [UInt64] { return self.ownedNFTs.keys } /// Return a reference to an NFT in this collection. /// /// This function panics if the NFT does not exist in this collection. /// pub fun borrowNFT(id: UInt64): &NonFungibleToken.NFT { return (&self.ownedNFTs[id] as &NonFungibleToken.NFT?)! } /// Return a reference to an NFT in this collection /// typed as MyFunNFT.NFT. /// /// This function returns nil if the NFT does not exist in this collection. /// pub fun borrowMyFunNFT(id: UInt64): &MyFunNFT.NFT? { if self.ownedNFTs[id] != nil { let ref = (&self.ownedNFTs[id] as auth &NonFungibleToken.NFT?)! return ref as! &MyFunNFT.NFT } return nil } destroy() { destroy self.ownedNFTs } } pub fun mintNFT(): @MyFunNFT.NFT { let nft <- create MyFunNFT.NFT() MyFunNFT.totalSupply = MyFunNFT.totalSupply + (1 as UInt64) return <- nft } pub fun createEmptyCollection(): @NonFungibleToken.Collection { return <- create Collection() } init() { self.CollectionPublicPath = PublicPath(identifier: "MyFunNFT_Collection")! self.CollectionStoragePath = StoragePath(identifier: "MyFunNFT_Collection")! self.CollectionPrivatePath = PrivatePath(identifier: "MyFunNFT_Collection")! self.totalSupply = 0 emit ContractInitialized() } } ``` This code implements a fundamental flow of Non-Fungible Tokens (NFTs) by extending the NonFungibleToken.INFT resource and a basic collection through MyFunNFTCollectionPublic. The program includes essential events that can be emitted, global variables that determine the storage paths of NFTs in a user's account, and a public mint function to create NFTs. It is worth noting that public minting is typically reserved for distributing free NFTs, while minting for profit requires an admin or the integration of a payment mechanism within the function. Although this is commendable progress, the current NFT implementation lacks data. To remedy this, we can introduce customizable data fields for each NFT. For instance, in this use case, we aim to incorporate editions, each with a unique name, description, and serial number, much like the TopShot platform Firstly, we will introduce two global variables at the top of the code, alongside `totalSupply`: ```go pub var totalEditions: UInt64 access(self) let editions: {UInt64: Edition} ``` We need to update the init() function for this contract. Add ```go self.totalEditions = 0 self.editions = {} ``` Should look like this ```go init() { self.CollectionPublicPath = PublicPath(identifier: "MyFunNFT_Collection")! self.CollectionStoragePath = StoragePath(identifier: "MyFunNFT_Collection")! self.CollectionPrivatePath = PrivatePath(identifier: "MyFunNFT_Collection")! self.totalSupply = 0 self.totalEditions = 0 self.editions = {} emit ContractInitialized() } ``` These variables will facilitate monitoring the overall count of editions and accessing a specific edition through its assigned identifier. The `editions`dictionary will provide a means to extract particular information for each edition. Consequently, we will proceed to construct the `Edition`struct that we refer to within our `editions`object. ```go pub struct Edition { pub let id: UInt64 /// The number of NFTs minted in this edition. /// /// This field is incremented each time a new NFT is minted. /// pub var size: UInt64 /// The number of NFTs in this edition that have been burned. /// /// This field is incremented each time an NFT is burned. /// pub var burned: UInt64 pub fun supply(): UInt64 { return self.size - self.burned } /// The metadata for this edition. pub let metadata: Metadata init( id: UInt64, metadata: Metadata ) { self.id = id self.metadata = metadata self.size = 0 self.burned = 0 } /// Increment the size of this edition. /// access(contract) fun incrementSize() { self.size = self.size + (1 as UInt64) } /// Increment the burn count for this edition. /// access(contract) fun incrementBurned() { self.burned = self.burned + (1 as UInt64) } } ``` This is a fundamental struct that we will employ to represent "Editions" within this NFT. It retains an `id`, the `size`, the `burned` count, and a bespoke `Metadata`object defined below. Please include this struct in your code as well. ```go pub struct Metadata { pub let name: String pub let description: String init( name: String, description: String ) { self.name = name self.description = description } } ``` To maintain simplicity, the `Metadata`in this instance consists solely of a name and a description. However, if necessary, you may include more complex data within this object We will now proceed to modify the NFT resource to include additional fields that allow us to track which "edition" each NFT belongs to and its serial number. We will be storing this information in the NFT resource. Following are the steps to accomplish this: Add the following fields below `id` in the NFT resource: ```go pub let editionID: UInt64 pub let serialNumber: UInt64 ``` Update the `init()` function in the NFT resource: ```go init( editionID: UInt64, serialNumber: UInt64 ) { self.id = self.uuid self.editionID = editionID self.serialNumber = serialNumber } ``` Update the `mintNFT()` function to adhere to the new `init()` and the `Edition` struct: ```go pub fun mintNFT(editionID: UInt64): @MyFunNFT.NFT { let edition = MyFunNFT.editions[editionID] ?? panic("edition does not exist") // Increase the edition size by one edition.incrementSize() let nft <- create MyFunNFT.NFT(editionID: editionID, serialNumber: edition.size) emit Minted(id: nft.id, editionID: editionID, serialNumber: edition.size) // Save the updated edition MyFunNFT.editions[editionID] = edition MyFunNFT.totalSupply = MyFunNFT.totalSupply + (1 as UInt64) return <- nft } ``` The updated `mintNFT()`function now receives an edition ID for the NFT to be minted. It validates the ID and creates the NFT by incrementing the serial number. It then updates the global variables to reflect the new size and returns the new NFT. Excellent progress! We can now mint new NFTs for a specific edition. However, we need to enable the creation of new editions. To accomplish this, we will add function that allows anyone to create an edition (although in a real-world scenario, this would typically be a capability reserved for admin-level users). Please note that for the purposes of this example, we will make this function public. ```go pub fun createEdition( name: String, description: String, ): UInt64 { let metadata = Metadata( name: name, description: description, ) MyFunNFT.totalEditions = MyFunNFT.totalEditions + (1 as UInt64) let edition = Edition( id: MyFunNFT.totalEditions, metadata: metadata ) // Save the edition MyFunNFT.editions[edition.id] = edition emit EditionCreated(edition: edition) return edition.id } pub fun getEdition(id: UInt64): Edition? { return MyFunNFT.editions[id] } ``` followed by adding the getEdition helper method. Let’s also add the new event: ``` pub event ContractInitialized() pub event Withdraw(id: UInt64, from: Address?) pub event Deposit(id: UInt64, to: Address?) pub event Minted(id: UInt64, editionID: UInt64, serialNumber: UInt64) pub event Burned(id: UInt64) pub event EditionCreated(edition: Edition) ``` Your NFT should look something like this: ```go import NonFungibleToken from "./NonFungibleToken.cdc" pub contract MyFunNFT: NonFungibleToken { pub event ContractInitialized() pub event Withdraw(id: UInt64, from: Address?) pub event Deposit(id: UInt64, to: Address?) pub event Minted(id: UInt64, editionID: UInt64, serialNumber: UInt64) pub event Burned(id: UInt64) pub event EditionCreated(edition: Edition) pub let CollectionStoragePath: StoragePath pub let CollectionPublicPath: PublicPath pub let CollectionPrivatePath: PrivatePath /// The total number of NFTs that have been minted. /// pub var totalSupply: UInt64 pub var totalEditions: UInt64 access(self) let editions: {UInt64: Edition} pub struct Metadata { pub let name: String pub let description: String init( name: String, description: String ) { self.name = name self.description = description } } pub struct Edition { pub let id: UInt64 /// The number of NFTs minted in this edition. /// /// This field is incremented each time a new NFT is minted. /// pub var size: UInt64 /// The number of NFTs in this edition that have been burned. /// /// This field is incremented each time an NFT is burned. /// pub var burned: UInt64 pub fun supply(): UInt64 { return self.size - self.burned } /// The metadata for this edition. pub let metadata: Metadata init( id: UInt64, metadata: Metadata ) { self.id = id self.metadata = metadata self.size = 0 self.burned = 0 } /// Increment the size of this edition. /// access(contract) fun incrementSize() { self.size = self.size + (1 as UInt64) } /// Increment the burn count for this edition. /// access(contract) fun incrementBurned() { self.burned = self.burned + (1 as UInt64) } } pub resource NFT: NonFungibleToken.INFT { pub let id: UInt64 pub let editionID: UInt64 pub let serialNumber: UInt64 init( editionID: UInt64, serialNumber: UInt64 ) { self.id = self.uuid self.editionID = editionID self.serialNumber = serialNumber } destroy() { MyFunNFT.totalSupply = MyFunNFT.totalSupply - (1 as UInt64) emit Burned(id: self.id) } } pub resource interface MyFunNFTCollectionPublic { pub fun deposit(token: @NonFungibleToken.NFT) pub fun getIDs(): [UInt64] pub fun borrowNFT(id: UInt64): &NonFungibleToken.NFT pub fun borrowMyFunNFT(id: UInt64): &MyFunNFT.NFT? { post { (result == nil) || (result?.id == id): "Cannot borrow MyFunNFT reference: The ID of the returned reference is incorrect" } } } pub resource Collection: MyFunNFTCollectionPublic, NonFungibleToken.Provider, NonFungibleToken.Receiver, NonFungibleToken.CollectionPublic { /// A dictionary of all NFTs in this collection indexed by ID. /// pub var ownedNFTs: @{UInt64: NonFungibleToken.NFT} init () { self.ownedNFTs <- {} } /// Remove an NFT from the collection and move it to the caller. /// pub fun withdraw(withdrawID: UInt64): @NonFungibleToken.NFT { let token <- self.ownedNFTs.remove(key: withdrawID) ?? panic("Requested NFT to withdraw does not exist in this collection") emit Withdraw(id: token.id, from: self.owner?.address) return <- token } /// Deposit an NFT into this collection. /// pub fun deposit(token: @NonFungibleToken.NFT) { let token <- token as! @MyFunNFT.NFT let id: UInt64 = token.id // add the new token to the dictionary which removes the old one let oldToken <- self.ownedNFTs[id] <- token emit Deposit(id: id, to: self.owner?.address) destroy oldToken } /// Return an array of the NFT IDs in this collection. /// pub fun getIDs(): [UInt64] { return self.ownedNFTs.keys } /// Return a reference to an NFT in this collection. /// /// This function panics if the NFT does not exist in this collection. /// pub fun borrowNFT(id: UInt64): &NonFungibleToken.NFT { return (&self.ownedNFTs[id] as &NonFungibleToken.NFT?)! } /// Return a reference to an NFT in this collection /// typed as MyFunNFT.NFT. /// /// This function returns nil if the NFT does not exist in this collection. /// pub fun borrowMyFunNFT(id: UInt64): &MyFunNFT.NFT? { if self.ownedNFTs[id] != nil { let ref = (&self.ownedNFTs[id] as auth &NonFungibleToken.NFT?)! return ref as! &MyFunNFT.NFT } return nil } destroy() { destroy self.ownedNFTs } } pub fun createEdition( name: String, description: String, ): UInt64 { let metadata = Metadata( name: name, description: description, ) MyFunNFT.totalEditions = MyFunNFT.totalEditions + (1 as UInt64) let edition = Edition( id: MyFunNFT.totalEditions, metadata: metadata ) // Save the edition MyFunNFT.editions[edition.id] = edition emit EditionCreated(edition: edition) return edition.id } pub fun mintNFT(editionID: UInt64): @MyFunNFT.NFT { let edition = MyFunNFT.editions[editionID] ?? panic("edition does not exist") // Increase the edition size by one edition.incrementSize() let nft <- create MyFunNFT.NFT(editionID: editionID, serialNumber: edition.size) emit Minted(id: nft.id, editionID: editionID, serialNumber: edition.size) // Save the updated edition MyFunNFT.editions[editionID] = edition MyFunNFT.totalSupply = MyFunNFT.totalSupply + (1 as UInt64) return <- nft } pub fun createEmptyCollection(): @NonFungibleToken.Collection { return <- create Collection() } init() { self.CollectionPublicPath = PublicPath(identifier: "MyFunNFT_Collection")! self.CollectionStoragePath = StoragePath(identifier: "MyFunNFT_Collection")! self.CollectionPrivatePath = PrivatePath(identifier: "MyFunNFT_Collection")! self.totalSupply = 0 self.totalEditions = 0 self.editions = {} emit ContractInitialized() } } ``` ## Adding Transactions Now that we have the contract we need to create `transactions` that can be called to call the functions `createEdition` and `mintNFT`. These `transactions` can be called by any wallet since the methods are public on the contract. Create these in your `transactions` folder. 1. `createEdition.cdc` ``` import MyFunNFT from "../contracts/MyFunNFT.cdc" transaction( name: String, description: String, ) { prepare(signer: AuthAccount) { } execute { MyFunNFT.createEdition(name: name, description: description) } } ``` This transaction takes in a name and description and creates a new edition with it. 2. `mintNFT.cdc` ``` import MyFunNFT from "../contracts/MyFunNFT.cdc" import MetadataViews from "../contracts/MetadataViews.cdc" import NonFungibleToken from "../contracts/NonFungibleToken.cdc" transaction( editionID: UInt64, ) { let MyFunNFTCollection: &MyFunNFT.Collection{MyFunNFT.MyFunNFTCollectionPublic,NonFungibleToken.CollectionPublic,NonFungibleToken.Receiver,MetadataViews.ResolverCollection} prepare(signer: AuthAccount) { if signer.borrow<&MyFunNFT.Collection>(from: MyFunNFT.CollectionStoragePath) == nil { // Create a new empty collection let collection <- MyFunNFT.createEmptyCollection() // save it to the account signer.save(<-collection, to: MyFunNFT.CollectionStoragePath) // create a public capability for the collection signer.link<&{NonFungibleToken.CollectionPublic, MyFunNFT.MyFunNFTCollectionPublic, MetadataViews.ResolverCollection}>( MyFunNFT.CollectionPublicPath, target: MyFunNFT.CollectionStoragePath ) } self.MyFunNFTCollection = signer.borrow<&MyFunNFT.Collection{MyFunNFT.MyFunNFTCollectionPublic,NonFungibleToken.CollectionPublic,NonFungibleToken.Receiver,MetadataViews.ResolverCollection}>(from: MyFunNFT.CollectionStoragePath)! } execute { let item <- MyFunNFT.mintNFT(editionID: editionID) self.MyFunNFTCollection.deposit(token: <-item) } } ``` This transaction verifies whether a `MyFunNFT` collection exists for the user by checking the presence of a setup. If no such collection is found, the transaction sets it up. Subsequently, the transaction mints a new NFT and deposits it in the user's collection. ## Interoperability We have successfully implemented a simple Edition NFT and created transactions to create editions and mint NFTs. However, in order for other applications to build on top of or interface with our NFT, they would need to know that our NFT contains a `Metadata`object with a `name`and `description`field. Additionally, it is important to consider how each app would keep track of the individual metadata and its structure for each NFT, especially given that different developers may choose to implement metadata in entirely different ways. In Cadence, `MetadataViews`serve as a standardized way of accessing NFT metadata, regardless of the specific metadata implementation used in the NFT resource. By providing a consistent interface for accessing metadata, `MetadataViews`enable developers to build applications that can work with any NFT that uses a `MetadataViews`, regardless of how that metadata is structured. By using `MetadataViews`, we can facilitate interoperability between different applications and services that use NFTs, and ensure that the metadata associated with our NFTs can be easily accessed and used by other developers. Now let’s unlock interoperability for our NFT… Let’s start off by importing the MetadataViews contract to the top `import MetadataViews from "./MetadataViews.cdc”` Now we need to have our NFT resource extend the `MetadataViews.Resolver` interface. `pub resource NFT: NonFungibleToken.INFT, MetadataViews.Resolver` Now we must implement `getViews` and `resolveView`. The function `getViews` tells anyone which views this NFT supports and `resolveView` takes in a view type and returns the view itself. Some common views are: _ExternalURL_ - A website / link for an NFT _NFT Collection Data_ - Data on how to setup this NFT collection in a users account _Display View_ - How to display this NFT on a website _Royalties View_ - Any royalties that should be adhered to for a marketplace transaction _NFT Collection Display View_ - How to display the NFT collection on a website Let’s add the following `getViews` implementation to our `NFT` resource. ```go pub fun getViews(): [Type] { let views = [ Type<MetadataViews.Display>(), Type<MetadataViews.ExternalURL>(), Type<MetadataViews.NFTCollectionDisplay>(), Type<MetadataViews.NFTCollectionData>(), Type<MetadataViews.Royalties>(), Type<MetadataViews.Edition>(), Type<MetadataViews.Serial>() ] return views } ``` These function helps inform what specific views this NFT supports. In the same NFT resource add the following method: ```go pub fun resolveView(_ view: Type): AnyStruct? { let edition = self.getEdition() switch view { case Type<MetadataViews.Display>(): return self.resolveDisplay(edition.metadata) case Type<MetadataViews.ExternalURL>(): return self.resolveExternalURL() case Type<MetadataViews.NFTCollectionDisplay>(): return self.resolveNFTCollectionDisplay() case Type<MetadataViews.NFTCollectionData>(): return self.resolveNFTCollectionData() case Type<MetadataViews.Royalties>(): return self.resolveRoyalties() case Type<MetadataViews.Edition>(): return self.resolveEditionView(serialNumber: self.serialNumber, size: edition.size) case Type<MetadataViews.Serial>(): return self.resolveSerialView(serialNumber: self.serialNumber) } return nil } ``` Now lets go over each individual helper function that you should add to your NFT resource ```go pub fun resolveDisplay(_ metadata: Metadata): MetadataViews.Display { return MetadataViews.Display( name: metadata.name, description: metadata.description, thumbnail: MetadataViews.HTTPFile(url: "https://upload.wikimedia.org/wikipedia/commons/thumb/e/ec/Mona_Lisa%2C_by_Leonardo_da_Vinci%2C_from_C2RMF_retouched.jpg/1200px-Mona_Lisa%2C_by_Leonardo_da_Vinci%2C_from_C2RMF_retouched.jpg"), ) } ``` 1\. This creates a display view and takes in the edition data to populate the name and description. I included a dummy image but you would want to include a unique thumbnail ```go pub fun resolveExternalURL(): MetadataViews.ExternalURL { let collectionURL = "www.flow-nft-catalog.com" return MetadataViews.ExternalURL(collectionURL) } ``` 2\. This is a link for the NFT. I’m putting in a placeholder site for now but this would be something for a specific NFT not an entire collection. So something like www.collection_site/nft_id ```go pub fun resolveNFTCollectionDisplay(): MetadataViews.NFTCollectionDisplay { let media = MetadataViews.Media( file: MetadataViews.HTTPFile(url: "https://assets-global.website-files.com/5f734f4dbd95382f4fdfa0ea/63ce603ae36f46f6bb67e51e_flow-logo.svg"), mediaType: "image" ) return MetadataViews.NFTCollectionDisplay( name: "MyFunNFT", description: "The open interopable NFT", externalURL: MetadataViews.ExternalURL("www.flow-nft-catalog.com"), squareImage: media, bannerImage: media, socials: {} ) } ``` 3\. This is a view that indicates to apps on how to display information about the collection. The externalURL here would be the website for the entire collection. I have linked a temporary flow image but you could many image you want here. ```go pub fun resolveNFTCollectionData(): MetadataViews.NFTCollectionData { return MetadataViews.NFTCollectionData( storagePath: MyFunNFT.CollectionStoragePath, publicPath: MyFunNFT.CollectionPublicPath, providerPath: MyFunNFT.CollectionPrivatePath, publicCollection: Type<&MyFunNFT.Collection{MyFunNFT.MyFunNFTCollectionPublic}>(), publicLinkedType: Type<&MyFunNFT.Collection{MyFunNFT.MyFunNFTCollectionPublic, NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, MetadataViews.ResolverCollection}>(), providerLinkedType: Type<&MyFunNFT.Collection{MyFunNFT.MyFunNFTCollectionPublic, NonFungibleToken.CollectionPublic, NonFungibleToken.Provider, MetadataViews.ResolverCollection}>(), createEmptyCollectionFunction: (fun (): @NonFungibleToken.Collection { return <-MyFunNFT.createEmptyCollection() }) ) } ``` 4\. This is a view that allows any Flow Dapps to have the information needed to setup a collection in any users account to support this NFT. ```go pub fun resolveRoyalties(): MetadataViews.Royalties { return MetadataViews.Royalties([]) } ``` 5\. For now we will skip Royalties but here you can specify which addresses should receive royalties and how much. ```go pub fun resolveEditionView(serialNumber: UInt64, size: UInt64): MetadataViews.Edition { return MetadataViews.Edition( name: "Edition", number: serialNumber, max: size ) } pub fun resolveSerialView(serialNumber: UInt64): MetadataViews.Serial { return MetadataViews.Serial(serialNumber) } ``` 6\. These are some extra views we can support since this NFT has editions and serial numbers. Not all NFTs need to support this but it’s nice to have for our case. Lastly we need our `Collection` resource to support `MetadataViews.ResolverCollection` ```go pub resource Collection: MyFunNFTCollectionPublic, NonFungibleToken.Provider, NonFungibleToken.Receiver, NonFungibleToken.CollectionPublic, MetadataViews.ResolverCollection ``` You should see an error that you need to implement `borrowViewResolver`. This is a method a Dapp can use on the collection to borrow an NFT that inherits to the `MetadataViews.Resolver` interface so that `resolveView` that we implemented earlier can be called. ```go pub fun borrowViewResolver(id: UInt64): &AnyResource{MetadataViews.Resolver} { let nft = (&self.ownedNFTs[id] as auth &NonFungibleToken.NFT?)! let nftRef = nft as! &MyFunNFT.NFT return nftRef as &AnyResource{MetadataViews.Resolver} } ``` Now your NFT is interoperable! Your final NFT contract should look something like [this](https://github.com/bshahid331/my-nft-project/blob/main/cadence/contracts/MyFunNFT.cdc). # Deploying the Project ## Creating a sample testnet account We will need an account to deploy the contract with. To set one up visit: [https://testnet-faucet.onflow.org/](https://testnet-faucet.onflow.org/). Run `flow keys generate` and paste your public key on the site. Keep your private key handy for the future. I just created the account `0x503b9841a6e501eb` on `testnet`. ## Configuration Deploying this on `testnet` is simple. We need to populate our config file with the relevant contracts and there addresses as well as where we want to deploy any new contracts. Copy and replace your `flow.json` with the following: ```json { "contracts": { "NonFungibleToken": { "source": "./cadence/contracts/NonFungibleToken.cdc", "aliases": { "testnet": "0x631e88ae7f1d7c20", "mainnet": "0x1d7e57aa55817448" } }, "MetadataViews": { "source": "./cadence/contracts/MetadataViews.cdc", "aliases": { "testnet": "0x631e88ae7f1d7c20", "mainnet": "0x1d7e57aa55817448" } }, "FungibleToken": { "source": "./cadence/contracts/FungibleToken.cdc", "aliases": { "emulator": "0xee82856bf20e2aa6", "testnet": "0x9a0766d93b6608b7", "mainnet": "0xf233dcee88fe0abe" } }, "MyFunNFT": "./cadence/contracts/MyFunNFT.cdc" }, "networks": { "emulator": "127.0.0.1:3569", "mainnet": "access.mainnet.nodes.onflow.org:9000", "testnet": "access.devnet.nodes.onflow.org:9000" }, "accounts": { "emulator-account": { "address": "f8d6e0586b0a20c7", "key": "6d12eebfef9866c9b6fa92b97c6e705c26a1785b1e7944da701fc545a51d4673" }, "testnet-account": { "address": "0x503b9841a6e501eb", "key": "$MYFUNNFT_TESTNET_PRIVATEKEY" } }, "deployments": { "emulator": { "emulator-account": [ "NonFungibleToken", "MetadataViews", "MyFunNFT" ] }, "testnet": { "testnet-account": ["MyFunNFT"] } } } ``` This is a file that is meant to be pushed so we don’t want to expose our private keys. Luckily we can reference environment variables so use the following command to update the `"$MYFUNNFT_TESTNET_PRIVATEKEY"` environment variable with your newly created private key. `export MYFUNNFT_TESTNET_PRIVATEKEY=<YOUR_PRIVATE_KEY_HERE>` This is telling Flow where to find the contracts NonFungibleToken, MetadataViews, FungibleToken. For `MyFunNFT` it’s specifying where to deploy it, being `testnet-account`. Run `flow project deploy --network=testnet` and your contract should be deployed on `testnet`! You can see mine here: [https://flow-view-source.com/testnet/account/0x503b9841a6e501eb/contract/MyFunNFT](https://flow-view-source.com/testnet/account/0x503b9841a6e501eb/contract/MyFunNFT). ## Creating and minting an NFT Let’s mint an NFT to an account. We will run the transactions from before. I’m using my `testnet` blocto wallet with the address: `0xf5e9719fa6bba61a`. The newly minted NFT will go into this account. Check out these links to see what I ran. [Edition Creation](https://runflow.pratikpatel.io?code=aW1wb3J0IE15RnVuTkZUIGZyb20gMHg1MDNiOTg0MWE2ZTUwMWViCgp0cmFuc2FjdGlvbigKICAgIG5hbWU6IFN0cmluZywKICAgIGRlc2NyaXB0aW9uOiBTdHJpbmcsCikgewoKICAgIHByZXBhcmUoc2lnbmVyOiBBdXRoQWNjb3VudCkgewogICAgfQoKICAgIGV4ZWN1dGUgeyAgICAgICAgCiAgICAgICAgTXlGdW5ORlQuY3JlYXRlRWRpdGlvbihuYW1lOiBuYW1lLCBkZXNjcmlwdGlvbjogZGVzY3JpcHRpb24pCiAgICB9Cn0%3D&network=testnet&args=eyJuYW1lIjoiVGhlIEZpcnN0IEVkaXRpb24iLCJkZXNjcmlwdGlvbiI6IlRoaXMgaXMgdGhlIGZpcnN0IGVkaXRpb24gc28gaXQncyB0aGUgYmVzdC4ifQ%3D%3D) [Minting an NFT](https://runflow.pratikpatel.io?code=aW1wb3J0IE15RnVuTkZUIGZyb20gMHg1MDNiOTg0MWE2ZTUwMWViCmltcG9ydCBNZXRhZGF0YVZpZXdzIGZyb20gMHg2MzFlODhhZTdmMWQ3YzIwCmltcG9ydCBOb25GdW5naWJsZVRva2VuIGZyb20gMHg2MzFlODhhZTdmMWQ3YzIwCgp0cmFuc2FjdGlvbigKICAgIGVkaXRpb25JRDogVUludDY0LAopIHsKICAgIGxldCBNeUZ1bk5GVENvbGxlY3Rpb246ICZNeUZ1bk5GVC5Db2xsZWN0aW9ue015RnVuTkZULk15RnVuTkZUQ29sbGVjdGlvblB1YmxpYyxOb25GdW5naWJsZVRva2VuLkNvbGxlY3Rpb25QdWJsaWMsTm9uRnVuZ2libGVUb2tlbi5SZWNlaXZlcixNZXRhZGF0YVZpZXdzLlJlc29sdmVyQ29sbGVjdGlvbn0KCiAgICBwcmVwYXJlKHNpZ25lcjogQXV0aEFjY291bnQpIHsKICAgICAgICBpZiBzaWduZXIuYm9ycm93PCZNeUZ1bk5GVC5Db2xsZWN0aW9uPihmcm9tOiBNeUZ1bk5GVC5Db2xsZWN0aW9uU3RvcmFnZVBhdGgpID09IG5pbCB7CiAgICAgICAgICAgIC8vIENyZWF0ZSBhIG5ldyBlbXB0eSBjb2xsZWN0aW9uCiAgICAgICAgICAgIGxldCBjb2xsZWN0aW9uIDwtIE15RnVuTkZULmNyZWF0ZUVtcHR5Q29sbGVjdGlvbigpCgogICAgICAgICAgICAvLyBzYXZlIGl0IHRvIHRoZSBhY2NvdW50CiAgICAgICAgICAgIHNpZ25lci5zYXZlKDwtY29sbGVjdGlvbiwgdG86IE15RnVuTkZULkNvbGxlY3Rpb25TdG9yYWdlUGF0aCkKCiAgICAgICAgICAgIC8vIGNyZWF0ZSBhIHB1YmxpYyBjYXBhYmlsaXR5IGZvciB0aGUgY29sbGVjdGlvbgogICAgICAgICAgICBzaWduZXIubGluazwme05vbkZ1bmdpYmxlVG9rZW4uQ29sbGVjdGlvblB1YmxpYywgTXlGdW5ORlQuTXlGdW5ORlRDb2xsZWN0aW9uUHVibGljLCBNZXRhZGF0YVZpZXdzLlJlc29sdmVyQ29sbGVjdGlvbn0%2BKAogICAgICAgICAgICAgICAgTXlGdW5ORlQuQ29sbGVjdGlvblB1YmxpY1BhdGgsCiAgICAgICAgICAgICAgICB0YXJnZXQ6IE15RnVuTkZULkNvbGxlY3Rpb25TdG9yYWdlUGF0aAogICAgICAgICAgICApCiAgICAgICAgfQogICAgICAgIHNlbGYuTXlGdW5ORlRDb2xsZWN0aW9uID0gc2lnbmVyLmJvcnJvdzwmTXlGdW5ORlQuQ29sbGVjdGlvbntNeUZ1bk5GVC5NeUZ1bk5GVENvbGxlY3Rpb25QdWJsaWMsTm9uRnVuZ2libGVUb2tlbi5Db2xsZWN0aW9uUHVibGljLE5vbkZ1bmdpYmxlVG9rZW4uUmVjZWl2ZXIsTWV0YWRhdGFWaWV3cy5SZXNvbHZlckNvbGxlY3Rpb259Pihmcm9tOiBNeUZ1bk5GVC5Db2xsZWN0aW9uU3RvcmFnZVBhdGgpIQogICAgfQoKICAgIGV4ZWN1dGUgeyAgICAgICAgCiAgICAgICAgbGV0IGl0ZW0gPC0gTXlGdW5ORlQubWludE5GVChlZGl0aW9uSUQ6IGVkaXRpb25JRCkKICAgICAgICBzZWxmLk15RnVuTkZUQ29sbGVjdGlvbi5kZXBvc2l0KHRva2VuOiA8LWl0ZW0pCiAgICB9Cn0%3D&network=testnet&args=eyJlZGl0aW9uSUQiOjF9) ## Adding the NFT collection to the Catalog Now that we have minted some NFTs into an account and made our NFT interoperable let’s add it to the NFT catalog. What is the Flow NFT Catalog? The Flow NFT Catalog is a repository of NFT’s on Flow that adhere to the Metadata standard and implement at least the core views. The core views being _External URL_ _NFT Collection Data_ _NFT Collection Display_ _Display_ _Royalties_ When proposing an NFT to the catalog, it will make sure you have implemented these views correctly. Once added your NFT will easily be discoverable and other ecosystem developers can feel confident that your NFT has implemented the core views and build on top of your NFT using the Metadata views we implemented earlier! Now go to [www.flow-nft-catalog.com](http://www.flow-nft-catalog.com) and click “Add NFT Collection” 1\. It starts off by asking for the NFT contract. This is where the contract is deployed so what is in your flow.json and what we created via the faucet. <img width="1509" alt="step-1" src="https://raw.githubusercontent.com/bshahid331/my-nft-project/skeleton/content/step-1.png" /> 2\. Now we need to enter the storage path. In our NFT it is `/storage/MyFunNFT_Collection` as well as an account that holds the NFT. This is `0xf5e9719fa6bba61a` for me. <img width="1509" alt="step-2" src="https://raw.githubusercontent.com/bshahid331/my-nft-project/skeleton/content/step-2.png" /> 3\. Now you should screen that verifies that you have implemented the “core” nft views correctly and you can also see the actual data being returned from the chain. <img width="1509" alt="step-3" src="https://raw.githubusercontent.com/bshahid331/my-nft-project/skeleton/content/step-3.png" /> In the last step you can submit your collection to the NFT catalog and voila, you have created an NFT on Flow that can easily be discovered and supported on any Dapp in the Flow ecosystem! # Conclusion In this tutorial, we created a basic NFT that supports multiple editions and unlimited serials. Each edition has a name and description and each NFT has a unique serial belonging to a specific Edition. We then made our NFT interoperable by implementing MetadataViews. We minted an NFT and added our NFT collection to the catalog so it’s easily discoverable and ready to be built on top of! Final version of the [code](https://github.com/bshahid331/my-nft-project/blob/main/cadence/contracts/MyFunNFT.cdc).
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
# Composability Chronicles #2: How to build a new experience on top of NFTs with Flowcase ## Introduction Composability is one of the key concepts behind the Flow blockchain. It allows developers to create new experiences by building on top of existing contracts and NFTs. With composability, developers can leverage the full power of the Flow network to create innovative and engaging experiences. In this guide, we will walk through the process of building a composable app called `Flowcase`. Flowcase will be will be an app that allows users to make showcases for any of their NFT collections on Flow, and store them on-chain for anyone to view. This is similar to NBATopShot showcases, with the added benefit that these showcases will let you select NFTs from any Flow collection, and all of the data of what you want to show will be available on-chain without any backend needed. This type of app which does not require hosting a backend of your own is sometimes referred to as a Serverless On-chain Distributed Applications (SODA), where we can take full advantage of Flow’s capabilities along with the composability afforded to us by Flow’s NFT design. We will cover setting up the development environment, writing the contracts and building the front-end. By the end of this guide, you will have a solid understanding of how to build a composable app on Flow and what is required to make an application that can make use of NFTs that already exist on flow. This guide will assume that you have a beginner level understanding of cadence and a beginner level understanding of front-end development. It is suggested that you first go through the following guide on how to create a basic, composable NFT before going continuing with this guide, because a lot of the same concepts are used. All of the resulting code from this guide is available [here](https://github.com/aishairzay/Flow-Serverless-React-Boilerplate/tree/flowcase). ## Getting Started Before we begin building our composable app, we need to set up the development environment. 1. Download and install NodeJS (version 16.15.0) using the instructions [here](https://nodejs.dev/en/download/). 2. Download and install the Flow CLI, a command-line tool used to interact with the Flow blockchain. You can find the instructions for installing it [here](https://developers.flow.com/tools/flow-cli/install). 3. Using git, clone the [https://github.com/aishairzay/Flow-Serverless-React-Boilerplate](https://github.com/aishairzay/Flow-Serverless-React-Boilerplate) repository as a starting point. 4. Navigate to the newly created `Flow-Serverless-React-Boilerplate` folder with `cd Flow-Serverless-React-Boilerplate` or open the folder with a text editor of your choice (i.e. VSCode). The `Flow-Serverless-React-Boilerplate` will create a new starter project which will provide us with all the necessary boilerplate to build a Flow app without needing a backend. The folder structure is organized as follows: - `/flow.json` - Configuration file to help manage local, testnet, and mainnet Flow deployments of contracts from the `/cadence` folder. - `/cadence` - `/contracts` - Smart contracts that can be deployed to the Flow blockchain. - `/transactions` - Transactions that can perform changes to data on the Flow blockchain. - `/scripts` - Scripts that can provide read-only access to data on the Flow blockchain. - `/web` - A simple create-react-app that is integrated with the `Flow Client Library` (FCL) to allow a user to log in with their Flow account and execute scripts and transactions from the aforementioned transactions and scripts folders. Once you have installed and configured these tools, you are ready to start building your composable app on Flow. The next step is to write the contracts that will serve as the foundation for the app. ## Cadence Development In this section, we will walk through the process of creating a Cadence contract for a showcase, and how to interact with that contract using transactions and scripts. ### Contract Creation The next step in building our composable app is to write a new contract for `Flowcase`. This contract will serve as the foundation for the app and provide a way for users to create and interact with our new NFT showcases. 1. The Flowcase contract In the `flowcase/cadence/contracts` folder, create a new empty File named `flowcase.cdc`. Fill in the contract with the following to start: ```go import NonFungibleToken from "./NonFungibleToken.cdc" public contract Flowcase { /* Initialization */ init() {} /* Structs and Resources */ } ``` Our showcase will serve as a read-only grouping of NFTs stored in a user’s Flow account. Since we don’t plan to move around the actual NFTs in our showcase, we can use a struct to represent our `Showcase` data store, and hold a list of `NFTPointer` structs to reference to where in the account the showcase NFTs exist. Below the comment that says `Structs and Resources`, we can implement our `Showcase` and `NFTPointer` like the following: ```go pub struct NFTPointer { pub let id: UInt64 pub let collection: Capability<&{NonFungibleToken.CollectionPublic}> init(id: UInt64, collection: Capability<&{NonFungibleToken.CollectionPublic}>) { self.id = id self.collection = collection } } pub struct Showcase { pub let name: String priv let nfts: [NFTPointer] init(name: String, nfts: [NFTPointer]) { self.name = name self.nfts = nfts } pub fun getNFTs(): [NFTPointer] { return self.nfts } } ``` The `NFTPointer` struct consists of two fields. The `collection` field is a capability that points to a user's public NFT collection, while the `id` field represents the specific NFT ID within that collection. The `Showcase` struct includes a name and description for display purposes, as well as a list of `NFTPointer` structs to represent the NFTs in the showcase. However, since we can't store structs directly on a Flow account, we'll need to create a `resource` called `ShowcaseCollection` to manage and store the `Showcase` structs. This resource will be responsible for handling the creation and deletion of showcases, as well as adding and removing NFTs from them. After defining the `Showcase` struct, we can create a resource named `ShowcaseCollection` that manages and stores the showcases in a user's account. The `ShowcaseCollection` resource has a similar implementation to an NFT collection resource, but there are some differences to note: - The type for showcases in this collection is `{String: Showcase}`, which means that we use the showcase's name as a key to ensure uniqueness within a single showcase collection. Unlike NFT collections, we don't need to use the `@` notation to store the data because our `Showcase` struct is not a resource. - Instead of `deposit` and `withdraw` functions, we have `addShowcase` and `removeShowcase` functions to modify the showcases stored in the collection. - We use a `ShowcaseCollectionPublic` resource interface to expose public capabilities that allow others to view the details of the showcases. Here is the code for the `ShowcaseCollection` resource: ```go pub event ShowcaseAdded(name: String, to: Address?) pub event ShowcaseRemoved(name: String) pub resource interface ShowcaseCollectionPublic { pub fun getShowcases(): {String: Showcase} pub fun getShowcase(name: String): Showcase? } pub resource ShowcaseCollection: ShowcaseCollectionPublic { pub let showcases: {String: Showcase} init() { self.showcases = {} } pub fun addShowcase(name: String, nfts: [NFTPointer]) { emit ShowcaseAdded(name: name, to: self.owner?.address) self.showcases[name] = Showcase(name: name, nfts: nfts) } pub fun removeShowcase(name: String) { self.showcases.remove(key: name) } pub fun getShowcases(): {String: Showcase} { return self.showcases } pub fun getShowcase(name: String): Showcase? { return self.showcases[name] } } pub fun createShowcaseCollection(): @ShowcaseCollection { return <-create ShowcaseCollection() } ``` With the `Showcase`struct and `ShowcaseCollection` resource, we now have everything we need to create and store showcases in a Flow account. ### Flowcase Transactions Add Showcase To allow any user to create a new showcase, create a new file in the `cadence/transactions` folder named `createShowcase.cdc` and fill it in with the following: ```go import NonFungibleToken from 0xNONFUNGIBLETOKEN import Flowcase from 0xFLOWCASE transaction(showcaseName: String, publicPaths: [PublicPath], nftIDs: [UInt64]) { let showcaseCollection: &Flowcase.ShowcaseCollection let showcaseAccount: PublicAccount prepare(signer: AuthAccount) { /* Initialization code goes here */ } execute { /* Execution code goes here */ } } ``` This transaction allows any user to create a new showcase, which can store NFTs from different collections. To enable this, we're importing two contracts: the `NonFungibleToken` contract that we'll use to interact with NFTs, and our own `Flowcase` contract that we'll use to create and store showcases. The `createShowcase` transaction takes three arguments: - `showcaseName`: a unique label for the new showcase. - `publicPaths`: an array of `PublicPath` objects representing the NFT collection paths where the NFTs that will be added to the showcase are stored. - `nftIDs`: an array of UInt64 values representing the IDs of the NFTs that will be added to the showcase. In the `prepare` statement, the `signer` AuthAccount is available as a parameter. This means the transaction expects a single user to sign it, and whoever signs the transaction will be providing the account where the new showcase will be stored. To initialize data for the prepare statement, we can replace the `/* Initialization code goes here */` code with the following: ```go // Initialize data for the prepare statement if signer.borrow<&Flowcase.ShowcaseCollection>(from: /storage/flowcaseCollection) == nil { // If the showcase collection does not exist for this account, create a new one let collection <- Flowcase.createShowcaseCollection() signer.save(<-collection, to: /storage/flowcaseCollection) } // Expose the showcase collection publicly so it can be queried signer.link<&{Flowcase.ShowcaseCollectionPublic}>(/public/flowcaseCollection, target: /storage/flowcaseCollection) // Borrow a reference to the showcase collection self.showcaseCollection = signer.borrow<&Flowcase.ShowcaseCollection>(from: /storage/flowcaseCollection) ?? panic("Could not borrow a reference to the Flowcase ShowcaseCollection") // Get the signer's account self.showcaseAccount = getAccount(signer.address) ``` In the prepare statement, we first check if the `showcaseCollection` exists for the signer's account, and if it doesn't, we create a new one. The `createShowcaseCollection` function is a custom function defined in the `Flowcase` contract that creates a new `ShowcaseCollection` resource. We then save this new `ShowcaseCollection` resource to the signer's account storage. Next, we expose the `ShowcaseCollectionPublic` interface publicly so that anyone can query the showcase collection using the account's public address. After that, we borrow a reference to the `ShowcaseCollection` resource from storage so that we can add new showcases to it. Finally, we get the `showcaseAccount` of the signer, which is the account that will be used to store the new showcase. Overall, this code is responsible for setting up the `showcaseCollection` and `showcaseAccount` for the transaction, and exposing the necessary functionality so that the transaction can create new showcases. For the `/* Execution here */` block, we can replace it with the following: ```go // initialize an array to hold the NFTs that will be included in the showcase var showcaseNFTs: [Flowcase.NFTPointer] = [] // iterate over the list of public paths and corresponding NFT IDs var i = 0 while (i < publicPaths.length) { let publicPath = publicPaths[i] let nftID = nftIDs[i] // Add a new NFTPointer struct to the array of NFTs showcaseNFTs.append(Flowcase.NFTPointer(id: nftID, collection: self.showcaseAccount.getCapability<&{NonFungibleToken.CollectionPublic}>(publicPath))) i = i + 1 } self.showcaseCollection.addShowcase(name: showcaseName, nfts: showcaseNFTs) ``` In this section, we initialize an empty array called `showcaseNFTs`, which will hold the `NFTPointer`structs that make up the showcase's NFTs. Then we iterate over the `publicPaths` and `nftIDs`parameters to create new `NFTPointer`structs for each NFT to be added to the showcase. Finally, we call the `addShowcase`function on the `showcaseCollection`to create the new showcase and add the NFTs to it. Remove Showcase To remove a showcase, we can create a new transaction in the `cadence/transactions` folder named `removeShowcase.cdc`. This transaction can be filled in with the following code: ```go import Flowcase from 0xFLOWCASE transaction(showcaseName: String) { let flowcase: &Flowcase.ShowcaseCollection prepare(signer: AuthAccount) { // Get a reference to the signed account's stored showcase collection self.flowcase = signer.borrow<&Flowcase.ShowcaseCollection>(from: /storage/flowcaseCollection) ?? panic("Could not borrow a reference to the Flowcase") } execute { // Call removeShowcase on the stored showcase collection reference self.flowcase.removeShowcase(name: showcaseName) } } ``` In this script, we accept a `showcaseName`parameter as input. We get a reference to the signed account's stored `Flowcase.ShowcaseCollection` in the `prepare`block. In the `execute` block, we call the `removeShowcase` function on the stored `showcaseCollectionRef` using the inputted `showcaseName`. This will remove the showcase with the inputted name from the stored `Flowcase.ShowcaseCollection`. ### Flowcase scripts Get Showcases Script In the `cadence/scripts` folder, create a new file called `getShowcases.cdc` We can use the following code to fill in `getShowcases.cdc` in order to retrieve showcase information from an account: ```go import NonFungibleToken from 0xNONFUNGIBLETOKENADDRESS import MetadataViews from 0xMETADATAVIEWSADDRESS import Flowcase from 0xFLOWCASEADDRESS pub fun main(address: Address): {String: [AnyStruct]}? { let account = getAccount(address) var nfts: [AnyStruct] = [] let flowcaseCap = account.getCapability<&{Flowcase.ShowcaseCollectionPublic}>(/public/flowcaseCollection) .borrow() if flowcaseCap != nil { let showcases = flowcaseCap!.getShowcases() let allShowcases: {String: [AnyStruct]} = {} for showcaseName in showcases.keys { let nfts: [AnyStruct] = [] let showcase = showcases[showcaseName]! let nftCaps = showcase.getNFTs() for nftPointer in nftCaps { let borrowedNFT = nftPointer.collection.borrow()!.borrowNFT(id: nftPointer.id) let displayView = borrowedNFT.resolveView(Type<MetadataViews.Display>()) let nftView: AnyStruct = { "nftID": borrowedNFT.id, "display": displayView, "type": borrowedNFT.getType().identifier } nfts.append(nftView) } allShowcases[showcaseName] = nfts } return allShowcases } return {} } ``` This script takes in an account address and will retrieve the public ShowcaseCollection we had initialized earlier in the createShowcase transaction. If it doesn’t exist in the passed in account, the script will simply return an empty map, indicating an empty showcase collection. If there is a showcase, the script will navigate into the showcase, extract all of the NFTs from it, and try to get the details of the contained NFTs with the following: `let borrowedNFT = nftPointer.collection.borrow()!.borrowNFT(id: nftPointer.id)` The script then aggregates all of the results in a dictionary data store to create a structure that looks like the following: ```go { "My Showcase's Name!": [ { "nftID": 1234, "display": { "title": "NFT's display title will show here" "thumbnail": { "url": "URL to NFT's image here" } }, "type": "A.41231234.MyFunNFT.NFT" }, ... ] ``` Here, `nftID` represents the ID of the NFT, `display` is a struct with the NFT’s display information (title and thumbnail), and `type` represents the NFT's type. ### Flow Configuration In the root directory of the project, you will find a file called `flow.json`. This file provides configurations that tell the flow CLI and other programs how to find the contracts you’ve created and how they should be deployed. To add the `Flowcase`contract that we created earlier, we need to update the `contracts` section of `flow.json`. You can do this by adding the following configuration: ```go { "contracts": { "Flowcase": { "source": "cadence/contracts/Flowcase.cdc", "aliases": { "testnet": "0xad34354eb0c6ab2a" } }, "MyFunNFT": ... }, ... } ``` Here, we define `Flowcase` as a smart contract and specify that its source code is located in `cadence/contracts/Flowcase.cdc`. Additionally, we define an `alias` for `Flowcase`, which is an optional configuration that tells the Flow CLI and other programs to use a specific address for the contract when deploying or interacting with it. In this case, we're using the address `0xad34354eb0c6ab2a` for the `testnet` environment. If you're using a different network or want to deploy the `Flowcase` contract to a different address, you'll need to update this configuration accordingly. With this configuration in place, the Flow CLI and other programs will be able to find and interact with the `Flowcase` contract that we created. ## Front-End Development Now that we have all of the necessary contracts, transactions, and scripts in place, we can begin building a front-end application. The starter template provides a basic React application in the `web` folder. To get started with adding showcases to the front-end, navigate to the `web` folder with the command `cd web` and install the required dependencies using `npm install`. Once the installation is complete, run `npm start` to start a local server hosting the front-end. This should start a web server running on `localhost:3000`. Open a web browser and go to [http://localhost:3000](http://localhost:3000/) to view the front-end that we will be working on. In the starter template, the React app is set up to point to the testnet and allows you to connect a testnet Flow wallet. Click on "Connect Wallet" to connect a wallet of your choice. For example, you can use Blocto for a first-time use. After you have connected your wallet, you will see a button that allows you to mint a new NFT. Click the button and follow the steps to mint a new NFT. Repeat this step at least twice to create multiple NFTs in your account, which will be useful when we create showcases. After running the transactions to mint NFTs, you can refresh the page to see your new NFTs listed under the `My NFTs` header. All of the code that powers this page can be found in the `App` component located in `web/src/App.js`. ### Creating a new showcase Let's modify the `App.js` file to support creating a new showcase using the NFTs that are minted in the current wallet. First, replace the following import at the top of the `App.js` file: ```go import { getNFTsFromAccount } from './cadut/scripts'; import { mintNFT } from './cadut/transactions'; ``` with the following: ```jsx import { mintNFT, createShowcase } from './cadut/transactions'; ``` This will import our previously created `createShowcase` transaction from the `cadut` folder to the React app. The template that we are using will automatically copy over the transactions and scripts we created earlier into the `cadut` folder using the open source `[flow-cadut](https://github.com/onflow/flow-cadut)` module. To create our showcase, we need to provide three parameters to `createShowcase`, which are: ```go transaction(showcaseName: String, publicPaths: [PublicPath], nftIDs: [UInt64]) ``` We need to get a name for the new showcase from the user and allow them to select one or many of their owned NFTs to provide values for `publicPaths` and `nftIDs`. Here are the steps to create a new showcase: 1. First, we need to add a state to hold the showcase name. We can create an initial state for showcase name at the top of our `App` function: ```jsx function App() { const [showcaseName, setShowcaseName] = useState(""); // ... } ``` 2. Next, we need to modify the `myNFTs` array to include a `selected` field that we will use to allow the user to select which NFTs they want to include in the showcase. To do this, we can modify the `setMyNFTs` call in the `useEffect` hook to include the `selected` field: ```jsx setMyNFTs(myNFTs[0].map(nft => ({ ...nft, selected: false }))); ``` This initializes all NFTs in `myNFTs` with a `selected` field set to `false`. 3. We now need to add a checkbox for each NFT that allows the user to select which NFTs they want to include in the showcase. To do this, we can modify the code that renders the NFTs: ```jsx myNFTs.map((curNFT, i) => { return <div key={i}> <h4 style={{ marginBottom: "2px" }}>NFT {i + 1}</h4> <NFTView {...curNFT} /> <label> <input type="checkbox" checked={myNFTs[i].selected} onChange={e => { const newNFTs = [...myNFTs]; newNFTs[i].selected = e.target.checked; setMyNFTs(newNFTs); }} /> Select for showcase </label> </div> ); }); ``` This adds a checkbox for each NFT that is initially unchecked. When a checkbox is clicked, the corresponding `selected` field for the NFT is updated. 4. Below the above code for NFTs, we can place the following to set a showcaseName and create a new showcase: ```jsx <form> <br /> <input type="text" value={showcaseName} onChange={(e) => setShowcaseName(e.target.value)} placeholder="Enter Showcase Name" /> <button type="button" onClick={async () => { const selectedNFTs = myNFTs.filter((nft) => { return nft.selected }) await createShowcase({ args: [ showcaseName, selectedNFTs.map((nft) => `/public/${nft.publicPath.identifier}`), selectedNFTs.map((nft) => nft.nftID) ], signers: [fcl.authz], payer: fcl.authz, proposer: fcl.authz }) }} > Create Showcase </button> </form> ``` The input will allow for a showcase name to be set by the user, and when the `Create Showcase` button is clicked, we will filter our NFT list for the selected ones to fill in our createShowcase arguments. Additionally, we use the default `fcl.authz` to fill in signers, payer, and proposer arguments to our createShowcase transaction to allow the user’s wallet to run the transaction. 5. We now have everything needed to create a showcase. The user can select some NFTs they minted, set a name for their showcase, and run the `createShowcase` transaction by clicking the “Create Showcase” button. ### View Showcases Now that we can create a showcase, we don’t have a way to view that the showcase was created, so next up we will figure out how to view showcases for an account. For viewing showcases, we can follow these steps: 1. Create a new React component called `Showcases.js` in the `web/src` folder. This component will be responsible for displaying all showcases owned by an account and will also allow the user to delete a showcase. Add the following code to the component file, and we can go over what’s going on in the following sections: ```jsx import { useState, useEffect } from 'react'; import * as fcl from "@onflow/fcl"; import { getShowcases } from './cadut/scripts'; import { removeShowcase } from './cadut/transactions'; import NFTView from './NFTView'; function Showcases({ user }) { const [showcases, setShowcases] = useState([]); return ( <div> <h3>Showcases:</h3> </div> ); } export default Showcases ``` This snippet will import our getShowcases and removeShowcase script and transaction which we can use to populate the page with created showcases from an account and later allow for deletion of a showcase. It also will set up a value for an input called `showcaseInput`, which will be where we can store a user inputted Flow account address we want to view showcases from. The `showcases` state variable will be used to store all resulting showcases coming out of the given address. 1. Back in `App.js`, lets add the following below our “Create Showcase” form to show our new showcases component: ```jsx ... <hr /> <Showcases user={user} /> ... ``` 1. Return back to `Showcases.js`. Below our state initialization, we can use the following code to help us retrieve some initial showcases for the logged in account: ```go ... const [showcases, setShowcases] = useState([]) useEffect(() => { const run = async () => { if (user.loggedIn) { getShowcasesForAddress(fcl.withPrefix(user.addr)) } } run() }, [user]) const getShowcasesForAddress = async (address) => { const showcases = await getShowcases({ args: [address], }); setShowcases(showcases[0] || []) } ... ``` The `useEffect` above will make it so if a user connects their wallet, we will set the address we want to retrieve to that user’s address. Additionally, we will call `getShowcasesForAddress` `getShowcasesForAddress` is a new function that calls our previously written cadence script and provides the given address as an argument. Our result from the script is then stored in the `showcases` object with the `setShowcases` call. Now we have a way to retrieve showcases given our logged in flow account, and we are retrieving showcases from the chain when a user connects their wallet. 1. To finish off, we need a way to show the retrieved showcases on the page. To do this, we can replace the piece of code with `<h3>Showcases:</h3>` with the following snippet: ```go <h3>Showcases:</h3> <div> { Object.keys(showcases).map((showcaseName, i) => { return ( <div key={showcaseName}> <h4 style={{marginBottom: '2px'}}> Showcase {i+1} - {showcaseName} <br /> {Object.keys(showcases[showcaseName]).length} NFTs </h4> { showcases[showcaseName].map((nft, i) => { return <NFTView key={`${showcaseName}-${i}`} { ...nft }/> }) } </div> ) }) } {Object.keys(showcases).length === 0 && <div>No showcases in account</div>} </div> ``` This code will loop through our resulting showcases, and display the name of the showcase followed by looping through the nfts within the showcase, and showcasing them using the already existing `NFTView` provided by the template. If no showcases were found and our showcase object does not have any data in it, we will let the user know that there were no showcases. Now if you refresh your page, you should see the showcase created earlier populated on the screen, and the last feature we need to support on this UI is a way to remove a showcase from our account. ### Removing a showcase To remove a showcase from the marketplace, you can use the `removeShowcase` transaction function you have previously imported in the Showcase component. To enable the removal of a showcase, you can add a "Remove showcase" button next to each showcase view using the following code snippet: ```go Object.keys(showcases).map((showcaseName, i) => { return ( <div key={showcaseName}> <h4 style={{marginBottom: '2px'}}> Showcase {i+1} - {showcaseName} <br /> {Object.keys(showcases[showcaseName]).length} NFTs </h4> { showcases[showcaseName].map((nft, i) => { return <NFTView key={`${showcaseName}-${i}`} { ...nft }/> }) } <button onClick={async () => { await removeShowcase({ args: [showcaseName], signers: [fcl.authz], payer: fcl.authz, proposer: fcl.authz }) }}> Delete this showcase </button> </div> ) }) ``` This code will iterate through each showcase and add a "Remove showcase" button next to it. When a user clicks the button, the `removeShowcase` function is called with the name of the showcase as an argument. This function will call the `removeShowcase`transaction defined earlier in the component, passing in the showcase name, and removing it from the marketplace. Note that the `removeShowcase`function now takes only one argument, the showcase name. The transaction object containing the signers, payer and proposer can be defined within the `removeShowcase`function itself. ## Conclusion In this tutorial, we've walked through the process of building a showcase application on Flow, from writing a smart contract for the showcases to implementing transactions to add and remove showcases. We also showed how to retrieve showcases in a script and add, view, and remove showcases from the front-end. With this knowledge, you now have a solid foundation for building composable applications on Flow, where you can leverage existing contracts and functionality to build your own applications.
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
# NFT Catalog The NFT Catalog is an on chain registry listing NFT collections that exists on Flow which adhere to the NFT metadata standard. This empowers dApp developers to easily build on top of and discover interoperable NFT collections on Flow. ## Live Site Checkout the catalog [site](https://www.flow-nft-catalog.com/) to submit your NFT collection both on testnet and mainnet. ## Contract Addresses `NFTCatalog.cdc`: This contract contains the NFT Catalog | Network | Address | | ------- | ------------------ | | Mainnet | 0x49a7cda3a1eecc29 | | Testnet | 0x324c34e1c517e4db | `NFTRetrieval.cdc`: This contract contains helper functions to make it easier to discover NFTs within accounts and from the catalog | Network | Address | | ------- | ------------------ | | Mainnet | 0x49a7cda3a1eecc29 | | Testnet | 0x324c34e1c517e4db | ## Submitting a Collection to the NFT Catalog 1. Visit [here](https://www.flow-nft-catalog.com/v) 2. Enter the address containing the NFT contract which contains the collection and select the contract. <img width="1509" alt="Screen Shot 2023-02-08 at 9 40 01 AM" src="https://user-images.githubusercontent.com/5430668/217561873-54beb50e-0ea2-46fb-b9f8-8dbe758ee12f.png" /> 3. Enter the storage path where the NFTs are stored and enter an address that holds a sample NFT or log in if you have access to an account that owns the NFT. <img width="1508" alt="Screen Shot 2023-02-08 at 9 42 54 AM" src="https://user-images.githubusercontent.com/5430668/217562366-e6cbf3cb-38b8-45cb-943e-e20185565743.png" /> 4. The application will verify that your NFT collection implements the required Metadata views. 1. The required metadata views include… 1. NFT Display 1. How to display an individual NFT part of the collection 2. External URL 1. A website for the NFT collection 3. Collection Data 1. Information needed to store and retrieve an NFT 4. Collection Display 1. How to display information about the NFT collection the NFT belongs to 5. Royalties 1. Any royalties that should be accounted for during marketplace transactions 2. You can find sample implementations of all these views in this example NFT [contract](https://github.com/onflow/flow-nft/blob/master/contracts/ExampleNFT.cdc). 3. If you are not implementing a view, the app will communicate this and you can update your NFT contract and try resubmitting. <img width="738" alt="Screen Shot 2023-02-08 at 9 46 56 AM" src="https://user-images.githubusercontent.com/5430668/217563435-86863297-183b-4345-9615-61f9d4212fe9.png" /> 5. Submit proposal transaction to the NFT catalog by entering a unique url safe identifier for the collection and a message including any additional context (like contact information). <img width="1503" alt="Screen Shot 2023-02-08 at 9 48 45 AM" src="https://user-images.githubusercontent.com/5430668/217563785-65065f51-37bc-49c7-8b3e-ba5d1dda3b24.png" /> 6. Once submitted you can view all proposals [here](https://www.flow-nft-catalog.com/proposals/mainnet) to track the review of your NFT. If you would like to make a proposal manually, you may submit the following transaction with all parameters filled in: [https://github.com/dapperlabs/nft-catalog/blob/main/cadence/transactions/propose_nft_to_catalog.cdc](https://github.com/dapperlabs/nft-catalog/blob/main/cadence/transactions/propose_nft_to_catalog.cdc) Proposals should be reviewed and approved within a few days. Reasons for a proposal being rejected may include: - Providing duplicate path or name information of an existing collection on the catalog - Providing a not url safe or inaccurate name as the identifier ## Using the Catalog (For marketplaces and other NFT applications) All of the below examples use the catalog in mainnet, you may replace the imports to the testnet address when using the testnet network. **Example 1 - Retrieve all NFT collections on the catalog** ```swift import NFTCatalog from 0x49a7cda3a1eecc29 /* The catalog is returned as a `String: NFTCatalogMetadata` The key string is intended to be a unique identifier for a specific collection. The NFTCatalogMetadata contains collection-level views corresponding to each collection identifier. */ pub fun main(): {String : NFTCatalog.NFTCatalogMetadata} { return NFTCatalog.getCatalog() } ``` **Example 2 - Retrieve all collection names in the catalog** ```swift import NFTCatalog from 0x49a7cda3a1eecc29 pub fun main(): [String] { let catalog: {String : NFTCatalog.NFTCatalogMetadata} = NFTCatalog.getCatalog() let catalogNames: [String] = [] for collectionIdentifier in catalog.keys { catalogNames.append(catalog[collectionIdentifier]!.collectionDisplay.name) } return catalogNames } ``` **Example 3 - Retrieve NFT collections and counts owned by an account** ```swift import MetadataViews from 0x1d7e57aa55817448 import NFTCatalog from 0x49a7cda3a1eecc29 import NFTRetrieval from 0x49a7cda3a1eecc29 pub fun main(ownerAddress: Address) : {String : Number} { let catalog = NFTCatalog.getCatalog() let account = getAuthAccount(ownerAddress) let items : {String : Number} = {} for key in catalog.keys { let value = catalog[key]! let tempPathStr = "catalog".concat(key) let tempPublicPath = PublicPath(identifier: tempPathStr)! account.link<&{MetadataViews.ResolverCollection}>( tempPublicPath, target: value.collectionData.storagePath ) let collectionCap = account.getCapability<&AnyResource{MetadataViews.ResolverCollection}>(tempPublicPath) if !collectionCap.check() { continue } let count = NFTRetrieval.getNFTCountFromCap(collectionIdentifier : key, collectionCap : collectionCap) if count != 0 { items[key] = count } } return items } ``` `Sample Response...` ```text { "schmoes_prelaunch_token": 1 } ``` **Example 4 - Retrieve all NFTs including metadata owned by an account** ```swift import MetadataViews from 0x1d7e57aa55817448 import NFTCatalog from 0x49a7cda3a1eecc29 import NFTRetrieval from 0x49a7cda3a1eecc29 pub struct NFT { pub let id : UInt64 pub let name : String pub let description : String pub let thumbnail : String pub let externalURL : String pub let storagePath : StoragePath pub let publicPath : PublicPath pub let privatePath: PrivatePath pub let publicLinkedType: Type pub let privateLinkedType: Type pub let collectionName : String pub let collectionDescription: String pub let collectionSquareImage : String pub let collectionBannerImage : String pub let royalties: [MetadataViews.Royalty] init( id: UInt64, name : String, description : String, thumbnail : String, externalURL : String, storagePath : StoragePath, publicPath : PublicPath, privatePath : PrivatePath, publicLinkedType : Type, privateLinkedType : Type, collectionIdentifier: String, collectionName : String, collectionDescription : String, collectionSquareImage : String, collectionBannerImage : String, royalties : [MetadataViews.Royalty] ) { self.id = id self.name = name self.description = description self.thumbnail = thumbnail self.externalURL = externalURL self.storagePath = storagePath self.publicPath = publicPath self.privatePath = privatePath self.publicLinkedType = publicLinkedType self.privateLinkedType = privateLinkedType self.collectionIdentifier = collectionIdentifier self.collectionName = collectionName self.collectionDescription = collectionDescription self.collectionSquareImage = collectionSquareImage self.collectionBannerImage = collectionBannerImage self.royalties = royalties } } pub fun main(ownerAddress: Address) : { String : [NFT] } { let catalog = NFTCatalog.getCatalog() let account = getAuthAccount(ownerAddress) let items : [NFTRetrieval.BaseNFTViewsV1] = [] let data : {String : [NFT] } = {} for key in catalog.keys { let value = catalog[key]! let tempPathStr = "catalog".concat(key) let tempPublicPath = PublicPath(identifier: tempPathStr)! account.link<&{MetadataViews.ResolverCollection}>( tempPublicPath, target: value.collectionData.storagePath ) let collectionCap = account.getCapability<&AnyResource{MetadataViews.ResolverCollection}>(tempPublicPath) if !collectionCap.check() { continue } let views = NFTRetrieval.getNFTViewsFromCap(collectionIdentifier : key, collectionCap : collectionCap) let items : [NFT] = [] for view in views { let displayView = view.display let externalURLView = view.externalURL let collectionDataView = view.collectionData let collectionDisplayView = view.collectionDisplay let royaltyView = view.royalties if (displayView == nil || externalURLView == nil || collectionDataView == nil || collectionDisplayView == nil || royaltyView == nil) { // This NFT does not have the proper views implemented. Skipping.... continue } items.append( NFT( id: view.id, name : displayView!.name, description : displayView!.description, thumbnail : displayView!.thumbnail.uri(), externalURL : externalURLView!.url, storagePath : collectionDataView!.storagePath, publicPath : collectionDataView!.publicPath, privatePath : collectionDataView!.providerPath, publicLinkedType : collectionDataView!.publicLinkedType, privateLinkedType : collectionDataView!.providerLinkedType, collectionIdentifier: key, collectionName : collectionDisplayView!.name, collectionDescription : collectionDisplayView!.description, collectionSquareImage : collectionDisplayView!.squareImage.file.uri(), collectionBannerImage : collectionDisplayView!.bannerImage.file.uri(), royalties : royaltyView!.getRoyalties() ) ) } data[key] = items } return data } ``` `Sample Response...` ```text { "FlovatarComponent": [], "schmoes_prelaunch_token": [ s.aa16be98aac20e8073f923261531cbbdfae1464f570f5be796b57cdc97656248.NFT( id: 1006, name: "Schmoes Pre Launch Token #1006", description: "", thumbnail: "https://gateway.pinata.cloud/ipfs/QmXQ1iBke5wjcjYG22ACVXsCvtMJKEkwFiMf96UChP8uJq", externalURL: "https://schmoes.io", storagePath: /storage/SchmoesPreLaunchTokenCollection, publicPath: /public/SchmoesPreLaunchTokenCollection, privatePath: /private/SchmoesPreLaunchTokenCollection, publicLinkedType: Type<&A.6c4fe48768523577.SchmoesPreLaunchToken.Collection{A.1d7e57aa55817448.NonFungibleToken.CollectionPublic,A. 1d7e57aa55817448.NonFungibleToken.Receiver,A.1d7e57aa55817448.MetadataViews.ResolverCollection}>(), privateLinkedType: Type<&A.6c4fe48768523577.SchmoesPreLaunchToken.Collection{A.1d7e57aa55817448.NonFungibleToken.CollectionPublic,A.1d7e57aa55817448.NonFungibleToken.Provider,A.1d7e57aa55817448.MetadataViews.ResolverCollection}>(), collectionName: "Schmoes Pre Launch Token", collectionDescription: "", collectionSquareImage: "https://gateway.pinata.cloud/ipfs/QmXQ1iBke5wjcjYG22ACVXsCvtMJKEkwFiMf96UChP8uJq", collectionBannerImage: "https://gateway.pinata.cloud/ipfs/QmXQ1iBke5wjcjYG22ACVXsCvtMJKEkwFiMf96UChP8uJq", royalties: [] ) ], "Flovatar": [] } ``` **Example 5 - Retrieve all NFTs including metadata owned by an account for large wallets** For Wallets that have a lot of NFTs you may run into memory issues. The common pattern to get around this for now is to retrieve just the ID's in a wallet by calling the following script ```swift import MetadataViews from 0x1d7e57aa55817448 import NFTCatalog from 0x49a7cda3a1eecc29 import NFTRetrieval from 0x49a7cda3a1eecc29 pub fun main(ownerAddress: Address) : {String : [UInt64]} { let catalog = NFTCatalog.getCatalog() let account = getAuthAccount(ownerAddress) let items : {String : [UInt64]} = {} for key in catalog.keys { let value = catalog[key]! let tempPathStr = "catalogIDs".concat(key) let tempPublicPath = PublicPath(identifier: tempPathStr)! account.link<&{MetadataViews.ResolverCollection}>( tempPublicPath, target: value.collectionData.storagePath ) let collectionCap = account.getCapability<&AnyResource{MetadataViews.ResolverCollection}>(tempPublicPath) if !collectionCap.check() { continue } let ids = NFTRetrieval.getNFTIDsFromCap(collectionIdentifier : key, collectionCap : collectionCap) if ids.length > 0 { items[key] = ids } } return items } ``` and then use the ids to retrieve the full metadata for only those ids by calling the following script and passing in a map of collectlionIdentifer -> [ids] ```swift import MetadataViews from 0x1d7e57aa55817448 import NFTCatalog from 0x49a7cda3a1eecc29 import NFTRetrieval from 0x49a7cda3a1eecc29 pub struct NFT { pub let id : UInt64 pub let name : String pub let description : String pub let thumbnail : String pub let externalURL : String pub let storagePath : StoragePath pub let publicPath : PublicPath pub let privatePath: PrivatePath pub let publicLinkedType: Type pub let privateLinkedType: Type pub let collectionName : String pub let collectionDescription: String pub let collectionSquareImage : String pub let collectionBannerImage : String pub let royalties: [MetadataViews.Royalty] init( id: UInt64, name : String, description : String, thumbnail : String, externalURL : String, storagePath : StoragePath, publicPath : PublicPath, privatePath : PrivatePath, publicLinkedType : Type, privateLinkedType : Type, collectionName : String, collectionDescription : String, collectionSquareImage : String, collectionBannerImage : String, royalties : [MetadataViews.Royalty] ) { self.id = id self.name = name self.description = description self.thumbnail = thumbnail self.externalURL = externalURL self.storagePath = storagePath self.publicPath = publicPath self.privatePath = privatePath self.publicLinkedType = publicLinkedType self.privateLinkedType = privateLinkedType self.collectionName = collectionName self.collectionDescription = collectionDescription self.collectionSquareImage = collectionSquareImage self.collectionBannerImage = collectionBannerImage self.royalties = royalties } } pub fun main(ownerAddress: Address, collections: {String : [UInt64]}) : {String : [NFT] } { let data : {String : [NFT] } = {} let catalog = NFTCatalog.getCatalog() let account = getAuthAccount(ownerAddress) for collectionIdentifier in collections.keys { if catalog.containsKey(collectionIdentifier) { let value = catalog[collectionIdentifier]! let tempPathStr = "catalog".concat(collectionIdentifier) let tempPublicPath = PublicPath(identifier: tempPathStr)! account.link<&{MetadataViews.ResolverCollection}>( tempPublicPath, target: value.collectionData.storagePath ) let collectionCap = account.getCapability<&AnyResource{MetadataViews.ResolverCollection}>(tempPublicPath) if !collectionCap.check() { return data } let views = NFTRetrieval.getNFTViewsFromIDs(collectionIdentifier : collectionIdentifier, ids: collections[collectionIdentifier]!, collectionCap : collectionCap) let items : [NFT] = [] for view in views { let displayView = view.display let externalURLView = view.externalURL let collectionDataView = view.collectionData let collectionDisplayView = view.collectionDisplay let royaltyView = view.royalties if (displayView == nil || externalURLView == nil || collectionDataView == nil || collectionDisplayView == nil || royaltyView == nil) { // Bad NFT. Skipping.... continue } items.append( NFT( id: view.id, name : displayView!.name, description : displayView!.description, thumbnail : displayView!.thumbnail.uri(), externalURL : externalURLView!.url, storagePath : collectionDataView!.storagePath, publicPath : collectionDataView!.publicPath, privatePath : collectionDataView!.providerPath, publicLinkedType : collectionDataView!.publicLinkedType, privateLinkedType : collectionDataView!.providerLinkedType, collectionName : collectionDisplayView!.name, collectionDescription : collectionDisplayView!.description, collectionSquareImage : collectionDisplayView!.squareImage.file.uri(), collectionBannerImage : collectionDisplayView!.bannerImage.file.uri(), royalties : royaltyView!.getRoyalties() ) ) } data[collectionIdentifier] = items } } return data } ``` **Example 6 - Retrieve all MetadataViews for NFTs in a wallet** If you're looking for some MetadataViews that aren't in the [core view list](https://github.com/onflow/flow-nft/blob/master/contracts/MetadataViews.cdc#L36) you can leverage this script to grab all the views each NFT supports. Note: You lose some typing here but get more data. ```swift import MetadataViews from 0x1d7e57aa55817448 import NFTCatalog from 0x49a7cda3a1eecc29 import NFTRetrieval from 0x49a7cda3a1eecc29 pub struct NFTCollectionData { pub let storagePath : StoragePath pub let publicPath : PublicPath pub let privatePath: PrivatePath pub let publicLinkedType: Type pub let privateLinkedType: Type init( storagePath : StoragePath, publicPath : PublicPath, privatePath : PrivatePath, publicLinkedType : Type, privateLinkedType : Type, ) { self.storagePath = storagePath self.publicPath = publicPath self.privatePath = privatePath self.publicLinkedType = publicLinkedType self.privateLinkedType = privateLinkedType } } pub fun main(ownerAddress: Address) : { String : {String : AnyStruct} } { let catalog = NFTCatalog.getCatalog() let account = getAuthAccount(ownerAddress) let items : [MetadataViews.NFTView] = [] let data : { String : {String : AnyStruct} } = {} for key in catalog.keys { let value = catalog[key]! let tempPathStr = "catalog".concat(key) let tempPublicPath = PublicPath(identifier: tempPathStr)! account.link<&{MetadataViews.ResolverCollection}>( tempPublicPath, target: value.collectionData.storagePath ) let collectionCap = account.getCapability<&AnyResource{MetadataViews.ResolverCollection}>(tempPublicPath) if !collectionCap.check() { continue } var views = NFTRetrieval.getAllMetadataViewsFromCap(collectionIdentifier : key, collectionCap : collectionCap) if views.keys.length == 0 { continue } // Cadence doesn't support function return types, lets manually get rid of it let nftCollectionDisplayView = views[Type<MetadataViews.NFTCollectionData>().identifier] as! MetadataViews.NFTCollectionData? let collectionDataView = NFTCollectionData( storagePath : nftCollectionDisplayView!.storagePath, publicPath : nftCollectionDisplayView!.publicPath, privatePath : nftCollectionDisplayView!.providerPath, publicLinkedType : nftCollectionDisplayView!.publicLinkedType, privateLinkedType : nftCollectionDisplayView!.providerLinkedType, ) views.insert(key: Type<MetadataViews.NFTCollectionData>().identifier, collectionDataView) data[key] = views } return data } ``` **Example 7 - Setup a user’s account to receive a specific collection** 1. Run the following script to retrieve some collection-level information for an NFT collection identifier from the catalog ```swift import MetadataViews from 0x1d7e57aa55817448 import NFTCatalog from 0x49a7cda3a1eecc29 import NFTRetrieval from 0x49a7cda3a1eecc29 pub struct NFTCollection { pub let storagePath : StoragePath pub let publicPath : PublicPath pub let privatePath: PrivatePath pub let publicLinkedType: Type pub let privateLinkedType: Type pub let collectionName : String pub let collectionDescription: String pub let collectionSquareImage : String pub let collectionBannerImage : String init( storagePath : StoragePath, publicPath : PublicPath, privatePath : PrivatePath, publicLinkedType : Type, privateLinkedType : Type, collectionName : String, collectionDescription : String, collectionSquareImage : String, collectionBannerImage : String ) { self.storagePath = storagePath self.publicPath = publicPath self.privatePath = privatePath self.publicLinkedType = publicLinkedType self.privateLinkedType = privateLinkedType self.collectionName = collectionName self.collectionDescription = collectionDescription self.collectionSquareImage = collectionSquareImage self.collectionBannerImage = collectionBannerImage } } pub fun main(collectionIdentifier : String) : NFT? { let catalog = NFTCatalog.getCatalog() assert(catalog.containsKey(collectionIdentifier), message: "Invalid Collection") return NFTCollection( storagePath : collectionDataView!.storagePath, publicPath : collectionDataView!.publicPath, privatePath : collectionDataView!.providerPath, publicLinkedType : collectionDataView!.publicLinkedType, privateLinkedType : collectionDataView!.providerLinkedType, collectionName : collectionDisplayView!.name, collectionDescription : collectionDisplayView!.description, collectionSquareImage : collectionDisplayView!.squareImage.file.uri(), collectionBannerImage : collectionDisplayView!.bannerImage.file.uri() ) } panic("Invalid Token ID") } ``` 2. This script result can then be used to form a transaction by inserting the relevant variables from above into a transaction template like the following: ```swift import NonFungibleToken from 0x1d7e57aa55817448 import MetadataViews from 0x1d7e57aa55817448 {ADDITIONAL_IMPORTS} transaction { prepare(signer: AuthAccount) { // Create a new empty collection let collection <- {CONTRACT_NAME}.createEmptyCollection() // save it to the account signer.save(<-collection, to: {STORAGE_PATH}) // create a public capability for the collection signer.link<&{PUBLIC_LINKED_TYPE}>( {PUBLIC_PATH}, target: {STORAGE_PATH} ) // create a private capability for the collection signer.link<&{PRIVATE_LINKED_TYPE}>( {PRIVATE_PATH}, target: {STORAGE_PATH} ) } } ``` ## Developer Usage ### 1. [Install the Flow CLI](https://github.com/onflow/flow-cli) ### 2. [Install Node](https://nodejs.org/en/) ### 3. Clone the project ```sh git clone --depth=1 https://github.com/onflow/nft-catalog.git ``` ### 4. Install packages - Run `npm install` in the root of the project ### 5. Run Test Suite - Run `npm test` in the root of the project ## License The works in these files: - [FungibleToken.cdc](cadence/contracts/FungibleToken.cdc) - [NonFungibleToken.cdc](cadence/contracts/NonFungibleToken.cdc) - [ExampleNFT.cdc](cadence/contracts/ExampleNFT.cdc) - [MetadataViews.cdc](cadence/contracts/MetadataViews.cdc) - [NFTCatalog.cdc](cadence/contracts/NFTCatalog.cdc) - [NFTCatalogAdmin.cdc](cadence/contracts/NFTCatalogAdmin.cdc) - [NFTRetrieval.cdc](cadence/contracts/NFTRetrieval.cdc) are under the [Unlicense](LICENSE).
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
import { useParams } from 'react-router-dom'; import { MDXProvider } from '@mdx-js/react'; import NFTGuide from './composability-nft-guide.mdx'; import Flowcase from './composability-flowcase-guide.mdx'; type DocsParams = { name: string; } export function Docs({}) { const { name } = useParams<DocsParams>(); var content = <div>Doc not found</div> if (name === 'nft-guide') { content = <NFTGuide /> } else if (name === 'flowcase-guide') { content = <Flowcase /> } const components = { h1: (props: any) => <div className="text-3xl font-bold" {...props}>props.children</div>, h2: (props: any) => <div className="text-2xl font-bold" {...props}>{props.children}</div>, p: (props: any) => <div className="text-lg" {...props} /> } return ( <div className="mx-auto px-4 md:px-4 lg:px-32 md"> <MDXProvider components={components}> { content } </MDXProvider> </div> ) }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
# Cadence Generation Using the NFT Catalog, you can generate common scripts and transactions to be run against the Flow Blockchain to support your application. ## How-to generate scripts and transactions ### From JavaScript #### Installation ``` npm install @onflow/fcl npm install flow-catalog ``` or ``` yarn add @onflow/fcl yarn add flow-catalog ``` #### Usage _1. Retrieve a list of transactions available for code generation:_ NOTE: In order to properly bootstrap the method, you will need to run and `await` on the `getAddressMaps()` method, passing it into all of the methods as shown below. ``` import { getAddressMaps, scripts } from "flow-catalog"; import * as fcl from "@onflow/fcl" const main = async () => { const addressMap = await getAddressMaps(); console.log(await scripts.getSupportedGeneratedTransactions(addressMap)); }; main(); ``` _2. Provide a Catalog collection identifier to generate code_ ``` const getTemplatedTransactionCode = async function() { const catalogAddressMap = await getAddressMaps() const result = await cadence.scripts.genTx({ /* 'CollectionInitialization' is one of the available transactions from step 1. 'Flunks' is the collection identifier in this case 'Flow' is a fungible token identifier (if applicable to the transaction being used) */ args: ['CollectionInitialization', 'Flunks', 'flow'], addressMap: catalogAddressMap }) return result } ``` _3. Use the generated code in a transaction_ ``` const txId = await fcl.mutate({ cadence: await getTemplatedTransactionCode()[0], limit: 9999, args: (arg: any, t: any) => [] }); const transaction = await fcl.tx(txId).onceSealed() return transaction ``` ### From non-javascript environments Cadence scripts and transactions can be generated directly on-chain via scripts. You will need to be able to run cadence scripts to continue. _1. Retrieve a list of transactions available for code generation_ Run the following script to retrieve available code generation methods: https://github.com/dapperlabs/nft-catalog/blob/main/cadence/scripts/get_supported_generated_transactions.cdc _2. Provide a catalog collection identifier to generate code_ You may use the following script to generate code: https://github.com/dapperlabs/nft-catalog/blob/main/cadence/scripts/gen_tx.cdc For example, from the CLI this may be run like the following: `flow -n mainnet scripts execute ./get_tx.cdc CollectionInitialization Flunks flow` In the above example, `CollectionInitialization` is one of the supported transactions returned from step 1, `Flunks` is the name of an entry on the catalog (https://www.flow-nft-catalog.com/catalog/mainnet/Flunks), and `flow` is a fungible token identifier.
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
const terms = `Flow NFT Catalog is an application (the “App”) that provides users with the opportunity to register metadata for a Non-Fungible Token (“NFT”) on the Flow™ blockchain network (the “Flow Network”). Dapper Labs, Inc. ("DLI", "we", or "us") is making the App available to you. Before you use the App, however, you will need to agree to these Terms of Use and any terms and conditions incorporated herein by reference (collectively, these “Terms"). PLEASE READ THESE TERMS CAREFULLY BEFORE USING THE APP. THESE TERMS GOVERN YOUR USE OF THE APP, UNLESS WE HAVE EXECUTED A SEPARATE WRITTEN AGREEMENT WITH YOU FOR THAT PURPOSE. WE ARE ONLY WILLING TO MAKE THE APP AVAILABLE TO YOU IF YOU ACCEPT ALL OF THESE TERMS. BY USING THE APP OR ANY PART OF IT, YOU ARE CONFIRMING THAT YOU UNDERSTAND AND AGREE TO BE BOUND BY ALL OF THESE TERMS. IF YOU ARE ACCEPTING THESE TERMS ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY, YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO ACCEPT THESE TERMS ON THAT ENTITY’S BEHALF, IN WHICH CASE “YOU” WILL MEAN THAT ENTITY. IF YOU DO NOT HAVE SUCH AUTHORITY, OR IF YOU DO NOT ACCEPT ALL OF THESE TERMS, THEN WE ARE UNWILLING TO MAKE THE APP AVAILABLE TO YOU. IF YOU DO NOT AGREE TO THESE TERMS, YOU MAY NOT ACCESS OR USE THE APP. THIS AGREEMENT CONTAINS AN ARBITRATION PROVISION (SEE SECTION 14). PLEASE REVIEW THE ARBITRATION PROVISION CAREFULLY, SINCE IT AFFECTS YOUR RIGHTS. BY USING THE APP OR ANY PART OF IT, OR BY CLICKING “I ACCEPT” BELOW OR INDICATING YOUR ACCEPTANCE IN AN ADJOINING BOX, YOU UNDERSTAND AND AGREE TO BE BOUND BY THE ARBITRATION PROVISION. This document contains very important information regarding your rights and obligations, as well as conditions, limitations and exclusions that might apply to you. Please read it carefully. By using this App, you affirm that you are of legal age to enter into these Terms, and you accept and are bound by these Terms. You affirm that if you are using this App on behalf of an organization or company, you have the legal authority to bind any such organization or company to these Terms. You may not use this App if you: (i) do not agree to these Terms; (ii) are not of the age of majority in your jurisdiction of residence; or (iii) are prohibited from accessing or using this App or any of this App’s contents, products or services by applicable law. 1. USE OF THE APP (i) User Content. This app allows you and other users to create and share content, including metadata about NFTs, text, hyperlinks, comments, code, and other materials (collectively, “User Content”). You represent and warrant that your User Content, and our use of such content as permitted by these Terms, will not violate any rights of or cause injury to any person or entity. Although we have no obligation to administer User Content, if we reasonably believe any User Content is in breach of these Terms, we may remove or refuse to deploy such User Content. 2. GAS FEES (i) Gas Fees. Every transaction on the Flow Network requires the payment of a transaction fee (each, a “Gas Fee”). The Gas Fees fund the network of computers that run the decentralized Flow Network. This means that you will need to pay a Gas Fee for each transaction that you instigate via the App. Except as otherwise expressly set forth in these Terms, you will be solely responsible to pay any Gas Fee for any transaction that you instigate via the App. 3. CONDITIONS OF USE AND PROHIBITED ACTIVITIES YOU AGREE THAT YOU ARE RESPONSIBLE FOR YOUR OWN CONDUCT WHILE ACCESSING OR USING THE APP, AND FOR ANY CONSEQUENCES THEREOF. YOU AGREE TO USE THE APP ONLY FOR PURPOSES THAT ARE LEGAL, PROPER AND IN ACCORDANCE WITH THESE TERMS AND ANY APPLICABLE LAWS OR REGULATIONS. (i) User Warranties. Without limiting the foregoing, you warrant and agree that your use of the App will not (and will not allow any third party to):(a) in any manner: (1) involve the sending, uploading, distributing or disseminating any unlawful, defamatory, harassing, abusive, fraudulent, obscene, or otherwise objectionable content; (2) involve the distribution of any viruses, worms, defects, Trojan horses, corrupted files, inaccurate data, hoaxes, or any other items of a destructive or deceptive nature; (3) involve the uploading, posting, transmitting or otherwise making available through the App any content that infringes the intellectual proprietary rights of any party; (4) involve using the App to violate the legal rights (such as rights of privacy and publicity) of others; (5) involve engaging in, promoting, or encouraging illegal activity (including, without limitation, money laundering); (6) involve interfering with other users’ enjoyment of the App; (7) involve exploiting the App for any unauthorized commercial purpose; (8) involve modifying, adapting, translating, or reverse engineering any portion of the App; (9) involve removing any copyright, trademark or other proprietary rights notices contained in or on the App or any part of it; (10) involve reformatting or framing any portion of the App; (11) involve displaying any content on the App that contains any hate-related or violent content or contains any other material, products or services that violate or encourage conduct that would violate any criminal laws, any other applicable laws, or any third party rights; (12) involve using any spider, site search/retrieval application, or other device to retrieve or index any portion of the App or the content posted on the App, or to collect information about its users for any unauthorized purpose; (13) involve accessing or using the App for the purpose of creating a product or service that is competitive with any of our products or services; (14) involve abusing, harassing, or threatening another user of the App or any of our authorized representatives, customer service personnel, chat board moderators, or volunteers (including, without limitation, filing support tickets with false information, sending excessive emails or support tickets, obstructing our employees from doing their jobs, refusing to follow the instructions of our employees, or publicly disparaging us by implying favoritism by a our employees or otherwise); or (15) involve using any abusive, defamatory, ethnically or racially offensive, harassing, harmful, hateful, obscene, offensive, sexually explicit, threatening or vulgar language when communicating with another user of the App or any of our authorized representatives, customer service personnel, chat board moderators, or volunteers (each, a “Category A Prohibited Activity”); and/or (b) in any manner: (1) involve creating user accounts by automated means or under false or fraudulent pretenses; (2) involve the impersonation of another person (via the use of an email address or otherwise); (3) involve using, employing, operating, or creating a computer program to simulate the human behavior of a user (“Bots”); (4) involve using, employing, or operating Bots or other similar forms of automation to engage in any activity or transaction on the App; (ii) Effect of Your Breaches. If you engage in any of the Prohibited Activities, we may, at our sole and absolute discretion, without notice or liability to you, and without limiting any of our other rights or remedies at law or in equity, immediately suspend or terminate your user account. 4. TERMINATION (i) You Terminate. You may terminate these Terms at any time by discontinuing your access to and use of the App. (ii) We Terminate. You agree that we, in our sole discretion and for any or no reason, may terminate these Terms and suspend and/or terminate your account(s) for the App without the provision of prior notice. You agree that any suspension or termination of your access to the App may be without prior notice, and that we will not be liable to you or to any third party for any such suspension or termination. (iii) Other Remedies Available. If we terminate these Terms or suspend or terminate your access to or use of the App due to your breach of these Terms or any suspected fraudulent, abusive, or illegal activity (including, without limitation, if you engage in any of the Prohibited Activities), then termination of these Terms will be in addition to any other remedies we may have at law or in equity. (iv) Referral to Governmental Authority. We have the right, without provision of prior notice, to take appropriate legal action, including, without limitation, referral to law enforcement or regulatory authority, or notifying the harmed party of any illegal or unauthorized use of the App. Without limiting the foregoing, we have the right to fully cooperate with any law enforcement authorities or court order requesting or directing us to disclose the identity or other information of anyone using the App. (v) Effect of Termination. Upon any termination or expiration of these Terms, whether by you or us, you may no longer have access to information that you have posted on the App or that is related to your account, and you acknowledge that we will have no obligation to maintain any such information in our databases or to forward any such information to you or to any third party. Sections 1 and 15 will survive the termination or expiration of these Terms for any reason. YOU WAIVE AND HOLD US AND OUR PARENT, SUBSIDIARIES, AFFILIATES AND OUR AND THEIR RESPECTIVE DIRECTORS, OFFICERS, EMPLOYEES, AGENTS, SERVICE PROVIDERS, CONTRACTORS, LICENSORS, LICENSEES, SUPPLIERS, AND SUCCESSORS HARMLESS FROM ANY AND ALL CLAIMS RESULTING FROM ANY ACTION TAKEN BY US AND ANY OF THE FOREGOING PARTIES RELATING TO ANY INVESTIGATIONS BY EITHER US OR SUCH PARTIES OR BY LAW ENFORCEMENT AUTHORITIES. 5. DISCLAIMERS YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR ACCESS TO AND USE OF THE APP IS AT YOUR SOLE RISK, AND THAT THE APP IS PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTIES OF ANY KIND, WHETHER EXPRESS OR IMPLIED. TO THE FULLEST EXTENT PERMISSIBLE PURSUANT TO APPLICABLE LAW, WE, OUR SUBSIDIARIES, AFFILIATES, AND LICENSORS MAKE NO EXPRESS WARRANTIES AND HEREBY DISCLAIM ALL IMPLIED WARRANTIES REGARDING THE APP AND ANY PART OF IT, INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, CORRECTNESS, ACCURACY, OR RELIABILITY. WITHOUT LIMITING THE GENERALITY OF THE FOREGOING, WE, OUR PARENT, SUBSIDIARIES, AFFILIATES, AND LICENSORS DO NOT REPRESENT OR WARRANT TO YOU THAT: (I) YOUR ACCESS TO OR USE OF THE APP WILL MEET YOUR REQUIREMENTS; (II) YOUR ACCESS TO OR USE OF THE APP WILL BE UNINTERRUPTED, TIMELY, SECURE OR FREE FROM ERROR; (III) USAGE DATA PROVIDED THROUGH THE APP WILL BE ACCURATE; (IV) THE APP OR ANY CONTENT, SERVICES, OR FEATURES MADE AVAILABLE ON OR THROUGH THE APP ARE FREE OF VIRUSES OR OTHER HARMFUL COMPONENTS; OR (V) THAT ANY DATA THAT YOU DISCLOSE WHEN YOU USE THE APP WILL BE SECURE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES IN CONTRACTS WITH CONSUMERS, SO SOME OR ALL OF THE ABOVE EXCLUSIONS MAY NOT APPLY TO YOU. YOU ACCEPT THE INHERENT SECURITY RISKS OF PROVIDING INFORMATION AND DEALING ONLINE OVER THE INTERNET, AND AGREE THAT WE HAVE NO LIABILITY OR RESPONSIBILITY FOR ANY BREACH OF SECURITY UNLESS IT IS DUE TO OUR GROSS NEGLIGENCE. WE WILL NOT BE RESPONSIBLE OR LIABLE TO YOU FOR ANY LOSSES YOU INCUR AS THE RESULT OF YOUR USE OF THE FLOW NETWORK, OR YOUR ELECTRONIC WALLET, INCLUDING BUT NOT LIMITED TO ANY LOSSES, DAMAGES OR CLAIMS ARISING FROM: (I) USER ERROR, SUCH AS FORGOTTEN PASSWORDS OR INCORRECTLY CONSTRUED SMART CONTRACTS OR OTHER TRANSACTIONS; (II) SERVER FAILURE OR DATA LOSS; (III) CORRUPTED WALLET FILES; OR (IV) UNAUTHORIZED ACCESS OR ACTIVITIES BY THIRD PARTIES, INCLUDING, BUT NOT LIMITED TO, THE USE OF VIRUSES, PHISHING, BRUTE-FORCING OR OTHER MEANS OF ATTACK AGAINST THE APP, THE FLOW NETWORK, OR ANY ELECTRONIC WALLET. WE ARE NOT RESPONSIBLE FOR LOSSES DUE TO BLOCKCHAINS OR ANY OTHER FEATURES OF THE FLOW NETWORK, OR ANY ELECTRONIC WALLET, INCLUDING BUT NOT LIMITED TO LATE REPORT BY DEVELOPERS OR REPRESENTATIVES (OR NO REPORT AT ALL) OF ANY ISSUES WITH THE BLOCKCHAIN SUPPORTING THE FLOW NETWORK, INCLUDING FORKS, TECHNICAL NODE ISSUES, OR ANY OTHER ISSUES HAVING FUND LOSSES AS A RESULT. 6. LIMITATION OF LIABILITY YOU UNDERSTAND AND AGREE THAT WE, OUR PARENT, SUBSIDIARIES, AFFILIATES AND LICENSORS WILL NOT BE LIABLE TO YOU OR TO ANY THIRD PARTY FOR ANY INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, OR EXEMPLARY DAMAGES WHICH YOU MAY INCUR, HOWSOEVER CAUSED AND UNDER ANY THEORY OF LIABILITY, INCLUDING, WITHOUT LIMITATION, ANY LOSS OF PROFITS (WHETHER INCURRED DIRECTLY OR INDIRECTLY), LOSS OF GOODWILL OR BUSINESS REPUTATION, LOSS OF DATA, COST OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, DIMINUTION OF VALUE OR ANY OTHER INTANGIBLE LOSS, EVEN IF WE HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. YOU AGREE THAT OUR TOTAL, AGGREGATE LIABILITY TO YOU FOR ANY AND ALL CLAIMS ARISING OUT OF OR RELATING TO THESE TERMS OR YOUR ACCESS TO OR USE OF (OR YOUR INABILITY TO ACCESS OR USE) ANY PORTION OF THE APP, WHETHER IN CONTRACT, TORT, STRICT LIABILITY, OR ANY OTHER LEGAL THEORY, IS LIMITED TO THE GREATER OF THE AMOUNTS YOU HAVE ACTUALLY AND LAWFULLY PAID US UNDER THESE TERMS IN THE TWO (2) MONTH PERIOD PRECEDING THE DATE THE CLAIM AROSE. YOU ACKNOWLEDGE AND AGREE THAT WE HAVE MADE THE APP AVAILABLE TO YOU AND ENTERED INTO THESE TERMS IN RELIANCE UPON THE REPRESENTATIONS AND WARRANTIES, DISCLAIMERS AND LIMITATIONS OF LIABILITY SET FORTH HEREIN, WHICH REFLECT A REASONABLE AND FAIR ALLOCATION OF RISK BETWEEN US AND YOU AND FORM AN ESSENTIAL BASIS OF THE BARGAIN BETWEEN US AND YOU. WE WOULD NOT BE ABLE TO PROVIDE THE APP TO YOU WITHOUT THESE LIMITATIONS. 7. ASSUMPTION OF RISK (i) Public Data. You agree that all data entered or submitted to the App is publicly queryable or readable on the Flow blockchain. Everything will be public and you should not input any information that you want to keep private. (ii) Software Risks. Upgrades to the Flow Network, a hard fork in the Flow Network, or a change in how transactions are confirmed on the Flow Network may have unintended, adverse effects on all blockchains using the Flow Network’s NFT standard. 8. INDEMNIFICATION You agree to hold harmless and indemnify us and our parent, subsidiaries, affiliates, officers, agents, employees, advertisers, licensors, suppliers or partners from and against any claim, liability, loss, damage (actual and consequential) of any kind or nature, suit, judgment, litigation cost and attorneys' fees arising out of or in any way related to: (i) your breach of these Terms; (ii) your misuse of the App; or (iii) your violation of applicable laws, rules or regulations in connection with your access to or use of the App. You agree that we will have control of the defense or settlement of any such claims. 9. EXTERNAL SITES The App may include hyperlinks to other websites or resources (collectively, the “External Sites”), which are provided solely as a convenience to our users. We have no control over any External Sites. You acknowledge and agree that we are not responsible for the availability of any External Sites, and that we do not endorse any advertising, products or other materials on or made available from or through any External Sites. Furthermore, you acknowledge and agree that we are not liable for any loss or damage which may be incurred as a result of the availability or unavailability of the External Sites, or as a result of any reliance placed by you upon the completeness, accuracy or existence of any advertising, products or other materials on, or made available from, any External Sites. 10. FORCE MAJEURE (i) Force Majeure Events. We will not be liable or responsible to the you, nor be deemed to have defaulted under or breached these Terms, for any failure or delay in fulfilling or performing any of these Terms, when and to the extent such failure or delay is caused by or results from the following force majeure events (“Force Majeure Event(s)”): (a) acts of God; (b) flood, fire, earthquake, epidemics, pandemics, including the 2019 novel coronavirus pandemic (COVID-19), tsunami, explosion; (c) war, invasion, hostilities (whether war is declared or not), terrorist threats or acts, riot or other civil unrest; (d) government order, law, or action; (e) embargoes or blockades in effect on or after the date of this agreement; (f) strikes, labour stoppages or slowdowns or other industrial disturbances; (g) shortage of adequate or suitable Internet connectivity, telecommunication breakdown or shortage of adequate power or electricity; and (h) other similar events beyond our control. (ii) Performance During Force Majeure Events. If we suffer a Force Majeure Event, we will use reasonable efforts to promptly notify you of the Force Majeure Event, stating the period of time the occurrence is expected to continue. We will use diligent efforts to end the failure or delay and ensure the effects of such Force Majeure Event are minimized. We will resume the performance of our obligations as soon as reasonably practicable after the removal of the cause. In the event that our failure or delay remains uncured for a period of forty-five (45) consecutive days following written notice given by us under this Section 10, we may thereafter terminate these Terms upon fifteen (15) days' written notice. 11. CHANGES TO THE APP We are constantly innovating the App to help provide the best possible experience. You acknowledge and agree that the form and nature of the App, and any part of it, may change from time to time without prior notice to you, and that we may add new features and change any part of the App at any time without notice. 12. CHILDREN You affirm that you are over the age of 18. The App is not intended for children under 18. If you are under the age of 18, you may not use the App. We do not knowingly collect information from or direct any of our content specifically to children under the age of 18. If we learn or have reason to suspect that you are a user who is under the age of 18, we will unfortunately have to close your account. Other countries may have different minimum age limits, and if you are below the minimum age for providing consent for data collection in your country, you may not use the App. 13. PRIVACY POLICY Our Privacy Policy describes the ways we collect, use, store and disclose your personal information, and is hereby incorporated by this reference into these Terms. You agree to the collection, use, storage, and disclosure of your data in accordance with our Privacy Policy. 14. DISPUTE RESOLUTION; BINDING ARBITRATION YOU ARE AGREEING TO GIVE UP ANY RIGHTS TO LITIGATE CLAIMS IN A COURT. OTHER RIGHTS THAT YOU WOULD HAVE IF YOU WENT TO COURT MAY ALSO BE UNAVAILABLE OR MAY BE LIMITED IN ARBITRATION. YOU HEREBY EXPRESSLY GIVE UP YOUR RIGHT TO HAVE A TRIAL BY JURY. YOU HEREBY EXPRESSLY GIVE UP YOUR RIGHT TO PARTICIPATE AS A MEMBER OF A CLASS OF CLAIMANTS IN ANY LAWSUIT, INCLUDING, BUT NOT LIMITED TO, CLASS ACTION LAWSUITS INVOLVING ANY SUCH DISPUTE. (i) Binding Arbitration. All disputes arising out of or in connection with this contract, or in respect of any defined legal relationship associated therewith or derived therefrom, shall be referred to and finally resolved by arbitration under the International Commercial Arbitration Rules of Procedure of the Vancouver International Arbitration Centre. The appointing authority shall be the Vancouver International Arbitration Centre. The case shall be administered by the Vancouver International Arbitration Centre in accordance with its Rules. The place of arbitration shall be Vancouver, British Columbia, Canada. (ii) Arbitration Fees. Each party will cover its own fees and costs associated with the arbitration proceedings; however, if the arbitrator finds that you cannot afford to pay the fees and costs reasonably associated with the arbitration proceedings, we will pay them for you. (iii) Award Enforcement. The award of the arbitrator will be final and binding, and any judgment on the award rendered by the arbitrator may be entered in any court of competent jurisdiction. The parties agree that they will not appeal any arbitration decision to any court. (iv) Our Equitable Remedies. Notwithstanding the foregoing, we may seek and obtain injunctive relief in any jurisdiction in any court of competent jurisdiction, and you agree that these Terms are specifically enforceable by us through injunctive relief and other equitable remedies without proof of monetary damages. 15. GENERAL (i) Entire Agreement. These Terms and our Privacy Policy constitute the entire legal agreement between you and us and will be deemed to be the final and integrated agreement between you and us, and govern your access to and use of the App, and completely replace any prior or contemporaneous agreements between you and us related to your access to or use of the App, whether oral or written. (ii) No Third-Party Beneficiaries. These Terms do not and are not intended to confer any rights or remedies upon any person or entity other than you (iii) Interpretation. The language in these Terms will be interpreted as to its fair meaning, and not strictly for or against any party. (iv) Severability. Should any part of these Terms be held invalid, illegal, void or unenforceable, that portion will deemed severed from these Terms and will not affect the validity or enforceability of the remaining provisions of these Terms. (v) No Waivers. Our failure or delay to exercise or enforce any right or provision of these Terms will not constitute or be deemed a waiver of future exercise or enforcement of such right or provision. The waiver of any right or provision of these Terms will be effective only if in writing and signed for and on behalf of us by a duly authorized representative. (vi) Governing Law. All matters arising out of or relating to these Terms will be governed by and construed in accordance with the laws of the Province of British Columbia and the federal laws of Canada applicable therein without giving effect to any choice or conflict of law provision or rule (whether of the Province of British Columbia or any other jurisdiction). (vii) Venue. Subject to Section 14 of these Terms, any legal action or proceeding arising under these Terms will be brought exclusively in the Supreme Court of the Province of British Columbia located in Vancouver, British Columbia, and we and you irrevocably consent and attorn to the personal jurisdiction and venue there. (viii) Notices. We may provide you with any notices (including, without limitation those regarding changes to these Terms) by email or postings on the App. By providing us with your email address, you consent to our using the email address to send you any notices. Notices sent by email will be effective when we send the email, and notices we provide by posting will be effective upon posting. It is your responsibility to keep your email address current. (ix) Assignment. You may not assign any of your rights or obligations under these Terms, whether by operation of law or otherwise, without our prior written consent. We may assign our rights and obligations under these Terms in our sole discretion to an affiliate, or in connection with an acquisition, sale or merger. ` export function Terms() { return ( <div className="mx-auto px-0 md:px-4 lg:px-32 pt-4"> <p className="text-2xl pb-4">Terms of Use</p> <p className="whitespace-pre-line"> {terms} </p> </div> ) }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
//@ts-nocheck export function LinkIcon() { return ( <svg xmlns="http://www.w3.org/2000/svg" className="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor" strokeWidth="2"> <path strokeLinecap="round" strokeLinejoin="round" d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14" /> </svg> ) }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
import { useState } from 'react'; export function TextInput({ value, updateValue, placeholder, }: { value: string; updateValue: (text: string) => void; placeholder: string; }) { return ( <input type="search" id="default-search" value={value} onChange={(e) => { updateValue(e.target.value); }} className="block p-4 pl-10 w-full text-sm text-gray-900 bg-white rounded-lg border border-black focus:ring-blue-500 focus:border-blue-500" placeholder={placeholder} /> ); }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
export function Button(props: any) { return ( <button className={`${props.bgColor || 'bg-white'} ${ props.hoverColor || 'hover:bg-gray-100' } ${ props.textColor || 'text-gray-800' } ${ props.textSize || 'text-sm' } font-semibold py-4 px-8 border border-gray-400 rounded-lg shadow`} {...props} > {props.children} </button> ); }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
import OnFlowIcon from "../../../assets/flow-icon-bw-green.svg" import GithubIcon from "../../../assets/github-light.svg" // reduce repetition of the section layout in Footer component const footerSections = [ { header: "", links: [ { link: "/", text: "Home", }, { link: "/catalog", text: "Catalog", }, { link: "/proposals", text: "Proposals", }, { link: "/transactions", text: "Generate Transactions", }, { link: "/nfts", text: "View NFTs", }, ], }, { header: "", links: [ { link: "/terms", text: "Terms of Use", }, { link: "/privacy", text: "Privacy Policy", } ], }, ] export const Footer = ({ sections = footerSections }) => { return ( <footer className="bg-black px-6 text-white"> <div className="container mx-auto"> <div className="block items-center justify-between px-2 pt-8 pb-6 md:flex md:px-4 md:pt-16"> <a className="flex items-center font-display text-xl cursor-pointer" href="/" > <img className="mr-4" alt="flow_logo" width="50" height="50" src={OnFlowIcon} /> <header><b>flow</b> nft catalog</header> </a> <div className="flex items-center gap-6 pt-8 md:pt-0"> <a href="https://github.com/dapperlabs/nft-catalog" className="hover:opacity-75"> <img src={GithubIcon} height={32} width={32} /> </a> <a href="https://onflow.org/" className="hover:opacity-75"> <img src={OnFlowIcon} height={28} width={28} /> </a> </div> </div> <div className="grid auto-cols-min gap-y-4 border-y border-y-primary-gray-300 px-2 pb-6 pt-9 xs:grid-cols-1 sm:grid-cols-2 sm:gap-x-12 md:gap-x-20 md:px-4 lg:grid-cols-[fit-content(25%)_fit-content(25%)_fit-content(25%)_fit-content(25%)]"> {sections.map((section, i) => ( <section key={i} className="w-fit pb-12 md:pb-0"> <div className="pb-3"> <h3 className="whitespace-nowrap text-base font-bold md:text-xl lg:text-2xl"> {section.header} </h3> </div> <ul> {section.links.map((link, j) => ( <li className="py-1 pl-0" key={j}> <a className="whitespace-nowrap text-xs text-primary-gray-200 hover:text-primary-gray-100 md:text-sm lg:text-base" href={link.link} > {link.text} </a> </li> ))} </ul> </section> ))} </div> <p className="pt-4 pb-8 text-sm">@2023 Flow</p> </div> </footer> ) }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
import { useState } from "react" import { TextInput } from "./text-input" import { Button } from "./button-v2" export function SearchBar({ onSubmit }: { onSubmit: (text: string) => void }) { const [value, setValue] = useState<string>("") return ( <form className="mb-8" onSubmit={(e) => { onSubmit(value) e.preventDefault() } }> <div className="relative"> <div className="flex gap-4 w-100"> <div className="flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none"> <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"></path></svg> </div> <div className="grow"> <TextInput value={value} updateValue={setValue} placeholder={"e.g. 0x123456abcdefg"} /> </div> <Button type="submit"> Enter </Button> </div> </div> </form> ) }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
import { AiOutlineClose } from 'react-icons/ai'; type HamburgerProps = { onClick: () => void, isOpen: boolean } export function Hamburger({ onClick, isOpen }: HamburgerProps) { return <div className="mt-1 flex flex-1 justify-end lg:hidden p-2"> <button className="flex items-center px-3 py-2 text-lg border rounded text-primary-black hover:opacity-75" onClick={onClick}> {!isOpen ? ( <svg className="fill-current h-6 w-6" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><title>Menu</title><path d="M0 3h20v2H0V3zm0 6h20v2H0V9zm0 6h20v2H0v-2z" /></svg> ) : ( <AiOutlineClose /> ) } </button> </div> }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
export function Box({children}: {children: any}) { return ( <div className="p-4 rounded-xl border-2"> {children} </div> ) }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
import { ContentCard } from './content-card'; import TxImage from '../../../assets/tx.png'; import SImage from '../../../assets/script.png'; import NFTImage from '../../../assets/nft.png'; export function ContentLinks({}: {}) { const classes = 'flex flex-col items-start items-center px-4 py-5 md:flex-row md:px-15 '; return ( <div className="container"> <span className="text-xl font-display font-bold md:mb-3">Build using collections on Flow</span> <div className={classes}> <div className="flex w-full flex-1 grid xs:grid-cols-1 md:grid-cols-2 gap-4 items-start"> <ContentCard title="Composability Guide" description="Build MyFunNFT: A composable NFT collection" href="/docs/nft-guide" /> <ContentCard title="Composability Guide" description="Build Flowcase: A composable app that uses NFTs" href="/docs/flowcase-guide" /> </div> </div> </div> ); }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
export function Spinner({}: {}) { return ( <div className="flex items-center justify-center"> Loading... </div> ) }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
import React from 'react'; import { LinkIcon } from './link-icon'; export function ContentCard({ title, description, href, image, }: { title: string; description?: string | undefined; href: string; image?: string | undefined; }) { const isExternal = href.startsWith('https://'); return ( <a style={{ minHeight: '128px' }} className="group my-2 flex flex-1 justify-between rounded-lg px-6 py-10 bg-white" href={href} target={!isExternal ? '_self' : '_blank'} rel="noreferrer" > {image && <img className="h-10" src={image} />} <div className='flex flex-col justify-between h-full'> <div className="text-l text-display font-semibold">{title}</div> <div className="text-l text-display font-semibold">{description}</div> </div> <div> <LinkIcon /> </div> </a> ); }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
export function SubmitButton(props: any) { return ( <input type="submit" className="bg-white hover:bg-gray-100 text-gray-800 font-semibold py-2 px-4 border border-gray-400 rounded shadow" { ...props } > {props.children} </input> ) }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
export function NFTDisplay({ display } : { display: any }) { return ( <> <div className="text-2xl">{display.name}</div> <a className="text-sm hover:underline text-blue-600" href="https://test.com" target="_blank">Visit Website</a> <div className="text-md"> {display.description} </div> </> ) }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
import { useState } from 'react'; import { Hamburger } from './hamburger'; import OnFlowIcon from '../../../assets/flow-icon-bw-green.svg'; import { Button } from './button-v2'; import { Divider } from './divider'; function NavDropDown() { const [isOpen, setIsOpen] = useState(false); return ( <div className="relative"> <button className="border-primary-gray-100 flex items-center whitespace-nowrap stroke-black text-primary-black hover:opacity-75 px-4" onClick={() => setIsOpen(!isOpen)} > <span className="align-middle">Resources</span> <svg className="h-5 w-5 ml-1 fill-current text-gray-500 align-middle" viewBox="0 0 20 20" stroke="grey" strokeWidth={0.5} xmlns="http://www.w3.org/2000/svg"> <path d="M9.293 12.95l.707.707L15.657 8l-1.414-1.414-.707.707L10 10.828 5.757 6.586l-.707-.707L4.343 8z" /> </svg> </button> {isOpen && ( <div className="absolute right-0 w-48 mt-2 origin-top-right rounded-md shadow-lg"> <div className="px-2 py-2 bg-white rounded-md shadow-xs"> <a href="/transactions" className="block px-4 py-2 text-sm leading-5 text-gray-700 hover:bg-gray-100 focus:outline-none focus:bg-gray-100">Generate Transaction</a> <a href="/nfts" className="block px-4 py-2 text-sm leading-5 text-gray-700 hover:bg-gray-100 focus:outline-none focus:bg-gray-100">View NFTs</a> <a target="_blank" href="https://github.com/dapperlabs/nft-catalog#using-the-catalog-for-marketplaces-and-other-nft-applications" className="block px-4 py-2 text-sm leading-5 text-gray-700 hover:bg-gray-100 focus:outline-none focus:bg-gray-100" rel="noreferrer">Cadence Scripts</a> </div> </div> )} </div> ); } function NavButton({ href, title, withBorder, }: { href: string; title: string; withBorder: boolean; }) { const border = withBorder ? 'border-l' : ''; return ( <li className={`${border} border-primary-gray-100`}> <a className={ 'inline-flex items-center whitespace-nowrap stroke-black text-primary-black hover:opacity-75 px-4' } href={href} > <span>{title}</span> </a> </li> ); } export function Navbar() { const [menuOpen, setMenuOpen] = useState(false); return ( <nav className={`${menuOpen && 'fixed left-0 right-0' } z-40 flex min-h-[96px] items-center bg-white p-4 text-primary-gray-400 lg:px-8 border-2 border-primary-gray-100`}> <a className="flex items-center font-display text-xl cursor-pointer" href="/" > <img className="mr-4" alt="flow_logo" width="50" height="50" src={OnFlowIcon} /> <header><b>flow</b> nft catalog</header> </a> <Hamburger onClick={() => setMenuOpen(!menuOpen)} isOpen={menuOpen} /> {menuOpen && ( <div style={{top: '86px'}} className="fixed left-0 right-0 bottom-0 bg-white mt-1 flex flex-1 justify-start lg:hidden z-40"> <ul className="flex flex-col space-y-4 lg:hidden pb-4 pl-8 pt-8"> <a href="/v" className="pl-4"> <Button>Add NFT Collection </Button> </a> <NavButton title="Catalog" href="/catalog" withBorder={false} /> <NavButton title="Proposals" href="/proposals" withBorder={false} /> <div className="text-primary-gray-300 text-sm pt-4 px-4">Resources</div> <NavButton title="Generate Transaction" href="/transactions" withBorder={false} /> <NavButton title="View NFTs" href="/nfts" withBorder={false} /> <NavButton title="Cadence Scripts" href="https://github.com/dapperlabs/nft-catalog#using-the-catalog-for-marketplaces-and-other-nft-applications" withBorder={false} /> </ul> </div> )} <div className="mt-1 flex flex-1 justify-end lg:flex hidden"> <ul className="flex items-center"> <NavButton title="Catalog" href="/catalog" withBorder={false} /> <NavButton title="Proposals" href="/proposals" withBorder={false} /> <NavButton title="Tools" href="/tools" withBorder={false} /> <NavDropDown /> <div className="h-1/2 border-l border-primary-gray-100"></div> <div className="px-4"> <a className="text-md text-blue-700 hover:text-primary-gray-100 lg:text-base flex items-center space-x-0" target="_blank" href="https://flow.com" rel="noreferrer" > Flow.com <svg xmlns="http://www.w3.org/2000/svg" fill="white" viewBox="0 0 24 24" strokeWidth={2.5} stroke="black" className="ml-2 mr-4 w-4 h-4"> <path strokeLinecap="round" strokeLinejoin="round" d="M4.5 19.5l15-15m0 0H8.25m11.25 0v11.25" /> </svg> </a> </div> <a href="/v"> <Button>Add NFT Collection </Button> </a> </ul> </div> </nav> ); }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
type AlertStatus = 'success' | 'error' | 'warning'; export function Alert({ status, title, body, }: { status: AlertStatus; title: any; body: any; }) { const classColor = getClassColor(status); return ( <div className={`bg-${classColor} border-2 border-solid border-${getBorderColor( status )} rounded px-4 py-4 shadow-md text-xs`} role="alert" > <div className="flex items-center"> <div className="mr-4"> <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" className="w-6 h-6" > <path stroke-linecap="round" stroke-linejoin="round" d="M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z" /> </svg> </div> <div className="flex items-center space-x-10"> <p className="text-lg font-bold">{title}</p> <p className="text-sm text-gray-800">{body}</p> </div> </div> </div> ); } function getBorderColor(status: AlertStatus): string { switch (status) { case 'success': return 'green-300'; case 'error': return 'red-300'; case 'warning': return 'yellow-300'; } } function getClassColor(status: AlertStatus): string { switch (status) { case 'success': return 'green-100'; case 'error': return 'red-100'; case 'warning': return 'yellow-100'; } }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
import React from 'react'; import { LinkIcon } from './link-icon'; export function LandingLinkCard({ title, href, image, }: { title: string; description?: string | undefined; href: string; image?: string | undefined; }) { const isExternal = href.startsWith('https://'); return ( <a className="group my-2 flex flex-1 justify-between rounded-lg px-6 py-10 bg-white" href={href} target={!isExternal ? '_self' : '_blank'} rel="noreferrer" > {image && <img className="h-10" src={image} />} <div className="text-l text-display font-semibold">{title}</div> <div> <LinkIcon /> </div> </a> ); }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
export function Divider({ space }: { space?: string|undefined }) { if (!space) { space = '8px' } return ( <div style={{ borderBottomWidth: '1px', borderColor: 'rgba(0,0,0,.11)', marginTop: space, marginBottom: space, }} /> ); }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
export function Button(props: any) { return ( <button className="cursor-pointer bg-black hover:bg-gray-100 text-white text-sm hover:text-black py-4 px-6 rounded-md" { ...props } > {props.children} </button> ) }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
export function TextArea({ value, placeholder }: { value: string, placeholder: string }) { return ( <textarea value={value} className="block p-2.5 w-full h-screen text-sm text-gray-900 bg-gray-50 rounded-lg border border-gray-300 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" placeholder={placeholder} /> ) }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
export function NFTCollectionDisplay({ display } : { display: any }) { return ( <> <div className="text-2xl">{display.name}</div> <a className="text-xs hover:underline text-blue-600" href={display.externalURL} target="_blank">Visit Website</a> <div className="text-md mt-2"> {display.description} </div> { display && display.socials && Object.keys(display.socials).map((social) => { return ( <div> {social} : {display.socials[social]} </div> ) }) } </> ) }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
/* Used from https://tailwind-elements.com/docs/standard/components/accordion/ as a base */ import React, { useState } from "react" import { Alert } from "./alert" function Collapsible({ item, index, containsInvalids, backHref }: { item: any, index: number, containsInvalids: boolean, backHref: string }) { const [expand, setExpand] = useState(false) const shouldNotExpand = containsInvalids && item.isValid const statusColor = item.isValid ? "green" : "red" return ( <div> <h2 className="bg-white accordion-header mb-0 rounded-lg" id="headingOne"> <button className=" relative flex items-center w-full py-4 px-5 text-base text-gray-800 text-left transition focus:outline-none " type="button" onClick={() => { !shouldNotExpand && setExpand(!expand) }} > {item.isValid ? <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" strokeWidth={1.5} stroke={statusColor} className="w-8 h-8"> <path strokeLinecap="round" strokeLinejoin="round" d="M4.5 12.75l6 6 9-13.5" /> </svg> : <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke={statusColor} className="w-8 h-8"> <path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" /> </svg> } {item.isValid ? <span className="ml-4 font-bold"> {item.title} </span> : <span className="ml-4 font-bold"> {item.title} </span>} <span className="ml-auto text-blue-500 underline text-sm"> {shouldNotExpand ? '' : !expand ? 'Show Details' : 'Hide Details'} </span> </button> </h2> { expand && ( <div className="bg-white"> <div className="py-4 px-5"> {item.content} </div> {!item.isValid && <div className="py-4 px-5"> <Alert status="error" title="Error with you collection's metadata" body={<>Please go <a href={backHref}><u><b>back to the previous step</b></u></a> and review your info.</>} /> </div>} </div> ) } </div> ) } export function Accordian({ items, backHref }: { items: Array<any>, backHref: string }) { const containsInvalids = items.filter((i) => { return !i.isValid }).length > 0 return ( <div className="grid grid-cols-1 gap-4 rounded-sm" id="accordionExample"> { items && items.map((item, i) => { return ( <React.Fragment key={i}> <Collapsible key={i} item={item} index={i} containsInvalids={containsInvalids} backHref={backHref} /> </React.Fragment> ) }) } </div> ) }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
type BadgeColor = 'red' | 'blue' | 'green' type BadgeProps = { color: BadgeColor, text: string } export function Badge({ color, text }: BadgeProps) { switch (color) { case 'red': return <span className="text-sm bg-red-100 text-black border-2 border-red-300 text-xs font-semibold mr-2 px-2.5 py-0.5 rounded dark:bg-red-200 dark:text-yellow-900 pt-1">{text}</span> case 'blue': return <span className="text-sm bg-blue-100 text-black border-2 border-blue-300 text-xs font-semibold mr-2 px-2.5 py-0.5 rounded dark:bg-blue-200 dark:text-blue-800 pt-1">{text}</span> case 'green': return <span className="text-sm bg-green-100 text-black border-2 border-green-300 text-xs font-semibold mr-2 px-2.5 py-0.5 rounded dark:bg-green-200 dark:text-green-900 pt-1">{text}</span> } }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
export function GenericViewData({ data } : { data: any }) { return ( <> { data && Object.keys(data).map((key) => { return ( <div> {key} : {data[key]} </div> ) }) } </> ) }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
import { LandingLinkCard } from './landing-link-card'; import TxImage from '../../../assets/tx.png'; import SImage from '../../../assets/script.png'; import NFTImage from '../../../assets/nft.png'; export function ToolsCard({}: {}) { const classes = 'flex flex-col items-start items-center px-4 py-5 md:flex-row md:px-15 '; return ( <div className="container"> <span className="text-xl font-display font-bold md:mb-3">Resources</span> <div className={classes}> <div className="flex w-full flex-1 grid xs:grid-cols-1 md:grid-cols-2 gap-4 items-start"> <LandingLinkCard title="Generate Transactions" href="/transactions" image={TxImage} /> <LandingLinkCard title="View NFT's" href="/nfts" image={NFTImage} /> <LandingLinkCard title="Cadence Scripts" href="https://github.com/dapperlabs/nft-catalog/tree/main/cadence" image={SImage} /> </div> </div> </div> ); }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
type OptionValue = number | string; type Option<Type extends OptionValue> = { value: Type; label: string; }; type DropDownProps<Type extends OptionValue> = { label: string, options: Option<Type>[]; value: Type, onChange: (value: Type) => void; }; export function DropDown<Type extends OptionValue>({ label, value, onChange, options }: DropDownProps<Type>) { function handleOnChange(e: React.FormEvent<HTMLSelectElement>) { const { selectedIndex } = e.currentTarget; const selectedOption = options[selectedIndex]; onChange(selectedOption.value); } return ( <select value={value} onChange={handleOnChange} className={`h-12 w-full form-select border-gray-300 text-sm cursor-pointer border-primary-gray-dark rounded-lg focus:outline-none`}> {options.map(option => ( <option key={option.value} value={option.value}> {option.label} </option> ))} </select> ); }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
import { GenericViewToggle } from './generic-view-toggle'; type GenericViewProps = { view: any; }; export function DisplayView({ view }: GenericViewProps) { let { thumbnail } = view; const { name, description } = view; if (thumbnail.startsWith('ipfs://')) { thumbnail = 'https://ipfs.io/ipfs/' + thumbnail.substring(7); } const classes = 'flex flex-col md:flex-row justify-between'; return ( <> <div className={classes}> <div className="flex flex-col mr-4"> <p className="text-3xl font-bold"> {'NFT | '} {name} </p> <span className="pt-4 text-m"> {description || 'No description set'} </span> <div className="pt-2"> <GenericViewToggle view={view} /> </div> </div> {thumbnail && ( <img className="align-right" src={thumbnail} width="400" alt="NFT Thumbnail" ></img> )} </div> </> ); }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
import { GenericViewToggle } from "./generic-view-toggle" type GenericViewProps = { view: any, withRawView: boolean } function convertToReadableType(type: string) { return type && type.replace ? type.replace(/A.[a-zA-Z0-9]+./g, '') : '' } export function CollectionDataView({ view, withRawView }: GenericViewProps) { const publicTypeID = view.publicLinkedType.typeID ? view.publicLinkedType.typeID : view.publicLinkedType.type.typeID const privateTypeID = view.privateLinkedType.typeID ? view.privateLinkedType.typeID : view.privateLinkedType.type.typeID return ( <> <div className="flex flex-row justify-between py-16"> <div className="text-2xl font-display font-bold">Contract Details</div> <div className="flex flex-row"> <div className="text-sm mr-8"> <a target="_blank"> <svg width="12" height="14" className="mt-1 mr-2" viewBox="0 0 12 14" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M9.05798 5.63057L12 3.84713L5.61546 0L0 3.3758V10.1401L6.38454 14V10.7771L12 7.38853L9.05798 5.63057ZM4.84639 11.1847L1.55035 9.19745V4.30573L5.61546 1.85987L8.89929 3.83439L4.84639 6.28026V11.1847ZM6.39674 7.23567L7.50763 6.56051L8.89929 7.38853L6.39674 8.9172V7.23567Z" fill="black"/> </svg> View Contract </a> </div> </div> </div> <div className="w-full overflow-x-auto text-md"> <div><b>Storage Path:</b> /storage/{view.storagePath.identifier}</div> <div><b>Public Path:</b> /public/{view.storagePath.identifier}</div> <div><b>Private Path:</b> /private/{view.storagePath.identifier}</div> <div><b>Public Type:</b> {convertToReadableType(publicTypeID)}</div> <div><b>Private Type:</b> {convertToReadableType(privateTypeID)}</div> </div> { withRawView && ( <> <hr className="my-2" /> <GenericViewToggle view={view} /> </> ) } </> ) }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
import { useState } from 'react'; import { GenericView } from './generic-view'; type GenericViewProps = { view: any; }; export function GenericViewToggle({ view }: GenericViewProps) { const [expanded, setExpanded] = useState(false); return ( <> {expanded && <GenericView view={view} />} <span className="ml-auto text-blue-600 underline text-s cursor-pointer" onClick={() => { setExpanded(!expanded); }} > {!expanded ? 'Show Raw View ↓' : 'Hide Raw View ↑'} </span> </> ); }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
import { GenericViewToggle } from "./generic-view-toggle" type GenericViewProps = { view: any } export function RoyaltiesView({ view }: GenericViewProps) { const royalties = view.royalties return ( <> { royalties.map((royalty: any, i: number) => { return ( <div className="text-md mt-2" key={i}> <b>{royalty.cut * 100}%</b> to <b>{royalty.receiver.address}</b> </div> ) }) } { !royalties || royalties.length === 0 && ( <div className="text-md mt-2"> No royalties set </div> ) } <hr className="my-2" /> <GenericViewToggle view={view} /> </> ) }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
import { GenericViewToggle } from "./generic-view-toggle" import { FiCopy } from 'react-icons/fi'; type GenericViewProps = { contractLink: string, view: any } function convertToReadableType(type: string) { return type && type.replace ? type.replace(/A.[a-zA-Z0-9]+./g, '') : '' } function ContractAttribute({ attribute, value }: { attribute: string, value: any }) { return ( <div className="flex flex-row justify-between h-28 w-full bg-white rounded-[16px] my-4 p-6"> <div className="flex flex-col"> <div className="font-bold">{attribute}</div> <div className="text-gray-400 xs:max-w-sm md:max-w-2xl lg:max-w-5xl whitespace-nowrap truncate pt-4">{value}</div> </div> <div className="cursor-pointer" onClick={() => { navigator.clipboard.writeText(value) }}> <FiCopy size="24px" /> </div> </div> ) } export function ContractDetails({ contractLink, view }: GenericViewProps) { const publicTypeID = view.publicLinkedType.typeID ? view.publicLinkedType.typeID : view.publicLinkedType.type.typeID const privateTypeID = view.privateLinkedType.typeID ? view.privateLinkedType.typeID : view.privateLinkedType.type.typeID return ( <> <div className="flex flex-row justify-between pt-16 pb-8"> <div className="text-2xl font-display font-bold">Contract Details</div> <div className="flex flex-row"> <div className="text-sm"> <a href={contractLink.replace('}', '')} target="_blank" className="cursor-pointer flex flex-row rounded bg-primary-gray-50 px-2 py-1 border" style={{width: 'fit-content'}}> <svg width="12" height="14" className="mt-1 mr-2" viewBox="0 0 12 14" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M9.05798 5.63057L12 3.84713L5.61546 0L0 3.3758V10.1401L6.38454 14V10.7771L12 7.38853L9.05798 5.63057ZM4.84639 11.1847L1.55035 9.19745V4.30573L5.61546 1.85987L8.89929 3.83439L4.84639 6.28026V11.1847ZM6.39674 7.23567L7.50763 6.56051L8.89929 7.38853L6.39674 8.9172V7.23567Z" fill="black"/> </svg> View Contract </a> </div> </div> </div> <div className="w-full overflow-x-auto text-md"> <ContractAttribute attribute="Type" value={view.type} /> <ContractAttribute attribute="Address" value={view.address} /> <ContractAttribute attribute="Storage path" value={`/storage/${view.storagePath.identifier}`} /> <ContractAttribute attribute="Public path" value={`/public/${view.publicPath.identifier}`} /> <ContractAttribute attribute="Private path" value={`/private/${view.privatePath.identifier}`} /> <ContractAttribute attribute="Public Type" value={convertToReadableType(publicTypeID)} /> <ContractAttribute attribute="Private Type" value={convertToReadableType(privateTypeID)} /> </div> </> ) }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
type GenericViewProps = { view: any } export function GenericView({ view }: GenericViewProps) { return ( <div className="w-full overflow-x-auto"> { Object.keys(view).map((key) => { return ( <div key={key} className="flex flex-wrap justify-left space-x-2 my-2"> <span className="px-4 py-2 rounded-full border border-gray-300 text-gray-500 font-semibold text-sm flex align-center w-max cursor-pointer active:bg-gray-300 transition duration-300 ease"> {key} : {JSON.stringify(view[key])} </span> </div> ) }) } </div> ) }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
import { SocialIcon } from 'react-social-icons'; import { LinkIcon } from '../link-icon'; import { Badge } from '../badge'; import { useEffect, useState } from "react" import { getNFTMetadataForCollectionIdentifier } from 'apps/nft-portal/src/flow/utils'; type GenericViewProps = { proposalData: any; view: any; withRawView: boolean; }; function getFormattedDate(date: any) { let year = date.getFullYear(); let month = (1 + date.getMonth()).toString().padStart(2, '0'); let day = date.getDate().toString().padStart(2, '0'); return month + '/' + day + '/' + year; } function Socials(externalURL: string, socials: any) { let formattedSocials: [{ social: string; socialLink: string }] = [ { social: 'Website', socialLink: externalURL, }, ]; Object.keys(socials).map((social) => { const socialLink = socials[social] && socials[social].url ? socials[social].url : socials[social]; formattedSocials.push({ social, socialLink, }); }); const withoutIcons = ( <> {formattedSocials.map((social, i) => { return ( <a key={i} href={social.socialLink} target="_blank" className="flex flex-row mr-8" > <div className="text-sm mr-2 text-lg"> {social.social[0].toUpperCase() + social.social.slice(1)} </div> <LinkIcon /> </a> ); })} </> ); const socialProps = { style: { height: 44, width: 44, marginRight: 12 }, target: '_blank', bgColor: '#DEE2E9', fgColor: '#3B3CFF', }; const withIcons = ( <> {externalURL && ( <div> <SocialIcon url={externalURL} href={externalURL} {...socialProps} />{' '} </div> )} {socials && Object.keys(socials).map((social) => { const socialLink = socials[social] && socials[social].url ? socials[social].url : socials[social]; return ( <div key={social}> <SocialIcon url={socialLink} href={socialLink} {...socialProps} />{' '} </div> ); })} </> ); return ( <div> <div className="flex md:hidden">{withIcons}</div> <div className="hidden md:flex">{withoutIcons}</div> </div> ); } export function CollectionDisplayView(props: any) { const [isUpdateProposal, setIsUpdateProposal] = useState<boolean | null>(null) useEffect(() => { if (!props?.proposalData?.collectionIdentifier) { return } const setup = async () => { const catalogEntry = await getNFTMetadataForCollectionIdentifier(props?.proposalData?.collectionIdentifier) if (catalogEntry != null) { // Proposing an update... setIsUpdateProposal(true) } else { setIsUpdateProposal(false) } } setup() }, [props?.proposalData?.collectionIdentifier]) const proposalData = props.proposalData; const view = props.view; const withRawView = props.withRawView; const readableStatus = proposalData && (proposalData.status === 'IN_REVIEW' ? 'In Review' : proposalData.status === 'APPROVED' ? 'Approved' : 'Rejected'); let proposal = proposalData && ( <div> <div className="flex flex-row"> <Badge color={ proposalData.status === 'IN_REVIEW' ? 'blue' : proposalData.status === 'APPROVED' ? 'green' : 'red' } text={readableStatus} /> <span className="rounded bg-primary-gray-50 border-2 text-sm border-2 text-xs mr-2 px-2.5 py-0.5 rounded pt-1"> Created {getFormattedDate(new Date(proposalData.createdTime * 1000))} </span> {isUpdateProposal && proposalData.status === "IN_REVIEW" && <Badge color="red" text="This is an update" />} </div> </div> ); let collectionSquareImage = view.squareImage && view.squareImage.file ? view.squareImage.file.url : view.collectionSquareImage.file.url; const externalURL = view && view.externalURL && view.externalURL.url ? view.externalURL.url : view.externalURL; if (collectionSquareImage.startsWith('ipfs://')) { collectionSquareImage = 'https://ipfs.io/ipfs/' + collectionSquareImage.substring(7); } return ( <> <div className="flex xs:flex-col md:flex-row"> <div className="md:basis-1/2 flex flex-col align-items-center justify-center pt-12"> {proposal} <div className="xs:text-2xl sm:text-4xl md:text-5xl font-display font-bold py-8 overflow-clip"> {view.collectionName || view.name} </div> <div className="text-md mt-2 font-semibold text-lg text-gray-600 overflow-clip"> {view.collectionDescription || view.description} </div> <div className="w-full overflow-x-none text-md py-20 flex flex-row"> {view.socials && Socials(externalURL, view.socials)} </div> </div> <div className="basis-1/2 flex flex-row justify-center"> <img className="basis-1/2 md:pl-12 py-16 object-contain" src={collectionSquareImage} ></img> </div> </div> </> ); }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
const url = <a href="/">flow-nft-catalog.com</a>; export function Privacy() { return ( <div className="mx-auto px-0 md:px-4 lg:px-32 pt-4"> <p className="text-2xl pb-4">Privacy Policy</p> <p className="whitespace-pre-line"> Flow NFT Catalog Privacy Notice Last Updated: July 12, 2022 <br /> <br /> This Privacy Notice applies to you if you visit {url} and use the Flow NFT Catalog application (collectively the “App”). <br /> <br /> Dapper Labs, Inc., a British Columbia company having its registered address at #600-565 Great Northern Way, Vancouver, British Columbia, Canada, V5T 0H8 (referred to in this Privacy Notice as “Dapper”, “we”, “us” or “our”) is, where applicable laws have such classifications, the controller of personal information described in this Notice unless otherwise stated. <br /> <br /> <br /> <b>PERSONAL INFORMATION WE COLLECT</b> <br /> We do not collect personal information in connection with the use of the App. <br /> <br /> Information you provide to us is used to register metadata for a Non-Fungible Token on the Flow™ blockchain network. <br /> <br /> <br /> <b>THIRD PARTY LINKS</b> <br /> The App may contain links to other sites. The owners of the linked sites are solely responsible for their privacy practices and content. Dapper is not responsible and does not endorse or control the content and privacy practices of third-party websites. When you access a third-party website, you will be subject to the terms of their applicable privacy policies and recommend you review them carefully. <br /> <br /> <br /> <b>COOKIES AND OTHER SIMILAR TECHNOLOGIES</b> <br /> We do not use cookies, web beacons, or other similar technologies to collect information about you. <br /> <br /> Without a common industry or legal standard for interpreting Do Not Track (DNT) signals, we do not respond to browser DNT signals. <br /> <br /> <br /> <b>INTERNATIONAL DATA TRANSFER</b> <br /> Information collected by Dapper may be transferred, stored, and processed in Canada, the U.S., or in any other country where Dapper or its affiliates, subsidiaries, or service providers maintain facilities, in which case the information may be subject to the laws of that jurisdiction. <br /> <br /> <br /> <b>SECURITY</b> <br /> We take reasonable efforts to protect information we collect using appropriate physical, technological and organizational safeguards. No security is foolproof, and the Internet is an insecure medium. However, we work hard to protect you from unauthorized access, alteration, disclosure, and destruction of your information collected and stored by us. As such, we have policies, procedures, guidelines, and safeguards in place to ensure your information is protected. <br /> <br /> <br /> <b>CHILDREN</b> <br /> We do not knowingly collect personal information from children under the age of 13. If we obtain actual knowledge that we have collected personal information for a child under the age of 13, we will delete it, unless we are legally obligated to retain such information. If you are a parent or guardian of a child and you become aware that a child has provided personal information to us, please contact via the methods described in the “How to Contact Us” section below. <br /> <br /> <br /> <b>CHANGES TO TNE PRIVACY NOTICE</b> <br /> Dapper reserves the right to make changes or update this Privacy Notice from time to time. The revised Privacy Notice will be effective as of the published last updated date. If we make any material changes to this Privacy Notice, we will notify you by email or other means prior to the changes becoming effective, or as otherwise required by law. We will also take other measures, to the extent they are required by applicable law. <br /> <br /> <br /> <b>HOW TO CONTACT US</b> <br /> If you have questions, concerns or complaints regarding this Notice, the handling of your personal information please reach out in the Flow discord. You can contact our Data Protection Officer at [email protected]. <br /> <br /> You may also mail us at: <br /> Dapper Labs Inc. <br /> Attn: Privacy <br /> #600-565 Great Northern Way <br /> Vancouver, British Columbia V5T 0H8 <br /> Canada </p> </div> ) }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
import { useNavigate } from 'react-router-dom'; import { CatalogItem } from '../catalog/catalog-explore'; import { Button } from '../shared/button'; const staticDisplayItems = [ { name: 'NFLAllDay', subtext: 'A.e4cf4bdc1751c65d.AllDay.NFT' }, { name: 'Flunks', subtext: 'A.807c3d470888cc48.Flunks.NFT' }, { name: 'UFCStrike', subtext: 'A.329feb3ab062d289.UFC_NFT.NFT' }, ]; export function NFTCatalogCard() { const navigate = useNavigate(); return ( <div className="container"> <div className="float-right"> <Button onClick={() => navigate('/catalog')} bgColor="bg-transparent"> Explore catalog </Button> </div> <span className="text-3xl font-display font-bold my-2 md:mb-3"> Flow NFT Catalog </span> <p className="overflow-hidden text-ellipsis text-gray-500"> Browse NFT collections on the catalog and view their collection-level data </p> <div className="mt-8"> <CatalogItem item={{ name: 'NBATopShot', subtext: 'A.0b2a3299cc857e29.TopShot.NFT', image: 'https://nbatopshot.com/static/img/og/og.png', }} network="mainnet" /> </div> <div className="flex flex-1 sm:flex-col sm:space-y-4 md:space-y-0 md:flex-row md:space-x-4 mt-4"> {staticDisplayItems.map((item, i) => ( <CatalogItem key={i} item={item} network="mainnet" /> ))} </div> </div> ); }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
export function HeaderLayout() { return (<section className="lg:px-12"> { /* <LandingHeaderHome title='NFT Portal' description='Browse NFT Collections and their available metadata. Verify your NFT collection is well-formed, and have your NFT added to the catalog to unlock interoperability throughout the Flow ecosystem.' tag='onFlow' /> */ } </section>); }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
import { useNavigate } from 'react-router-dom'; import HomeBannerImage from '../../../assets/home-banner.png'; import { Button } from '../shared/button'; export function CatalogLandingCard({}: {}) { const navigate = useNavigate(); const classes = 'flex flex-col items-start items-center px-4 py-6 md:flex-row md:px-15 md:py-12'; return ( <div className="bg-gradient-home-br"> <div className="container"> <div className={classes}> <div className="flex flex-1 flex-col items-start md:mr-10"> <span className="mr-2 rounded px-1 py-1 font-display font-bold text-m text-gray-500"> #onFlow </span> <header className="text-5xl font-display font-bold my-2 md:mb-3"> Explore the Flow NFT Catalog </header> <p className="md:max-w-sm overflow-hidden text-ellipsis font-semibold text-gray-600 mb-2"> Build your next idea using Flow NFT collections. </p> <Button onClick={() => navigate('/catalog')} bgColor="bg-black" textColor="text-white" hoverColor="hover:bg-black/50" > Explore catalog </Button> </div> <div className="flex w-full flex-1 flex-col items-stretch sm:mt-10 md:mt-0"> <img src={"https://raw.githubusercontent.com/dapperlabs/nft-catalog/v2/ui/apps/nft-portal/src/assets/home-banner.png"} referrerPolicy="no-referrer" /> </div> </div> </div> </div> ); }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
import { Divider } from '../shared/divider'; import { ToolsCard } from '../shared/tools-card'; import { CatalogLandingCard } from './catalog-landing-card'; import { NFTCatalogCard } from './nft-catalog-card'; import { ContentLinks } from '../shared/content-links'; export function CardLayout() { return ( <section> <CatalogLandingCard /> <br /> <NFTCatalogCard /> <Divider space='80px'></Divider> <ContentLinks /> <Divider space='80px'></Divider> <ToolsCard /> </section> ); }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
import { useEffect, useState } from "react" import { useParams } from "react-router-dom" import { getAccount, retrieveContractInformation } from "../../../flow/utils" import { Network } from "../catalog/network-dropdown" import { Alert } from "../shared/alert" import { Spinner } from "../shared/spinner" import { NFTValidity } from "./nft-validity" import { SampleNFTPrompt } from "./sample-nft-prompt" import { VerifierInfoBox } from "./verifier-info-box" export function AdditionalNftInfo({ }: { }) { const { selectedNetwork, selectedAddress, selectedContract } = useParams<any>() const [account, setAccount] = useState<any>({}) const [contractInfo, setContractInfo] = useState<any>(null) const [loading, setLoading] = useState<boolean>(false) const [error, setError] = useState<string | null>(null) useEffect(() => { const verifyContract = async () => { if (!selectedAddress || !selectedContract || !selectedNetwork) { return; } setLoading(true) const accountInfo = await getAccount(selectedAddress, selectedNetwork as Network) setAccount(accountInfo) if (!accountInfo) { setLoading(false) setError("Failed to retrieve account") return } const contracts = accountInfo.contracts as any if (!accountInfo || !contracts || !contracts[selectedContract]) { setLoading(false) setError("The provided contract could not be found") return; } const res = await retrieveContractInformation( selectedAddress, selectedContract, contracts[selectedContract], selectedNetwork as Network ) if (res) { setLoading(false) } else { } setContractInfo(res) } verifyContract() }, [selectedAddress, selectedContract, selectedNetwork]) const isContractValid = contractInfo && contractInfo.isNFTContract && contractInfo.nftConformsToMetadata && contractInfo.collectionConformsToMetadata return ( <div className="w-full"> <div className="text-h1 mb-4 w-1/2 overflow-hidden text-ellipsis !text-xl md:!text-2xl font-bold">Enter additional contract information</div> {loading && <Spinner />} {error && <><Alert status="error" title={error} body="" /><br /></>} <NFTValidity selectedContract={selectedContract} contractInfo={contractInfo} /> { isContractValid && selectedContract && <> <div className="text-l w-7/12 text-stone-600"> We need a bit more information about {selectedContract} </div> <br /> <SampleNFTPrompt contractCode={account.contracts[selectedContract]} defaultValues={{ sampleAddress: "", storagePath: "" }} setError={(error: string) => { setError(error) }} /> </> } <VerifierInfoBox /> </div> ) }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
import { useState } from 'react'; import { getAccounts } from "../../../flow/utils" import { SearchBar } from '../shared/search-bar'; import { Alert } from '../shared/alert'; import { Badge } from '../shared/badge'; import { VerifierInfoBox } from './verifier-info-box'; export function ContractSelect({ selectContract }: { selectContract: (address: string, text: string, network: string) => void }) { const [contractAddress, setContractAddress] = useState<string>("") const [accounts, setAccounts] = useState<any>({}) const [error, setError] = useState<string | null>(null) return ( <> <div className="text-h1 mb-6 w-1/2 overflow-hidden text-ellipsis !text-xl md:!text-2xl font-bold">Select NFT Contract</div> <div className="text-l text-stone-500"> This tool will assist you in verifying the metadata on your NFTs and allow your collection to be added to the Flow NFT Catalog. The Flow NFT Catalog will provide the needed context to applications and marketplaces to utilize your NFT collection and unlock interoperability throughout the Flow ecosystem. <br /> </div> <div className="my-12"> <b className="w-1/2">Enter Address containing your NFT Contract</b> <div className="my-4 w-full"> <SearchBar onSubmit={(address) => { if (!address) { return } const retrieveAccount = async () => { setError(null) const res = await getAccounts(String(address)) if (res) { setAccounts(res) setContractAddress(address) setError(null) } else { setAccounts({}) setError("Failed to retrieve address") } } retrieveAccount() }} /> </div> </div> { accounts && Object.keys(accounts).length > 0 && <> <b>Select a contract to continue</b> <div className="flex flex-wrap sm:flex-no-wrap"> { Object.keys(accounts).map((network: string) => { const account = accounts[network]; if (account != null) { return Object.keys(account.contracts).map((contractName: string) => { return ( <div className='cursor-pointer flex space-x-4 p-6 rounded-xl border-2 m-4' onClick={() => { selectContract(contractAddress, contractName, network) }}> <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" className="w-6 h-6"> <path stroke-linecap="round" stroke-linejoin="round" d="M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z" /> </svg> <div> <div className="text-md truncate pr-24 hover:text-clip"> {contractName} </div> <div className='flex items-center mt-2'> {network === 'mainnet' ? <div className="bg-white text-green-600 text-xs">#{network}</div> : <div className="bg-white py-1 text-violet-600 text-xs">#{network}</div>} </div> </div> </div> ) }) } return null; }) } </div> </> } { error && ( <Alert status='error' title="Failed to retrieve address" body="Please try a different address" /> ) } <VerifierInfoBox /> </> ) }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
import React from 'react' /* https://fancytailwind.com/app/fancy-laboratory/molecules/steps/steps4 used as a base A free to use responsive component implementation */ export function StepsProgressBar({ steps }: { steps: Array<any> }) { return ( <nav className="max-w-7xl bg-transparent" aria-label="Progress Steps"> <div className="flex flex-row w-100"> <ol className="w-fit grid grid-cols-4 gap-0 items-end"> {steps.map((step, index) => ( <div key={step.id} className="grid-span-1"> {step.isComplete && <a href={step.href} onClick={step.onClick} className="group p-4 px-8 flex flex-col border-b-2 hover:border-primary-purple text-center"> {/* ::Step number */} <p className="mb-1 text-primary-gray-300 dark:text-primary-gray-200">{`Step ${index + 1}`}</p> {/* ::Step title */} <span className="text-sm text-stone-500">{step.title}</span> </a> } {step.isActive && !step.isComplete && <a className="group p-4 px-8 flex flex-col border-b-4 border-black text-center"> {/* ::Step number */} <p className="mb-1 text-black font-bold dark:text-primary-gray-400 text-center">{`Step ${index + 1}`}</p> {/* ::Step title */} <span className="text-sm text-black">{step.title}</span> </a> } {!step.isActive && !step.isComplete && <a className="group p-4 px-8 flex flex-col border-b-2 border-gray-300 hover:border-gray-500 text-center"> {/* ::Step number */} <p className="mb-1 text-primary-gray-300 dark:text-primary-gray-200">{`Step ${index + 1}`}</p> {/* ::Step title */} <span className="text-sm text-stone-500">{step.title}</span> </a> } </div> )) } </ol> <div className="border-b-2 border-gray-300 grow"></div> </div> </nav> ) }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
import { TextInput } from '../shared/text-input'; import { useState, useEffect } from 'react'; import { useParams, useNavigate } from 'react-router-dom'; import { Alert } from '../shared/alert'; import { Spinner } from '../shared/spinner'; import { proposeNFTToCatalog, getNFTMetadataForCollectionIdentifier, } from '../../../flow/utils'; import { useDebounce } from '../../../app/hooks/use-debounce'; import { getNFTsInAccount } from '../../../flow/utils'; import * as fcl from '@onflow/fcl'; import { VerifierInfoBox } from './verifier-info-box'; type CatalogProps = { sampleAddress: string | null; storagePath: string | null; nftID: string | null; }; export function CatalogForm({ sampleAddress, storagePath, nftID, }: CatalogProps) { const navigate = useNavigate(); const [collectionIdentifier, setCollectionIdentifier] = useState<string>(''); const debouncedCollectionIdentifier: string = useDebounce<string>( collectionIdentifier, 500 ); const [message, setMessage] = useState<string>(''); const [emailAddress, setEmailAddress] = useState<string>(''); const { selectedNetwork, selectedAddress, selectedContract } = useParams<any>(); const [loading, setLoading] = useState<boolean>(false); const [error, setError] = useState<string | null>(null); const [warning, setWarning] = useState<string | null>(null); const [user, setUser] = useState({ loggedIn: null }); useEffect(() => fcl.currentUser().subscribe(setUser), []); useEffect(() => { if (!sampleAddress || !storagePath || !nftID) { return; } const getNfts = async () => { const allNFTs = await getNFTsInAccount(sampleAddress, storagePath); if (!collectionIdentifier || collectionIdentifier === '') { const selectedNft = allNFTs.find((nft: { Id: string }) => { return nft.Id === nftID; }); if (selectedNft && selectedNft.NFTCollectionDisplay) { // Get rid of spaces if they exist.. setCollectionIdentifier( selectedNft.NFTCollectionDisplay.collectionName.replace(/\s+/g, '') ); } } }; getNfts(); }, []); useEffect(() => { const metadataInformation = async () => { const res = await getNFTMetadataForCollectionIdentifier( debouncedCollectionIdentifier ); if (res != null) { setError(null); setWarning( 'An entry with this collection identifier already exists in the catalog. This proposal will be proposing an update.' ); } else { setWarning(null); } }; if (debouncedCollectionIdentifier !== '') { metadataInformation(); } }, [debouncedCollectionIdentifier]); function validateIdentifier(collectionIdentifier: string): boolean { return ( !/\s/.test(collectionIdentifier) && !/-/.test(collectionIdentifier) && !/\./.test(collectionIdentifier) ); } return ( <> {warning && ( <> <Alert status="warning" title={warning} body="" /> <br /> </> )} {error && ( <> <Alert status="error" title={error} body="" /> <br /> </> )} <form className="my-12 w-7/12" onSubmit={async (e) => { e.preventDefault(); setError(null); setWarning(null); if ( collectionIdentifier === '' || collectionIdentifier == null || message === '' || message == null ) { setError('Missing Data'); return; } if ( !storagePath || !sampleAddress || !selectedAddress || !selectedContract || !nftID ) { setError('Missing Data'); return; } if (!validateIdentifier(collectionIdentifier)) { setError( "Invalid identifier, please make sure you don't include any spaces or dashes." ); return; } if (!user.loggedIn) { await fcl.logIn(); } setLoading(true); const proposalMessage = message + ' ( This proposal was made via: ' + window.location.href + ' )'; try { await proposeNFTToCatalog( collectionIdentifier, sampleAddress, nftID, storagePath, selectedContract, selectedAddress, proposalMessage ); setError(null); navigate(`/submitted`); } catch (e: any) { setError(e.toString()); } setLoading(false); }} > <p className="text-sm mb-4 font-bold"> Enter a unique identifier (title) to describe this collection </p> <TextInput value={collectionIdentifier} updateValue={setCollectionIdentifier} placeholder="e.g. ExampleNFT" /> <br /> <br /> <p className="text-sm mb-4 font-bold">Add a description</p> <TextInput value={message} updateValue={setMessage} placeholder="Description" /> <br /> <br /> {/*<p className='text-sm mb-4 font-bold'>Enter an email address to be notified when your submission has been reviewed</p> <TextInput value={emailAddress} updateValue={setEmailAddress} placeholder="" /> <br />*/} {loading ? ( <Spinner /> ) : ( <input type="submit" value={'Submit for review'} className="cursor-pointer bg-black hover:bg-gray-100 text-white text-sm hover:text-black py-4 px-6 rounded-md" /> )} </form> <VerifierInfoBox /> </> ); }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
export function VerifierInfoBox() { return ( <div className="mt-28 p-6 bg-gray-200 rounded-xl border-2"> <div className="text-h1 mb-6 overflow-hidden text-ellipsis !text-xl md:!text-2xl font-display font-bold">How to add your NFT Collection</div> <div className="text-l text-stone-500 mb-6"> Follow the prompts above and fill in the information to add your NFT collection to the Flow NFT Catalog. Visit the link below to view detailed instructions with sample inputs. <br /> </div> <div className="flex"> <div className="mb-2"> <a className="text-md font-bold hover:text-primary-gray-100 lg:text-base flex items-center space-x-0" target="_blank" href="https://github.com/dapperlabs/nft-catalog/#submitting-a-collection-to-the-nft-catalog" rel="noreferrer" > Link to instructions <svg xmlns="http://www.w3.org/2000/svg" fill="white" viewBox="0 0 24 24" strokeWidth={2.5} stroke="black" className="ml-2 mr-4 w-4 h-4"> <path strokeLinecap="round" strokeLinejoin="round" d="M4.5 19.5l15-15m0 0H8.25m11.25 0v11.25" /> </svg> </a> </div> </div> </div> ); }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
import { Button } from "../shared/button-v2"; export function Submitted() { return <div className="py-16 ml-24 w-1/2"> <p className="mb-6 text-7xl font-display font-bold leading-relaxed">Your collection was submitted succesfully</p> <p className="mb-16 text-2xl font-semibold">Our internal review team will take a look at your submission. <br /> After approval it will be available in the catalog.</p> <a href="/"><Button>Back to homepage</Button></a> </div> }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
import { useState, useEffect } from 'react'; import { useNavigate } from 'react-router-dom'; import { TextInput } from '../shared/text-input'; import { withPrefix } from '@onflow/fcl'; import { Button } from '../shared/button'; import * as fcl from '@onflow/fcl' export function SampleNFTPrompt({ contractCode, defaultValues, setError }: { contractCode: string, defaultValues: any, setError: any }) { const navigate = useNavigate() const [storagePath, setStoragePath] = useState<string>(defaultValues.storagePath || "") const [sampleAddress, setSampleAddress] = useState<string>(defaultValues.sampleAddress || "") const [showLogIn, setShowLogIn] = useState<boolean>(false) const possibleStoragePahts: Array<string> = contractCode.match(/\/storage\/[A-Za-z0-9]*/gmi) || [] const [user, setUser] = useState({ loggedIn: null, addr: null }) useEffect(() => fcl.currentUser().subscribe(setUser), []) return ( <form className="w-7/12 mt-2" onSubmit={(e) => { e.preventDefault(); const address = showLogIn ? user.addr : sampleAddress if (storagePath.indexOf("/storage/") !== 0) { setError("The storage path must include the /storage/ prefix") return false } if (withPrefix(address).length !== 18) { setError("The provided address is not valid ") return false } navigate({ pathname: window.location.pathname, search: `?path=${storagePath}&sampleAddress=${address}` }) return false; }}> <p></p> <b>Enter the storage path your NFT collection uses</b> <p className="mt-2"></p> <TextInput value={storagePath} updateValue={setStoragePath} placeholder="Enter storage path (e.g. '/storage/exampleNFTCollection')" /> { possibleStoragePahts.length > 0 && <> <p className="mt-4 mb-2 text-sm w-7/12 text-stone-600 italic">We found some possible paths from your contract:</p> { possibleStoragePahts.map((path) => { return ( <a className="py-2 px-6 shadow-md no-underline cursor-pointer border border-black rounded-full font-bold text-sm text-black text-center inline-flex items-center hover:bg-gray-100 focus:outline-none active:shadow-none mr-2" key={path} onClick={() => setStoragePath(path)}>{path} <svg className="w-4 h-4 ml-2" fill="none" stroke="currentColor" stroke-width="2.5" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"> <path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15"></path> </svg></a> ) }) } </> } <br /> { showLogIn && ( <> <b>Log In to an account that holds this NFT</b><br /> <p className="mt-4 text-sm w-7/12 text-stone-600 mb-4"> <a className="cursor-pointer hover:underline" onClick={() => { setShowLogIn(!showLogIn) }}>Click here </a> to enter a different account that holds this NFT. </p> { user.loggedIn && ( <div> <div className="text-sm"> Logged in as <span className="font-semibold">{user.addr}</span> <a className="ml-2 text-xs cursor-pointer hover:underline text-blue-500" onClick={() => { fcl.unauthenticate() }} > Log Out </a> </div> </div> ) } { !user.loggedIn && ( <> <Button onClick={async (e: any) => { e.preventDefault() const user = await fcl.logIn() setSampleAddress(user.addr) return false }}>Log In</Button> </> ) } </> ) } { !showLogIn && ( <div className='mt-8'> <b> Enter an account address that holds this NFT </b> <br /> <p className="mt-2 text-sm w-7/12 text-stone-600"> <a className="cursor-pointer hover:underline" onClick={() => { setShowLogIn(!showLogIn) }}>Click here </a> to log in to an account that holds this NFT. </p> <br /> <TextInput value={sampleAddress} updateValue={setSampleAddress} placeholder="e.g. 0x123456abcdef" /> </div> ) } <br /> { (!showLogIn || (showLogIn && user.loggedIn)) && ( <> <input type="submit" value={"Next step"} className="cursor-pointer bg-black hover:bg-gray-100 text-white text-sm hover:text-black py-4 px-6 rounded-md" /> </> ) } <br /> {/* <p>Sample account w/ a testnet topshot NFT: <a onClick={() => { setSampleAddress("0xd80d84b4b0a88782") }}>0xd80d84b4b0a88782</a></p> <p>Sample account w/ a testnet goatedgoat NFT: <a onClick={() => { setSampleAddress("0xe27bf406ede951f7") }}>0xe27bf406ede951f7</a></p> */} </form> ) }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
import { useNavigate, useParams } from "react-router-dom" import { useQuery } from '../../hooks/use-query'; import { ContractSelect } from './contract-select'; import { SampleNFTView } from './sample-nft-view'; import { StepsProgressBar } from "./steps-progress-bar"; import { AdditionalNftInfo } from "./additional-nft-info"; import { AddToCatalog } from "./add-to-catalog"; import { changeFCLEnvironment } from "../../../flow/setup"; import { Network } from "../catalog/network-dropdown"; export default function ({ }: { }) { const query = useQuery() const navigate = useNavigate() const { selectedNetwork, selectedAddress, selectedContract } = useParams<any>() if (selectedNetwork) { changeFCLEnvironment(selectedNetwork as Network) } const storagePath = query.get("path") const sampleAddress = query.get("sampleAddress") const nftID = query.get("nftID") const confirmed = query.get("confirmed") const steps = [ { id: "S1", title: "Select contract", href: `/v`, isActive: !selectedNetwork || !selectedAddress || !selectedContract, isComplete: selectedNetwork && selectedAddress && selectedContract }, { id: "S2", title: "Additional info", href: `/v/${selectedNetwork}/${selectedAddress}/${selectedContract}`, isActive: selectedNetwork && selectedAddress && selectedContract, isComplete: selectedNetwork && selectedAddress && selectedContract && sampleAddress && storagePath }, { id: "S3", title: "Review Metadata", href: `/v/${selectedNetwork}/${selectedAddress}/${selectedContract}?path=${storagePath}&sampleAddress=${sampleAddress}`, isActive: selectedNetwork && selectedAddress && selectedContract && sampleAddress && storagePath, isComplete: selectedNetwork && selectedAddress && selectedContract && sampleAddress && storagePath && confirmed }, { id: "S4", title: "Submit for review", onClick: () => {}, isActive: selectedNetwork && selectedAddress && selectedContract && sampleAddress && storagePath && confirmed, isComplete: false } ] return ( <div className="xs:p-4 xs:py-16 md:pl-24"> <div className="md:mb-8 overflow-hidden text-ellipsis xs:text-2xl md:text-4xl lg:text-5xl font-display font-bold">Add your NFT Collection</div> <StepsProgressBar steps={steps} /> <div className="mt-8 max-w-7xl"> { steps[0].isActive && !steps[0].isComplete && ( <ContractSelect selectContract={(contractAddress: String, contractName: string, network: string) => { changeFCLEnvironment(network as Network) navigate(`/v/${network}/${contractAddress}/${contractName}`); }} /> ) } { steps[1].isActive && !steps[1].isComplete && ( <AdditionalNftInfo /> ) } { steps[2].isActive && !steps[2].isComplete && ( <SampleNFTView sampleAddress={sampleAddress} storagePath={storagePath} nftID={nftID} /> ) } { steps[3].isActive && !steps[3].isComplete && ( <AddToCatalog sampleAddress={sampleAddress} storagePath={storagePath} nftID={nftID} /> ) } </div> </div> ) }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
import React, { useEffect, useState } from "react"; import { useNavigate, useParams } from "react-router-dom"; import { retrieveMetadataInformation, getNFTsInAccount, getAreLinksSetup, getNFTInAccount } from "../../../flow/utils" import { Accordian } from "../shared/accordian"; import { Alert } from "../shared/alert"; import { Spinner } from "../shared/spinner"; import { GenericView } from "../shared/views/generic-view"; import { CollectionDisplayView } from "../shared/views/collection-display-view"; import { DisplayView } from "../shared/views/display-view"; import { CollectionDataView } from "../shared/views/collection-data-view"; import { SubmitButton } from "../shared/submit-button"; import { RoyaltiesView } from "../shared/views/royalties-view"; import { VerifierInfoBox } from "./verifier-info-box"; export function SampleNFTView({ sampleAddress, storagePath, nftID }: { sampleAddress: string | null, storagePath: string | null, nftID: string | null }) { const navigate = useNavigate() const { selectedNetwork, selectedAddress, selectedContract } = useParams<any>() const [ownedNFTs, setOwnedNFTs] = useState<any>(null) const [viewsImplemented, setViewsImplemented] = useState<any>([]); const [uniqueCollections, setUniqueCollections] = useState<any>(null) const [viewData, setViewData] = useState<{ [key: string]: Object }>({}); const [error, setError] = useState<string | null>(null); const [loading, setLoading] = useState<boolean>(true); useEffect(() => { const getMetadataConformity = async () => { if (!sampleAddress || !storagePath) { return } setLoading(true) setError(null) const metadataConformities = await retrieveMetadataInformation(sampleAddress, storagePath); if (!metadataConformities) { setError("Failed to retrieve metadata") } else { const hasInvalidViews = Object.values(metadataConformities).filter((conforms) => { return !conforms }).length > 0 if (hasInvalidViews) { setViewsImplemented(metadataConformities) } else { const allNFTs = await getNFTsInAccount(sampleAddress, storagePath); setOwnedNFTs(allNFTs) const uniqueCollections: any = {} allNFTs.forEach((nft: any, i: number) => { const id = nft.Id const key = nft && nft.NFTCollectionDisplay ? nft.NFTCollectionDisplay.collectionName : null if (key) { uniqueCollections[key] = { index: i, id: id } } }) if (Object.keys(uniqueCollections).length > 1 && !nftID) { // We have more than one unique collection, we must prompt the user to select the right collection setUniqueCollections(uniqueCollections) setViewsImplemented(metadataConformities) } else { if (nftID) { setUniqueCollections(null) navigate(`${window.location.pathname}${window.location.search.replace(/&nftID=.*/, '')}&nftID=${nftID}`) setViewsImplemented(metadataConformities) const res = allNFTs.find((nft: { Id: string }) => { return nft.Id === nftID }) if (res) { setViewData(res) } else { setError("The given ID does not exist in the account") } } else { setUniqueCollections(null); // We have just one possible collection from this account, so we can take any to be set as the query param const selectedNftID = (Object.values(uniqueCollections)[0] as any).id const nftIndex = (Object.values(uniqueCollections)[0] as any).index navigate(`${window.location.pathname}${window.location.search.replace(/&nftID=.*/, '')}&nftID=${selectedNftID}`) setViewsImplemented(metadataConformities) setViewData(allNFTs[nftIndex]) } } } } setLoading(false) } getMetadataConformity() }, [sampleAddress, storagePath, nftID]) let invalidViews: any = [] let otherErrors: any = [] const accordianItems = Object.keys(viewsImplemented).map((item) => { let title = item; let content = <div>Failed to load details</div> if (item.indexOf('MetadataViews.Royalties') >= 0) { title = 'Royalties View' content = viewData["Royalties"] ? <RoyaltiesView view={viewData["Royalties"]} /> : <div>No royalties view was found.</div> } else if (item.indexOf('MetadataViews.Display') >= 0) { title = 'Display View' content = viewData["Display"] ? <DisplayView view={viewData["Display"]} /> : <div>No display view was found.</div> } else if (item.indexOf('MetadataViews.NFTCollectionData') >= 0) { title = 'NFT Collection Data View'; if ((viewData["NFTCollectionData"] as any)?.publicLinkedType.type.typeID.indexOf("NonFungibleToken.Provider") > -1) { invalidViews.push(title) otherErrors.push("NFTCollectionData view should not include NonFungibleToken.Provider within the public link, as this would allow anyone to publically withdraw nfts from an account") } content = viewData["NFTCollectionData"] ? <CollectionDataView view={viewData["NFTCollectionData"]} withRawView={false} /> : <div>No NFT Collection Data view was found.</div> } else if (item.indexOf('MetadataViews.NFTCollectionDisplay') >= 0) { title = 'NFT Collection Display View'; content = viewData["NFTCollectionDisplay"] ? <CollectionDisplayView view={viewData["NFTCollectionDisplay"]} withRawView={true} /> : <div>No NFT Display view was found.</div> } else if (item.indexOf('MetadataViews.ExternalURL') >= 0) { title = 'External URL View'; content = viewData["ExternalURL"] ? <GenericView view={viewData["ExternalURL"]} /> : <div>No ExternalURL view was found.</div> } if (!viewsImplemented[item]) { invalidViews.push(title) } return { isValid: viewsImplemented[item], title: title, content: content } }) return ( <> <div className="text-h1 mb-4 w-1/2 overflow-hidden text-ellipsis !text-xl md:!text-2xl font-bold">Review Metadata</div> {loading && <Spinner />} { error && <Alert status="error" title="Failed to retrieve sample NFT" body={ <> We were unable to retrieve an from your account. Ensure you have an NFT in this account at the storage path provided. </> } /> } { !error && uniqueCollections && <> We found NFTs with varying collection names within the selected account. Which collection would you like to continue with? <div> <br /> { Object.keys(uniqueCollections).map((key) => { return ( <React.Fragment key={key}> <a className="cursor-pointer text-blue-500 hover:underline" onClick={() => { navigate(`${window.location.pathname}${window.location.search.replace(/&nftID=.*/, '')}&nftID=${uniqueCollections[key].id}`) }} > {key} </a> <br /> </React.Fragment> ) }) } </div> </> } { !error && !uniqueCollections && <> <Accordian items={accordianItems} backHref={`/v/${selectedNetwork}/${selectedAddress}/${selectedContract}`} /> { invalidViews.length > 0 && ( <div className="mt-8"> You have not properly implemented all recommended metadata views required to be added to the NFT catalog. <br /> <br /> Please implement the following views in your contract correctly to continue: <ul> { invalidViews.map((view: any) => { return <li className="font-semibold my-2" key={view}>* {view}</li> }) } </ul> </div> ) } { otherErrors.length > 0 && ( <div className="mt-8"> Please fix the following problems in your metadata implementation: <ul> { otherErrors.map((view: any) => { return <li className="font-semibold my-2" key={view}>* {view}</li> }) } </ul> </div> ) } <br /> { !loading && ( <> <p>This NFT contract, <b>{selectedContract}</b>, is implementing all of the recommended views!</p> <p>Review the metadata details above. If they look good, click continue to add or update this collection in the NFT Catalog.</p> <br /> <form onSubmit={() => { navigate(`${window.location.pathname}${window.location.search}&confirmed=true`) }} > <SubmitButton disabled={invalidViews.length > 0} className="cursor-pointer bg-black hover:bg-gray-400 disabled:cursor-default disabled:bg-neutral-400 disabled:text-white text-white text-sm hover:text-black py-4 px-6 rounded-md" value="Next step" /> </form> </> ) } <VerifierInfoBox /> </> } </> ) }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
import { Alert } from "../shared/alert" export function NFTValidity({ selectedContract, contractInfo }: { selectedContract: string|undefined, contractInfo: any }) { if (!contractInfo) { return null } if (!contractInfo.isNFTContract) { return ( <> <Alert status="error" title={`The provided contract, ${selectedContract}, is not an NFT`} body="Your contract must implement the standard NonFungibleToken contract" /> </> ) } if (!contractInfo.nftConformsToMetadata || !contractInfo.collectionConformsToMetadata) { return ( <> <Alert status="error" title={`The provided contract, ${selectedContract}, is not metadata standards ready`} body={ <ul> { !contractInfo.nftConformsToMetadata && <li>* The contract's NFT resource should implement <b>MetadataViews.Resolver</b></li> } { !contractInfo.collectionConformsToMetadata && <li>* The contract's Collection resource should implement <b>MetadataViews.ResolverCollection</b></li> } </ul> } /> </> ) } return null }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
import { CatalogForm } from "./catalog-form" type AddToCatalogProps = { sampleAddress: string | null storagePath: string | null, nftID: string | null } export function AddToCatalog({ sampleAddress, storagePath, nftID }: AddToCatalogProps) { return ( <> <div className="text-h1 mb-2 w-1/2 overflow-hidden text-ellipsis !text-xl md:!text-2xl font-bold">Submit your collection</div> <div className="text-l w-2/3 text-stone-500"> After submitting your collection, it will be reviewed by our submissions team. When approved, it will be added to the catalog. </div> <CatalogForm sampleAddress={sampleAddress} storagePath={storagePath} nftID={nftID} /> </> ) }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
import { useEffect, useState } from "react" import { getAllCollections } from "../../../flow/utils" import { Spinner } from "../shared/spinner" import { EmptyContent } from "./empty-content" import { CollectionDataView } from "../shared/views/collection-data-view" import { CollectionDisplayView } from "../shared/views/collection-display-view" export function NftCollectionContent({collectionIdentifier}: {collectionIdentifier: string|undefined}) { const [collectionData, setCollectionData] = useState<any>() const [error, setError] = useState<string|null>(null) useEffect(() => { setCollectionData(null) setError(null) if (!collectionIdentifier) { return } const setup = async () => { const res = await getAllCollections(); const collection = res[collectionIdentifier] if (res) { setCollectionData(collection) } else { setError(`Unable to find a catalog entry with identifier ${collectionIdentifier}`) } } setup() }, [collectionIdentifier]) if (!collectionIdentifier) { return <EmptyContent /> } if (!collectionData) { return <Spinner /> } return ( <> <CollectionDisplayView view={collectionData.collectionDisplay} withRawView={false} /> <br /> <CollectionDataView view={collectionData.collectionData} withRawView={false} /> </> ) }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
export function EmptyContent({}: {}) { return <div>Select an item on the left to view details</div> }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
import { useEffect, useState } from 'react'; import { useNavigate } from 'react-router-dom'; import { getAllNFTsInAccountFromCatalog, getSupportedGeneratedTransactions, getSupportedGeneratedScripts, getAllCollections, getAllProposals, } from '../../../flow/utils'; import { Network } from './network-dropdown'; import { changeFCLEnvironment } from '../../../flow/setup'; import { Badge } from '../shared/badge'; import { Alert } from '../shared/alert'; export function CatalogSelect({ type, network, selected, userAddress = null, collectionIdentifier = null, ftVault = null, }: { type: 'Catalog' | 'Proposals' | 'NFTs' | 'Transactions'; network: Network; selected: string | undefined; userAddress?: string | null; collectionIdentifier?: string | null; ftVault?: string | null; }) { const navigate = useNavigate(); const [items, setItems] = useState<null | Array<any>>(null); const [search, setSearch] = useState(''); const loading = !items; const [error, setError] = useState<string | null>(null); useEffect(() => { setError(null); const setup = async () => { changeFCLEnvironment(network); // retrieve list of proposals or if (type === 'Proposals') { const proposals = await getAllProposals(); const items = Object.keys(proposals).map((proposalID) => { const proposal = proposals[proposalID]; return { name: `#${proposalID} - ${proposal.collectionIdentifier}`, subtext: `Created ${new Date( proposal.createdTime * 1000 ).toLocaleDateString('en-US')}`, id: proposalID, status: proposal.status, }; }); setItems(items); } else if (type === 'Catalog') { const catalogCollections = (await getAllCollections()) || []; const items = Object.keys(catalogCollections).map((catalogKey) => { const catalog = catalogCollections[catalogKey]; return { name: `${catalogKey}`, subtext: `${catalog.nftType.typeID}`, id: catalogKey, }; }); setItems(items); } else if (type == 'NFTs') { console.log(userAddress); if (userAddress != null && userAddress !== '') { let nftTypes: any; try { nftTypes = await getAllNFTsInAccountFromCatalog(userAddress); } catch (e: any) { console.log(e); setError(e.errorMessage); } if (nftTypes == null) { setItems([]); return; } const items = Object.keys(nftTypes) .map((nftKey) => { const nfts = nftTypes[nftKey]; return nfts.map((nft: any) => { return { name: `${nft.name}`, subtext: `${nft.collectionName}`, collectionIdentifier: nftKey, id: nft.id, }; }); }) .flat(); setItems(items); } else { setItems([]); setError(null); } } else if (type == 'Transactions') { const supportedTransactions = await getSupportedGeneratedTransactions(); const supportedScripts = await getSupportedGeneratedScripts(); const combined = supportedTransactions.concat(supportedScripts); if (combined == null) { setItems([]); return; } const items = combined.map((tx: string) => { return { name: tx, subtext: '', id: tx, }; }); setItems(items ?? []); } }; setup(); }, [type, network, userAddress]); if (error) { return ( <Alert status="error" title={`Cannot Read ${type} from Account`} body={''} /> ); } return ( <a className="border-t-1 my-4"> <div className="py-4"> <span className="mr-2 rounded px-1 py-1 text-m text-gray-500"> Select {type} </span> <div className="flex-grow pt-4 px-4"> <input style={{ borderWidth: 1, }} className="w-full h-12 px-4 border-primary-gray-dark rounded-lg focus:outline-none" placeholder="Search" value={search} onChange={(e) => setSearch(e.target.value)} /> </div> </div> {items && items .filter((item) => { if (search === '') { return true; } else { return item.name.toLowerCase().includes(search.toLowerCase()); } }) .map((item, i) => { const selectedStyle = selected && item.id === selected ? 'border-x-primary-purple border-l-4' : ''; return ( <div key={i} className={`flex-col p-8 hover:bg-gray-300 cursor-pointer border-t-2 text-left ${selectedStyle}`} onClick={() => { if (type === 'NFTs') { navigate( `/nfts/${network}/${userAddress}/${item.collectionIdentifier}/${item.id}` ); } else if (type === 'Proposals') { navigate(`/proposals/${network}/${item.id}`); } else if (type === 'Transactions') { if ( collectionIdentifier == null || collectionIdentifier === '' ) { navigate( `/transactions/${network}/${item.id}/${collectionIdentifier}` ); } else { navigate( `/transactions/${network}/${item.id}/${collectionIdentifier}/${ftVault}` ); } } else { navigate(`/catalog/${network}/${item.id}`); } }} > <div className="font-semibold">{item.name}</div> {item.status && ( <Badge color={ item.status === 'IN_REVIEW' ? 'blue' : item.status === 'APPROVED' ? 'green' : 'red' } text={item.status} /> )} <div className="whitespace-pre text-xs">{item.subtext}</div> </div> ); })} {loading && [0, 0, 0, 0, 0, 0, 0, 0, 0].map((item, i) => { return ( <div key={i} className={`flex-col p-8 cursor-pointer border-t-2`}> <div className="font-semibold"> </div> <div className=""> </div> </div> ); })} {items != null && items.length === 0 && ( <div className={`flex-col p-8 cursor-pointer border-t-2`}> <div className="font-semibold">No Items</div> <div className=""> </div> </div> )} </a> ); }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
import { useEffect, useState } from "react" import { getNFTMetadataForCollectionIdentifier, getProposal } from "../../../flow/utils" import { useParams } from "react-router-dom"; import { Spinner } from "../shared/spinner" import { EmptyContent } from "./empty-content" import { Network } from "./network-dropdown"; import { CollectionDisplayView } from "../shared/views/collection-display-view" import { changeFCLEnvironment } from '../../../flow/setup'; import { ContractDetails } from "../shared/views/contract-details"; import { ProposalActions } from './proposal-actions'; type CatalogParams = { network: Network; collectionIdentifier: string; }; export function CatalogDetails({ type }: { type: "Catalog" | "Proposals", }) { const { network = 'testnet', collectionIdentifier } = useParams<CatalogParams>() const [collectionData, setCollectionData] = useState<any>() const [error, setError] = useState<string|null>(null) useEffect(() => { changeFCLEnvironment(network); setCollectionData(null) setError(null) if (!collectionIdentifier) { return } const setup = async () => { let res; if (type === 'Proposals') { res = await getProposal(collectionIdentifier) console.log() res = { ...res, ...res.metadata } } else { res = await getNFTMetadataForCollectionIdentifier(collectionIdentifier) } console.log('res is', res) const collection = res if (res) { setCollectionData(collection) } else { setError(`Unable to find a catalog entry with identifier ${collectionIdentifier}`) } } setup() }, [network, collectionIdentifier]) let content = null if (!collectionIdentifier) { content = <EmptyContent /> } else if (!collectionData) { content = <Spinner /> } else { const link = `https://${network === "testnet" ? 'testnet.' : ''}flowscan.org/contract/${collectionData.nftType.typeID.replace(/\.NFT/, '')}}` content = ( <> <CollectionDisplayView proposalData={ type === "Proposals" ? collectionData : null } view={collectionData.collectionDisplay} withRawView={false} /> <div className="-mt-16 pb-16"> { type === 'Proposals' ? <ProposalActions proposal={collectionData} proposalID={collectionIdentifier} /> : null } </div> <hr /> <ContractDetails contractLink={link} view={{ type: collectionData.nftType.typeID, address: collectionData.contractAddress, ...collectionData.collectionData }} /> </> ) } return ( <div className="mx-auto px-4 md:px-4 lg:px-32"> { content } </div> ) }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
import { useEffect, useState } from 'react'; import { useNavigate, useSearchParams } from 'react-router-dom'; import { getAllCollections, getAllProposals } from '../../../flow/utils'; import { Network } from './network-dropdown'; import { changeFCLEnvironment } from '../../../flow/setup'; import { Badge } from '../shared/badge'; export function CatalogExplore({ statusFilter, search, network, type, userAddress = null, }: { statusFilter: string; search: string; type: 'Catalog' | 'Proposals' | 'NFTs' | 'Transactions'; network: Network; selected: string | undefined; userAddress?: string | null; collectionIdentifier?: string | null; ftVault?: string | null; }) { const navigate = useNavigate(); const searchParams = useSearchParams(); const [unfilteredItems, setUnfilteredItems] = useState<null | Array<any>>( null ); const [items, setItems] = useState<null | Array<any>>(null); const loading = !items; const [numToShow, setNumToShow] = useState(18); const [itemsLength, setItemsLength] = useState(0); useEffect(() => { if (unfilteredItems && unfilteredItems.length > 0 && (search.length >= 2 || statusFilter !== 'ALL')) { const searchFilter = search.toLowerCase(); // filter the items based on the search field const filteredItems = unfilteredItems.filter((item) => { return ( item.name.toLowerCase().includes(searchFilter || '') || item.subtext.toLowerCase().includes(searchFilter || '') ) && (statusFilter === 'ALL' || item.status === statusFilter); }); setItemsLength(filteredItems.length); setItems(filteredItems.slice(0, numToShow)); } else { if (unfilteredItems) { setItemsLength(unfilteredItems.length); setItems(unfilteredItems.slice(0, numToShow)); } else { setItems(unfilteredItems); } } }, [search, unfilteredItems, numToShow, statusFilter]); useEffect(() => { const setup = async () => { changeFCLEnvironment(network); let collections: [any] | [] = []; if (type === 'Catalog') { collections = (await getAllCollections()) || []; } else if (type === 'Proposals') { collections = (await getAllProposals()) || []; } let items = Object.keys(collections).map((catalogKey: any) => { const catalog = collections[catalogKey]; return { name: `${ catalog.metadata ? catalog.collectionIdentifier : catalogKey }`, subtext: `${ catalog.metadata ? catalog.metadata.nftType.typeID : catalog.nftType.typeID }`, id: catalogKey, status: catalog.status, }; }); if (type === 'Proposals') { items = items.reverse(); } setUnfilteredItems(items); }; setup(); }, [network, userAddress]); return ( <div> <div className="grid xs:grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 mt-8"> {items && items.length > 0 && items.map((item, i) => { return <CatalogItem key={i} item={item} network={network} />; })} </div> {items && items.length > 0 && ( <> <p className="text-center text-gray-400 mt-8"> You're viewing {numToShow > itemsLength ? itemsLength : numToShow}{' '} of {itemsLength} items </p> {itemsLength > numToShow && ( <button className="border-2 w-full border-blue-700 text-blue-700 py-4 px-4 rounded-lg mt-4" onClick={() => setNumToShow(numToShow + 18)} > Load More </button> )} </> )} {loading && ( <div className="p-8 w-full h-full"> <div className="loader"></div> </div> )} {items != null && items.length === 0 && ( <div className={`flex-col p-8 cursor-pointer border-t-2`}> <div className="font-semibold">No Items</div> <div className=""> </div> </div> )} </div> ); } export function CatalogItem(props: any) { const item = props.item; const network = props.network; const readableStatus = item.status === 'IN_REVIEW' ? 'In Review' : item.status === 'APPROVED' ? 'Approved' : 'Rejected'; return ( <a className="flex flex-1 flex-row bg-white w-full h-full border-2 rounded-2xl h-50 justify-between" href={ !item.status ? `/catalog/${network}/${item.name}` : `/proposals/${network}/${item.id}` } > <div className="flex flex-col p-6 w-full"> <header className="font-display font-semibold text-xl truncate hover:text-clip"> {item.name} </header> <div className="whitespace-pre text-xs h-16 pt-3.5">{item.subtext}</div> <div className="grow"></div> <div className="font-semibold text-sm"> <a target="_blank" href={`https://${ network === 'testnet' ? 'testnet.' : '' }flowscan.org/contract/${item.subtext.replace(/.NFT$/, '')}`} className="flex flex-row rounded bg-primary-gray-50 px-2 py-1 mb-2" style={{ width: 'fit-content' }} rel="noreferrer" > <svg width="12" height="14" className="mt-1 mr-2" viewBox="0 0 12 14" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="M9.05798 5.63057L12 3.84713L5.61546 0L0 3.3758V10.1401L6.38454 14V10.7771L12 7.38853L9.05798 5.63057ZM4.84639 11.1847L1.55035 9.19745V4.30573L5.61546 1.85987L8.89929 3.83439L4.84639 6.28026V11.1847ZM6.39674 7.23567L7.50763 6.56051L8.89929 7.38853L6.39674 8.9172V7.23567Z" fill="black" /> </svg> View Contract </a> {item.status && ( <Badge color={ item.status === 'IN_REVIEW' ? 'blue' : item.status === 'APPROVED' ? 'green' : 'red' } text={readableStatus} /> )} </div> </div> {item.image && ( <img className="xs:hidden md:inline-flex max-w-lg rounded-r-2xl" src={item.image}></img> )} </a> ); }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
import { useCallback, useState } from "react" import { useParams } from "react-router-dom"; import { NetworkDropDown, Network } from "./network-dropdown"; import { CatalogSelect } from "./catalog-select"; import { NftCollectionContent } from "./nft-collection-content"; import { ProposalContent } from "./proposal-content"; import { useNavigate } from "react-router-dom" import { Hamburger } from "../shared/hamburger"; type CatalogParams = { network: Network; identifier: string; }; export default function Layout({ type }: { type: "Catalog" | "Proposals", }) { const { network = 'testnet', identifier } = useParams<CatalogParams>() const navigate = useNavigate() const onNetworkChange = useCallback((network: Network) => { navigate(type === 'Proposals' ? `/proposals/${network}` : `/catalog/${network}`) }, []) return ( <div className="mx-auto px-0 md:px-4 lg:px-32 pt-4"> <div className="text-h1 p-2 max-w-full overflow-hidden text-ellipsis !text-2xl md:!text-4xl sm:border-0"> {type === 'Proposals' ? 'NFT Catalog Proposals' : 'NFT Catalog'} </div> <div className="text-xs px-2"> Looking to add your collection to the catalog? <br /> Complete the steps <a className="cursor-pointer text-blue-600 hover:underline" href="/v">here</a> </div> <div className="flex w-full h-full items-center text-center bg-white rounded-2xl sm:flex-col md:flex-row" > <div className="flex-col lg:hidden w-full"> <div className="flex w-full items-center"> <div className="grow"> <NetworkDropDown network={network} onNetworkChange={onNetworkChange} /> </div> <div> { /* <Hamburger onClick={() => { // Item selected if(identifier != null) { navigate(type === 'Proposals' ? `/proposals/${network}` : `/catalog/${network}`) } }} /> */ } </div> </div> {identifier == null && <CatalogSelect type={type} selected={identifier} network={network} />} {identifier && type === 'Proposals' && <ProposalContent proposalID={identifier} />} {identifier && type === 'Catalog' && <NftCollectionContent collectionIdentifier={identifier} />} </div> <div className="lg:flex hidden overflow-hidden"> <div className="flex-1 border-accent-light-gray sm:border-0 md:border-r-2 self-start min-h-screen md:max-w-xs lg:max-w-sm"> <div className="flex-col"> <NetworkDropDown network={network} onNetworkChange={onNetworkChange} /> <CatalogSelect type={type} selected={identifier} network={network} /> </div> </div> <div className="px-10 w-3/4 self-start py-10 justify-self-start text-left"> { type === 'Proposals' && <ProposalContent proposalID={identifier} /> } { type === 'Catalog' && <NftCollectionContent collectionIdentifier={identifier} /> } </div> </div> </div> </div> ) }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
import { useState } from "react"; import { TextInput } from "../shared/text-input"; export function Filter({ }: {}) { const [filter, setFilter] = useState("") return ( <div className="px-8 py-4"> <form> <TextInput value={filter} updateValue={setFilter} placeholder="Filter Results" /> </form> </div> ) }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
import * as fcl from "@onflow/fcl" import { useEffect, useState } from "react" import { acceptProposal, createAdminProxy, deleteProposal, getAccountHasAdminProxy, getIsAdmin, rejectProposal } from "../../../flow/utils" import { Button } from "../shared/button" import { Spinner } from "../shared/spinner" export function ProposalActions({ proposal, proposalID }: { proposal: any, proposalID: string }) { const proposer = proposal.proposer const [loading, setLoading] = useState<boolean>(false) const [address, setAddress] = useState<string | null>(null) const [hasAdminProxy, setHasAdminProxy] = useState<boolean>(false) const [isAdmin, setIsAdmin] = useState<boolean>(false) const [forceState, setForceState] = useState<number>(0) useEffect(() => { const setup = async () => { if (address) { const hasAdminProxy = await getAccountHasAdminProxy(address) const isAdmin = await getIsAdmin(address) setHasAdminProxy(hasAdminProxy) setIsAdmin(isAdmin) } } setup() }, [address]) useEffect(() => { const setupUser = async () => { const user = await fcl.currentUser().snapshot() const userAddress = user && user.addr ? user.addr : null setAddress(userAddress) } setupUser() }, [forceState]) const loggedIn = address !== null if (!loggedIn) { return ( <> <Button key="login" onClick={ async () => { setLoading(true) await fcl.logIn() setForceState(forceState + 1) setLoading(false) } } > Log In </Button> </> ) } if (loading) { return <Spinner /> } const buttons: Array<any> = [] if (isAdmin && proposal.status === 'IN_REVIEW') { buttons.push( <Button key="accept" onClick={async () => { setLoading(true) await acceptProposal(proposalID) setForceState(forceState + 1) window.location.reload() setLoading(false) }} > Accept Proposal </Button> ) buttons.push( <Button key="reject" onClick={async () => { setLoading(true) await rejectProposal(proposalID) setForceState(forceState + 1) window.location.reload() setLoading(false) }} > Reject Proposal </Button> ) } if (address !== null && proposer === address || isAdmin) { buttons.push( <Button key="delete" onClick={async () => { setLoading(true) await deleteProposal(proposalID) setForceState(forceState + 1) window.location.reload() setLoading(false) }} > Delete Proposal </Button> ) } return ( <> <div className="text-md"><b>Contract: </b>{proposal.metadata.contractAddress} - {proposal.metadata.contractName}</div> <div className="text-md"><b>Submitted:</b> {proposal.proposer} on {(new Date(proposal.createdTime * 1000)).toLocaleDateString("en-US")}</div> <div className="text-md"><b>Message: </b>{proposal.message}</div> { buttons.map((b) => { return b }) } { buttons.length === 0 && ( <> Logged in as <b>{address}</b> <br /> You must be the creator of this proposal or an admin to take any actions. </> ) } </> ) }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
import { useEffect, useState } from "react" import { getNFTMetadataForCollectionIdentifier, getProposal } from "../../../flow/utils" import { Alert } from "../shared/alert" import { Spinner } from "../shared/spinner" import { CollectionDataView } from "../shared/views/collection-data-view" import { CollectionDisplayView } from "../shared/views/collection-display-view" import { EmptyContent } from "./empty-content" import { Box } from "../shared/box" import { ProposalActions } from "./proposal-actions" import { Badge } from "../shared/badge" export function ProposalContent({ proposalID }: { proposalID: string | undefined }) { const [proposalData, setProposalData] = useState<any>(null) const [isUpdateProposal, setIsUpdateProposal] = useState<boolean | null>(null) const [error, setError] = useState<string | null>(null) useEffect(() => { setProposalData(null) setError(null) if (!proposalID) { return } const setup = async () => { const res = await getProposal(proposalID) if (res) { const { collectionIdentifier } = res const catalogEntry = await getNFTMetadataForCollectionIdentifier(collectionIdentifier) if (catalogEntry != null) { // Proposing an update... setIsUpdateProposal(true) } else { setIsUpdateProposal(false) } setProposalData(res) } else { setError(`Unable to find a proposal with ID ${proposalID}`) } } setup() }, [proposalID]) if (error) { <Alert status="error" title={error} body={""} /> } if (!proposalID) { return <EmptyContent /> } if (!proposalData) { return <Spinner /> } let color = "blue" if (proposalData.status === 'APPROVED') { color = "green" } if (proposalData.status === 'REJECTED') { color = "yellow" } return ( <> <div> <span className="text-xl"><b>{proposalData.collectionIdentifier}</b></span> <span className="text-md ml-2"><Badge color={color as any} text={proposalData.status} /></span> {isUpdateProposal && proposalData.status === "IN_REVIEW" && <Badge color="red" text="This is an update" />}</div> <br /> <div className="text-md"><b>Contract: </b>{proposalData.metadata.contractAddress} - {proposalData.metadata.contractName}</div> <div className="text-md"><b>Submitted:</b> {proposalData.proposer} on {(new Date(proposalData.createdTime * 1000)).toLocaleDateString("en-US")}</div> <div className="text-md"><b>Message: </b>{proposalData.message}</div> <br /> <div className="text-lg">Collection Display</div> <Box> <CollectionDisplayView view={proposalData.metadata.collectionDisplay} withRawView={false} /> </Box> <br /> <div className="text-lg">Collection Data</div> <Box> <CollectionDataView view={proposalData.metadata.collectionData} withRawView={false} /> </Box> <br /> <div className="text-lg">Actions</div> <Box> <div className="text-md"><b>Contract: </b>{proposalData.metadata.contractAddress} - {proposalData.metadata.contractName}</div> <div className="text-md"><b>Submitted:</b> {proposalData.proposer} on {(new Date(proposalData.createdTime * 1000)).toLocaleDateString("en-US")}</div> <div className="text-md"><b>Message: </b>{proposalData.message}</div> <ProposalActions proposalID={proposalID} proposal={proposalData} /> </Box> </> ) }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
import { flushSync } from "react-dom"; import { DropDown } from "../shared/drop-down" import * as fcl from "@onflow/fcl"; export type Network = "mainnet" | "testnet"; type NetworkOption = { value: Network, label: string } type NetworkDropDownProps = { network: Network onNetworkChange: (value: Network) => void; }; export function NetworkDropDown({ network, onNetworkChange }: NetworkDropDownProps) { const networks: NetworkOption[] = [ { value: "mainnet", label: "Mainnet" }, { value: "testnet", label: "Testnet" }, ]; return <DropDown label="" options={networks} value={network} onChange={(e) => { fcl.unauthenticate() return onNetworkChange(e) }} /> }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
import { useCallback, useState } from "react" import { useParams } from "react-router-dom"; import { Network } from "./network-dropdown"; import { CatalogExplore } from "./catalog-explore"; import { useNavigate } from "react-router-dom" type CatalogParams = { network: Network; identifier: string; }; export default function Layout({ type }: { type: "Catalog" | "Proposals", }) { const { network = 'testnet', identifier } = useParams<CatalogParams>() const [search, setSearch] = useState('') const [statusFilter, setStatusFilter] = useState('ALL') const tabSelectedStyle = "font-bold text-black border-b-4 border-black rounded dark:text-gray-500 dark:border-gray-500" const tabUnselectedStyle = "text-gray-400 border-transparent dark:text-gray-400 dark:border-transparent" return ( <> <div className="overflow-hidden"> <div className="max-h-60 bg-gradient-catalog-1"></div> <div className="max-h-60 bg-gradient-catalog-2"></div> </div> <div className="mx-auto px-4 md:px-4 lg:px-32 pt-16"> <header className="font-display font-bold text-2xl relative z-20"> Explore {type === 'Catalog' ? 'the catalog' : 'NFT Catalog Proposals'} </header> <div className="flex flex-col lg:flex-row pt-4"> <div className="flex flex-1"> <div className="flex-grow"> <input style={{ borderWidth: 1 }} className="w-full h-12 px-4 border-primary-gray-dark rounded-lg focus:outline-none relative z-20" placeholder="Search" value={search} onChange={(e) => setSearch(e.target.value)} /> </div> { type === 'Proposals' && ( <select multiple={false} defaultValue="ALL" className="border-primary-gray-dark rounded-lg focus:outline-none relative z-20" onChange={(e) => setStatusFilter(e.target.value)} > <option value="ALL">Show All</option> <option value="IN_REVIEW">Show Pending</option> <option value="APPROVED">Show Approved</option> <option value="REJECTED">Show Rejected</option> </select> ) } </div> </div> <div style={{borderBottomWidth:"1px", borderColor: 'rgba(0,0,0,.11)'}} className="text-sm mt-10 font-medium text-center text-gray-500 dark:text-gray-400 dark:border-gray-700"> <ul className="flex flex-wrap -mb-px"> <li className="mr-2"> <a href={type === 'Catalog' ? "/catalog/mainnet" : "/proposals/mainnet"} className={`inline-block p-4 rounded-t-lg ${network === 'mainnet' ? tabSelectedStyle : tabUnselectedStyle}`}>Mainnet</a> </li> <li className="mr-2"> <a href={type === 'Catalog' ? "/catalog/testnet" : "/proposals/testnet"} className={`inline-block p-4 rounded-t-lg ${network === 'testnet' ? tabSelectedStyle : tabUnselectedStyle}`} aria-current="page">Testnet</a> </li> </ul> </div> <CatalogExplore statusFilter={statusFilter} search={search} type={type} selected={identifier} network={network} /> </div> </> ) }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
import * as fcl from "@onflow/fcl"; import { useEffect, useState } from "react" import { createAdminProxy, getAccountHasAdminProxy, getIsAdmin } from "../../../flow/utils" import { Button } from "../shared/button"; export function AdminSetup() { const [address, setAddress] = useState<string | null>(null) const [hasAdminProxy, setHasAdminProxy] = useState<boolean>(false) const [isAdmin, setIsAdmin] = useState<boolean>(false) const [forceState, setForceState] = useState<number>(0) useEffect(() => { const setupUser = async () => { const user = await fcl.currentUser().snapshot() const userAddress = user && user.addr ? user.addr : null setAddress(userAddress) } setupUser() }, [forceState]) useEffect(() => { const setup = async () => { if (address) { const hasAdminProxy = await getAccountHasAdminProxy(address) const isAdmin = await getIsAdmin(address) setHasAdminProxy(hasAdminProxy) setIsAdmin(isAdmin) } } setup() }, [address]) const loggedIn = address !== null if (!loggedIn) { return ( <> <Button key="login" onClick={ async () => { await fcl.logIn() setForceState(forceState + 1) } } > Log In </Button> </> ) } if (!hasAdminProxy) { return ( <> Logged in as <b>{address}</b> <br /> <Button key="setup" onClick={async () => { await createAdminProxy() setForceState(forceState + 1) window.location.reload() }}> Create Admin Proxy </Button> </> ) } if (!isAdmin) { return ( <> Logged in as <b>{address}</b> <br /> You have created an admin proxy, an existing admin must transfer admin capabilities to you. </> ) } return ( <> Logged in as <b>{address}</b> <br /> You are an admin already. </> ) }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
import { useCallback, useState } from 'react'; import { NetworkDropDown, Network } from '../catalog/network-dropdown'; import { useParams, useNavigate } from 'react-router-dom'; import { CatalogSelect } from '../catalog/catalog-select'; import { NFTContent } from './nft-content'; import { changeFCLEnvironment } from 'apps/nft-portal/src/flow/setup'; import { TextInput } from '../shared/text-input'; type NFTParams = { network: Network; address: string; identifier: string; nftID: string; }; export default function Layout() { const { network = 'testnet', address, identifier, nftID, } = useParams<NFTParams>(); const [addressProvided, setAddressProvided] = useState(address); const navigate = useNavigate(); const onNetworkChange = useCallback((network: Network) => { changeFCLEnvironment(network); navigate(`/nfts/${network}`); }, []); const classes = 'flex flex-col items-start items-center px-4 py-6 md:px-15 md:py-12'; return ( <div className="bg-gradient-to-r from-violet-600 to-blue-500"> <div className="container"> <div className={classes}> <header className="flex-1 text-2xl md:text-5xl text-center font-display text-white font-bold my-2 md:mb-3"> View NFTs </header> <p className="md:max-w-sm overflow-hidden text-ellipsis text-white mt-2 mb-8"> Build your next idea using Flow NFT collections. </p> <div className="flex flex-col md:flex-row w-full items-center space-x-4"> <div className="flex flex-col w-full"> <span className="px-1 py-1 text-s text-white"> Flow account address </span> <TextInput value={addressProvided ?? ''} placeholder="0xabcdefghijklmnop" updateValue={setAddressProvided} /> </div> <div className="flex flex-col w-full"> <span className="px-1 py-1 text-s text-white">Flow network</span> <NetworkDropDown network={network} onNetworkChange={onNetworkChange} /> </div> </div> </div> </div> <div className="flex w-full h-full items-center text-center bg-white sm:flex-col md:flex-row"> <div className="flex-1 border-accent-light-gray sm:border-0 md:border-r-2 self-start min-h-screen w-full md:max-w-xs lg:max-w-sm"> <div className="flex-col"> <CatalogSelect userAddress={addressProvided} type="NFTs" network={network} selected={undefined} /> </div> </div> <div className="px-10 w-3/4 self-start py-10 justify-self-start text-left"> <NFTContent network={network} walletAddress={addressProvided} nftID={nftID} identifier={identifier} /> </div> </div> </div> ); }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
import { useEffect, useState } from 'react'; import { Spinner } from '../shared/spinner'; import { getNFTInAccountFromCatalog } from 'apps/nft-portal/src/flow/utils'; import { Alert } from '../shared/alert'; import { Box } from '../shared/box'; import { DisplayView } from '../shared/views/display-view'; import { EmptyContent } from '../catalog/empty-content'; import { Network } from '../catalog/network-dropdown'; import { CollectionDisplayView } from '../shared/views/collection-display-view'; export function NFTContent({ nftID, identifier, walletAddress, }: { nftID: string | undefined; identifier: string | undefined; walletAddress: string | undefined; network: Network; }) { const [loading, setLoading] = useState<boolean>(false); const [nftData, setNFTData] = useState<any>(null); const [error, setError] = useState<string | null>(null); useEffect(() => { setError(null); const setup = async () => { setLoading(true); if (nftID && walletAddress && identifier) { try { const res = await getNFTInAccountFromCatalog( walletAddress, identifier, nftID ); setNFTData(res); } catch (e) { console.log(e); setError( `Unable to find nft with ID ${nftID} and collection ${identifier}` ); } } else { setNFTData(null); } setLoading(false); }; setup(); }, [identifier, walletAddress, nftID]); if (loading) { return <Spinner />; } if (error) { return <Alert status="error" title={error} body={''} />; } if (nftData == null) { return <EmptyContent />; } return ( <div> <div className="pb-96"> <DisplayView view={{ name: nftData.name, description: nftData.description, thumbnail: nftData.thumbnail, }} /> </div> <hr className="my-3" /> <div> <CollectionDisplayView view={{ collectionSquareImage: { file: { url: nftData.collectionSquareImage }, }, collectionBannerImage: { file: { url: nftData.collectionBannerImage }, }, externalURL: { url: nftData.externalURL }, collectionDescription: nftData.collectionDescription, description: nftData.description, collectionName: nftData.collectioNName, name: nftData.name, }} withRawView={false} /> </div> </div> ); }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
import { useEffect, useState } from 'react'; import { Network } from '../catalog/network-dropdown'; import { Spinner } from '../shared/spinner'; import { Alert } from '../shared/alert'; import { getGeneratedTransaction } from 'apps/nft-portal/src/flow/utils'; import { CopyBlock, dracula } from 'react-code-blocks'; export function TransactionContent({ identifier, transaction, network, vault, merchantAddress, }: { identifier: string | undefined; transaction: string | undefined; network: Network; vault: string | undefined; merchantAddress: string; }) { const [loading, setLoading] = useState<boolean>(false); const [error, setError] = useState<string | null>(null); const [transactionData, setTransactionData] = useState<string | null>(null); useEffect(() => { setError(null); const setup = async () => { setLoading(true); if ( identifier != null && identifier !== '' && transaction != null && transaction !== '' ) { const res = await getGeneratedTransaction( transaction, identifier, vault ?? 'flow', merchantAddress ); if (res) { setTransactionData(res); } else { setError( `Unable to generate transaction: ${transaction} for collection: ${identifier}. Please make sure you entered a valid collection identifier from the NFT Catalog.` ); } } else { setTransactionData(null); } setLoading(false); }; setup(); }, [identifier, transaction, vault]); if (transaction == null) { return ( <div> <div className="text-md"> Please enter a collection identifier and select a transaction on the left. </div> </div> ); } const hasIdentifier = identifier != null && identifier !== ''; if (!hasIdentifier) { return ( <div> <div className="text-md"> Enter a collection identifier from the NFT Catalog. </div> </div> ); } if (loading) { return <Spinner />; } if (error) { return <Alert status="error" title={error} body={''} />; } return ( <div> <span className="text-3xl font-bold">Transaction | {transaction}</span> <div className="my-4"> <CopyBlock text={transactionData ?? ''} theme={dracula} language="text" /> </div> </div> ); }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
import { useCallback, useState } from 'react'; import { NetworkDropDown, Network } from '../catalog/network-dropdown'; import { useParams, useNavigate } from 'react-router-dom'; import { CatalogSelect } from '../catalog/catalog-select'; import { changeFCLEnvironment } from 'apps/nft-portal/src/flow/setup'; import { TransactionContent } from './transaction-content'; import { TextInput } from '../shared/text-input'; import { DropDown } from '../shared/drop-down'; type TransactionParams = { network: Network; identifier: string; transaction: string; vault: string; }; export default function Layout() { const { network = 'testnet', transaction, identifier, vault = 'flow', } = useParams<TransactionParams>(); const [collectionIdentifier, setCollectionIdentifier] = useState<string>( identifier ?? '' ); const [ftVault, setFTVault] = useState<string>(vault ?? 'flow'); const [merchantAddress, setMerchantAddress] = useState<string>('0x9999999999999999'); const navigate = useNavigate(); const onNetworkChange = useCallback((network: Network) => { changeFCLEnvironment(network); navigate(`/transactions/${network}`); }, []); const classes = 'flex flex-col items-start items-center px-4 py-6 md:px-15 md:py-12'; return ( <div className="bg-gradient-to-r from-violet-600 to-blue-500"> <div className="container"> <div className={classes}> <header className="flex-1 text-2xl md:text-5xl text-center font-display text-white font-bold my-2 md:mb-3"> Generate Transactions </header> <p className="md:max-w-sm overflow-hidden text-ellipsis text-white mt-2 mb-8"> Generate Cadence code for transactions </p> <div className="flex flex-col w-full"> <TransactionForm collectionIdentifier={collectionIdentifier} setCollectionIdentifier={setCollectionIdentifier} ftVault={ftVault} setFTVault={setFTVault} network={network} onNetworkChange={onNetworkChange} /> </div> </div> </div> <div className="flex w-full h-full items-center text-center bg-white sm:flex-col md:flex-row"> <div className="flex-col lg:hidden w-full"> <CatalogSelect type="Transactions" network={network} selected={transaction} collectionIdentifier={collectionIdentifier} ftVault={ftVault} /> <TransactionContent network={network} identifier={identifier} vault={vault ?? 'flow'} transaction={transaction} merchantAddress={merchantAddress} /> </div> <div className="lg:flex hidden overflow-hidden"> <div className="flex-1 border-accent-light-gray sm:border-0 md:border-r-2 self-start min-h-screen w-full md:max-w-xs lg:max-w-sm"> <div className="flex-col"> <CatalogSelect type="Transactions" network={network} selected={transaction} collectionIdentifier={collectionIdentifier} ftVault={ftVault} /> </div> </div> <div className="px-10 w-3/4 self-start py-10 justify-self-start text-left"> <TransactionContent network={network} identifier={identifier} vault={vault ?? 'flow'} transaction={transaction} merchantAddress={merchantAddress} /> </div> </div> </div> </div> ); } type TransactionFormParams = { collectionIdentifier: string; setCollectionIdentifier: (collectionIdentifier: string) => void; setFTVault: (vault: string) => void; ftVault: string; network: Network; onNetworkChange: any; }; function TransactionForm({ collectionIdentifier, setCollectionIdentifier, setFTVault, ftVault, network, onNetworkChange, }: TransactionFormParams) { return ( <div className="flex flex-col md:flex-row w-full items-start items-center space-x-4"> <div className="flex flex-col w-full"> <span className="px-1 py-1 text-s text-white">Fungible token</span> <DropDown value={ftVault ?? ''} label="Fungible Token" options={[ { value: 'flow', label: 'Flow' }, { value: 'fut', label: 'Flow Utility Token' }, { value: 'duc', label: 'Dapper Utility Coin' }, ]} onChange={setFTVault} /> </div> <div className="flex flex-col w-full"> <span className="px-1 py-1 text-s text-white"> Collection Identifier </span> <TextInput value={collectionIdentifier ?? ''} placeholder="UFCStrike" updateValue={setCollectionIdentifier} /> </div> <div className="flex flex-col w-full"> <span className="px-1 py-1 text-s text-white">Flow network</span> <NetworkDropDown network={network} onNetworkChange={onNetworkChange} /> </div> </div> ); }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
import { ToolsCard } from '../shared/tools-card'; export function ToolsLayout() { return ( <section className="pt-10"> <ToolsCard /> </section> ); }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
@tailwind components; @tailwind base; @tailwind utilities; .internal-landing-card-green-bg { background: linear-gradient(85.22deg, #00ef8b -26.3%, rgba(0, 239, 139, 0.566845) 24.91%, rgba(0, 239, 139, 0.566845) 24.92%, rgba(193, 240, 220, 0) 91.91%); } .bg-gradient-home { background-image: url(../../assets/home.svg); } .bg-gradient-home-br { background-image: url(../../assets/home.svg); background-position: right bottom; } .bg-gradient-catalog-1 { position: absolute; top: 100px; left: 10%; right: 50%; bottom: -70.09%; background: #F77D65; filter: blur(33px); opacity: 0.1; z-index: 0; rotate: 10deg; } .bg-gradient-catalog-2 { position: absolute; left: 40%; right: 8%; top: 100px; bottom: -70.09%; rotate: 10deg; background: #3B3CFF; filter: blur(42px); opacity: 0.1; z-index: 0; } @font-face { font-family: 'Acumin Pro'; src: local('Acumin Pro'), url(../../assets/fonts/acumin-pro/Acumin-RPro.otf) format('opentype'); } @font-face { font-family: 'Acumin Pro'; src: local('Acumin Pro'), url(../../assets/fonts/acumin-pro/Acumin-RPro.otf) format('opentype'); font-style: italic; } @font-face { font-family: 'Acumin Pro'; src: local('Acumin Pro'), url(../../assets/fonts/acumin-pro/Acumin-BdPro.otf) format('opentype'); font-weight: 700; } @font-face { font-family: 'Termina'; src: local('Termina'), url(../../assets/fonts/termina/Termina-Regular.otf) format('opentype'); } @font-face { font-family: 'Termina'; src: local('Termina'), url(../../assets/fonts/termina/Termina-Bold.otf) format('opentype'); font-weight: 700; } @font-face { font-family: 'Termina'; src: local('Termina'), url(../../assets/fonts/termina/Termina-Heavy.otf) format('opentype'); font-weight: 800; } @font-face { font-family: 'IBM Plex Mono'; src: local('IBM Plex Mono'), url(../../assets/fonts/ibm-plex/IBMPlexMono-Regular.ttf) format('truetype'); } .font-display { font-family: Termina; } .loader { width: 16px; height: 16px; border-radius: 50%; background: #00ee8a; position: relative; } .loader:before, .loader:after { content: ""; position: absolute; border-radius: 50%; inset: 0; background: #00ee8a; transform: rotate(0deg) translate(30px); animation: rotate 1s ease infinite; } .loader:after { animation-delay: 0.5s } @keyframes rotate { 100% {transform: rotate(360deg) translate(30px)} } .md h1 { font-family: sans-serif; font-style: normal; font-weight: 800; font-size: 48px; line-height: 56px; color: #000; margin-bottom: 32px; padding-top: 32px; } .md h2 { font-family: sans-serif; font-style: normal; font-weight: 800; font-size: 36px; line-height: 42px; color: #000; padding-top: 32px; padding-bottom: 24px; } .md h3 { font-family: sans-serif; font-style: normal; font-weight: 800; font-size: 24px; line-height: 28px; color: #000; margin-top: 32px; margin-bottom: 24px; } .md p { font-family: sans-serif; font-style: normal; font-weight: normal; font-size: 16px; line-height: 24px; color: #000; margin-top: 32px; margin-bottom: 32px; } .md a { font-family: sans-serif; font-style: normal; font-weight: normal; font-size: 16px; line-height: 24px; color: blue; margin-top: 8px; margin-bottom: 8px; } .md pre { background-color: #fff; margin-top: 24px; } .md ol { counter-reset: item; list-style-type: none; } .md ol li { display: block; margin-top: 24px; } .md ol li:before { content: counter(item) ". "; counter-increment: item; } .md ol{ margin-left:10px; } .md ol ol{ margin-left:15px; } .md ol ol ol{ margin-left:20px; } .md li p { margin-bottom: 0px; margin-top: 0px; } .md code { font-family: 'IBM Plex Mono', monospace; font-size: 14px; line-height: 20px; color: #EB5757; background-color: #fff; padding: 4px 8px; border-radius: 4px; }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
.container { width: 100%; margin-right: auto; margin-left: auto; padding-right: 1rem; padding-left: 1rem; } @media (min-width: 1140px) { .container { max-width: 1140px; } } .form-input,.form-textarea,.form-select,.form-multiselect { -webkit-appearance: none; appearance: none; background-color: #fff; border-color: #6b7280; border-width: 1px; border-radius: 0px; padding-top: 0.5rem; padding-right: 0.75rem; padding-bottom: 0.5rem; padding-left: 0.75rem; font-size: 1rem; line-height: 1.5rem; --tw-shadow: 0 0 #0000; } .form-input:focus, .form-textarea:focus, .form-select:focus, .form-multiselect:focus { outline: 2px solid transparent; outline-offset: 2px; --tw-ring-inset: var(--tw-empty,/*!*/ /*!*/); --tw-ring-offset-width: 0px; --tw-ring-offset-color: #fff; --tw-ring-color: #2563eb; --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color); box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow); border-color: #2563eb; } .form-select { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e"); background-position: right 0.5rem center; background-repeat: no-repeat; background-size: 1.5em 1.5em; padding-right: 2.5rem; -webkit-print-color-adjust: exact; print-color-adjust: exact; } /* ! tailwindcss v3.1.4 | MIT License | https://tailwindcss.com */ /* 1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4) 2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116) */ *, ::before, ::after { box-sizing: border-box; /* 1 */ border-width: 0; /* 2 */ border-style: solid; /* 2 */ border-color: #e5e7eb; /* 2 */ } ::before, ::after { --tw-content: ''; } /* 1. Use a consistent sensible line-height in all browsers. 2. Prevent adjustments of font size after orientation changes in iOS. 3. Use a more readable tab size. 4. Use the user's configured `sans` font-family by default. */ html { line-height: 1.5; /* 1 */ -webkit-text-size-adjust: 100%; /* 2 */ /* 3 */ tab-size: 4; /* 3 */ font-family: Acumin Variable Concept, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; /* 4 */ } /* 1. Remove the margin in all browsers. 2. Inherit line-height from `html` so users can set them as a class directly on the `html` element. */ body { margin: 0; /* 1 */ line-height: inherit; /* 2 */ } /* 1. Add the correct height in Firefox. 2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655) 3. Ensure horizontal rules are visible by default. */ hr { height: 0; /* 1 */ color: inherit; /* 2 */ border-top-width: 1px; /* 3 */ } /* Add the correct text decoration in Chrome, Edge, and Safari. */ abbr:where([title]) { -webkit-text-decoration: underline dotted; text-decoration: underline dotted; } /* Remove the default font size and weight for headings. */ h1, h2, h3, h4, h5, h6 { font-size: inherit; font-weight: inherit; } /* Reset links to optimize for opt-in styling instead of opt-out. */ a { color: inherit; text-decoration: inherit; } /* Add the correct font weight in Edge and Safari. */ b, strong { font-weight: bolder; } /* 1. Use the user's configured `mono` font family by default. 2. Correct the odd `em` font sizing in all browsers. */ code, kbd, samp, pre { font-family: IBM Plex Mono; /* 1 */ font-size: 1em; /* 2 */ } /* Add the correct font size in all browsers. */ small { font-size: 80%; } /* Prevent `sub` and `sup` elements from affecting the line height in all browsers. */ sub, sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; } sub { bottom: -0.25em; } sup { top: -0.5em; } /* 1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297) 2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016) 3. Remove gaps between table borders by default. */ table { text-indent: 0; /* 1 */ border-color: inherit; /* 2 */ border-collapse: collapse; /* 3 */ } /* 1. Change the font styles in all browsers. 2. Remove the margin in Firefox and Safari. 3. Remove default padding in all browsers. */ button, input, optgroup, select, textarea { font-family: inherit; /* 1 */ font-size: 100%; /* 1 */ font-weight: inherit; /* 1 */ line-height: inherit; /* 1 */ color: inherit; /* 1 */ margin: 0; /* 2 */ padding: 0; /* 3 */ } /* Remove the inheritance of text transform in Edge and Firefox. */ button, select { text-transform: none; } /* 1. Correct the inability to style clickable types in iOS and Safari. 2. Remove default button styles. */ button, [type='button'], [type='reset'], [type='submit'] { -webkit-appearance: button; /* 1 */ background-color: transparent; /* 2 */ background-image: none; /* 2 */ } /* Use the modern Firefox focus style for all focusable elements. */ :-moz-focusring { outline: auto; } /* Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737) */ :-moz-ui-invalid { box-shadow: none; } /* Add the correct vertical alignment in Chrome and Firefox. */ progress { vertical-align: baseline; } /* Correct the cursor style of increment and decrement buttons in Safari. */ ::-webkit-inner-spin-button, ::-webkit-outer-spin-button { height: auto; } /* 1. Correct the odd appearance in Chrome and Safari. 2. Correct the outline style in Safari. */ [type='search'] { -webkit-appearance: textfield; /* 1 */ outline-offset: -2px; /* 2 */ } /* Remove the inner padding in Chrome and Safari on macOS. */ ::-webkit-search-decoration { -webkit-appearance: none; } /* 1. Correct the inability to style clickable types in iOS and Safari. 2. Change font properties to `inherit` in Safari. */ ::-webkit-file-upload-button { -webkit-appearance: button; /* 1 */ font: inherit; /* 2 */ } /* Add the correct display in Chrome and Safari. */ summary { display: list-item; } /* Removes the default spacing and border for appropriate elements. */ blockquote, dl, dd, h1, h2, h3, h4, h5, h6, hr, figure, p, pre { margin: 0; } fieldset { margin: 0; padding: 0; } legend { padding: 0; } ol, ul, menu { list-style: none; margin: 0; padding: 0; } /* Prevent resizing textareas horizontally by default. */ textarea { resize: vertical; } /* 1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300) 2. Set the default placeholder color to the user's configured gray 400 color. */ input::placeholder, textarea::placeholder { opacity: 1; /* 1 */ color: #9ca3af; /* 2 */ } /* Set the default cursor for buttons. */ button, [role="button"] { cursor: pointer; } /* Make sure disabled buttons don't get the pointer cursor. */ :disabled { cursor: default; } /* 1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14) 2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210) This can trigger a poorly considered lint error in some tools but is included by design. */ img, svg, video, canvas, audio, iframe, embed, object { display: block; /* 1 */ vertical-align: middle; /* 2 */ } /* Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14) */ img, video { max-width: 100%; height: auto; } [type='text'],[type='email'],[type='url'],[type='password'],[type='number'],[type='date'],[type='datetime-local'],[type='month'],[type='search'],[type='tel'],[type='time'],[type='week'],[multiple],textarea,select { -webkit-appearance: none; appearance: none; background-color: #fff; border-color: #6b7280; border-width: 1px; border-radius: 0px; padding-top: 0.5rem; padding-right: 0.75rem; padding-bottom: 0.5rem; padding-left: 0.75rem; font-size: 1rem; line-height: 1.5rem; --tw-shadow: 0 0 #0000; } [type='text']:focus, [type='email']:focus, [type='url']:focus, [type='password']:focus, [type='number']:focus, [type='date']:focus, [type='datetime-local']:focus, [type='month']:focus, [type='search']:focus, [type='tel']:focus, [type='time']:focus, [type='week']:focus, [multiple]:focus, textarea:focus, select:focus { outline: 2px solid transparent; outline-offset: 2px; --tw-ring-inset: var(--tw-empty,/*!*/ /*!*/); --tw-ring-offset-width: 0px; --tw-ring-offset-color: #fff; --tw-ring-color: #2563eb; --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color); box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow); border-color: #2563eb; } input::placeholder,textarea::placeholder { color: #6b7280; opacity: 1; } ::-webkit-datetime-edit-fields-wrapper { padding: 0; } ::-webkit-date-and-time-value { min-height: 1.5em; } ::-webkit-datetime-edit,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-meridiem-field { padding-top: 0; padding-bottom: 0; } select { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e"); background-position: right 0.5rem center; background-repeat: no-repeat; background-size: 1.5em 1.5em; padding-right: 2.5rem; -webkit-print-color-adjust: exact; print-color-adjust: exact; } [multiple] { background-image: initial; background-position: initial; background-repeat: unset; background-size: initial; padding-right: 0.75rem; -webkit-print-color-adjust: unset; print-color-adjust: unset; } [type='checkbox'],[type='radio'] { -webkit-appearance: none; appearance: none; padding: 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; display: inline-block; vertical-align: middle; background-origin: border-box; -webkit-user-select: none; user-select: none; flex-shrink: 0; height: 1rem; width: 1rem; color: #2563eb; background-color: #fff; border-color: #6b7280; border-width: 1px; --tw-shadow: 0 0 #0000; } [type='checkbox'] { border-radius: 0px; } [type='radio'] { border-radius: 100%; } [type='checkbox']:focus,[type='radio']:focus { outline: 2px solid transparent; outline-offset: 2px; --tw-ring-inset: var(--tw-empty,/*!*/ /*!*/); --tw-ring-offset-width: 2px; --tw-ring-offset-color: #fff; --tw-ring-color: #2563eb; --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color); box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow); } [type='checkbox']:checked,[type='radio']:checked { border-color: transparent; background-color: currentColor; background-size: 100% 100%; background-position: center; background-repeat: no-repeat; } [type='checkbox']:checked { background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e"); } [type='radio']:checked { background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e"); } [type='checkbox']:checked:hover,[type='checkbox']:checked:focus,[type='radio']:checked:hover,[type='radio']:checked:focus { border-color: transparent; background-color: currentColor; } [type='checkbox']:indeterminate { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8h8'/%3e%3c/svg%3e"); border-color: transparent; background-color: currentColor; background-size: 100% 100%; background-position: center; background-repeat: no-repeat; } [type='checkbox']:indeterminate:hover,[type='checkbox']:indeterminate:focus { border-color: transparent; background-color: currentColor; } [type='file'] { background: unset; border-color: inherit; border-width: 0; border-radius: 0; padding: 0; font-size: unset; line-height: inherit; } [type='file']:focus { outline: 1px solid ButtonText; outline: 1px auto -webkit-focus-ring-color; } *, ::before, ::after { --tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; --tw-rotate: 0; --tw-skew-x: 0; --tw-skew-y: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-pan-x: ; --tw-pan-y: ; --tw-pinch-zoom: ; --tw-scroll-snap-strictness: proximity; --tw-ordinal: ; --tw-slashed-zero: ; --tw-numeric-figure: ; --tw-numeric-spacing: ; --tw-numeric-fraction: ; --tw-ring-inset: ; --tw-ring-offset-width: 0px; --tw-ring-offset-color: #fff; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-shadow: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-shadow-colored: 0 0 #0000; --tw-blur: ; --tw-brightness: ; --tw-contrast: ; --tw-grayscale: ; --tw-hue-rotate: ; --tw-invert: ; --tw-saturate: ; --tw-sepia: ; --tw-drop-shadow: ; --tw-backdrop-blur: ; --tw-backdrop-brightness: ; --tw-backdrop-contrast: ; --tw-backdrop-grayscale: ; --tw-backdrop-hue-rotate: ; --tw-backdrop-invert: ; --tw-backdrop-opacity: ; --tw-backdrop-saturate: ; --tw-backdrop-sepia: ; } ::-webkit-backdrop { --tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; --tw-rotate: 0; --tw-skew-x: 0; --tw-skew-y: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-pan-x: ; --tw-pan-y: ; --tw-pinch-zoom: ; --tw-scroll-snap-strictness: proximity; --tw-ordinal: ; --tw-slashed-zero: ; --tw-numeric-figure: ; --tw-numeric-spacing: ; --tw-numeric-fraction: ; --tw-ring-inset: ; --tw-ring-offset-width: 0px; --tw-ring-offset-color: #fff; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-shadow: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-shadow-colored: 0 0 #0000; --tw-blur: ; --tw-brightness: ; --tw-contrast: ; --tw-grayscale: ; --tw-hue-rotate: ; --tw-invert: ; --tw-saturate: ; --tw-sepia: ; --tw-drop-shadow: ; --tw-backdrop-blur: ; --tw-backdrop-brightness: ; --tw-backdrop-contrast: ; --tw-backdrop-grayscale: ; --tw-backdrop-hue-rotate: ; --tw-backdrop-invert: ; --tw-backdrop-opacity: ; --tw-backdrop-saturate: ; --tw-backdrop-sepia: ; } ::backdrop { --tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; --tw-rotate: 0; --tw-skew-x: 0; --tw-skew-y: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-pan-x: ; --tw-pan-y: ; --tw-pinch-zoom: ; --tw-scroll-snap-strictness: proximity; --tw-ordinal: ; --tw-slashed-zero: ; --tw-numeric-figure: ; --tw-numeric-spacing: ; --tw-numeric-fraction: ; --tw-ring-inset: ; --tw-ring-offset-width: 0px; --tw-ring-offset-color: #fff; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-shadow: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-shadow-colored: 0 0 #0000; --tw-blur: ; --tw-brightness: ; --tw-contrast: ; --tw-grayscale: ; --tw-hue-rotate: ; --tw-invert: ; --tw-saturate: ; --tw-sepia: ; --tw-drop-shadow: ; --tw-backdrop-blur: ; --tw-backdrop-brightness: ; --tw-backdrop-contrast: ; --tw-backdrop-grayscale: ; --tw-backdrop-hue-rotate: ; --tw-backdrop-invert: ; --tw-backdrop-opacity: ; --tw-backdrop-saturate: ; --tw-backdrop-sepia: ; } .pointer-events-none { pointer-events: none; } .fixed { position: fixed; } .absolute { position: absolute; } .relative { position: relative; } .inset-y-0 { top: 0px; bottom: 0px; } .right-0 { right: 0px; } .left-0 { left: 0px; } .bottom-0 { bottom: 0px; } .z-20 { z-index: 20; } .z-40 { z-index: 40; } .float-right { float: right; } .m-4 { margin: 1rem; } .mx-auto { margin-left: auto; margin-right: auto; } .my-4 { margin-top: 1rem; margin-bottom: 1rem; } .my-2 { margin-top: 0.5rem; margin-bottom: 0.5rem; } .my-3 { margin-top: 0.75rem; margin-bottom: 0.75rem; } .my-12 { margin-top: 3rem; margin-bottom: 3rem; } .-mt-16 { margin-top: -4rem; } .mt-8 { margin-top: 2rem; } .mt-4 { margin-top: 1rem; } .mb-2 { margin-bottom: 0.5rem; } .mt-1 { margin-top: 0.25rem; } .mr-2 { margin-right: 0.5rem; } .mt-10 { margin-top: 2.5rem; } .-mb-px { margin-bottom: -1px; } .ml-2 { margin-left: 0.5rem; } .mt-2 { margin-top: 0.5rem; } .mb-8 { margin-bottom: 2rem; } .mb-0 { margin-bottom: 0px; } .ml-4 { margin-left: 1rem; } .ml-auto { margin-left: auto; } .mr-4 { margin-right: 1rem; } .ml-1 { margin-left: 0.25rem; } .mb-4 { margin-bottom: 1rem; } .mb-6 { margin-bottom: 1.5rem; } .mb-1 { margin-bottom: 0.25rem; } .ml-24 { margin-left: 6rem; } .mb-16 { margin-bottom: 4rem; } .mt-28 { margin-top: 7rem; } .mr-8 { margin-right: 2rem; } .block { display: block; } .inline-block { display: inline-block; } .flex { display: flex; } .inline-flex { display: inline-flex; } .grid { display: grid; } .contents { display: contents; } .hidden { display: none; } .h-full { height: 100%; } .h-16 { height: 4rem; } .h-12 { height: 3rem; } .h-8 { height: 2rem; } .h-6 { height: 1.5rem; } .h-10 { height: 2.5rem; } .h-5 { height: 1.25rem; } .h-1\/2 { height: 50%; } .h-4 { height: 1rem; } .h-screen { height: 100vh; } .h-28 { height: 7rem; } .max-h-60 { max-height: 15rem; } .min-h-screen { min-height: 100vh; } .min-h-\[96px\] { min-height: 96px; } .w-full { width: 100%; } .w-3\/4 { width: 75%; } .w-8 { width: 2rem; } .w-6 { width: 1.5rem; } .w-fit { width: -moz-fit-content; width: fit-content; } .w-5 { width: 1.25rem; } .w-48 { width: 12rem; } .w-4 { width: 1rem; } .w-1\/2 { width: 50%; } .w-2\/3 { width: 66.666667%; } .w-7\/12 { width: 58.333333%; } .w-max { width: max-content; } .max-w-lg { max-width: 32rem; } .max-w-full { max-width: 100%; } .max-w-7xl { max-width: 80rem; } .flex-1 { flex: 1 1 0%; } .flex-grow { flex-grow: 1; } .grow { flex-grow: 1; } .basis-1\/2 { flex-basis: 50%; } .origin-top-right { transform-origin: top right; } .transform { transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); } .cursor-pointer { cursor: pointer; } .auto-cols-min { grid-auto-columns: min-content; } .grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); } .grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .flex-row { flex-direction: row; } .flex-col { flex-direction: column; } .flex-wrap { flex-wrap: wrap; } .items-start { align-items: flex-start; } .items-end { align-items: flex-end; } .items-center { align-items: center; } .items-stretch { align-items: stretch; } .justify-start { justify-content: flex-start; } .justify-end { justify-content: flex-end; } .justify-center { justify-content: center; } .justify-between { justify-content: space-between; } .gap-6 { gap: 1.5rem; } .gap-4 { gap: 1rem; } .gap-0 { gap: 0px; } .gap-y-4 { row-gap: 1rem; } .space-x-4 > :not([hidden]) ~ :not([hidden]) { --tw-space-x-reverse: 0; margin-right: calc(1rem * var(--tw-space-x-reverse)); margin-left: calc(1rem * calc(1 - var(--tw-space-x-reverse))); } .space-x-10 > :not([hidden]) ~ :not([hidden]) { --tw-space-x-reverse: 0; margin-right: calc(2.5rem * var(--tw-space-x-reverse)); margin-left: calc(2.5rem * calc(1 - var(--tw-space-x-reverse))); } .space-y-4 > :not([hidden]) ~ :not([hidden]) { --tw-space-y-reverse: 0; margin-top: calc(1rem * calc(1 - var(--tw-space-y-reverse))); margin-bottom: calc(1rem * var(--tw-space-y-reverse)); } .space-x-0 > :not([hidden]) ~ :not([hidden]) { --tw-space-x-reverse: 0; margin-right: calc(0px * var(--tw-space-x-reverse)); margin-left: calc(0px * calc(1 - var(--tw-space-x-reverse))); } .space-x-2 > :not([hidden]) ~ :not([hidden]) { --tw-space-x-reverse: 0; margin-right: calc(0.5rem * var(--tw-space-x-reverse)); margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse))); } .self-start { align-self: flex-start; } .justify-self-start { justify-self: start; } .overflow-hidden { overflow: hidden; } .overflow-clip { overflow: clip; } .overflow-x-auto { overflow-x: auto; } .truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .text-ellipsis { text-overflow: ellipsis; } .whitespace-nowrap { white-space: nowrap; } .whitespace-pre { white-space: pre; } .whitespace-pre-line { white-space: pre-line; } .rounded-lg { border-radius: 0.5rem; } .rounded-2xl { border-radius: 1rem; } .rounded { border-radius: 0.25rem; } .rounded-sm { border-radius: 0.125rem; } .rounded-xl { border-radius: 0.75rem; } .rounded-md { border-radius: 0.375rem; } .rounded-full { border-radius: 9999px; } .rounded-\[16px\] { border-radius: 16px; } .rounded-r-2xl { border-top-right-radius: 1rem; border-bottom-right-radius: 1rem; } .rounded-t-lg { border-top-left-radius: 0.5rem; border-top-right-radius: 0.5rem; } .border-2 { border-width: 2px; } .border { border-width: 1px; } .border-y { border-top-width: 1px; border-bottom-width: 1px; } .border-t-2 { border-top-width: 2px; } .border-l-4 { border-left-width: 4px; } .border-b-4 { border-bottom-width: 4px; } .border-l { border-left-width: 1px; } .border-b-2 { border-bottom-width: 2px; } .border-solid { border-style: solid; } .border-blue-700 { --tw-border-opacity: 1; border-color: rgb(29 78 216 / var(--tw-border-opacity)); } .border-primary-gray-dark { --tw-border-opacity: 1; border-color: rgb(151 151 151 / var(--tw-border-opacity)); } .border-black { --tw-border-opacity: 1; border-color: rgb(0 0 0 / var(--tw-border-opacity)); } .border-transparent { border-color: transparent; } .border-accent-light-gray { --tw-border-opacity: 1; border-color: rgb(243 243 243 / var(--tw-border-opacity)); } .border-red-300 { --tw-border-opacity: 1; border-color: rgb(252 165 165 / var(--tw-border-opacity)); } .border-blue-300 { --tw-border-opacity: 1; border-color: rgb(147 197 253 / var(--tw-border-opacity)); } .border-green-300 { --tw-border-opacity: 1; border-color: rgb(134 239 172 / var(--tw-border-opacity)); } .border-gray-400 { --tw-border-opacity: 1; border-color: rgb(156 163 175 / var(--tw-border-opacity)); } .border-gray-300 { --tw-border-opacity: 1; border-color: rgb(209 213 219 / var(--tw-border-opacity)); } .border-primary-gray-100 { --tw-border-opacity: 1; border-color: rgb(222 226 233 / var(--tw-border-opacity)); } .border-x-primary-purple { --tw-border-opacity: 1; border-left-color: rgb(162 105 255 / var(--tw-border-opacity)); border-right-color: rgb(162 105 255 / var(--tw-border-opacity)); } .border-y-primary-gray-300 { --tw-border-opacity: 1; border-top-color: rgb(105 113 126 / var(--tw-border-opacity)); border-bottom-color: rgb(105 113 126 / var(--tw-border-opacity)); } .bg-primary-gray-50 { --tw-bg-opacity: 1; background-color: rgb(246 247 249 / var(--tw-bg-opacity)); } .bg-white { --tw-bg-opacity: 1; background-color: rgb(255 255 255 / var(--tw-bg-opacity)); } .bg-black { --tw-bg-opacity: 1; background-color: rgb(0 0 0 / var(--tw-bg-opacity)); } .bg-transparent { background-color: transparent; } .bg-red-100 { --tw-bg-opacity: 1; background-color: rgb(254 226 226 / var(--tw-bg-opacity)); } .bg-blue-100 { --tw-bg-opacity: 1; background-color: rgb(219 234 254 / var(--tw-bg-opacity)); } .bg-green-100 { --tw-bg-opacity: 1; background-color: rgb(220 252 231 / var(--tw-bg-opacity)); } .bg-gray-50 { --tw-bg-opacity: 1; background-color: rgb(249 250 251 / var(--tw-bg-opacity)); } .bg-gray-200 { --tw-bg-opacity: 1; background-color: rgb(229 231 235 / var(--tw-bg-opacity)); } .bg-gradient-to-r { background-image: linear-gradient(to right, var(--tw-gradient-stops)); } .from-violet-600 { --tw-gradient-from: #7c3aed; --tw-gradient-to: rgb(124 58 237 / 0); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); } .to-blue-500 { --tw-gradient-to: #3b82f6; } .fill-current { fill: currentColor; } .stroke-black { stroke: #000; } .object-contain { object-fit: contain; } .p-8 { padding: 2rem; } .p-6 { padding: 1.5rem; } .p-4 { padding: 1rem; } .p-2 { padding: 0.5rem; } .p-2\.5 { padding: 0.625rem; } .px-4 { padding-left: 1rem; padding-right: 1rem; } .py-4 { padding-top: 1rem; padding-bottom: 1rem; } .px-2 { padding-left: 0.5rem; padding-right: 0.5rem; } .py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; } .px-1 { padding-left: 0.25rem; padding-right: 0.25rem; } .px-8 { padding-left: 2rem; padding-right: 2rem; } .px-0 { padding-left: 0px; padding-right: 0px; } .px-10 { padding-left: 2.5rem; padding-right: 2.5rem; } .py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; } .py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; } .px-5 { padding-left: 1.25rem; padding-right: 1.25rem; } .px-2\.5 { padding-left: 0.625rem; padding-right: 0.625rem; } .py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; } .py-0 { padding-top: 0px; padding-bottom: 0px; } .px-6 { padding-left: 1.5rem; padding-right: 1.5rem; } .py-5 { padding-top: 1.25rem; padding-bottom: 1.25rem; } .px-3 { padding-left: 0.75rem; padding-right: 0.75rem; } .py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; } .py-16 { padding-top: 4rem; padding-bottom: 4rem; } .py-8 { padding-top: 2rem; padding-bottom: 2rem; } .py-20 { padding-top: 5rem; padding-bottom: 5rem; } .pb-16 { padding-bottom: 4rem; } .pt-3\.5 { padding-top: 0.875rem; } .pt-3 { padding-top: 0.75rem; } .pt-4 { padding-top: 1rem; } .pt-16 { padding-top: 4rem; } .pb-96 { padding-bottom: 24rem; } .pb-4 { padding-bottom: 1rem; } .pt-1 { padding-top: 0.25rem; } .pt-8 { padding-top: 2rem; } .pb-6 { padding-bottom: 1.5rem; } .pt-9 { padding-top: 2.25rem; } .pb-12 { padding-bottom: 3rem; } .pb-3 { padding-bottom: 0.75rem; } .pl-0 { padding-left: 0px; } .pb-8 { padding-bottom: 2rem; } .pl-8 { padding-left: 2rem; } .pl-4 { padding-left: 1rem; } .pl-3 { padding-left: 0.75rem; } .pl-10 { padding-left: 2.5rem; } .pt-10 { padding-top: 2.5rem; } .pr-24 { padding-right: 6rem; } .pt-12 { padding-top: 3rem; } .pt-2 { padding-top: 0.5rem; } .text-left { text-align: left; } .text-center { text-align: center; } .align-middle { vertical-align: middle; } .font-display { font-family: Termina; } .text-xl { font-size: 1.25rem; line-height: 1.75rem; } .text-xs { font-size: 0.75rem; line-height: 1rem; } .text-sm { font-size: 0.875rem; line-height: 1.25rem; } .text-2xl { font-size: 1.5rem; line-height: 2rem; } .text-lg { font-size: 1.125rem; line-height: 1.75rem; } .\!text-2xl { font-size: 1.5rem !important; line-height: 2rem !important; } .text-3xl { font-size: 1.875rem; line-height: 2.25rem; } .text-5xl { font-size: 3.5rem; line-height: 1; } .text-base { font-size: 1rem; line-height: 1.5rem; } .\!text-xl { font-size: 1.25rem !important; line-height: 1.75rem !important; } .text-7xl { font-size: 4rem; line-height: 1; } .font-semibold { font-weight: 600; } .font-bold { font-weight: 700; } .font-medium { font-weight: 500; } .italic { font-style: italic; } .leading-5 { line-height: 1.25rem; } .leading-relaxed { line-height: 1.625; } .text-gray-400 { --tw-text-opacity: 1; color: rgb(156 163 175 / var(--tw-text-opacity)); } .text-blue-700 { --tw-text-opacity: 1; color: rgb(29 78 216 / var(--tw-text-opacity)); } .text-gray-500 { --tw-text-opacity: 1; color: rgb(107 114 128 / var(--tw-text-opacity)); } .text-black { --tw-text-opacity: 1; color: rgb(0 0 0 / var(--tw-text-opacity)); } .text-blue-600 { --tw-text-opacity: 1; color: rgb(37 99 235 / var(--tw-text-opacity)); } .text-gray-600 { --tw-text-opacity: 1; color: rgb(75 85 99 / var(--tw-text-opacity)); } .text-white { --tw-text-opacity: 1; color: rgb(255 255 255 / var(--tw-text-opacity)); } .text-gray-800 { --tw-text-opacity: 1; color: rgb(31 41 55 / var(--tw-text-opacity)); } .text-blue-500 { --tw-text-opacity: 1; color: rgb(59 130 246 / var(--tw-text-opacity)); } .text-primary-gray-200 { --tw-text-opacity: 1; color: rgb(171 179 191 / var(--tw-text-opacity)); } .text-gray-700 { --tw-text-opacity: 1; color: rgb(55 65 81 / var(--tw-text-opacity)); } .text-primary-gray-400 { --tw-text-opacity: 1; color: rgb(47 53 63 / var(--tw-text-opacity)); } .text-primary-gray-300 { --tw-text-opacity: 1; color: rgb(105 113 126 / var(--tw-text-opacity)); } .text-gray-900 { --tw-text-opacity: 1; color: rgb(17 24 39 / var(--tw-text-opacity)); } .text-stone-500 { --tw-text-opacity: 1; color: rgb(120 113 108 / var(--tw-text-opacity)); } .text-stone-600 { --tw-text-opacity: 1; color: rgb(87 83 78 / var(--tw-text-opacity)); } .text-green-600 { --tw-text-opacity: 1; color: rgb(22 163 74 / var(--tw-text-opacity)); } .text-violet-600 { --tw-text-opacity: 1; color: rgb(124 58 237 / var(--tw-text-opacity)); } .underline { text-decoration-line: underline; } .no-underline { text-decoration-line: none; } .shadow-md { --tw-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); --tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color); box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); } .shadow { --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1); --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color); box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); } .shadow-lg { --tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color); box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); } .filter { filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); } .transition { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter; transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter; transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; } .duration-300 { transition-duration: 300ms; } .internal-landing-card-green-bg { background: linear-gradient(85.22deg, #00ef8b -26.3%, rgba(0, 239, 139, 0.566845) 24.91%, rgba(0, 239, 139, 0.566845) 24.92%, rgba(193, 240, 220, 0) 91.91%); } .bg-gradient-home { background-image: url(../../assets/home.svg); } .bg-gradient-home-br { background-image: url(../../assets/home.svg); background-position: right bottom; } .bg-gradient-catalog-1 { position: absolute; top: 100px; left: 10%; right: 50%; bottom: -70.09%; background: #F77D65; filter: blur(33px); opacity: 0.1; z-index: 0; rotate: 10deg; } .bg-gradient-catalog-2 { position: absolute; left: 40%; right: 8%; top: 100px; bottom: -70.09%; rotate: 10deg; background: #3B3CFF; filter: blur(42px); opacity: 0.1; z-index: 0; } @font-face { font-family: 'Acumin Pro'; src: local('Acumin Pro'), url(../../assets/fonts/acumin-pro/Acumin-RPro.otf) format('opentype'); } @font-face { font-family: 'Acumin Pro'; src: local('Acumin Pro'), url(../../assets/fonts/acumin-pro/Acumin-RPro.otf) format('opentype'); font-style: italic; } @font-face { font-family: 'Acumin Pro'; src: local('Acumin Pro'), url(../../assets/fonts/acumin-pro/Acumin-BdPro.otf) format('opentype'); font-weight: 700; } @font-face { font-family: 'Termina'; src: local('Termina'), url(../../assets/fonts/termina/Termina-Regular.otf) format('opentype'); } @font-face { font-family: 'Termina'; src: local('Termina'), url(../../assets/fonts/termina/Termina-Bold.otf) format('opentype'); font-weight: 700; } @font-face { font-family: 'Termina'; src: local('Termina'), url(../../assets/fonts/termina/Termina-Heavy.otf) format('opentype'); font-weight: 800; } @font-face { font-family: 'IBM Plex Mono'; src: local('IBM Plex Mono'), url(../../assets/fonts/ibm-plex/IBMPlexMono-Regular.ttf) format('truetype'); } .font-display { font-family: Termina; } .loader { width: 16px; height: 16px; border-radius: 50%; background: #00ee8a; position: relative; } .loader:before, .loader:after { content: ""; position: absolute; border-radius: 50%; inset: 0; background: #00ee8a; transform: rotate(0deg) translate(30px); animation: rotate 1s ease infinite; } .loader:after { animation-delay: 0.5s } @keyframes rotate { 100% { transform: rotate(360deg) translate(30px) } } .md h1 { font-family: sans-serif; font-style: normal; font-weight: 800; font-size: 48px; line-height: 56px; color: #000; margin-bottom: 32px; padding-top: 32px; } .md h2 { font-family: sans-serif; font-style: normal; font-weight: 800; font-size: 36px; line-height: 42px; color: #000; padding-top: 32px; padding-bottom: 24px; } .md h3 { font-family: sans-serif; font-style: normal; font-weight: 800; font-size: 24px; line-height: 28px; color: #000; margin-top: 32px; margin-bottom: 24px; } .md p { font-family: sans-serif; font-style: normal; font-weight: normal; font-size: 16px; line-height: 24px; color: #000; margin-top: 32px; margin-bottom: 32px; } .md a { font-family: sans-serif; font-style: normal; font-weight: normal; font-size: 16px; line-height: 24px; color: blue; margin-top: 8px; margin-bottom: 8px; } .md pre { background-color: #fff; margin-top: 24px; } .md ol { counter-reset: item; list-style-type: none; } .md ol li { display: block; margin-top: 24px; } .md ol li:before { content: counter(item) ". "; counter-increment: item; } .md ol{ margin-left:10px; } .md ol ol{ margin-left:15px; } .md ol ol ol{ margin-left:20px; } .md li p { margin-bottom: 0px; margin-top: 0px; } .md code { font-family: 'IBM Plex Mono', monospace; font-size: 14px; line-height: 20px; color: #EB5757; background-color: #fff; padding: 4px 8px; border-radius: 4px; } .hover\:text-clip:hover { text-overflow: clip; } .hover\:border-primary-purple:hover { --tw-border-opacity: 1; border-color: rgb(162 105 255 / var(--tw-border-opacity)); } .hover\:border-gray-500:hover { --tw-border-opacity: 1; border-color: rgb(107 114 128 / var(--tw-border-opacity)); } .hover\:bg-gray-300:hover { --tw-bg-opacity: 1; background-color: rgb(209 213 219 / var(--tw-bg-opacity)); } .hover\:bg-black\/50:hover { background-color: rgb(0 0 0 / 0.5); } .hover\:bg-gray-100:hover { --tw-bg-opacity: 1; background-color: rgb(243 244 246 / var(--tw-bg-opacity)); } .hover\:bg-gray-400:hover { --tw-bg-opacity: 1; background-color: rgb(156 163 175 / var(--tw-bg-opacity)); } .hover\:text-black:hover { --tw-text-opacity: 1; color: rgb(0 0 0 / var(--tw-text-opacity)); } .hover\:text-primary-gray-100:hover { --tw-text-opacity: 1; color: rgb(222 226 233 / var(--tw-text-opacity)); } .hover\:underline:hover { text-decoration-line: underline; } .hover\:opacity-75:hover { opacity: 0.75; } .focus\:border-blue-500:focus { --tw-border-opacity: 1; border-color: rgb(59 130 246 / var(--tw-border-opacity)); } .focus\:bg-gray-100:focus { --tw-bg-opacity: 1; background-color: rgb(243 244 246 / var(--tw-bg-opacity)); } .focus\:outline-none:focus { outline: 2px solid transparent; outline-offset: 2px; } .focus\:ring-blue-500:focus { --tw-ring-opacity: 1; --tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity)); } .active\:bg-gray-300:active { --tw-bg-opacity: 1; background-color: rgb(209 213 219 / var(--tw-bg-opacity)); } .active\:shadow-none:active { --tw-shadow: 0 0 #0000; --tw-shadow-colored: 0 0 #0000; box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); } .disabled\:cursor-default:disabled { cursor: default; } .disabled\:bg-neutral-400:disabled { --tw-bg-opacity: 1; background-color: rgb(163 163 163 / var(--tw-bg-opacity)); } .disabled\:text-white:disabled { --tw-text-opacity: 1; color: rgb(255 255 255 / var(--tw-text-opacity)); } @media (prefers-color-scheme: dark) { .dark\:border-gray-500 { --tw-border-opacity: 1; border-color: rgb(107 114 128 / var(--tw-border-opacity)); } .dark\:border-transparent { border-color: transparent; } .dark\:border-gray-700 { --tw-border-opacity: 1; border-color: rgb(55 65 81 / var(--tw-border-opacity)); } .dark\:border-gray-600 { --tw-border-opacity: 1; border-color: rgb(75 85 99 / var(--tw-border-opacity)); } .dark\:bg-red-200 { --tw-bg-opacity: 1; background-color: rgb(254 202 202 / var(--tw-bg-opacity)); } .dark\:bg-blue-200 { --tw-bg-opacity: 1; background-color: rgb(191 219 254 / var(--tw-bg-opacity)); } .dark\:bg-green-200 { --tw-bg-opacity: 1; background-color: rgb(187 247 208 / var(--tw-bg-opacity)); } .dark\:bg-gray-700 { --tw-bg-opacity: 1; background-color: rgb(55 65 81 / var(--tw-bg-opacity)); } .dark\:text-gray-500 { --tw-text-opacity: 1; color: rgb(107 114 128 / var(--tw-text-opacity)); } .dark\:text-gray-400 { --tw-text-opacity: 1; color: rgb(156 163 175 / var(--tw-text-opacity)); } .dark\:text-yellow-900 { --tw-text-opacity: 1; color: rgb(113 63 18 / var(--tw-text-opacity)); } .dark\:text-blue-800 { --tw-text-opacity: 1; color: rgb(30 64 175 / var(--tw-text-opacity)); } .dark\:text-green-900 { --tw-text-opacity: 1; color: rgb(20 83 45 / var(--tw-text-opacity)); } .dark\:text-white { --tw-text-opacity: 1; color: rgb(255 255 255 / var(--tw-text-opacity)); } .dark\:text-primary-gray-200 { --tw-text-opacity: 1; color: rgb(171 179 191 / var(--tw-text-opacity)); } .dark\:text-primary-gray-400 { --tw-text-opacity: 1; color: rgb(47 53 63 / var(--tw-text-opacity)); } .dark\:placeholder-gray-400::placeholder { --tw-placeholder-opacity: 1; color: rgb(156 163 175 / var(--tw-placeholder-opacity)); } .dark\:focus\:border-blue-500:focus { --tw-border-opacity: 1; border-color: rgb(59 130 246 / var(--tw-border-opacity)); } .dark\:focus\:ring-blue-500:focus { --tw-ring-opacity: 1; --tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity)); } } @media (min-width: 360px) { .xs\:hidden { display: none; } .xs\:max-w-sm { max-width: 24rem; } .xs\:grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); } .xs\:flex-col { flex-direction: column; } .xs\:p-4 { padding: 1rem; } .xs\:py-16 { padding-top: 4rem; padding-bottom: 4rem; } .xs\:text-2xl { font-size: 1.5rem; line-height: 2rem; } } @media (min-width: 375px) { .sm\:mt-10 { margin-top: 2.5rem; } .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sm\:flex-col { flex-direction: column; } .sm\:gap-x-12 { column-gap: 3rem; } .sm\:space-y-4 > :not([hidden]) ~ :not([hidden]) { --tw-space-y-reverse: 0; margin-top: calc(1rem * calc(1 - var(--tw-space-y-reverse))); margin-bottom: calc(1rem * var(--tw-space-y-reverse)); } .sm\:border-0 { border-width: 0px; } .sm\:text-4xl { font-size: 2rem; line-height: 2.25rem; } } @media (min-width: 768px) { .md\:mr-10 { margin-right: 2.5rem; } .md\:mb-3 { margin-bottom: 0.75rem; } .md\:mt-0 { margin-top: 0px; } .md\:mb-8 { margin-bottom: 2rem; } .md\:flex { display: flex; } .md\:inline-flex { display: inline-flex; } .md\:hidden { display: none; } .md\:max-w-xs { max-width: 20rem; } .md\:max-w-sm { max-width: 24rem; } .md\:max-w-2xl { max-width: 42rem; } .md\:basis-1\/2 { flex-basis: 50%; } .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .md\:flex-row { flex-direction: row; } .md\:gap-x-20 { column-gap: 5rem; } .md\:space-y-0 > :not([hidden]) ~ :not([hidden]) { --tw-space-y-reverse: 0; margin-top: calc(0px * calc(1 - var(--tw-space-y-reverse))); margin-bottom: calc(0px * var(--tw-space-y-reverse)); } .md\:space-x-4 > :not([hidden]) ~ :not([hidden]) { --tw-space-x-reverse: 0; margin-right: calc(1rem * var(--tw-space-x-reverse)); margin-left: calc(1rem * calc(1 - var(--tw-space-x-reverse))); } .md\:border-r-2 { border-right-width: 2px; } .md\:px-4 { padding-left: 1rem; padding-right: 1rem; } .md\:py-12 { padding-top: 3rem; padding-bottom: 3rem; } .md\:pt-16 { padding-top: 4rem; } .md\:pt-0 { padding-top: 0px; } .md\:pb-0 { padding-bottom: 0px; } .md\:pl-24 { padding-left: 6rem; } .md\:pl-12 { padding-left: 3rem; } .md\:\!text-4xl { font-size: 2rem !important; line-height: 2.25rem !important; } .md\:text-5xl { font-size: 3.5rem; line-height: 1; } .md\:text-xl { font-size: 1.25rem; line-height: 1.75rem; } .md\:text-sm { font-size: 0.875rem; line-height: 1.25rem; } .md\:\!text-2xl { font-size: 1.5rem !important; line-height: 2rem !important; } .md\:text-4xl { font-size: 2rem; line-height: 2.25rem; } } @media (min-width: 1440px) { .lg\:flex { display: flex; } .lg\:hidden { display: none; } .lg\:max-w-sm { max-width: 24rem; } .lg\:max-w-5xl { max-width: 64rem; } .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .lg\:grid-cols-\[fit-content\(25\%\)_fit-content\(25\%\)_fit-content\(25\%\)_fit-content\(25\%\)\] { grid-template-columns: fit-content(25%) fit-content(25%) fit-content(25%) fit-content(25%); } .lg\:flex-row { flex-direction: row; } .lg\:px-32 { padding-left: 8rem; padding-right: 8rem; } .lg\:px-12 { padding-left: 3rem; padding-right: 3rem; } .lg\:px-8 { padding-left: 2rem; padding-right: 2rem; } .lg\:text-2xl { font-size: 1.5rem; line-height: 2rem; } .lg\:text-base { font-size: 1rem; line-height: 1.5rem; } .lg\:text-5xl { font-size: 3.5rem; line-height: 1; } }
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
export const environment = { production: true, };
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
// This file can be replaced during build by using the `fileReplacements` array. // When building for production, this file is replaced with `environment.prod.ts`. export const environment = { production: false, };
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
# Running Headless ``` nx e2e nft-portal-e2e ``` Headful ``` nx e2e nft-portal-e2e --watch ```
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
describe('nft-metadata/catalog', () => { beforeEach(() => cy.visit('/transactions')); it('should load the transaction generation page', () => { cy.get('.px-4 > .flex-1').contains('Generate Transactions'); }); it('Should show when clicking transaction name', () => { // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(2000); cy.get('#default-search').type('UFCStrike'); cy.get('.lg\\:hidden > .border-t-1 > :nth-child(2)').first().click(); cy.get(':nth-child(2) > .my-4 > .sc-gswNZR > span > code').contains( 'import' ); }); });
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
describe('nft-metadata/verifier', () => { beforeEach(() => cy.visit('/v')); it('should load the verifier page', () => { cy.get('.md\\:mb-8').contains('Add your NFT Collection'); }); it('should go through the verifier flow for good contract', () => { // On step 1 cy.get(':nth-child(1) > .group').should('have.class', 'border-black'); cy.get('#default-search').click(); cy.get('#default-search').type('0x37d92dad2356b641'); cy.get('.gap-4 > .cursor-pointer').click(); cy.get('.flex-wrap > :nth-child(1)').click(); // On step 2 cy.get(':nth-child(2) > .group').should('have.class', 'border-black'); cy.get('form.w-7\\/12 > :nth-child(6)').click(); cy.get('.mt-8 > #default-search').click(); cy.get('.mt-8 > #default-search').type('0x2aa77a0776d7c209'); cy.get('form.w-7\\/12 > .bg-black').click(); // On step 3 cy.get(':nth-child(3) > .group').should('have.class', 'border-black'); // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(5000); cy.get('.mt-8 > :nth-child(4)').contains( 'is implementing all of the recommended views!' ); }); it('should go through the verifier flow for non standard contract', () => { // On step 1 cy.get(':nth-child(1) > .group').should('have.class', 'border-black'); cy.get('#default-search').click(); cy.get('#default-search').type('0x37d92dad2356b641'); cy.get('.gap-4 > .cursor-pointer').click(); cy.get('.flex-wrap > :nth-child(2)').click(); // On step 2 cy.get(':nth-child(2) > .group').should('have.class', 'border-black'); cy.get('form.w-7\\/12 > :nth-child(6)').click(); cy.get('.mt-8 > #default-search').click(); cy.get('.mt-8 > #default-search').type('0x2aa77a0776d7c209'); cy.get('form.w-7\\/12 > .bg-black').click(); // On step 3 cy.get(':nth-child(3) > .group').should('have.class', 'border-black'); // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(5000); cy.get('.mt-8.max-w-7xl > .mt-8').contains( 'You have not properly implemented all recommended metadata views required to be added to the NFT catalog.' ); }); });
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
describe('nft-metadata/viewnfts', () => { beforeEach(() => cy.visit('/nfts')); it('should load the view nft page', () => { cy.get('.px-4 > .flex-1').contains('View NFTs'); }); it('Should prompt for proper collection identifier when clicking transaction name', () => { // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(2000); cy.get('#default-search').type('0x2aa77a0776d7c209'); // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(2000); cy.get('.md\\:flex-row > :nth-child(2) > .h-12').select('Testnet'); // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(2000); cy.get('.border-t-1 > .flex-col').click(); cy.get('.text-3xl').contains('NFT | Test NFT Name 1'); }); });
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
describe('nft-metadata/catalog', () => { beforeEach(() => cy.visit('/catalog')); it('should load the catalog page', () => { cy.get('.text-2xl').contains('Explore the catalog'); }); it('should search and load an item from the catalog', () => { // eslint-disable-next-line cypress/no-unnecessary-waiting cy.wait(5000); cy.get('.flex-grow > .w-full').type('TopShot'); cy.get('[href="/catalog/mainnet/NBATopShot"] > .flex-col').click(); cy.get('.xs\\:text-2xl').contains('NBA-Top-Shot'); }); });
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
describe('nft-metadata/home', () => { beforeEach(() => cy.visit('/')); it('should load the home page', () => { // Should be on home page. cy.get('.text-5xl').contains('Explore the Flow NFT Catalog'); // Should have buttons. cy.get('.items-start > .bg-black').contains('Explore catalog'); }); });
{ "repo_name": "onflow/nft-catalog", "stars": "34", "repo_language": "Cadence", "file_name": "home.spec.ts", "mime_type": "text/plain" }
tilde.xvvvyz.xyz
{ "repo_name": "xvvvyz/tilde", "stars": "594", "repo_language": "HTML", "file_name": "README.md", "mime_type": "text/plain" }
<!DOCTYPE html> <meta charset="utf-8" /> <meta name="color-scheme" content="dark light" /> <meta name="robots" content="noindex" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <title>~</title> <style> :root { --color-background: #111; --color-text-subtle: #999; --color-text: #eee; --font-family: -apple-system, Helvetica, sans-serif; --font-size-1: 1rem; --font-size-2: 3rem; --font-size-base: clamp(16px, 1.6vw, 18px); --font-weight-bold: 700; --font-weight-normal: 400; --line-height-base: 1.4; --space-1: 0.5rem; --space-2: 1rem; --space-3: 4rem; --transition-speed: 200ms; } @media (prefers-color-scheme: light) { :root { --color-background: #eee; --color-text-subtle: #777; --color-text: #111; } } </style> <script> const CONFIG = { commandPathDelimiter: '/', commandSearchDelimiter: ' ', defaultSearchTemplate: 'https://duckduckgo.com/?q={}', openLinksInNewTab: true, suggestionLimit: 4, }; const COMMANDS = new Map([ [ 'b', { name: 'Dribbble', url: 'https://dribbble.com/shots/popular', }, ], [ 'c', { name: 'Calendar', url: 'https://calendar.google.com', }, ], [ 'd', { name: 'Drive', url: 'https://drive.google.com', }, ], [ 'f', { name: 'Figma', url: 'https://www.figma.com/files/recent', }, ], [ 'g', { name: 'GitHub', url: 'https://github.com', }, ], [ 'i', { name: 'Discord', url: 'https://discord.com/channels/@me', }, ], [ 'k', { name: 'Keep', url: 'https://keep.google.com', }, ], [ 'm', { name: 'Mail', url: 'https://mail.proton.me/u/0/inbox', }, ], [ 'n', { name: 'Notion', url: 'https://www.notion.so', }, ], [ 'r', { name: 'Reddit', searchTemplate: '/search?q={}', suggestions: [ 'r/r/startpages', 'r/r/webdev', 'r/r/onebag', 'r/r/fujix', ], url: 'https://www.reddit.com', }, ], [ 't', { name: 'DeepL', searchTemplate: '/en/translator#en/es/{}', suggestions: ['t/en/translator#es/en/'], url: 'https://www.deepl.com/en/translator', }, ], [ 'u', { name: 'Supabase', url: 'https://app.supabase.com/projects', }, ], [ 'v', { name: 'Vercel', suggestions: ['sdk.vercel.ai'], url: 'https://vercel.com/dashboard', }, ], [ 'w', { name: 'Twitter', url: 'https://twitter.com/home', }, ], [ 'y', { name: 'YouTube', searchTemplate: '/results?search_query={}', url: 'https://youtube.com/feed/subscriptions', }, ], [ '0', { name: 'local', searchTemplate: ':{}', suggestions: ['0 54323', '0 54324'], url: 'http://localhost:3000', }, ], ]); </script> <template id="commands-template"> <style> .commands { columns: 1; list-style: none; margin: 0 auto; max-width: 10rem; padding: 0 0 0 var(--space-1); width: 100vw; } .command { display: flex; gap: var(--space-2); outline: 0; padding: var(--space-1); text-decoration: none; } .key { color: var(--color-text); display: inline-block; text-align: center; width: 3ch; } .name { color: var(--color-text-subtle); transition: color var(--transition-speed); } .command:where(:focus, :hover) .name { color: var(--color-text); } @media (min-width: 500px) { .commands { columns: 2; max-width: 20rem; } } @media (min-width: 800px) { .commands { columns: 4; max-width: 40rem; } } </style> <nav> <menu class="commands"></menu> </nav> </template> <template id="command-template"> <li> <a class="command" rel="noopener noreferrer"> <span class="key"></span> <span class="name"></span> </a> </li> </template> <script type="module"> class Commands extends HTMLElement { constructor() { super(); this.attachShadow({ mode: 'open' }); const template = document.getElementById('commands-template'); const clone = template.content.cloneNode(true); const commands = clone.querySelector('.commands'); const commandTemplate = document.getElementById('command-template'); for (const [key, { name, url }] of COMMANDS.entries()) { if (!name || !url) continue; const clone = commandTemplate.content.cloneNode(true); const command = clone.querySelector('.command'); command.href = url; if (CONFIG.openLinksInNewTab) command.target = '_blank'; clone.querySelector('.key').innerText = key; clone.querySelector('.name').innerText = name; commands.append(clone); } this.shadowRoot.append(clone); } } customElements.define('commands-component', Commands); </script> <template id="search-template"> <style> input, button { -moz-appearance: none; -webkit-appearance: none; background: transparent; border: 0; display: block; outline: 0; } .dialog { align-items: center; background: var(--color-background); border: none; display: none; flex-direction: column; height: 100%; justify-content: center; left: 0; padding: 0; top: 0; width: 100%; } .dialog[open] { display: flex; } .form { width: 100%; } .input { color: var(--color-text); font-size: var(--font-size-2); font-weight: var(--font-weight-bold); padding: 0; text-align: center; width: 100%; } .suggestions { align-items: center; display: flex; flex-direction: column; flex-wrap: wrap; justify-content: center; list-style: none; margin: var(--space-2) 0 0; overflow: hidden; padding: 0; } .suggestion { color: var(--color-text); cursor: pointer; font-size: var(--font-size-1); padding: var(--space-2); position: relative; transition: color var(--transition-speed); white-space: nowrap; z-index: 1; } .suggestion:where(:focus, :hover) { color: var(--color-background); } .suggestion::before { background-color: var(--color-text); bottom: var(--space-2); content: ' '; left: var(--space-2); opacity: 0; position: absolute; right: var(--space-2); top: var(--space-2); transform: translateY(0.5em); transition: all var(--transition-speed); z-index: -1; } .suggestion:where(:focus, :hover)::before { opacity: 1; transform: translateY(0); } .match { color: var(--color-text-subtle); transition: color var(--transition-speed); } .suggestion:where(:focus, :hover) .match { color: var(--color-background); } @media (min-width: 700px) { .suggestions { flex-direction: row; } } </style> <dialog class="dialog"> <form autocomplete="off" class="form" method="dialog" spellcheck="false"> <input class="input" title="search" type="text" /> <menu class="suggestions"></menu> </form> </dialog> </template> <template id="suggestion-template"> <li> <button class="suggestion" type="button"></button> </li> </template> <template id="match-template"> <span class="match"></span> </template> <script type="module"> class Search extends HTMLElement { #dialog; #form; #input; #suggestions; constructor() { super(); this.attachShadow({ mode: 'open' }); const template = document.getElementById('search-template'); const clone = template.content.cloneNode(true); this.#dialog = clone.querySelector('.dialog'); this.#form = clone.querySelector('.form'); this.#input = clone.querySelector('.input'); this.#suggestions = clone.querySelector('.suggestions'); this.#form.addEventListener('submit', this.#onSubmit, false); this.#input.addEventListener('input', this.#onInput); this.#suggestions.addEventListener('click', this.#onSuggestionClick); document.addEventListener('keydown', this.#onKeydown); this.shadowRoot.append(clone); } static #attachSearchPrefix(array, { key, splitBy }) { if (!splitBy) return array; return array.map((search) => `${key}${splitBy}${search}`); } static #escapeRegexCharacters(s) { return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); } static #fetchDuckDuckGoSuggestions(search) { return new Promise((resolve) => { window.autocompleteCallback = (res) => { const suggestions = []; for (const item of res) { if (item.phrase === search.toLowerCase()) continue; suggestions.push(item.phrase); } resolve(suggestions); }; const script = document.createElement('script'); document.querySelector('head').appendChild(script); script.src = `https://duckduckgo.com/ac/?callback=autocompleteCallback&q=${search}`; script.onload = script.remove; }); } static #formatSearchUrl(url, searchPath, search) { if (!searchPath) return url; const [baseUrl] = Search.#splitUrl(url); const urlQuery = encodeURIComponent(search); searchPath = searchPath.replace(/{}/g, urlQuery); return baseUrl + searchPath; } static #hasProtocol(s) { return /^[a-zA-Z]+:\/\//i.test(s); } static #isUrl(s) { return /^((https?:\/\/)?[\w-]+(\.[\w-]+)+\.?(:\d+)?(\/\S*)?)$/i.test(s); } static #parseQuery = (raw) => { const query = raw.trim(); if (this.#isUrl(query)) { const url = this.#hasProtocol(query) ? query : `https://${query}`; return { query, url }; } if (COMMANDS.has(query)) { const { command, key, url } = COMMANDS.get(query); return command ? Search.#parseQuery(command) : { key, query, url }; } let splitBy = CONFIG.commandSearchDelimiter; const [searchKey, rawSearch] = query.split(new RegExp(`${splitBy}(.*)`)); if (COMMANDS.has(searchKey)) { const { searchTemplate, url: base } = COMMANDS.get(searchKey); const search = rawSearch.trim(); const url = Search.#formatSearchUrl(base, searchTemplate, search); return { key: searchKey, query, search, splitBy, url }; } splitBy = CONFIG.commandPathDelimiter; const [pathKey, path] = query.split(new RegExp(`${splitBy}(.*)`)); if (COMMANDS.has(pathKey)) { const { url: base } = COMMANDS.get(pathKey); const [baseUrl] = Search.#splitUrl(base); const url = `${baseUrl}/${path}`; return { key: pathKey, path, query, splitBy, url }; } const [baseUrl, rest] = Search.#splitUrl(CONFIG.defaultSearchTemplate); const url = Search.#formatSearchUrl(baseUrl, rest, query); return { query, search: query, url }; }; static #splitUrl(url) { const parser = document.createElement('a'); parser.href = url; const baseUrl = `${parser.protocol}//${parser.hostname}`; const rest = `${parser.pathname}${parser.search}`; return [baseUrl, rest]; } #close() { this.#input.value = ''; this.#input.blur(); this.#dialog.close(); this.#suggestions.innerHTML = ''; } #execute(query) { const { url } = Search.#parseQuery(query); const target = CONFIG.openLinksInNewTab ? '_blank' : '_self'; window.open(url, target, 'noopener noreferrer'); this.#close(); } #focusNextSuggestion(previous = false) { const active = this.shadowRoot.activeElement; let nextIndex; if (active.dataset.index) { const activeIndex = Number(active.dataset.index); nextIndex = previous ? activeIndex - 1 : activeIndex + 1; } else { nextIndex = previous ? this.#suggestions.childElementCount - 1 : 0; } const next = this.#suggestions.children[nextIndex]; if (next) next.querySelector('.suggestion').focus(); else this.#input.focus(); } #onInput = async () => { const oq = Search.#parseQuery(this.#input.value); if (!oq.query) { this.#close(); return; } let suggestions = COMMANDS.get(oq.query)?.suggestions ?? []; if (oq.search && suggestions.length < CONFIG.suggestionLimit) { const res = await Search.#fetchDuckDuckGoSuggestions(oq.search); const formatted = Search.#attachSearchPrefix(res, oq); suggestions = suggestions.concat(formatted); } const nq = Search.#parseQuery(this.#input.value); if (nq.query !== oq.query) return; this.#renderSuggestions(suggestions, oq.query); }; #onKeydown = (e) => { if (!this.#dialog.open) { this.#dialog.show(); this.#input.focus(); requestAnimationFrame(() => { // close the search dialog before the next repaint if a character is // not produced (e.g. if you type shift, control, alt etc.) if (!this.#input.value) this.#close(); }); return; } if (e.key === 'Escape') { this.#close(); return; } const alt = e.altKey ? 'alt-' : ''; const ctrl = e.ctrlKey ? 'ctrl-' : ''; const meta = e.metaKey ? 'meta-' : ''; const shift = e.shiftKey ? 'shift-' : ''; const modifierPrefixedKey = `${alt}${ctrl}${meta}${shift}${e.key}`; if (/^(ArrowDown|Tab|ctrl-n)$/.test(modifierPrefixedKey)) { e.preventDefault(); this.#focusNextSuggestion(); return; } if (/^(ArrowUp|ctrl-p|shift-Tab)$/.test(modifierPrefixedKey)) { e.preventDefault(); this.#focusNextSuggestion(true); } }; #onSubmit = () => { this.#execute(this.#input.value); }; #onSuggestionClick = (e) => { const ref = e.target.closest('.suggestion'); if (!ref) return; this.#execute(ref.dataset.suggestion); }; #renderSuggestions(suggestions, query) { this.#suggestions.innerHTML = ''; const sliced = suggestions.slice(0, CONFIG.suggestionLimit); const template = document.getElementById('suggestion-template'); for (const [index, suggestion] of sliced.entries()) { const clone = template.content.cloneNode(true); const ref = clone.querySelector('.suggestion'); ref.dataset.index = index; ref.dataset.suggestion = suggestion; const escapedQuery = Search.#escapeRegexCharacters(query); const matched = suggestion.match(new RegExp(escapedQuery, 'i')); if (matched) { const template = document.getElementById('match-template'); const clone = template.content.cloneNode(true); const matchRef = clone.querySelector('.match'); const pre = suggestion.slice(0, matched.index); const post = suggestion.slice(matched.index + matched[0].length); matchRef.innerText = matched[0]; matchRef.insertAdjacentHTML('beforebegin', pre); matchRef.insertAdjacentHTML('afterend', post); ref.append(clone); } else { ref.innerText = suggestion; } this.#suggestions.append(clone); } } } customElements.define('search-component', Search); </script> <style> html { background-color: var(--color-background); font-family: var(--font-family); font-size: var(--font-size-base); line-height: var(--line-height-base); } body { margin: 0; } main { align-items: center; box-sizing: border-box; display: flex; justify-content: center; min-height: 100vh; overflow: hidden; padding: var(--space-3) var(--space-2); position: relative; width: 100vw; } </style> <main> <commands-component></commands-component> <search-component></search-component> </main>
{ "repo_name": "xvvvyz/tilde", "stars": "594", "repo_language": "HTML", "file_name": "README.md", "mime_type": "text/plain" }
# Tilde Inspired by [r/startpages](https://www.reddit.com/r/startpages)&mdash;Tilde is the browser homepage for pro web surfers. ## Basic Usage To go to a site, type the corresponding key and press return. e.g: - `g` will redirect you to [github.com](https://github.com) To search a site, type a space after the site&rsquo;s key followed by your query. e.g: - `y kittens` will [search YouTube for kittens](https://www.youtube.com/results?search_query=kittens) A DuckDuckGo search will be triggered if your input doesn&rsquo;t match a key. e.g: - `google` will [search DuckDuckGo for google](https://duckduckgo.com/?q=google) To go to a specific path on a site, type the path after the site&rsquo;s key. e.g: - `r/r/startpages` will redirect you to [reddit.com/r/startpages](https://www.reddit.com/r/startpages) To access any other site, enter the URL directly. e.g: - `example.com` will redirect you to [example.com](https://example.com) ## Beyond Tilde is meant to be customized&mdash;[make it yours!](index.html) ## License Use and modify Tilde [as you see fit](UNLICENSE).
{ "repo_name": "xvvvyz/tilde", "stars": "594", "repo_language": "HTML", "file_name": "README.md", "mime_type": "text/plain" }
# Awesome Modrinth [![Awesome logo](https://awesome.re/badge.svg)](https://awesome.re) **This is a collection of awesome open-source projects which use the Modrinth API in one way or another!** Use the generated table of contents to navigate, right next to where it says `README.md` just above. To avoid biases, all categories and entries within categories are sorted alphabetically (except for the [Miscellaneous](#miscellaneous) category). Feel free to add your own project(s)—just fork and make a pull request! We suggest also adding the `modrinth` topic to your GitHub repository, if applicable. Want to get started on creating your own project using the Modrinth API? Check out our [documentation](https://docs.modrinth.com)! *Note:* Simply because a project is on this list does not mean it is necessarily endorsed or official. --- ## Discord bots/webhooks - **[beans-squared/modrunner-bot](https://github.com/beans-squared/modrunner-bot)** - A bot that allows both searching for and tracking updates for projects - **[Deftu/DeftuDownloadCounter](https://github.com/Deftu/DeftuDownloadCounter)** - A (self-hosted) bot which tracks download milestones (100, 200, 1000, 2000, etc) - **[HyacinthBots/Allium](https://github.com/HyacinthBots/Allium)** - A bot with a mappings extension to search Minecraft Mappings or just Modrinth projects. - **[No767/Rin](https://github.com/No767/Rin)** - A bot with a command for searching mods on Modrinth - **[PinkGoosik/kitsun](https://github.com/PinkGoosik/kitsun)** - A bot designed to provide simple features for Minecraft modding-themed servers - **[The-Cutie-Corporation/ModrinthUpdatesBot](https://github.com/The-Cutie-Corporation/ModrinthUpdatesBot)** - A bot which tracks project updates - **[Zechiax/Asterion](https://github.com/Zechiax/Asterion)** - A Discord bot that provides easy access to the Modrinth platform and helps you stay updated with your favorite projects ## Frontends - **[mineblock11/android-modrinth-dashboard](https://github.com/mineblock11/android-modrinth-dashboard)** - An Android app for the Modrinth dashboard written in Vue - **[modrinth/knossos](https://github.com/modrinth/knossos)** ([Website](https://modrinth.com)) - The official Modrinth frontend we're all familiar with - **[TheClashFruit/Rithle](https://github.com/TheClashFruit/Rithle)** - An Android app for Modrinth written in Kotlin ## Launchers - **[ATLauncher/ATLauncher](https://github.com/ATLauncher/ATLauncher)** - A launcher for Minecraft which allows you to download and install modpacks easily and quickly - **[Jackzmc/craftymc](https://github.com/Jackzmc/craftymc)** - Yet another cross-platform launcher with a familiar launcher design - **[huanghongxun/HMCL](https://github.com/huanghongxun/HMCL)** - A multi-functional, cross-platform Minecraft launcher - **[jfmods/inceptum](https://gitlab.com/jfmods/inceptum)** - An advanced launcher, server launcher and mod manager for Minecraft - **[modrinth/theseus](https://github.com/modrinth/theseus)** - The official Modrinth launcher which can be used as a CLI, GUI, and library - **[MultiMC/Launcher](https://github.com/MultiMC/Launcher)** - A power-user launcher for Minecraft that allows you to easily manage multiple installations at once - **[PrismLauncher/PrismLauncher](https://github.com/PrismLauncher/PrismLauncher)** - A power-user launcher for Minecraft that allows you to easily manage multiple installations at once (fork of MultiMC) - **[QuestCraftPlusPlus/QuestCraft](https://github.com/QuestCraftPlusPlus/QuestCraft)** - A port of Minecraft: Java Edition to the Meta Quest Platform - **[Voxelum/x-minecraft-launcher](https://github.com/Voxelum/x-minecraft-launcher)** - A Minecraft launcher focusing on modern UX and disk efficiency ## Libraries - **[EssentialMC/modrinth-rs](https://github.com/EssentialMC/modrinth-rs)** - A Rust wrapper for the Modrinth API - **[FlowArg/FlowUpdater](https://github.com/FlowArg/FlowUpdater)** - An open-source library to update Minecraft. Supports Modrinth and CurseForge for mods. - **[gorilla-devs/ferinth](https://github.com/gorilla-devs/ferinth)** - A simple Rust wrapper for the official Modrinth API - **[hihiqy1/modrinth_api_dart](https://github.com/hihiqy1/modrinth_api_dart)** - An unofficial Modrinth API wrapper library for the Dart programming language. - **[masecla22/Modrinth4J](https://github.com/masecla22/Modrinth4J)** - A fluent CompletableFuture-based Java wrapper for the Modrinth API - **[Xemay/aiomodrinth](https://github.com/Xemay/aiomodrinth)** - Async Python API wrapper for Modrinth - **[Zechiax/Modrinth.Net](https://github.com/Zechiax/Modrinth.Net)** - A Modrinth API wrapper for C# ## Mod managers/updaters ### CLI - **[Aetopia/modpkg](https://github.com/Aetopia/modpkg)** - A simple mod manager for Modrinth - **[amodi04/MinecraftModUpdater](https://github.com/amodi04/MinecraftModUpdater)** - A small Python script to help update and download Modrinth mods - **[Brogramming-Inc/Minebrew](https://github.com/Brogramming-Inc/Minebrew)** - A package manager for Minecraft mods hosted on Modrinth - **[calliecameron/mc-mod-compatibility](https://github.com/calliecameron/mc-mod-compatibility)** - A script to check whether Minecraft modpacks are compatible with newer game versions - **[Encrypted-Thoughts/ModManager](https://github.com/Encrypted-Thoughts/ModManager)** - A tool to help manage and update Minecraft mods - **[Fxomt-III/Minecraft-package-manager](https://github.com/Fxomt-III/Minecraft-package-manager)** - A mod manager for Minecraft - **[gorilla-devs/ferium](https://github.com/gorilla-devs/ferium)** - Fast and multi-source CLI program for managing Minecraft mods and modpacks from Modrinth, CurseForge, and GitHub Releases - **[IshimiMC/ishimi](https://github.com/IshimiMC/ishimi)** - A mod manager for Minecraft - **[it0946/emd](https://github.com/it0946/emd)** - A simple program for downloading Minecraft mods - **[jakobkmar/pacmc](https://github.com/jakobkmar/pacmc)** - An easy-to-use package manager for Minecraft mods - **[MrNavaStar/ModMan](https://github.com/MrNavaStar/ModMan)** - An easy-to-use Minecraft mod manager - **[nothub/mrpack-install](https://github.com/nothub/mrpack-install)** - Modrinth Modpack server deployment - **[rotgruengelb/modrinth.modpack-to-mcinstance](https://github.com/rotgruengelb/modrinth.modpack-to-mcinstance)** - Convert a .mrpack into a Minecraft Default Launcher Instance and automatically downloads everything that needs downloading. - **[tebibytemedia/hopper](https://github.com/tebibytemedia/hopper)** - A Minecraft mod manager for the terminal inspired by paru and topgrade - **[tympanicblock61/modrinth-downloader](https://github.com/tympanicblock61/modrinth-downloader)** - A small Python script to auto download Modrinth mods - **[un-pogaz/MC-Modrinth-Project-Manager](https://github.com/un-pogaz/MC-Modrinth-Project-Manager)** - A simple Python CLI Project Manager for Minecraft and Modrinth. Support Mods, Resource Packs, Shaders, Data Packs. - **[VasilisMylonas/talos](https://github.com/VasilisMylonas/talos)** - A script for downloading mods and their dependencies from Modrinth - **[vividuwu/Mercurius](https://github.com/vividuwu/Mercurius)** - A package/mod manager built for Modrinth's API - **[zphrus/ModrinthUpdateScript](https://github.com/zphrus/ModrinthUpdateScript)** - A small, smart, and simple mod updating script making use of the advanced version file API ### GUI - **[4JX/mCubed](https://github.com/4JX/mCubed)** - An experimental Minecraft mod manager - **[Blookerss/mdpkm](https://github.com/Blookerss/mdpkm)** - An all-in-one instance manager for Minecraft - **[IsAvaible/AngularModUpdater](https://github.com/IsAvaible/AngularModUpdater)** - An easy-to-use website to find updates for and migrate mods based on file hashes - **[ModdingX/Moonstone](https://github.com/ModdingX/Moonstone)** - An IntelliJ plugin for managing mod lists and installing mods directly from Modrinth or CurseForge ### In-game - **[DeDiamondPro/Resourcify](https://github.com/DeDiamondPro/Resourcify)** ([Modrinth](https://modrinth.com/mod/resourcify)) - An in-game resource pack browser - **[JustAlittleWolf/modpackLoaderFabric](https://github.com/JustAlittleWolf/modpackLoaderFabric)** - Automatically checks for updates for installed mods via a JSON file - **[TerraformersMC/ModMenu](https://github.com/TerraformersMC/ModMenu)** ([Modrinth](https://modrinth.com/mod/modmenu)) - The leading mod for seeing all of your installed mods for Fabric and Quilt has a Modrinth update checker built-in ## Modpack creation tools - **[Kneelawk/PackVulcan](https://github.com/Kneelawk/PackVulcan)** - A GUI modpack builder for Modrinth and packwiz - **[ModdingX/PackDev](https://github.com/ModdingX/PackDev)** - A Gradle plugin for creating and running modpacks using ForgeGradle or Loom. - **[packwiz/packwiz](https://github.com/packwiz/packwiz)** - A command line tool for editing and distributing Minecraft modpacks, supporting Modrinth and CurseForge - **[RozeFound/mmc-export](https://github.com/RozeFound/mmc-export)** - A tool for exporting a MultiMC modpack to other formats - **[ryanccn/moddermore](https://github.com/ryanccn/moddermore)** ([Website](https://moddermore.vercel.app)) - A web app for creating public lists of mods exportable to `mrpack`s - **[shap-po/selene-modpacker](https://github.com/shap-po/selene-modpacker)** - A modpack creation browser extension allowing you to save mods from Modrinth and CurseForge to collections ## Project/version management tools - **[firstdarkdev/modpublisher](https://github.com/firstdarkdev/modpublisher)** - A Gradle plugin to upload mods to Modrinth, CurseForge and GitHub - **[funnyboy-roks/modrinth-auto-desc](https://github.com/funnyboy-roks/modrinth-auto-desc)** ([GitHub Marketplace](https://github.com/marketplace/actions/modrinth-auto-description)) - Automatically update Modrinth description and project settings from a GitHub repository - **[Kir-Antipov/mc-publish](https://github.com/Kir-Antipov/mc-publish)** - A GitHub Action for uploading versions to Modrinth, CurseForge, and GitHub - **[modrinth/minotaur](https://github.com/modrinth/minotaur)** - The official Gradle plugin for uploading versions to Modrinth - **[SilverAndro/Modifold](https://github.com/SilverAndro/Modifold)** - A Kotlin CLI tool for moving CurseForge mods to Modrinth ## Miscellaneous - **[AI-nsley69/true-all-of-fabric](https://github.com/AI-nsley69/true-all-of-fabric)** - A Python script to try and download as many Fabric mods as possible on a given Minecraft version from Modrinth - **[astrooom/Minecraft-Serverpack-Installer](https://github.com/astrooom/Minecraft-Serverpack-Installer)** - A Python script made to install modpacks - **[badges/shields](https://github.com/badges/shields)** ([shields.io](https://shields.io)) - A badge generator with multiple badges for showing information from Modrinth - **[devBoi76/modrinthify](https://github.com/devBoi76/modrinthify)** - A browser extension to automatically redirect CurseForge projects to Modrinth whenever possible - **[Gaming32/Superpack](https://github.com/Gaming32/Superpack)** - A standalone application for downloading Modrinth modpacks - **[Infinidoge/nix-minecraft](https://github.com/Infinidoge/nix-minecraft)** - An attempt to better package and support Minecraft as part of the Nix ecosystem - **[Ketok4321/modrinth-statistics](https://github.com/Ketok4321/modrinth-statistics)** - A simple script for gathering statistics about mods on Modrinth - **[MCBanners/banner-api](https://github.com/MCBanners/banner-api)** ([mcbanners.com](https://mcbanners.com/modrinth)) - A banner generator with a banner for Modrinth project information - **[ModdingX/ModListCreator](https://github.com/ModdingX/ModListCreator)** - A tool to create a nice looking modlist for modpacks, or a changelog by giving two modpack exports
{ "repo_name": "modrinth/awesome", "stars": "83", "repo_language": "None", "file_name": "README.md", "mime_type": "text/plain" }
# SnapseedImitation ## App of imitation SnapSeed. ### 0.Repository introduction. Base on GPUImage framework,support some picture editing operation. The same drop menu user interface as Snapseed. Can beauty user's photograph with different filters. ### 1.Import GPUImage CocoaPods ``` pod 'GPUImage' ``` ## ### 2.Useing GPUImage ### 1.Process description ###### Use GPUImagePicture category to get picture.Render a frame with filters by GPUImageFilter category.Notice by pipline when it render finish.Finally we can show edited photo in GPUImageView,or maybe we can get picture by GPUImageFilter. ``` graph LR GPUImageInput-->GPUImageFilter; GPUImageFilter-->GPUImageOutput; ``` ###### Example: ``` //@Stretch filter    //Input photo.    GPUImagePicture * gpupicture = [[GPUImagePicture alloc]initWithImage:[UIImage imageNamed:@"Duck.jpg"]];    //Init Filter    PUImageStretchDistortionFilter * stretchDistortionFilter = [GPUImageStretchDistortionFilter new];    //Set filter parama    stretchDistortionFilter.center = CGPointMake(0.2, 0.2);    //Binding it.    [gpupicture addTarget:stretchDistortionFilter];    //Process photo    [gpupicture processImage];    //Let filter get next frame(That's the final frame.)    [stretchDistortionFilter useNextFrameForImageCapture];    //Get photo.    UIImage *image = [stretchDistortionFilter imageFromCurrentFramebuffer]; ``` ###### Impression comparison : ![](https://upload-images.jianshu.io/upload_images/1647887-507c937ab8882497.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/700) #### 2. Multiple Filter ###### Users have different filter options when editing pictures.This may requires control of brightness, contrast, and exposure.Every time we add a filter, the picture renders once, which means we lose the original image if we render twice. This is why we need to do multiple filters but make it render for only one time. ###### All we need is GPUImageFilterPipeline category. ###### GPUImageFilterPipeline can do multi filters but only one-time rendering . After many times of adding filters,we can still get origin picture. ###### Example: ```    //get origin    GPUImagePicture * gpupicture = [[GPUImagePicture alloc]initWithImage:[UIImage imageNamed:@"Duck.jpg"]];    GPUImageView * gpuimageView = [[GPUImageView alloc]initWithFrame:CGRectMake(0, 60, 320, 320)]; [self.view addSubview:gpuimageView]; //ToonFilter GPUImageToonFilter * toonFilter = [GPUImageToonFilter new]; toonFilter.threshold = 0.1; //StreStretchDistortionFilter GPUImageStretchDistortionFilter * stretchDistortionFilter = [GPUImageStretchDistortionFilter new]; stretchDistortionFilter.center = CGPointMake(0.5, 0.5);    // Get the combination array.    NSArray * filters = @[toonFilter,stretchDistortionFilter];    //binding pipline    GPUImageFilterPipeline * pipLine = [[GPUImageFilterPipeline alloc]initWithOrderedFilters:filters input:self.gpupicture output:self.gpuimageView]; //process [self.gpupicture processImage]; [stretchDistortionFilter useNextFrameForImageCapture]; UIImage * image = [self.pipLine currentFilteredFrame]; ``` ![](https://upload-images.jianshu.io/upload_images/1647887-2ed90da3be4de5b5.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/700) ###### #### 3.Multiple Filter use in the app demo. ###### With the drop menu,user can edit photo with different filters,and the ![](https://upload-images.jianshu.io/upload_images/1647887-5fa6719ff2f7ca52.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/414) ##
{ "repo_name": "filelife/SnapseedImitation", "stars": "83", "repo_language": "Objective-C", "file_name": "GPUImageParallelCoordinateLineTransformFilter.h", "mime_type": "text/x-objective-c" }
// !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ BF0B004C1E0FA3170014BA4B /* CoreImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BF0B004B1E0FA3170014BA4B /* CoreImage.framework */; settings = {ATTRIBUTES = (Required, ); }; }; BF26A8CD1E30C1A90009BB69 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BF26A8CC1E30C1A90009BB69 /* QuartzCore.framework */; }; BF26A8CF1E30C1B10009BB69 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BF26A8CE1E30C1B10009BB69 /* AVFoundation.framework */; }; BF26A8D11E30C1B70009BB69 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BF26A8D01E30C1B70009BB69 /* OpenGLES.framework */; }; BF26A8D31E30C1C00009BB69 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BF26A8D21E30C1C00009BB69 /* CoreVideo.framework */; }; BF26A8D51E30C1C90009BB69 /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BF26A8D41E30C1C90009BB69 /* CoreMedia.framework */; }; BFCB95521E3308CE001731BF /* libGPUImagemix.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BFCB954C1E3308CE001731BF /* libGPUImagemix.a */; }; BFCB95531E3308CE001731BF /* LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = BFCB954E1E3308CE001731BF /* LICENSE */; }; BFCB95541E3308CE001731BF /* MBProgressHUD.m in Sources */ = {isa = PBXBuildFile; fileRef = BFCB95501E3308CE001731BF /* MBProgressHUD.m */; }; BFCB95551E3308CE001731BF /* README.mdown in Sources */ = {isa = PBXBuildFile; fileRef = BFCB95511E3308CE001731BF /* README.mdown */; }; BFCB955F1E3308F4001731BF /* SnapseedDropMenu.m in Sources */ = {isa = PBXBuildFile; fileRef = BFCB95581E3308F4001731BF /* SnapseedDropMenu.m */; }; BFCB95601E3308F4001731BF /* SnapseedDropMenuTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = BFCB955A1E3308F4001731BF /* SnapseedDropMenuTableViewCell.m */; }; BFCB95611E3308F4001731BF /* UIView+Extention.m in Sources */ = {isa = PBXBuildFile; fileRef = BFCB955C1E3308F4001731BF /* UIView+Extention.m */; }; BFCB95621E3308F4001731BF /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BFCB955E1E3308F4001731BF /* ViewController.m */; }; BFCB95701E330911001731BF /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = BFCB95651E330911001731BF /* AppDelegate.m */; }; BFCB95711E330911001731BF /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BFCB95661E330911001731BF /* Assets.xcassets */; }; BFCB95721E330911001731BF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BFCB95681E330911001731BF /* LaunchScreen.storyboard */; }; BFCB95731E330911001731BF /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BFCB956A1E330911001731BF /* Main.storyboard */; }; BFCB95741E330911001731BF /* Duck.jpg in Resources */ = {isa = PBXBuildFile; fileRef = BFCB956C1E330911001731BF /* Duck.jpg */; }; BFCB95751E330911001731BF /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = BFCB956D1E330911001731BF /* Info.plist */; }; BFCB95761E330911001731BF /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = BFCB956E1E330911001731BF /* main.m */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ BF0B00301E0FA2E50014BA4B /* SnapseedImitation.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SnapseedImitation.app; sourceTree = BUILT_PRODUCTS_DIR; }; BF0B004B1E0FA3170014BA4B /* CoreImage.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreImage.framework; path = System/Library/Frameworks/CoreImage.framework; sourceTree = SDKROOT; }; BF26A8CC1E30C1A90009BB69 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; BF26A8CE1E30C1B10009BB69 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; BF26A8D01E30C1B70009BB69 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; BF26A8D21E30C1C00009BB69 /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = System/Library/Frameworks/CoreVideo.framework; sourceTree = SDKROOT; }; BF26A8D41E30C1C90009BB69 /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; }; BFCB949E1E3308CE001731BF /* GLProgram.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLProgram.h; sourceTree = "<group>"; }; BFCB949F1E3308CE001731BF /* GPUImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImage.h; sourceTree = "<group>"; }; BFCB94A01E3308CE001731BF /* GPUImage3x3ConvolutionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImage3x3ConvolutionFilter.h; sourceTree = "<group>"; }; BFCB94A11E3308CE001731BF /* GPUImage3x3TextureSamplingFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImage3x3TextureSamplingFilter.h; sourceTree = "<group>"; }; BFCB94A21E3308CE001731BF /* GPUImageAdaptiveThresholdFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageAdaptiveThresholdFilter.h; sourceTree = "<group>"; }; BFCB94A31E3308CE001731BF /* GPUImageAddBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageAddBlendFilter.h; sourceTree = "<group>"; }; BFCB94A41E3308CE001731BF /* GPUImageAlphaBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageAlphaBlendFilter.h; sourceTree = "<group>"; }; BFCB94A51E3308CE001731BF /* GPUImageAmatorkaFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageAmatorkaFilter.h; sourceTree = "<group>"; }; BFCB94A61E3308CE001731BF /* GPUImageAverageColor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageAverageColor.h; sourceTree = "<group>"; }; BFCB94A71E3308CE001731BF /* GPUImageAverageLuminanceThresholdFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageAverageLuminanceThresholdFilter.h; sourceTree = "<group>"; }; BFCB94A81E3308CE001731BF /* GPUImageBilateralFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageBilateralFilter.h; sourceTree = "<group>"; }; BFCB94A91E3308CE001731BF /* GPUImageBoxBlurFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageBoxBlurFilter.h; sourceTree = "<group>"; }; BFCB94AA1E3308CE001731BF /* GPUImageBrightnessFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageBrightnessFilter.h; sourceTree = "<group>"; }; BFCB94AB1E3308CE001731BF /* GPUImageBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageBuffer.h; sourceTree = "<group>"; }; BFCB94AC1E3308CE001731BF /* GPUImageBulgeDistortionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageBulgeDistortionFilter.h; sourceTree = "<group>"; }; BFCB94AD1E3308CE001731BF /* GPUImageCannyEdgeDetectionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageCannyEdgeDetectionFilter.h; sourceTree = "<group>"; }; BFCB94AE1E3308CE001731BF /* GPUImageCGAColorspaceFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageCGAColorspaceFilter.h; sourceTree = "<group>"; }; BFCB94AF1E3308CE001731BF /* GPUImageChromaKeyBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageChromaKeyBlendFilter.h; sourceTree = "<group>"; }; BFCB94B01E3308CE001731BF /* GPUImageChromaKeyFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageChromaKeyFilter.h; sourceTree = "<group>"; }; BFCB94B11E3308CE001731BF /* GPUImageClosingFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageClosingFilter.h; sourceTree = "<group>"; }; BFCB94B21E3308CE001731BF /* GPUImageColorBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageColorBlendFilter.h; sourceTree = "<group>"; }; BFCB94B31E3308CE001731BF /* GPUImageColorBurnBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageColorBurnBlendFilter.h; sourceTree = "<group>"; }; BFCB94B41E3308CE001731BF /* GPUImageColorConversion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageColorConversion.h; sourceTree = "<group>"; }; BFCB94B51E3308CE001731BF /* GPUImageColorDodgeBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageColorDodgeBlendFilter.h; sourceTree = "<group>"; }; BFCB94B61E3308CE001731BF /* GPUImageColorInvertFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageColorInvertFilter.h; sourceTree = "<group>"; }; BFCB94B71E3308CE001731BF /* GPUImageColorLocalBinaryPatternFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageColorLocalBinaryPatternFilter.h; sourceTree = "<group>"; }; BFCB94B81E3308CE001731BF /* GPUImageColorMatrixFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageColorMatrixFilter.h; sourceTree = "<group>"; }; BFCB94B91E3308CE001731BF /* GPUImageColorPackingFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageColorPackingFilter.h; sourceTree = "<group>"; }; BFCB94BA1E3308CE001731BF /* GPUImageColourFASTFeatureDetector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageColourFASTFeatureDetector.h; sourceTree = "<group>"; }; BFCB94BB1E3308CE001731BF /* GPUImageColourFASTSamplingOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageColourFASTSamplingOperation.h; sourceTree = "<group>"; }; BFCB94BC1E3308CE001731BF /* GPUImageContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageContext.h; sourceTree = "<group>"; }; BFCB94BD1E3308CE001731BF /* GPUImageContrastFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageContrastFilter.h; sourceTree = "<group>"; }; BFCB94BE1E3308CE001731BF /* GPUImageCropFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageCropFilter.h; sourceTree = "<group>"; }; BFCB94BF1E3308CE001731BF /* GPUImageCrosshairGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageCrosshairGenerator.h; sourceTree = "<group>"; }; BFCB94C01E3308CE001731BF /* GPUImageCrosshatchFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageCrosshatchFilter.h; sourceTree = "<group>"; }; BFCB94C11E3308CE001731BF /* GPUImageDarkenBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageDarkenBlendFilter.h; sourceTree = "<group>"; }; BFCB94C21E3308CE001731BF /* GPUImageDifferenceBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageDifferenceBlendFilter.h; sourceTree = "<group>"; }; BFCB94C31E3308CE001731BF /* GPUImageDilationFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageDilationFilter.h; sourceTree = "<group>"; }; BFCB94C41E3308CE001731BF /* GPUImageDirectionalNonMaximumSuppressionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageDirectionalNonMaximumSuppressionFilter.h; sourceTree = "<group>"; }; BFCB94C51E3308CE001731BF /* GPUImageDirectionalSobelEdgeDetectionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageDirectionalSobelEdgeDetectionFilter.h; sourceTree = "<group>"; }; BFCB94C61E3308CE001731BF /* GPUImageDissolveBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageDissolveBlendFilter.h; sourceTree = "<group>"; }; BFCB94C71E3308CE001731BF /* GPUImageDivideBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageDivideBlendFilter.h; sourceTree = "<group>"; }; BFCB94C81E3308CE001731BF /* GPUImageEmbossFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageEmbossFilter.h; sourceTree = "<group>"; }; BFCB94C91E3308CE001731BF /* GPUImageErosionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageErosionFilter.h; sourceTree = "<group>"; }; BFCB94CA1E3308CE001731BF /* GPUImageExclusionBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageExclusionBlendFilter.h; sourceTree = "<group>"; }; BFCB94CB1E3308CE001731BF /* GPUImageExposureFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageExposureFilter.h; sourceTree = "<group>"; }; BFCB94CC1E3308CE001731BF /* GPUImageFalseColorFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageFalseColorFilter.h; sourceTree = "<group>"; }; BFCB94CD1E3308CE001731BF /* GPUImageFASTCornerDetectionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageFASTCornerDetectionFilter.h; sourceTree = "<group>"; }; BFCB94CE1E3308CE001731BF /* GPUImageFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageFilter.h; sourceTree = "<group>"; }; BFCB94CF1E3308CE001731BF /* GPUImageFilterGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageFilterGroup.h; sourceTree = "<group>"; }; BFCB94D01E3308CE001731BF /* GPUImageFilterPipeline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageFilterPipeline.h; sourceTree = "<group>"; }; BFCB94D11E3308CE001731BF /* GPUImageFourInputFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageFourInputFilter.h; sourceTree = "<group>"; }; BFCB94D21E3308CE001731BF /* GPUImageFramebuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageFramebuffer.h; sourceTree = "<group>"; }; BFCB94D31E3308CE001731BF /* GPUImageFramebufferCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageFramebufferCache.h; sourceTree = "<group>"; }; BFCB94D41E3308CE001731BF /* GPUImageGammaFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageGammaFilter.h; sourceTree = "<group>"; }; BFCB94D51E3308CE001731BF /* GPUImageGaussianBlurFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageGaussianBlurFilter.h; sourceTree = "<group>"; }; BFCB94D61E3308CE001731BF /* GPUImageGaussianBlurPositionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageGaussianBlurPositionFilter.h; sourceTree = "<group>"; }; BFCB94D71E3308CE001731BF /* GPUImageGaussianSelectiveBlurFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageGaussianSelectiveBlurFilter.h; sourceTree = "<group>"; }; BFCB94D81E3308CE001731BF /* GPUImageGlassSphereFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageGlassSphereFilter.h; sourceTree = "<group>"; }; BFCB94D91E3308CE001731BF /* GPUImageGrayscaleFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageGrayscaleFilter.h; sourceTree = "<group>"; }; BFCB94DA1E3308CE001731BF /* GPUImageHalftoneFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageHalftoneFilter.h; sourceTree = "<group>"; }; BFCB94DB1E3308CE001731BF /* GPUImageHardLightBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageHardLightBlendFilter.h; sourceTree = "<group>"; }; BFCB94DC1E3308CE001731BF /* GPUImageHarrisCornerDetectionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageHarrisCornerDetectionFilter.h; sourceTree = "<group>"; }; BFCB94DD1E3308CE001731BF /* GPUImageHazeFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageHazeFilter.h; sourceTree = "<group>"; }; BFCB94DE1E3308CE001731BF /* GPUImageHighlightShadowFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageHighlightShadowFilter.h; sourceTree = "<group>"; }; BFCB94DF1E3308CE001731BF /* GPUImageHighlightShadowTintFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageHighlightShadowTintFilter.h; sourceTree = "<group>"; }; BFCB94E01E3308CE001731BF /* GPUImageHighPassFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageHighPassFilter.h; sourceTree = "<group>"; }; BFCB94E11E3308CE001731BF /* GPUImageHistogramEqualizationFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageHistogramEqualizationFilter.h; sourceTree = "<group>"; }; BFCB94E21E3308CE001731BF /* GPUImageHistogramFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageHistogramFilter.h; sourceTree = "<group>"; }; BFCB94E31E3308CE001731BF /* GPUImageHistogramGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageHistogramGenerator.h; sourceTree = "<group>"; }; BFCB94E41E3308CE001731BF /* GPUImageHoughTransformLineDetector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageHoughTransformLineDetector.h; sourceTree = "<group>"; }; BFCB94E51E3308CE001731BF /* GPUImageHSBFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageHSBFilter.h; sourceTree = "<group>"; }; BFCB94E61E3308CE001731BF /* GPUImageHueBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageHueBlendFilter.h; sourceTree = "<group>"; }; BFCB94E71E3308CE001731BF /* GPUImageHueFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageHueFilter.h; sourceTree = "<group>"; }; BFCB94E81E3308CE001731BF /* GPUImageiOSBlurFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageiOSBlurFilter.h; sourceTree = "<group>"; }; BFCB94E91E3308CE001731BF /* GPUImageJFAVoronoiFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageJFAVoronoiFilter.h; sourceTree = "<group>"; }; BFCB94EA1E3308CE001731BF /* GPUImageKuwaharaFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageKuwaharaFilter.h; sourceTree = "<group>"; }; BFCB94EB1E3308CE001731BF /* GPUImageKuwaharaRadius3Filter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageKuwaharaRadius3Filter.h; sourceTree = "<group>"; }; BFCB94EC1E3308CE001731BF /* GPUImageLanczosResamplingFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageLanczosResamplingFilter.h; sourceTree = "<group>"; }; BFCB94ED1E3308CE001731BF /* GPUImageLaplacianFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageLaplacianFilter.h; sourceTree = "<group>"; }; BFCB94EE1E3308CE001731BF /* GPUImageLevelsFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageLevelsFilter.h; sourceTree = "<group>"; }; BFCB94EF1E3308CE001731BF /* GPUImageLightenBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageLightenBlendFilter.h; sourceTree = "<group>"; }; BFCB94F01E3308CE001731BF /* GPUImageLinearBurnBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageLinearBurnBlendFilter.h; sourceTree = "<group>"; }; BFCB94F11E3308CE001731BF /* GPUImageLineGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageLineGenerator.h; sourceTree = "<group>"; }; BFCB94F21E3308CE001731BF /* GPUImageLocalBinaryPatternFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageLocalBinaryPatternFilter.h; sourceTree = "<group>"; }; BFCB94F31E3308CE001731BF /* GPUImageLookupFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageLookupFilter.h; sourceTree = "<group>"; }; BFCB94F41E3308CE001731BF /* GPUImageLowPassFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageLowPassFilter.h; sourceTree = "<group>"; }; BFCB94F51E3308CE001731BF /* GPUImageLuminanceRangeFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageLuminanceRangeFilter.h; sourceTree = "<group>"; }; BFCB94F61E3308CE001731BF /* GPUImageLuminanceThresholdFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageLuminanceThresholdFilter.h; sourceTree = "<group>"; }; BFCB94F71E3308CE001731BF /* GPUImageLuminosity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageLuminosity.h; sourceTree = "<group>"; }; BFCB94F81E3308CE001731BF /* GPUImageLuminosityBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageLuminosityBlendFilter.h; sourceTree = "<group>"; }; BFCB94F91E3308CE001731BF /* GPUImageMaskFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageMaskFilter.h; sourceTree = "<group>"; }; BFCB94FA1E3308CE001731BF /* GPUImageMedianFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageMedianFilter.h; sourceTree = "<group>"; }; BFCB94FB1E3308CE001731BF /* GPUImageMissEtikateFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageMissEtikateFilter.h; sourceTree = "<group>"; }; BFCB94FC1E3308CE001731BF /* GPUImageMonochromeFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageMonochromeFilter.h; sourceTree = "<group>"; }; BFCB94FD1E3308CE001731BF /* GPUImageMosaicFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageMosaicFilter.h; sourceTree = "<group>"; }; BFCB94FE1E3308CE001731BF /* GPUImageMotionBlurFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageMotionBlurFilter.h; sourceTree = "<group>"; }; BFCB94FF1E3308CE001731BF /* GPUImageMotionDetector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageMotionDetector.h; sourceTree = "<group>"; }; BFCB95001E3308CE001731BF /* GPUImageMovie.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageMovie.h; sourceTree = "<group>"; }; BFCB95011E3308CE001731BF /* GPUImageMovieComposition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageMovieComposition.h; sourceTree = "<group>"; }; BFCB95021E3308CE001731BF /* GPUImageMovieWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageMovieWriter.h; sourceTree = "<group>"; }; BFCB95031E3308CE001731BF /* GPUImageMultiplyBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageMultiplyBlendFilter.h; sourceTree = "<group>"; }; BFCB95041E3308CE001731BF /* GPUImageNobleCornerDetectionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageNobleCornerDetectionFilter.h; sourceTree = "<group>"; }; BFCB95051E3308CE001731BF /* GPUImageNonMaximumSuppressionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageNonMaximumSuppressionFilter.h; sourceTree = "<group>"; }; BFCB95061E3308CE001731BF /* GPUImageNormalBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageNormalBlendFilter.h; sourceTree = "<group>"; }; BFCB95071E3308CE001731BF /* GPUImageOpacityFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageOpacityFilter.h; sourceTree = "<group>"; }; BFCB95081E3308CE001731BF /* GPUImageOpeningFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageOpeningFilter.h; sourceTree = "<group>"; }; BFCB95091E3308CE001731BF /* GPUImageOutput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageOutput.h; sourceTree = "<group>"; }; BFCB950A1E3308CE001731BF /* GPUImageOverlayBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageOverlayBlendFilter.h; sourceTree = "<group>"; }; BFCB950B1E3308CE001731BF /* GPUImageParallelCoordinateLineTransformFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageParallelCoordinateLineTransformFilter.h; sourceTree = "<group>"; }; BFCB950C1E3308CE001731BF /* GPUImagePerlinNoiseFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImagePerlinNoiseFilter.h; sourceTree = "<group>"; }; BFCB950D1E3308CE001731BF /* GPUImagePicture+TextureSubimage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "GPUImagePicture+TextureSubimage.h"; sourceTree = "<group>"; }; BFCB950E1E3308CE001731BF /* GPUImagePicture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImagePicture.h; sourceTree = "<group>"; }; BFCB950F1E3308CE001731BF /* GPUImagePinchDistortionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImagePinchDistortionFilter.h; sourceTree = "<group>"; }; BFCB95101E3308CE001731BF /* GPUImagePixellateFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImagePixellateFilter.h; sourceTree = "<group>"; }; BFCB95111E3308CE001731BF /* GPUImagePixellatePositionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImagePixellatePositionFilter.h; sourceTree = "<group>"; }; BFCB95121E3308CE001731BF /* GPUImagePoissonBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImagePoissonBlendFilter.h; sourceTree = "<group>"; }; BFCB95131E3308CE001731BF /* GPUImagePolarPixellateFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImagePolarPixellateFilter.h; sourceTree = "<group>"; }; BFCB95141E3308CE001731BF /* GPUImagePolkaDotFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImagePolkaDotFilter.h; sourceTree = "<group>"; }; BFCB95151E3308CE001731BF /* GPUImagePosterizeFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImagePosterizeFilter.h; sourceTree = "<group>"; }; BFCB95161E3308CE001731BF /* GPUImagePrewittEdgeDetectionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImagePrewittEdgeDetectionFilter.h; sourceTree = "<group>"; }; BFCB95171E3308CE001731BF /* GPUImageRawDataInput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageRawDataInput.h; sourceTree = "<group>"; }; BFCB95181E3308CE001731BF /* GPUImageRawDataOutput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageRawDataOutput.h; sourceTree = "<group>"; }; BFCB95191E3308CE001731BF /* GPUImageRGBClosingFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageRGBClosingFilter.h; sourceTree = "<group>"; }; BFCB951A1E3308CE001731BF /* GPUImageRGBDilationFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageRGBDilationFilter.h; sourceTree = "<group>"; }; BFCB951B1E3308CE001731BF /* GPUImageRGBErosionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageRGBErosionFilter.h; sourceTree = "<group>"; }; BFCB951C1E3308CE001731BF /* GPUImageRGBFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageRGBFilter.h; sourceTree = "<group>"; }; BFCB951D1E3308CE001731BF /* GPUImageRGBOpeningFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageRGBOpeningFilter.h; sourceTree = "<group>"; }; BFCB951E1E3308CE001731BF /* GPUImageSaturationBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageSaturationBlendFilter.h; sourceTree = "<group>"; }; BFCB951F1E3308CE001731BF /* GPUImageSaturationFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageSaturationFilter.h; sourceTree = "<group>"; }; BFCB95201E3308CE001731BF /* GPUImageScreenBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageScreenBlendFilter.h; sourceTree = "<group>"; }; BFCB95211E3308CE001731BF /* GPUImageSepiaFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageSepiaFilter.h; sourceTree = "<group>"; }; BFCB95221E3308CE001731BF /* GPUImageSharpenFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageSharpenFilter.h; sourceTree = "<group>"; }; BFCB95231E3308CE001731BF /* GPUImageShiTomasiFeatureDetectionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageShiTomasiFeatureDetectionFilter.h; sourceTree = "<group>"; }; BFCB95241E3308CE001731BF /* GPUImageSingleComponentGaussianBlurFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageSingleComponentGaussianBlurFilter.h; sourceTree = "<group>"; }; BFCB95251E3308CE001731BF /* GPUImageSketchFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageSketchFilter.h; sourceTree = "<group>"; }; BFCB95261E3308CE001731BF /* GPUImageSkinToneFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageSkinToneFilter.h; sourceTree = "<group>"; }; BFCB95271E3308CE001731BF /* GPUImageSmoothToonFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageSmoothToonFilter.h; sourceTree = "<group>"; }; BFCB95281E3308CE001731BF /* GPUImageSobelEdgeDetectionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageSobelEdgeDetectionFilter.h; sourceTree = "<group>"; }; BFCB95291E3308CE001731BF /* GPUImageSoftEleganceFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageSoftEleganceFilter.h; sourceTree = "<group>"; }; BFCB952A1E3308CE001731BF /* GPUImageSoftLightBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageSoftLightBlendFilter.h; sourceTree = "<group>"; }; BFCB952B1E3308CE001731BF /* GPUImageSolarizeFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageSolarizeFilter.h; sourceTree = "<group>"; }; BFCB952C1E3308CE001731BF /* GPUImageSolidColorGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageSolidColorGenerator.h; sourceTree = "<group>"; }; BFCB952D1E3308CE001731BF /* GPUImageSourceOverBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageSourceOverBlendFilter.h; sourceTree = "<group>"; }; BFCB952E1E3308CE001731BF /* GPUImageSphereRefractionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageSphereRefractionFilter.h; sourceTree = "<group>"; }; BFCB952F1E3308CE001731BF /* GPUImageStillCamera.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageStillCamera.h; sourceTree = "<group>"; }; BFCB95301E3308CE001731BF /* GPUImageStretchDistortionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageStretchDistortionFilter.h; sourceTree = "<group>"; }; BFCB95311E3308CE001731BF /* GPUImageSubtractBlendFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageSubtractBlendFilter.h; sourceTree = "<group>"; }; BFCB95321E3308CE001731BF /* GPUImageSwirlFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageSwirlFilter.h; sourceTree = "<group>"; }; BFCB95331E3308CE001731BF /* GPUImageTextureInput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageTextureInput.h; sourceTree = "<group>"; }; BFCB95341E3308CE001731BF /* GPUImageTextureOutput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageTextureOutput.h; sourceTree = "<group>"; }; BFCB95351E3308CE001731BF /* GPUImageThreeInputFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageThreeInputFilter.h; sourceTree = "<group>"; }; BFCB95361E3308CE001731BF /* GPUImageThresholdEdgeDetectionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageThresholdEdgeDetectionFilter.h; sourceTree = "<group>"; }; BFCB95371E3308CE001731BF /* GPUImageThresholdedNonMaximumSuppressionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageThresholdedNonMaximumSuppressionFilter.h; sourceTree = "<group>"; }; BFCB95381E3308CE001731BF /* GPUImageThresholdSketchFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageThresholdSketchFilter.h; sourceTree = "<group>"; }; BFCB95391E3308CE001731BF /* GPUImageTiltShiftFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageTiltShiftFilter.h; sourceTree = "<group>"; }; BFCB953A1E3308CE001731BF /* GPUImageToneCurveFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageToneCurveFilter.h; sourceTree = "<group>"; }; BFCB953B1E3308CE001731BF /* GPUImageToonFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageToonFilter.h; sourceTree = "<group>"; }; BFCB953C1E3308CE001731BF /* GPUImageTransformFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageTransformFilter.h; sourceTree = "<group>"; }; BFCB953D1E3308CE001731BF /* GPUImageTwoInputCrossTextureSamplingFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageTwoInputCrossTextureSamplingFilter.h; sourceTree = "<group>"; }; BFCB953E1E3308CE001731BF /* GPUImageTwoInputFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageTwoInputFilter.h; sourceTree = "<group>"; }; BFCB953F1E3308CE001731BF /* GPUImageTwoPassFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageTwoPassFilter.h; sourceTree = "<group>"; }; BFCB95401E3308CE001731BF /* GPUImageTwoPassTextureSamplingFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageTwoPassTextureSamplingFilter.h; sourceTree = "<group>"; }; BFCB95411E3308CE001731BF /* GPUImageUIElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageUIElement.h; sourceTree = "<group>"; }; BFCB95421E3308CE001731BF /* GPUImageUnsharpMaskFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageUnsharpMaskFilter.h; sourceTree = "<group>"; }; BFCB95431E3308CE001731BF /* GPUImageVibranceFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageVibranceFilter.h; sourceTree = "<group>"; }; BFCB95441E3308CE001731BF /* GPUImageVideoCamera.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageVideoCamera.h; sourceTree = "<group>"; }; BFCB95451E3308CE001731BF /* GPUImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageView.h; sourceTree = "<group>"; }; BFCB95461E3308CE001731BF /* GPUImageVignetteFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageVignetteFilter.h; sourceTree = "<group>"; }; BFCB95471E3308CE001731BF /* GPUImageVoronoiConsumerFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageVoronoiConsumerFilter.h; sourceTree = "<group>"; }; BFCB95481E3308CE001731BF /* GPUImageWeakPixelInclusionFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageWeakPixelInclusionFilter.h; sourceTree = "<group>"; }; BFCB95491E3308CE001731BF /* GPUImageWhiteBalanceFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageWhiteBalanceFilter.h; sourceTree = "<group>"; }; BFCB954A1E3308CE001731BF /* GPUImageXYDerivativeFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageXYDerivativeFilter.h; sourceTree = "<group>"; }; BFCB954B1E3308CE001731BF /* GPUImageZoomBlurFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageZoomBlurFilter.h; sourceTree = "<group>"; }; BFCB954C1E3308CE001731BF /* libGPUImagemix.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libGPUImagemix.a; sourceTree = "<group>"; }; BFCB954E1E3308CE001731BF /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = "<group>"; }; BFCB954F1E3308CE001731BF /* MBProgressHUD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MBProgressHUD.h; sourceTree = "<group>"; }; BFCB95501E3308CE001731BF /* MBProgressHUD.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MBProgressHUD.m; sourceTree = "<group>"; }; BFCB95511E3308CE001731BF /* README.mdown */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.mdown; sourceTree = "<group>"; }; BFCB95571E3308F4001731BF /* SnapseedDropMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SnapseedDropMenu.h; path = SnapseedImitation/SnapseedDropMenu.h; sourceTree = "<group>"; }; BFCB95581E3308F4001731BF /* SnapseedDropMenu.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SnapseedDropMenu.m; path = SnapseedImitation/SnapseedDropMenu.m; sourceTree = "<group>"; }; BFCB95591E3308F4001731BF /* SnapseedDropMenuTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SnapseedDropMenuTableViewCell.h; path = SnapseedImitation/SnapseedDropMenuTableViewCell.h; sourceTree = "<group>"; }; BFCB955A1E3308F4001731BF /* SnapseedDropMenuTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SnapseedDropMenuTableViewCell.m; path = SnapseedImitation/SnapseedDropMenuTableViewCell.m; sourceTree = "<group>"; }; BFCB955B1E3308F4001731BF /* UIView+Extention.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIView+Extention.h"; path = "SnapseedImitation/UIView+Extention.h"; sourceTree = "<group>"; }; BFCB955C1E3308F4001731BF /* UIView+Extention.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIView+Extention.m"; path = "SnapseedImitation/UIView+Extention.m"; sourceTree = "<group>"; }; BFCB955D1E3308F4001731BF /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ViewController.h; path = SnapseedImitation/ViewController.h; sourceTree = "<group>"; }; BFCB955E1E3308F4001731BF /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ViewController.m; path = SnapseedImitation/ViewController.m; sourceTree = "<group>"; }; BFCB95641E330911001731BF /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = SnapseedImitation/AppDelegate.h; sourceTree = "<group>"; }; BFCB95651E330911001731BF /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = SnapseedImitation/AppDelegate.m; sourceTree = "<group>"; }; BFCB95661E330911001731BF /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = SnapseedImitation/Assets.xcassets; sourceTree = "<group>"; }; BFCB95691E330911001731BF /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = LaunchScreen.storyboard; sourceTree = "<group>"; }; BFCB956B1E330911001731BF /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Main.storyboard; sourceTree = "<group>"; }; BFCB956C1E330911001731BF /* Duck.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; name = Duck.jpg; path = SnapseedImitation/Duck.jpg; sourceTree = "<group>"; }; BFCB956D1E330911001731BF /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = SnapseedImitation/Info.plist; sourceTree = "<group>"; }; BFCB956E1E330911001731BF /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = SnapseedImitation/main.m; sourceTree = "<group>"; }; BFCB956F1E330911001731BF /* PrefixHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PrefixHeader.h; path = SnapseedImitation/PrefixHeader.h; sourceTree = "<group>"; }; BFD10A911E19031000DB17B5 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ BF0B002D1E0FA2E50014BA4B /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( BF26A8D51E30C1C90009BB69 /* CoreMedia.framework in Frameworks */, BF26A8D31E30C1C00009BB69 /* CoreVideo.framework in Frameworks */, BF26A8D11E30C1B70009BB69 /* OpenGLES.framework in Frameworks */, BF26A8CF1E30C1B10009BB69 /* AVFoundation.framework in Frameworks */, BF26A8CD1E30C1A90009BB69 /* QuartzCore.framework in Frameworks */, BFCB95521E3308CE001731BF /* libGPUImagemix.a in Frameworks */, BF0B004C1E0FA3170014BA4B /* CoreImage.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ BF0B00271E0FA2E50014BA4B = { isa = PBXGroup; children = ( BFCB95771E330BCA001731BF /* 3rdSDK */, BFCB95631E3308F7001731BF /* SupportFile */, BFCB95561E3308D4001731BF /* SnapseedImitation */, BF0B00311E0FA2E50014BA4B /* Products */, BF0B004A1E0FA3170014BA4B /* Frameworks */, ); sourceTree = "<group>"; }; BF0B00311E0FA2E50014BA4B /* Products */ = { isa = PBXGroup; children = ( BF0B00301E0FA2E50014BA4B /* SnapseedImitation.app */, ); name = Products; sourceTree = "<group>"; }; BF0B004A1E0FA3170014BA4B /* Frameworks */ = { isa = PBXGroup; children = ( BF26A8D41E30C1C90009BB69 /* CoreMedia.framework */, BF26A8D21E30C1C00009BB69 /* CoreVideo.framework */, BF26A8D01E30C1B70009BB69 /* OpenGLES.framework */, BF26A8CE1E30C1B10009BB69 /* AVFoundation.framework */, BF26A8CC1E30C1A90009BB69 /* QuartzCore.framework */, BFD10A911E19031000DB17B5 /* UIKit.framework */, BF0B004B1E0FA3170014BA4B /* CoreImage.framework */, ); name = Frameworks; sourceTree = "<group>"; }; BFCB949C1E3308CE001731BF /* GPUImage */ = { isa = PBXGroup; children = ( BFCB949D1E3308CE001731BF /* Header */, BFCB954C1E3308CE001731BF /* libGPUImagemix.a */, ); name = GPUImage; path = SnapseedImitation/GPUImage; sourceTree = "<group>"; }; BFCB949D1E3308CE001731BF /* Header */ = { isa = PBXGroup; children = ( BFCB949E1E3308CE001731BF /* GLProgram.h */, BFCB949F1E3308CE001731BF /* GPUImage.h */, BFCB94A01E3308CE001731BF /* GPUImage3x3ConvolutionFilter.h */, BFCB94A11E3308CE001731BF /* GPUImage3x3TextureSamplingFilter.h */, BFCB94A21E3308CE001731BF /* GPUImageAdaptiveThresholdFilter.h */, BFCB94A31E3308CE001731BF /* GPUImageAddBlendFilter.h */, BFCB94A41E3308CE001731BF /* GPUImageAlphaBlendFilter.h */, BFCB94A51E3308CE001731BF /* GPUImageAmatorkaFilter.h */, BFCB94A61E3308CE001731BF /* GPUImageAverageColor.h */, BFCB94A71E3308CE001731BF /* GPUImageAverageLuminanceThresholdFilter.h */, BFCB94A81E3308CE001731BF /* GPUImageBilateralFilter.h */, BFCB94A91E3308CE001731BF /* GPUImageBoxBlurFilter.h */, BFCB94AA1E3308CE001731BF /* GPUImageBrightnessFilter.h */, BFCB94AB1E3308CE001731BF /* GPUImageBuffer.h */, BFCB94AC1E3308CE001731BF /* GPUImageBulgeDistortionFilter.h */, BFCB94AD1E3308CE001731BF /* GPUImageCannyEdgeDetectionFilter.h */, BFCB94AE1E3308CE001731BF /* GPUImageCGAColorspaceFilter.h */, BFCB94AF1E3308CE001731BF /* GPUImageChromaKeyBlendFilter.h */, BFCB94B01E3308CE001731BF /* GPUImageChromaKeyFilter.h */, BFCB94B11E3308CE001731BF /* GPUImageClosingFilter.h */, BFCB94B21E3308CE001731BF /* GPUImageColorBlendFilter.h */, BFCB94B31E3308CE001731BF /* GPUImageColorBurnBlendFilter.h */, BFCB94B41E3308CE001731BF /* GPUImageColorConversion.h */, BFCB94B51E3308CE001731BF /* GPUImageColorDodgeBlendFilter.h */, BFCB94B61E3308CE001731BF /* GPUImageColorInvertFilter.h */, BFCB94B71E3308CE001731BF /* GPUImageColorLocalBinaryPatternFilter.h */, BFCB94B81E3308CE001731BF /* GPUImageColorMatrixFilter.h */, BFCB94B91E3308CE001731BF /* GPUImageColorPackingFilter.h */, BFCB94BA1E3308CE001731BF /* GPUImageColourFASTFeatureDetector.h */, BFCB94BB1E3308CE001731BF /* GPUImageColourFASTSamplingOperation.h */, BFCB94BC1E3308CE001731BF /* GPUImageContext.h */, BFCB94BD1E3308CE001731BF /* GPUImageContrastFilter.h */, BFCB94BE1E3308CE001731BF /* GPUImageCropFilter.h */, BFCB94BF1E3308CE001731BF /* GPUImageCrosshairGenerator.h */, BFCB94C01E3308CE001731BF /* GPUImageCrosshatchFilter.h */, BFCB94C11E3308CE001731BF /* GPUImageDarkenBlendFilter.h */, BFCB94C21E3308CE001731BF /* GPUImageDifferenceBlendFilter.h */, BFCB94C31E3308CE001731BF /* GPUImageDilationFilter.h */, BFCB94C41E3308CE001731BF /* GPUImageDirectionalNonMaximumSuppressionFilter.h */, BFCB94C51E3308CE001731BF /* GPUImageDirectionalSobelEdgeDetectionFilter.h */, BFCB94C61E3308CE001731BF /* GPUImageDissolveBlendFilter.h */, BFCB94C71E3308CE001731BF /* GPUImageDivideBlendFilter.h */, BFCB94C81E3308CE001731BF /* GPUImageEmbossFilter.h */, BFCB94C91E3308CE001731BF /* GPUImageErosionFilter.h */, BFCB94CA1E3308CE001731BF /* GPUImageExclusionBlendFilter.h */, BFCB94CB1E3308CE001731BF /* GPUImageExposureFilter.h */, BFCB94CC1E3308CE001731BF /* GPUImageFalseColorFilter.h */, BFCB94CD1E3308CE001731BF /* GPUImageFASTCornerDetectionFilter.h */, BFCB94CE1E3308CE001731BF /* GPUImageFilter.h */, BFCB94CF1E3308CE001731BF /* GPUImageFilterGroup.h */, BFCB94D01E3308CE001731BF /* GPUImageFilterPipeline.h */, BFCB94D11E3308CE001731BF /* GPUImageFourInputFilter.h */, BFCB94D21E3308CE001731BF /* GPUImageFramebuffer.h */, BFCB94D31E3308CE001731BF /* GPUImageFramebufferCache.h */, BFCB94D41E3308CE001731BF /* GPUImageGammaFilter.h */, BFCB94D51E3308CE001731BF /* GPUImageGaussianBlurFilter.h */, BFCB94D61E3308CE001731BF /* GPUImageGaussianBlurPositionFilter.h */, BFCB94D71E3308CE001731BF /* GPUImageGaussianSelectiveBlurFilter.h */, BFCB94D81E3308CE001731BF /* GPUImageGlassSphereFilter.h */, BFCB94D91E3308CE001731BF /* GPUImageGrayscaleFilter.h */, BFCB94DA1E3308CE001731BF /* GPUImageHalftoneFilter.h */, BFCB94DB1E3308CE001731BF /* GPUImageHardLightBlendFilter.h */, BFCB94DC1E3308CE001731BF /* GPUImageHarrisCornerDetectionFilter.h */, BFCB94DD1E3308CE001731BF /* GPUImageHazeFilter.h */, BFCB94DE1E3308CE001731BF /* GPUImageHighlightShadowFilter.h */, BFCB94DF1E3308CE001731BF /* GPUImageHighlightShadowTintFilter.h */, BFCB94E01E3308CE001731BF /* GPUImageHighPassFilter.h */, BFCB94E11E3308CE001731BF /* GPUImageHistogramEqualizationFilter.h */, BFCB94E21E3308CE001731BF /* GPUImageHistogramFilter.h */, BFCB94E31E3308CE001731BF /* GPUImageHistogramGenerator.h */, BFCB94E41E3308CE001731BF /* GPUImageHoughTransformLineDetector.h */, BFCB94E51E3308CE001731BF /* GPUImageHSBFilter.h */, BFCB94E61E3308CE001731BF /* GPUImageHueBlendFilter.h */, BFCB94E71E3308CE001731BF /* GPUImageHueFilter.h */, BFCB94E81E3308CE001731BF /* GPUImageiOSBlurFilter.h */, BFCB94E91E3308CE001731BF /* GPUImageJFAVoronoiFilter.h */, BFCB94EA1E3308CE001731BF /* GPUImageKuwaharaFilter.h */, BFCB94EB1E3308CE001731BF /* GPUImageKuwaharaRadius3Filter.h */, BFCB94EC1E3308CE001731BF /* GPUImageLanczosResamplingFilter.h */, BFCB94ED1E3308CE001731BF /* GPUImageLaplacianFilter.h */, BFCB94EE1E3308CE001731BF /* GPUImageLevelsFilter.h */, BFCB94EF1E3308CE001731BF /* GPUImageLightenBlendFilter.h */, BFCB94F01E3308CE001731BF /* GPUImageLinearBurnBlendFilter.h */, BFCB94F11E3308CE001731BF /* GPUImageLineGenerator.h */, BFCB94F21E3308CE001731BF /* GPUImageLocalBinaryPatternFilter.h */, BFCB94F31E3308CE001731BF /* GPUImageLookupFilter.h */, BFCB94F41E3308CE001731BF /* GPUImageLowPassFilter.h */, BFCB94F51E3308CE001731BF /* GPUImageLuminanceRangeFilter.h */, BFCB94F61E3308CE001731BF /* GPUImageLuminanceThresholdFilter.h */, BFCB94F71E3308CE001731BF /* GPUImageLuminosity.h */, BFCB94F81E3308CE001731BF /* GPUImageLuminosityBlendFilter.h */, BFCB94F91E3308CE001731BF /* GPUImageMaskFilter.h */, BFCB94FA1E3308CE001731BF /* GPUImageMedianFilter.h */, BFCB94FB1E3308CE001731BF /* GPUImageMissEtikateFilter.h */, BFCB94FC1E3308CE001731BF /* GPUImageMonochromeFilter.h */, BFCB94FD1E3308CE001731BF /* GPUImageMosaicFilter.h */, BFCB94FE1E3308CE001731BF /* GPUImageMotionBlurFilter.h */, BFCB94FF1E3308CE001731BF /* GPUImageMotionDetector.h */, BFCB95001E3308CE001731BF /* GPUImageMovie.h */, BFCB95011E3308CE001731BF /* GPUImageMovieComposition.h */, BFCB95021E3308CE001731BF /* GPUImageMovieWriter.h */, BFCB95031E3308CE001731BF /* GPUImageMultiplyBlendFilter.h */, BFCB95041E3308CE001731BF /* GPUImageNobleCornerDetectionFilter.h */, BFCB95051E3308CE001731BF /* GPUImageNonMaximumSuppressionFilter.h */, BFCB95061E3308CE001731BF /* GPUImageNormalBlendFilter.h */, BFCB95071E3308CE001731BF /* GPUImageOpacityFilter.h */, BFCB95081E3308CE001731BF /* GPUImageOpeningFilter.h */, BFCB95091E3308CE001731BF /* GPUImageOutput.h */, BFCB950A1E3308CE001731BF /* GPUImageOverlayBlendFilter.h */, BFCB950B1E3308CE001731BF /* GPUImageParallelCoordinateLineTransformFilter.h */, BFCB950C1E3308CE001731BF /* GPUImagePerlinNoiseFilter.h */, BFCB950D1E3308CE001731BF /* GPUImagePicture+TextureSubimage.h */, BFCB950E1E3308CE001731BF /* GPUImagePicture.h */, BFCB950F1E3308CE001731BF /* GPUImagePinchDistortionFilter.h */, BFCB95101E3308CE001731BF /* GPUImagePixellateFilter.h */, BFCB95111E3308CE001731BF /* GPUImagePixellatePositionFilter.h */, BFCB95121E3308CE001731BF /* GPUImagePoissonBlendFilter.h */, BFCB95131E3308CE001731BF /* GPUImagePolarPixellateFilter.h */, BFCB95141E3308CE001731BF /* GPUImagePolkaDotFilter.h */, BFCB95151E3308CE001731BF /* GPUImagePosterizeFilter.h */, BFCB95161E3308CE001731BF /* GPUImagePrewittEdgeDetectionFilter.h */, BFCB95171E3308CE001731BF /* GPUImageRawDataInput.h */, BFCB95181E3308CE001731BF /* GPUImageRawDataOutput.h */, BFCB95191E3308CE001731BF /* GPUImageRGBClosingFilter.h */, BFCB951A1E3308CE001731BF /* GPUImageRGBDilationFilter.h */, BFCB951B1E3308CE001731BF /* GPUImageRGBErosionFilter.h */, BFCB951C1E3308CE001731BF /* GPUImageRGBFilter.h */, BFCB951D1E3308CE001731BF /* GPUImageRGBOpeningFilter.h */, BFCB951E1E3308CE001731BF /* GPUImageSaturationBlendFilter.h */, BFCB951F1E3308CE001731BF /* GPUImageSaturationFilter.h */, BFCB95201E3308CE001731BF /* GPUImageScreenBlendFilter.h */, BFCB95211E3308CE001731BF /* GPUImageSepiaFilter.h */, BFCB95221E3308CE001731BF /* GPUImageSharpenFilter.h */, BFCB95231E3308CE001731BF /* GPUImageShiTomasiFeatureDetectionFilter.h */, BFCB95241E3308CE001731BF /* GPUImageSingleComponentGaussianBlurFilter.h */, BFCB95251E3308CE001731BF /* GPUImageSketchFilter.h */, BFCB95261E3308CE001731BF /* GPUImageSkinToneFilter.h */, BFCB95271E3308CE001731BF /* GPUImageSmoothToonFilter.h */, BFCB95281E3308CE001731BF /* GPUImageSobelEdgeDetectionFilter.h */, BFCB95291E3308CE001731BF /* GPUImageSoftEleganceFilter.h */, BFCB952A1E3308CE001731BF /* GPUImageSoftLightBlendFilter.h */, BFCB952B1E3308CE001731BF /* GPUImageSolarizeFilter.h */, BFCB952C1E3308CE001731BF /* GPUImageSolidColorGenerator.h */, BFCB952D1E3308CE001731BF /* GPUImageSourceOverBlendFilter.h */, BFCB952E1E3308CE001731BF /* GPUImageSphereRefractionFilter.h */, BFCB952F1E3308CE001731BF /* GPUImageStillCamera.h */, BFCB95301E3308CE001731BF /* GPUImageStretchDistortionFilter.h */, BFCB95311E3308CE001731BF /* GPUImageSubtractBlendFilter.h */, BFCB95321E3308CE001731BF /* GPUImageSwirlFilter.h */, BFCB95331E3308CE001731BF /* GPUImageTextureInput.h */, BFCB95341E3308CE001731BF /* GPUImageTextureOutput.h */, BFCB95351E3308CE001731BF /* GPUImageThreeInputFilter.h */, BFCB95361E3308CE001731BF /* GPUImageThresholdEdgeDetectionFilter.h */, BFCB95371E3308CE001731BF /* GPUImageThresholdedNonMaximumSuppressionFilter.h */, BFCB95381E3308CE001731BF /* GPUImageThresholdSketchFilter.h */, BFCB95391E3308CE001731BF /* GPUImageTiltShiftFilter.h */, BFCB953A1E3308CE001731BF /* GPUImageToneCurveFilter.h */, BFCB953B1E3308CE001731BF /* GPUImageToonFilter.h */, BFCB953C1E3308CE001731BF /* GPUImageTransformFilter.h */, BFCB953D1E3308CE001731BF /* GPUImageTwoInputCrossTextureSamplingFilter.h */, BFCB953E1E3308CE001731BF /* GPUImageTwoInputFilter.h */, BFCB953F1E3308CE001731BF /* GPUImageTwoPassFilter.h */, BFCB95401E3308CE001731BF /* GPUImageTwoPassTextureSamplingFilter.h */, BFCB95411E3308CE001731BF /* GPUImageUIElement.h */, BFCB95421E3308CE001731BF /* GPUImageUnsharpMaskFilter.h */, BFCB95431E3308CE001731BF /* GPUImageVibranceFilter.h */, BFCB95441E3308CE001731BF /* GPUImageVideoCamera.h */, BFCB95451E3308CE001731BF /* GPUImageView.h */, BFCB95461E3308CE001731BF /* GPUImageVignetteFilter.h */, BFCB95471E3308CE001731BF /* GPUImageVoronoiConsumerFilter.h */, BFCB95481E3308CE001731BF /* GPUImageWeakPixelInclusionFilter.h */, BFCB95491E3308CE001731BF /* GPUImageWhiteBalanceFilter.h */, BFCB954A1E3308CE001731BF /* GPUImageXYDerivativeFilter.h */, BFCB954B1E3308CE001731BF /* GPUImageZoomBlurFilter.h */, ); path = Header; sourceTree = "<group>"; }; BFCB954D1E3308CE001731BF /* MBProgressHUD */ = { isa = PBXGroup; children = ( BFCB954E1E3308CE001731BF /* LICENSE */, BFCB954F1E3308CE001731BF /* MBProgressHUD.h */, BFCB95501E3308CE001731BF /* MBProgressHUD.m */, BFCB95511E3308CE001731BF /* README.mdown */, ); name = MBProgressHUD; path = SnapseedImitation/MBProgressHUD; sourceTree = "<group>"; }; BFCB95561E3308D4001731BF /* SnapseedImitation */ = { isa = PBXGroup; children = ( BFCB95571E3308F4001731BF /* SnapseedDropMenu.h */, BFCB95581E3308F4001731BF /* SnapseedDropMenu.m */, BFCB95591E3308F4001731BF /* SnapseedDropMenuTableViewCell.h */, BFCB955A1E3308F4001731BF /* SnapseedDropMenuTableViewCell.m */, BFCB955B1E3308F4001731BF /* UIView+Extention.h */, BFCB955C1E3308F4001731BF /* UIView+Extention.m */, BFCB955D1E3308F4001731BF /* ViewController.h */, BFCB955E1E3308F4001731BF /* ViewController.m */, ); name = SnapseedImitation; sourceTree = "<group>"; }; BFCB95631E3308F7001731BF /* SupportFile */ = { isa = PBXGroup; children = ( BFCB95641E330911001731BF /* AppDelegate.h */, BFCB95651E330911001731BF /* AppDelegate.m */, BFCB95661E330911001731BF /* Assets.xcassets */, BFCB95671E330911001731BF /* Base.lproj */, BFCB956C1E330911001731BF /* Duck.jpg */, BFCB956D1E330911001731BF /* Info.plist */, BFCB956E1E330911001731BF /* main.m */, BFCB956F1E330911001731BF /* PrefixHeader.h */, ); name = SupportFile; sourceTree = "<group>"; }; BFCB95671E330911001731BF /* Base.lproj */ = { isa = PBXGroup; children = ( BFCB95681E330911001731BF /* LaunchScreen.storyboard */, BFCB956A1E330911001731BF /* Main.storyboard */, ); name = Base.lproj; path = SnapseedImitation/Base.lproj; sourceTree = "<group>"; }; BFCB95771E330BCA001731BF /* 3rdSDK */ = { isa = PBXGroup; children = ( BFCB949C1E3308CE001731BF /* GPUImage */, BFCB954D1E3308CE001731BF /* MBProgressHUD */, ); name = 3rdSDK; sourceTree = "<group>"; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ BF0B002F1E0FA2E50014BA4B /* SnapseedImitation */ = { isa = PBXNativeTarget; buildConfigurationList = BF0B00471E0FA2E50014BA4B /* Build configuration list for PBXNativeTarget "SnapseedImitation" */; buildPhases = ( BF0B002C1E0FA2E50014BA4B /* Sources */, BF0B002D1E0FA2E50014BA4B /* Frameworks */, BF0B002E1E0FA2E50014BA4B /* Resources */, 344A29351E5C81F6009383F7 /* ShellScript */, ); buildRules = ( ); dependencies = ( ); name = SnapseedImitation; productName = CoreImageDemo; productReference = BF0B00301E0FA2E50014BA4B /* SnapseedImitation.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ BF0B00281E0FA2E50014BA4B /* Project object */ = { isa = PBXProject; attributes = { LastUpgradeCheck = 0800; ORGANIZATIONNAME = VincentJac; TargetAttributes = { BF0B002F1E0FA2E50014BA4B = { CreatedOnToolsVersion = 8.0; DevelopmentTeam = YXCF763UR4; ProvisioningStyle = Automatic; }; }; }; buildConfigurationList = BF0B002B1E0FA2E50014BA4B /* Build configuration list for PBXProject "SnapseedImitation" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); mainGroup = BF0B00271E0FA2E50014BA4B; productRefGroup = BF0B00311E0FA2E50014BA4B /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( BF0B002F1E0FA2E50014BA4B /* SnapseedImitation */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ BF0B002E1E0FA2E50014BA4B /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( BFCB95721E330911001731BF /* LaunchScreen.storyboard in Resources */, BFCB95711E330911001731BF /* Assets.xcassets in Resources */, BFCB95751E330911001731BF /* Info.plist in Resources */, BFCB95741E330911001731BF /* Duck.jpg in Resources */, BFCB95531E3308CE001731BF /* LICENSE in Resources */, BFCB95731E330911001731BF /* Main.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ 344A29351E5C81F6009383F7 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "APP_PATH=\"${TARGET_BUILD_DIR}/${WRAPPER_NAME}\"\n\n# This script loops through the frameworks embedded in the application and\n# removes unused architectures.\nfind \"$APP_PATH\" -name '*.framework' -type d | while read -r FRAMEWORK\ndo\nFRAMEWORK_EXECUTABLE_NAME=$(defaults read \"$FRAMEWORK/Info.plist\" CFBundleExecutable)\nFRAMEWORK_EXECUTABLE_PATH=\"$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME\"\necho \"Executable is $FRAMEWORK_EXECUTABLE_PATH\"\n\nEXTRACTED_ARCHS=()\n\nfor ARCH in $ARCHS\ndo\necho \"Extracting $ARCH from $FRAMEWORK_EXECUTABLE_NAME\"\nlipo -extract \"$ARCH\" \"$FRAMEWORK_EXECUTABLE_PATH\" -o \"$FRAMEWORK_EXECUTABLE_PATH-$ARCH\"\nEXTRACTED_ARCHS+=(\"$FRAMEWORK_EXECUTABLE_PATH-$ARCH\")\ndone\n\necho \"Merging extracted architectures: ${ARCHS}\"\nlipo -o \"$FRAMEWORK_EXECUTABLE_PATH-merged\" -create \"${EXTRACTED_ARCHS[@]}\"\nrm \"${EXTRACTED_ARCHS[@]}\"\n\necho \"Replacing original executable with thinned version\"\nrm \"$FRAMEWORK_EXECUTABLE_PATH\"\nmv \"$FRAMEWORK_EXECUTABLE_PATH-merged\" \"$FRAMEWORK_EXECUTABLE_PATH\"\n\ndone"; }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ BF0B002C1E0FA2E50014BA4B /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( BFCB95621E3308F4001731BF /* ViewController.m in Sources */, BFCB95611E3308F4001731BF /* UIView+Extention.m in Sources */, BFCB955F1E3308F4001731BF /* SnapseedDropMenu.m in Sources */, BFCB95541E3308CE001731BF /* MBProgressHUD.m in Sources */, BFCB95601E3308F4001731BF /* SnapseedDropMenuTableViewCell.m in Sources */, BFCB95551E3308CE001731BF /* README.mdown in Sources */, BFCB95761E330911001731BF /* main.m in Sources */, BFCB95701E330911001731BF /* AppDelegate.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXVariantGroup section */ BFCB95681E330911001731BF /* LaunchScreen.storyboard */ = { isa = PBXVariantGroup; children = ( BFCB95691E330911001731BF /* Base */, ); name = LaunchScreen.storyboard; sourceTree = "<group>"; }; BFCB956A1E330911001731BF /* Main.storyboard */ = { isa = PBXVariantGroup; children = ( BFCB956B1E330911001731BF /* Base */, ); name = Main.storyboard; sourceTree = "<group>"; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ BF0B00451E0FA2E50014BA4B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_SUSPICIOUS_MOVES = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_BITCODE = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 10.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; }; name = Debug; }; BF0B00461E0FA2E50014BA4B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_SUSPICIOUS_MOVES = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_BITCODE = NO; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 10.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; }; name = Release; }; BF0B00481E0FA2E50014BA4B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "iPhone Developer: Vishnu Gopal (9W5B2P4YRQ)"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Vishnu Gopal (9W5B2P4YRQ)"; DEVELOPMENT_TEAM = YXCF763UR4; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "$(SRCROOT)/SnapseedImitation/PrefixHeader.h"; GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = NO; HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = SnapseedImitation/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/SnapseedImitation/GPUImage", "$(PROJECT_DIR)/SnapseedImitation/GPUImage/Header", "$(PROJECT_DIR)/SnapseedImitation/GPUImage", ); ONLY_ACTIVE_ARCH = NO; PRODUCT_BUNDLE_IDENTIFIER = VincentJac.SnapseedImitation; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = "4bad389f-7d8b-4b47-8773-33ba5f3bdae8"; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = 1; VALID_ARCHS = "armv7 armv7s"; }; name = Debug; }; BF0B00491E0FA2E50014BA4B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; DEVELOPMENT_TEAM = YXCF763UR4; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "$(SRCROOT)/SnapseedImitation/PrefixHeader.h"; GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = NO; HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = SnapseedImitation/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/SnapseedImitation/GPUImage", "$(PROJECT_DIR)/SnapseedImitation/GPUImage/Header", "$(PROJECT_DIR)/SnapseedImitation/GPUImage", ); ONLY_ACTIVE_ARCH = NO; PRODUCT_BUNDLE_IDENTIFIER = VincentJac.SnapseedImitation; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = 1; VALID_ARCHS = "armv7 armv7s"; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ BF0B002B1E0FA2E50014BA4B /* Build configuration list for PBXProject "SnapseedImitation" */ = { isa = XCConfigurationList; buildConfigurations = ( BF0B00451E0FA2E50014BA4B /* Debug */, BF0B00461E0FA2E50014BA4B /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; BF0B00471E0FA2E50014BA4B /* Build configuration list for PBXNativeTarget "SnapseedImitation" */ = { isa = XCConfigurationList; buildConfigurations = ( BF0B00481E0FA2E50014BA4B /* Debug */, BF0B00491E0FA2E50014BA4B /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = BF0B00281E0FA2E50014BA4B /* Project object */; }
{ "repo_name": "filelife/SnapseedImitation", "stars": "83", "repo_language": "Objective-C", "file_name": "GPUImageParallelCoordinateLineTransformFilter.h", "mime_type": "text/x-objective-c" }
<?xml version="1.0" encoding="UTF-8"?> <Workspace version = "1.0"> <FileRef location = "self:CoreImageDemo.xcodeproj"> </FileRef> </Workspace>
{ "repo_name": "filelife/SnapseedImitation", "stars": "83", "repo_language": "Objective-C", "file_name": "GPUImageParallelCoordinateLineTransformFilter.h", "mime_type": "text/x-objective-c" }
// // AppDelegate.m // CoreImageDemo // // Created by Gejiaxin on 16/12/25. // Copyright © 2016 VincentJac. All rights reserved. // #import "AppDelegate.h" @interface AppDelegate () @end @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. return YES; } - (void)applicationWillResignActive:(UIApplication *)application { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. } - (void)applicationDidEnterBackground:(UIApplication *)application { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } - (void)applicationWillEnterForeground:(UIApplication *)application { // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. } - (void)applicationDidBecomeActive:(UIApplication *)application { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } - (void)applicationWillTerminate:(UIApplication *)application { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } @end
{ "repo_name": "filelife/SnapseedImitation", "stars": "83", "repo_language": "Objective-C", "file_name": "GPUImageParallelCoordinateLineTransformFilter.h", "mime_type": "text/x-objective-c" }
// // ViewController.h // CoreImageDemo // // Created by Gejiaxin on 16/12/25. // Copyright © 2016 VincentJac. All rights reserved. // #import <UIKit/UIKit.h> @interface ViewController : UIViewController @end
{ "repo_name": "filelife/SnapseedImitation", "stars": "83", "repo_language": "Objective-C", "file_name": "GPUImageParallelCoordinateLineTransformFilter.h", "mime_type": "text/x-objective-c" }
// // AppDelegate.h // CoreImageDemo // // Created by Gejiaxin on 16/12/25. // Copyright © 2016 VincentJac. All rights reserved. // #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
{ "repo_name": "filelife/SnapseedImitation", "stars": "83", "repo_language": "Objective-C", "file_name": "GPUImageParallelCoordinateLineTransformFilter.h", "mime_type": "text/x-objective-c" }
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleDevelopmentRegion</key> <string>en</string> <key>CFBundleDisplayName</key> <string>SnapseedImitation</string> <key>CFBundleExecutable</key> <string>$(EXECUTABLE_NAME)</string> <key>CFBundleIdentifier</key> <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleName</key> <string>$(PRODUCT_NAME)</string> <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleShortVersionString</key> <string>1.0</string> <key>CFBundleVersion</key> <string>1</string> <key>LSRequiresIPhoneOS</key> <true/> <key>NSPhotoLibraryUsageDescription</key> <string>Privacy - Photo Library Usage </string> <key>UILaunchStoryboardName</key> <string>LaunchScreen</string> <key>UIMainStoryboardFile</key> <string>Main</string> <key>UIRequiredDeviceCapabilities</key> <array> <string>armv7</string> </array> <key>UISupportedInterfaceOrientations</key> <array> <string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationLandscapeRight</string> </array> </dict> </plist>
{ "repo_name": "filelife/SnapseedImitation", "stars": "83", "repo_language": "Objective-C", "file_name": "GPUImageParallelCoordinateLineTransformFilter.h", "mime_type": "text/x-objective-c" }
// // SnapseedDropMenuTableViewCell.m // CoreImageDemo // // Created by Gejiaxin on 16/12/28. // Copyright © 2016 VincentJac. All rights reserved. // #import "SnapseedDropMenuTableViewCell.h" @interface SnapseedDropMenuTableViewCell() @end @implementation SnapseedDropMenuTableViewCell - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(nullable NSString *)reuseIdentifier { self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; self.mainView = [[UIView alloc] initWithFrame:CGRectMake(0, -1, SnapseedDropMenuCellWidth, SnapseedDropMenuCellHeight + 2)]; self.mainView.opaque = YES; [self.contentView addSubview:self.mainView]; self.title = [[UILabel alloc] initWithFrame:CGRectMake(15, 0, SnapseedDropMenuCellWidth, SnapseedDropMenuCellHeight)]; self.title.textColor = [UIColor whiteColor]; [self.mainView addSubview:self.title]; self.valueLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, SnapseedDropMenuCellWidth - 15, SnapseedDropMenuCellHeight)]; self.valueLab.textAlignment = NSTextAlignmentRight; self.valueLab.textColor = [UIColor whiteColor]; [self.mainView addSubview:self.valueLab]; return self; } - (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; // Configure the view for the selected state } @end
{ "repo_name": "filelife/SnapseedImitation", "stars": "83", "repo_language": "Objective-C", "file_name": "GPUImageParallelCoordinateLineTransformFilter.h", "mime_type": "text/x-objective-c" }
// // ViewController.m // CoreImageDemo // // Created by Gejiaxin on 16/12/25. // Copyright © 2016 VincentJac. All rights reserved. // #import "ViewController.h" #import "MBProgressHUD.h" #import "SnapseedDropMenu.h" #import <math.h> #import "GPUImage.h" @interface ViewController () <SnapseedDropMenuDelegate, UIImagePickerControllerDelegate, UINavigationControllerDelegate>{ BOOL _change; } @property (nonatomic, strong) CALayer * imgLayer; @property (nonatomic, strong) UIImage * originImg; @property (nonatomic, strong) UIView * gestureView; @property (nonatomic, strong) MBProgressHUD *tipHud; @property (nonatomic, strong) UIScrollView * tabScrollView; @property (nonatomic, strong) SnapseedDropMenu * menu; @property (nonatomic, strong) UILabel * selectFilterNameLab; @property (nonatomic, copy) NSArray<SnapseedDropMenuModel *> * colorFilterArray; @property (nonatomic, copy) NSArray * tabbarFilterArray; @property (nonatomic, strong) UIButton * leftbtn; @property (nonatomic, strong) UIButton * rightbtn; @property (nonatomic, strong) UIImagePickerController *picker; @property (nonatomic, strong) GPUImageBrightnessFilter * brighterFilter; @property (nonatomic, strong) GPUImageExposureFilter * exposureFilter; @property (nonatomic, strong) GPUImageContrastFilter * constrastFilter; @property (nonatomic, strong) GPUImageHighlightShadowFilter * lightShadowFilter; @property (nonatomic, strong) GPUImageHighlightShadowFilter * highLightFilter; @property (nonatomic, strong) GPUImageFilterPipeline * filterPipeline; @property (nonatomic, strong) GPUImagePicture * gpuOriginImage; @property (nonatomic, strong) GPUImageView * previewImageView; @property (nonatomic, strong) NSMutableArray * filtersArray; @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; [self initData]; [self initUI]; } - (void)viewWillAppear:(BOOL)animated { } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } - (void) initUI { self.view.backgroundColor = BACKGROUNDCOLOR; //loading tip _tipHud = [[MBProgressHUD alloc] initWithView:self.view]; [self.view addSubview:_tipHud]; self.leftbtn = [UIButton buttonWithType:UIButtonTypeCustom]; self.leftbtn.frame = CGRectMake(0, 30, 100, 30); [self.leftbtn setTitle:@"Save" forState:UIControlStateNormal]; [self.leftbtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; [self.leftbtn addTarget:self action:@selector(saveImage:) forControlEvents:UIControlEventTouchUpInside]; [self.view addSubview:self.leftbtn]; self.rightbtn = [UIButton buttonWithType:UIButtonTypeCustom]; self.rightbtn.frame = CGRectMake(SCREEN_WIDTH - 100, 30, 100, 30); [self.rightbtn setTitle:@"Open" forState:UIControlStateNormal]; [self.rightbtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; [self.rightbtn addTarget:self action:@selector(openAlbum:) forControlEvents:UIControlEventTouchUpInside]; [self.view addSubview:self.rightbtn]; self.selectFilterNameLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, NAV_VIEW_HEIGHT + 30)]; self.selectFilterNameLab.textColor = [UIColor whiteColor]; self.selectFilterNameLab.backgroundColor = [UIColor clearColor]; self.selectFilterNameLab.textAlignment = NSTextAlignmentCenter; [self.view addSubview:self.selectFilterNameLab]; self.gestureView = [[UIView alloc]initWithFrame:CGRectMake(0, 60, SCREEN_WIDTH, SCREEN_HEIGHT)]; [self.view addSubview:self.gestureView]; //Snapseed menu CGPoint point = CGPointMake(SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2); self.menu = [[SnapseedDropMenu alloc]initWithArray:self.colorFilterArray viewCenterPoint:point inView:self.gestureView]; self.menu.dropMenuDelegate = self; [self.view addSubview:self.menu]; } - (void) initData { _change = YES; SnapseedDropMenuModel * brightModel = [[SnapseedDropMenuModel alloc]initWithTitle:@"Bright" defaultValue:0 maxValue:1 minValue:-1]; SnapseedDropMenuModel * constrastModel = [[SnapseedDropMenuModel alloc]initWithTitle:@"Constrast" defaultValue:1 maxValue:4 minValue:0]; SnapseedDropMenuModel * exposureModel = [[SnapseedDropMenuModel alloc]initWithTitle:@"Exposure" defaultValue:1 maxValue:4 minValue:-2]; SnapseedDropMenuModel * shadowModel = [[SnapseedDropMenuModel alloc]initWithTitle:@"Shadow" defaultValue:0 maxValue:4 minValue:0]; SnapseedDropMenuModel * hightLightMolde = [[SnapseedDropMenuModel alloc]initWithTitle:@"HightLight" defaultValue:1 maxValue:1 minValue:0]; self.colorFilterArray = @[brightModel,constrastModel,exposureModel,shadowModel,hightLightMolde]; self.brighterFilter = [[GPUImageBrightnessFilter alloc] init]; self.constrastFilter = [[GPUImageContrastFilter alloc] init]; self.exposureFilter = [[GPUImageExposureFilter alloc] init]; self.lightShadowFilter = [[GPUImageHighlightShadowFilter alloc] init]; self.highLightFilter = [[GPUImageHighlightShadowFilter alloc] init]; _filtersArray = [NSMutableArray arrayWithObjects:self.brighterFilter,self.constrastFilter,self.exposureFilter,self.lightShadowFilter,self.highLightFilter,nil]; self.originImg = [UIImage imageNamed:@"Duck.jpg"]; [self initImageVIew:self.originImg]; } - (void)initImageVIew:(UIImage *)image { self.gpuOriginImage = [[GPUImagePicture alloc] initWithImage:image smoothlyScaleOutput:YES]; [self.gpuOriginImage processImage]; [self.gpuOriginImage addTarget:self.brighterFilter]; [self.gpuOriginImage addTarget:self.constrastFilter]; [self.gpuOriginImage addTarget:self.exposureFilter]; [self.gpuOriginImage addTarget:self.lightShadowFilter]; [self.gpuOriginImage addTarget:self.highLightFilter]; if(self.previewImageView == nil) { self.previewImageView = [[GPUImageView alloc] initWithFrame:CGRectZero]; self.previewImageView.width = SCREEN_WIDTH - 30; self.previewImageView.height = SCREEN_HEIGHT / 3 * 2; self.previewImageView.contentMode = UIViewContentModeScaleAspectFit; self.previewImageView.centerX = SCREEN_WIDTH / 2; self.previewImageView.y = SCREEN_HEIGHT / 6; [self.view addSubview:self.previewImageView]; } self.filterPipeline = [[GPUImageFilterPipeline alloc]initWithOrderedFilters:_filtersArray input:self.gpuOriginImage output:_previewImageView]; [_gpuOriginImage processImage]; } #pragma mark button action block - (void)openAlbum:(UIButton *)sender { self.picker = [[UIImagePickerController alloc] init]; [self settingGeneralProperty]; [self presentViewController:self.picker animated:YES completion:nil]; } - (void)saveImage:(UIButton *)sender { UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Message" message:@"Save photo?" preferredStyle:(UIAlertControllerStyleAlert)]; UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"YES" style:(UIAlertActionStyleDefault) handler:^(UIAlertAction *action) { [self showLoadingTips]; [self saveEditImage]; }]; UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"Cancel" style:(UIAlertActionStyleCancel) handler:^(UIAlertAction *action) { }]; [alertController addAction:okAction]; [alertController addAction:cancelAction]; [self presentViewController:alertController animated:YES completion:nil]; } - (void)saveEditImage { SEL selectorToCall = @selector(imageWasSavedSuccessfully:didFinishSavingWithError:contextInfo:); UIImage * saveImage = [self createFinalImage]; UIImageWriteToSavedPhotosAlbum(saveImage, self,selectorToCall, NULL); } - (UIImage *)createFinalImage{ UIImage * currentImage; GPUImagePicture * temp = [[GPUImagePicture alloc]initWithImage:self.originImg]; for(GPUImageFilter * filter in self.filtersArray) { [temp addTarget:filter]; [temp processImage]; [filter useNextFrameForImageCapture]; currentImage = [filter imageFromCurrentFramebuffer]; if(!currentImage) { break; } else { temp = [[GPUImagePicture alloc]initWithImage:currentImage]; } } return currentImage; } #pragma mark UIImagePicker Delegate - (void) imageWasSavedSuccessfully:(UIImage *)paramImage didFinishSavingWithError:(NSError *)paramError contextInfo:(void *)paramContextInfo { [self dismissLoadingTips]; if (paramError == nil){ [self showTextTips:@"Saving successfully"]; NSLog(@"Image was saved successfully."); } else { [self showTextTips:@"Saved failure"]; NSLog(@"An error happened while saving the image."); NSLog(@"Error = %@", paramError); } } - (void)settingGeneralProperty { /* UIImagePickerControllerSourceTypePhotoLibrary UIImagePickerControllerSourceTypeCamera UIImagePickerControllerSourceTypeSavedPhotosAlbum */ _picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; _picker.mediaTypes = [UIImagePickerController availableMediaTypesForSourceType:UIImagePickerControllerSourceTypeSavedPhotosAlbum]; _picker.allowsEditing = YES; _picker.delegate = self; } -(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary<NSString *,id> *)info { /* info key UIImagePickerControllerMediaType UIImagePickerControllerOriginalImage UIImagePickerControllerEditedImage UIImagePickerControllerCropRect UIImagePickerControllerMediaURL UIImagePickerControllerReferenceURL UIImagePickerControllerMediaMetadata UIImagePickerControllerLivePhoto // a PHLivePhoto */ __weak UIImage * pickerImg = [info objectForKey:UIImagePickerControllerEditedImage]; self.originImg = pickerImg; [self initImageVIew:self.originImg]; //Compression Quality // NSData *dataEdited = UIImageJPEGRepresentation(self.imageView.image, 0.3); [_picker dismissViewControllerAnimated:YES completion:nil]; } -(void)imagePickerControllerDidCancel:(UIImagePickerController *)picker { NSLog(@"Cancel"); [_picker dismissViewControllerAnimated:YES completion:nil]; } #pragma mark SnapseedDropMenu Delegate - (void)snapseedDropMenu:(SnapseedDropMenu *)sender didSelectCellAtIndex:(NSInteger)index value:(CGFloat)value{ SnapseedDropMenuModel * model = [self.colorFilterArray objectAtIndex:index]; NSString * colorFilterName = [NSString stringWithFormat:@"%@ %.1f",model.title,value]; self.selectFilterNameLab.text = colorFilterName; } - (void)snapseedDropMenu:(SnapseedDropMenu *)sender atIndex:(NSInteger)index valueDidChange:(CGFloat)value { } - (void)snapseedDropMenu:(SnapseedDropMenu *)sender atIndex:(NSInteger)index isChanging:(CGFloat)value { SnapseedDropMenuModel * model = [self.colorFilterArray objectAtIndex:index]; NSString * colorFilterName = [NSString stringWithFormat:@"%@ %.1f",model.title,value]; self.selectFilterNameLab.text = colorFilterName; [self randerImageWithFilter:index value:value]; } #pragma mark - Filter - (void)randerImageWithFilter:(NSInteger)index value:(CGFloat)value{ switch (index) { case 0: { if(_brighterFilter) { _brighterFilter.brightness = value ; [_gpuOriginImage processImage]; [_brighterFilter useNextFrameForImageCapture]; } } break; case 1: { if(_constrastFilter) { _constrastFilter.contrast = value; [_gpuOriginImage processImage]; [_constrastFilter useNextFrameForImageCapture]; } } break; case 2: { if(_exposureFilter) { _exposureFilter.exposure = value ; [_gpuOriginImage processImage]; [_exposureFilter useNextFrameForImageCapture]; } } break; case 3: { if(_lightShadowFilter) { _lightShadowFilter.shadows = value; [_gpuOriginImage processImage]; [_lightShadowFilter useNextFrameForImageCapture]; } } break; case 4: { if(self.highLightFilter) { self.highLightFilter.highlights = value; [_gpuOriginImage processImage]; [self.highLightFilter useNextFrameForImageCapture]; } } default: break; } } #pragma mark - HUD - (void)showTextTips:(NSString *)tips { if(!_tipHud) { _tipHud = [[MBProgressHUD alloc] initWithView:[UIApplication sharedApplication].keyWindow]; } [MBProgressHUD hideHUDForView:[UIApplication sharedApplication].keyWindow animated:NO]; [[UIApplication sharedApplication].keyWindow addSubview:_tipHud]; [[UIApplication sharedApplication].keyWindow bringSubviewToFront:_tipHud]; _tipHud.mode = MBProgressHUDModeText; _tipHud.labelText = tips; [_tipHud show:YES]; [_tipHud hide:YES afterDelay:1]; } - (void)showLoadingTips { if(!_tipHud) { _tipHud = [[MBProgressHUD alloc] initWithView:[UIApplication sharedApplication].keyWindow]; } [MBProgressHUD hideHUDForView:[UIApplication sharedApplication].keyWindow animated:NO]; [[UIApplication sharedApplication].keyWindow addSubview:_tipHud]; [[UIApplication sharedApplication].keyWindow bringSubviewToFront:_tipHud]; _tipHud.labelText = nil; _tipHud.mode = MBProgressHUDModeIndeterminate; [_tipHud show:YES]; } - (void)dismissLoadingTips { [_tipHud hide:YES]; } @end
{ "repo_name": "filelife/SnapseedImitation", "stars": "83", "repo_language": "Objective-C", "file_name": "GPUImageParallelCoordinateLineTransformFilter.h", "mime_type": "text/x-objective-c" }
// // PrefixHeader.pch // CoreImageDemo // // Created by Gejiaxin on 16/12/28. // Copyright © 2016 VincentJac. All rights reserved. // #ifndef PrefixHeader_pch #define PrefixHeader_pch #define SnapseedDropMenuCellHeight 45 #define SnapseedDropMenuCellWidth 200 #pragma mark - ScreenSize #define SCREEN_WIDTH ([UIScreen mainScreen].bounds.size.width) #define SCREEN_HEIGHT ([UIScreen mainScreen].bounds.size.height) #define NAV_VIEW_HEIGHT 44.0f #pragma mark - Model Version #define IS_IPHONE4 (([[UIScreen mainScreen] bounds].size.height == 480) ? YES : NO) #define IS_IPHONE5 (([[UIScreen mainScreen] bounds].size.height == 568) ? YES : NO) #define IS_IPHONE6 (([[UIScreen mainScreen] bounds].size.width == 375) ? YES : NO) #define IS_IPHONE6P (([[UIScreen mainScreen] bounds].size.width == 414) ? YES : NO) #pragma mark - Sys version #define IOS_VERSION [[[UIDevice currentDevice] systemVersion] floatValue] #define CurrentSystemVersion ([[UIDevice currentDevice] systemVersion]) #define HEX_RGBA(s,a) [UIColor colorWithRed:(((s & 0xFF0000) >> 16))/255.0 green:(((s &0xFF00) >>8))/255.0 blue:((s & 0xFF))/255.0 alpha:a] #define COLOR_1 HEX_RGBA(0x333333, 1) #define COLOR_2 HEX_RGBA(0x666666, 1) #define COLOR_3 HEX_RGBA(0x0090ff, 1) #define COLOR_4 HEX_RGBA(0x999999, 1) #define COLOR_5 HEX_RGBA(0xcccccc, 1) #define COLOR_6 HEX_RGBA(0xff6e00, 1) #define COLOR_7 HEX_RGBA(0xffffff, 1) #define COLOR_8 HEX_RGBA(0xdddddd, 1) #define COLOR_9 HEX_RGBA(0xeeeeee, 1) #define COLOR_10 HEX_RGBA(0xf5f5f5, 1) #define COLOR_11 HEX_RGBA(0xebeced, 1) #define COLOR_12 HEX_RGBA(0x7fedff, 1) #define COLOR_14 HEX_RGBA(0x38adff, 1) #define COLOR_16 HEX_RGBA(0xff6f6f, 1) #define COLOR_19 HEX_RGBA(0xff9518, 1) #define COLOR_20 HEX_RGBA(0x000000,0.6) #define BACKGROUNDCOLOR HEX_RGBA(0x000000,0.80) #endif /* PrefixHeader_pch */
{ "repo_name": "filelife/SnapseedImitation", "stars": "83", "repo_language": "Objective-C", "file_name": "GPUImageParallelCoordinateLineTransformFilter.h", "mime_type": "text/x-objective-c" }
// // UIView(Extention).h // CoreImageDemo // // Created by Gejiaxin on 16/12/28. // Copyright © 2016 VincentJac. All rights reserved. // #import <UIKit/UIKit.h> @interface UIView (Extention) /** * top = frame.origin.y */ @property (nonatomic, assign) CGFloat top; /** * left = frame.origin.x */ @property (nonatomic, assign) CGFloat left; /** * bottom = frame.origin.y + frame.size.height */ @property (nonatomic, assign) CGFloat bottom; /** * right = frame.origin.x + frame.size.width */ @property (nonatomic, assign) CGFloat right; /** * width = frame.size.width */ @property (nonatomic, assign) CGFloat width; /** * height = frame.size.height */ @property (nonatomic, assign) CGFloat height; /** * centerX = center.x */ @property (nonatomic, assign) CGFloat centerX; /** * centerY = center.y */ @property (nonatomic, assign) CGFloat centerY; /** * 当前实例在屏幕上的x坐标 */ @property (nonatomic, readonly) CGFloat screenX; /** * 当前实例在屏幕上的y坐标 */ @property (nonatomic, readonly) CGFloat screenY; /** * 当前实例在屏幕上的x坐标(scroll view适用) */ @property (nonatomic, readonly) CGFloat screenViewX; /** * 当前实例在屏幕上的y坐标(scroll view适用) */ @property (nonatomic, readonly) CGFloat screenViewY; /** * 当前实例在屏幕上的位置大小 */ @property (nonatomic, readonly) CGRect screenFrame; /** * origin = frame.origin */ @property (nonatomic) CGPoint origin; /** * size = frame.size */ @property (nonatomic) CGSize size; /** * 返回实例在竖屏下的宽或横屏下的高 */ @property (nonatomic, readonly) CGFloat orientationWidth; /** * 返回实例在竖屏下的高或横屏下的宽 */ @property (nonatomic, readonly) CGFloat orientationHeight; /** * 返回实例相对于otherView的位置,otherView指某一层的superview */ - (CGPoint)offsetFromView:(UIView*)otherView; /** * 返回screenSize */ @property (nonatomic) CGSize screenSize; /** * 移除VIEW上所有的子VIEW */ - (void)removeAllSubviews; @property (assign, nonatomic) CGFloat x; @property (assign, nonatomic) CGFloat y; @property (assign, nonatomic) CGFloat w; @property (assign, nonatomic) CGFloat h; @end
{ "repo_name": "filelife/SnapseedImitation", "stars": "83", "repo_language": "Objective-C", "file_name": "GPUImageParallelCoordinateLineTransformFilter.h", "mime_type": "text/x-objective-c" }
// // SnapseedDropMenuTableViewCell.h // CoreImageDemo // // Created by Gejiaxin on 16/12/28. // Copyright © 2016 VincentJac. All rights reserved. // #import <UIKit/UIKit.h> @interface SnapseedDropMenuTableViewCell : UITableViewCell @property (nonatomic, strong) UILabel * title; @property (nonatomic, strong) UILabel * valueLab; @property (nonatomic, strong) UIView * mainView; @end
{ "repo_name": "filelife/SnapseedImitation", "stars": "83", "repo_language": "Objective-C", "file_name": "GPUImageParallelCoordinateLineTransformFilter.h", "mime_type": "text/x-objective-c" }