From d892225c52ea86ac7a974572e00954235ebf575f Mon Sep 17 00:00:00 2001 From: Mentor Palokaj Date: Mon, 18 Oct 2021 15:08:46 +0200 Subject: [PATCH] website polishing --- contracts/Rocketeer.sol | 6 ++- firebase.json | 4 +- functions/modules/express.js | 17 ++++++- functions/modules/mainnet.js | 10 ++-- functions/modules/testnet.js | 4 +- website/modules/config.js | 2 +- website/modules/publish-css.js | 2 +- website/src/css/essential-above-the-fold.sass | 46 ++++++++++++------- website/src/index.pug | 30 ++++++++---- 9 files changed, 83 insertions(+), 38 deletions(-) diff --git a/contracts/Rocketeer.sol b/contracts/Rocketeer.sol index 45242fd..ebeeea7 100644 --- a/contracts/Rocketeer.sol +++ b/contracts/Rocketeer.sol @@ -30,13 +30,15 @@ contract Rocketeer is ERC721Tradable { // TODO: add Api data // https://docs.opensea.io/docs/metadata-standards function baseTokenURI() override public pure returns (string memory) { - return "https://us-central1-rocketeer-nft.cloudfunctions.net/testnetMetadata/rocketeer/"; + // return "https://rocketeer.fans/testnetapi/rocketeer/"; + return "https://rocketeer.fans/api/rocketeer/"; } // TODO: add API link // https://docs.opensea.io/docs/contract-level-metadata function contractURI() public pure returns (string memory) { - return "https://us-central1-rocketeer-nft.cloudfunctions.net/collection"; + // return "https://rocketeer.fans/testnetapi/collection/"; + return "https://rocketeer.fans/api/rocketeer/"; } // /////////////////////////////// diff --git a/firebase.json b/firebase.json index befa371..f26eeba 100644 --- a/firebase.json +++ b/firebase.json @@ -14,11 +14,11 @@ "public": "website/docs", "rewrites": [ { - "source": "/api", + "source": "/api/**", "function": "mainnetMetadata" }, { - "source": "/testnetapi", + "source": "/testnetapi/**", "function": "testnetMetadata" } ] diff --git a/functions/modules/express.js b/functions/modules/express.js index 103eca6..ee20919 100644 --- a/functions/modules/express.js +++ b/functions/modules/express.js @@ -2,5 +2,20 @@ const express = require( 'express' ) const cors = require( 'cors' ) + // CORS enabled express generator -module.exports = f => express().use( cors( { origin: true } ) ) \ No newline at end of file +module.exports = f => { + + const app = express() + app.use( cors( { origin: true } ) ) + // Logger for debugging + // app.use( ( req, res, next ) => { + + // console.log( 'base:', req.baseUrl, 'params:', req.params, 'body:', req.body, 'originalurl:', req.originalUrl, 'path:', req.path ) + + // next() + // } ) + + return app + +} \ No newline at end of file diff --git a/functions/modules/mainnet.js b/functions/modules/mainnet.js index 0147e69..a427c3e 100644 --- a/functions/modules/mainnet.js +++ b/functions/modules/mainnet.js @@ -14,7 +14,7 @@ const globalAttributes = [ ] } ] const heavenlyBodies = [ "Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune", "Pluto", "the Moon", "the Sun" ] -const web2domain = 'https://mentor.eth.link/' +const web2domain = 'https://rocketeer.fans' // /////////////////////////////// // Rocketeer helpers @@ -59,7 +59,7 @@ function pickRandomAttributes( attributes ) { // /////////////////////////////// // Specific Rocketeer instances // /////////////////////////////// -app.get( '/rocketeer/:id', async ( req, res ) => { +app.get( '/api/rocketeer/:id', async ( req, res ) => { // Parse the request const { id } = req.params @@ -106,7 +106,7 @@ app.get( '/rocketeer/:id', async ( req, res ) => { name: `${ name.first() } ${ name.middle() } ${ name.last() } of ${ pickRandomArrayEntry( heavenlyBodies ) }`, description: ``, image: ``, - external_url: `${ web2domain }rocketeer/${ id }`, + external_url: `${ web2domain }/api/rocketeer/${ id }`, attributes: [] } @@ -132,9 +132,9 @@ app.get( '/rocketeer/:id', async ( req, res ) => { // /////////////////////////////// // Static collection data // /////////////////////////////// -app.get( '/collection', ( req, res ) => res.json( { +app.get( '/api/collection', ( req, res ) => res.json( { description: "A testnet collection", - external_url: `https://openseacreatures.io/`, + external_url: web2domain, image: "https://rocketpool.net/images/rocket.png", name: `Rocketeer collection`, seller_fee_basis_points: 0, diff --git a/functions/modules/testnet.js b/functions/modules/testnet.js index c7ec684..028e5ab 100644 --- a/functions/modules/testnet.js +++ b/functions/modules/testnet.js @@ -2,7 +2,7 @@ const app = require( './express' )() const { getTotalSupply } = require( './contract' ) // Specific Rocketeer instances -app.get( '/rocketeer/:id', async ( req, res ) => res.json( { +app.get( '/testnetapi/rocketeer/:id', async ( req, res ) => res.json( { description: "A testnet Rocketeer", external_url: `https://openseacreatures.io/${ req.params.id }`, image: "https://rocketpool.net/images/rocket.png", @@ -15,7 +15,7 @@ app.get( '/rocketeer/:id', async ( req, res ) => res.json( { // Collection data -app.get( '/collection', async ( req, res ) => res.json( { +app.get( '/testnetapi/collection', async ( req, res ) => res.json( { totalSupply: await getTotalSupply( 'rinkeby' ), description: "A testnet collection", external_url: `https://openseacreatures.io/`, diff --git a/website/modules/config.js b/website/modules/config.js index a36b7cb..552fa35 100644 --- a/website/modules/config.js +++ b/website/modules/config.js @@ -34,7 +34,7 @@ module.exports = { // browsers: [ 'last 2 versions', 'not dead' ], // Format your own based on: https://github.com/browserslist/browserslist - browsers: [ '>1%' ] + browsers: [ '>0.2%', 'last 2 versions', 'not dead', 'not op_mini all', 'not IE 11' ] } }, diff --git a/website/modules/publish-css.js b/website/modules/publish-css.js index e8103b6..f9c9774 100644 --- a/website/modules/publish-css.js +++ b/website/modules/publish-css.js @@ -34,7 +34,7 @@ const file = site => new Promise( ( resolve, reject ) => { postcss( [ autoprefixer, cssnano, - doiuse( { ...site.system.browser, onFeatureUsage: cssWarning } ) + doiuse( { ...site.system.browser.support, onFeatureUsage: cssWarning } ) ] ) .process( result.css, { from: css.from, to: css.to } ) .then( result => fs.writeFile( css.to, result.css ) ) diff --git a/website/src/css/essential-above-the-fold.sass b/website/src/css/essential-above-the-fold.sass index 1517922..c85c3db 100644 --- a/website/src/css/essential-above-the-fold.sass +++ b/website/src/css/essential-above-the-fold.sass @@ -41,6 +41,24 @@ main opacity: 0.6 font-size: 13px +a.button + padding: 1rem + text-decoration: none + margin: 1rem + background: black + color: white + font-size: 1.2rem + &.outline + border: 2px solid black + color: black + background: none + +.row + display: flex + flex-direction: row + flex-wrap: wrap + justify-content: center + // /////////////////////////////// // Index page // /////////////////////////////// @@ -63,6 +81,7 @@ main text-align: center &:nth-child(2n+1) background: rgba( 0,0,0, .05 ) + box-shadow: 0px 0 20px 2px rgba( 0, 0, 0, .2) &:first-child text-align: left padding: 0 @@ -70,7 +89,6 @@ main max-width: 100% - .stretch position: absolute z-index: -1 @@ -90,7 +108,7 @@ main height: 99vh max-height: 100vh - h1, h2, a + h1, h2 background: rgba( 0,0,0,.9 ) color: white padding: 1rem @@ -98,6 +116,8 @@ main h2 font-family: "Courier New", monospace, serif line-height: 2rem + a + margin-top: 2rem #story p @@ -107,15 +127,21 @@ main font-size: 1.5rem border-left: 5px solid black padding-left: 1.5rem + margin-bottom: 4rem - #usps + .usps flex-direction: row flex-wrap: wrap + width: 100% + justify-content: space-evenly .usp width: 300px max-width: 100% padding: 1rem text-align: center + img + height: 200px + width: 200px p &:first-child font-size: 4rem @@ -127,21 +153,9 @@ main margin-top: 4rem width: 100% text-align: center - a - padding: 1rem - text-decoration: none - margin: 0 1rem - &:first-child - background: black - color: white - &:last-child - border: 2px solid black - color: black + #cta - #compressed - height: 200px - width: 200px a background: black color: white diff --git a/website/src/index.pug b/website/src/index.pug index 78c53f9..ab8cfe8 100644 --- a/website/src/index.pug +++ b/website/src/index.pug @@ -27,11 +27,15 @@ html( lang=content.lang ) h2 The Rocketeers stand.
| Moon looms, rocket waits, eyes stare.
| The sole thought is wen. - //- a( target='_blank' href='' ) Mint now - p Launching Soon™️ + + //- p Launching Soon™️ +rimg.stretch( src=site.system.url+'/assets/mike-kiev-Opzk_hvwO9Q-unsplash.jpg' ) section#story p Until minted, each Rocketeer exists in a superposition of 10,000,000 possible identities. They are each unique, but share a foundational desire to reach the moon. + div.row + a( target='_blank' href='' ).button Mint now + a( target='_blank' href='' ).button.outline View on Opensea + //- section#usps //- div.usp //- p 🕶 @@ -47,20 +51,30 @@ html( lang=content.lang ) //- //- a( href='/' ) View on Opensea //- p Launching Soon™️ - section#cta - +cimg.circle#compressed( size=200 src=site.system.url+'/assets/adam-miller-dBaz0xhCkPY-unsplash-cropped.jpg' ) - //- a( href='/' ) Mint now - p Launching Soon™️ + //- section#cta + //- +cimg.circle#compressed( size=200 src=site.system.url+'/assets/adam-miller-dBaz0xhCkPY-unsplash-cropped.jpg' ) + //- a( href='/' ) Mint now + //- //- p Launching Soon™️ section#credits h1 Acknowledgements - p Designs by unvetica.eth, code by mentor.eth, logistical support from colfax and LookingForOwls. + + div.row.usps + div.usp + +cimg.circle( size=200 src=site.system.url+'/assets/adam-miller-dBaz0xhCkPY-unsplash-cropped.jpg' ) + p NFT design components by unvetica.eth and team. + div.usp + +cimg.circle( size=200 src=site.system.url+'/assets/adam-miller-dBaz0xhCkPY-unsplash-cropped.jpg' ) + p Contract, frontend and API code by mentor.eth + div.usp + +cimg.circle( size=200 src=site.system.url+'/assets/adam-miller-dBaz0xhCkPY-unsplash-cropped.jpg' ) + p Logistical support by LookingForOwls and colfax p Photos taken by Mike Kiev and Adam Miller. Illustrations by Katerina Limpitsouni. section#about h1 About this project - p This is a Rocketpool community led initiative to fill the void between the present and mainnet. + p This is a Rocketpool community inspired initiative to fill the void between the present and mainnet. p We all hope to look back 10 years from now at our Rocketeers and remember the days when we asked silly questions like wen mainnet and wen moon. include pug/_footer.pug \ No newline at end of file