This project is a simple colour generator built with Nuxt 3 and Tailwind CSS. It allows users to generate a rainbow palette based on the number of colours entered. Users can click on any colour box to copy the colour code to the clipboard, with a tooltip indicating the successful copy.
Make sure to install the dependencies:
npm install
Start the development server on http://localhost:3000:
npm run dev
Build the application for production:
npm run build
Generate static files:
npm run generate
nuxt.config.ts
for static export:export default defineNuxtConfig({
ssr: false,
app: {
baseURL: '/colour-generator/',
},
});
deploy.sh
script:Create a file named deploy.sh
in the root of your project with the following content:
#!/usr/bin/env sh
# abort on errors
set -e
# build
npm run build
# generate static files
npm run generate
# navigate into the build output directory
cd dist
# if you are deploying to a custom domain
# echo 'www.example.com' > CNAME
git init
git add -A
git commit -m 'deploy'
# if you are deploying to https://samherb.github.io/colour-generator
git push -f [email protected]:samherb/colour-generator.git master:gh-pages
cd -
Make the deploy.sh
script executable:
chmod +x deploy.sh
Run the deploy.sh
script:
./deploy.sh
Go to Settings > Pages in your repository.
Set the source to the gh-pages
branch.
Your site should be available at https://samherb.github.io/colour-generator/.
Check out the deployment documentation for more information.