Certainly! Below is a simple single-page Vue.js website design using TailwindCSS. This design will introduce you as a programmer and list the pricing for the websites you create.
Project Structure
code Copy code
my-portfolio/
├── public/
│ └── index.html
├── src/
│ ├── assets/
│ ├── components/
│ │ └── PricingCard.vue
│ ├── App.vue
│ └── main.js
├── tailwind.config.js
├── package.json
└── ...
Step 1: Set up the project
First, you need to set up a Vue.js project and install TailwindCSS.
bash Copy code
# Create a new Vue.js project
vue create my-portfolio
# Navigate to the project directory
cd my-portfolio
# Install TailwindCSS
npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -p
Step 2: Configure TailwindCSS
Edit tailwind.config.js to include the paths to all of your template files:
js Copy code
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
"./src/**/*.{vue,js,ts,jsx,tsx}",
],
theme: {
extend: {},
},
plugins: [],
}
Step 3: Add Tailwind to your CSS
In src/assets/tailwind.css, add the following:
css Copy code
@tailwind base;
@tailwind components;
@tailwind utilities;
Step 4: Import TailwindCSS in your main.js
In src/main.js, import the TailwindCSS file:
js Copy code
import { createApp } from 'vue'
import App from './App.vue'
import './assets/tailwind.css'
createApp(App).mount('#app')
Step 5: Create Components and App Layout
PricingCard.vue
Create a component for the pricing cards in src/components/PricingCard.vue:
vue Copy code
<template>
<div class="max-w-sm rounded overflow-hidden shadow-lg bg-white m-4">
<div class="px-6 py-4">
<div class="font-bold text-xl mb-2">{{ title }}</div>
<p class="text-gray-700 text-base">
{{ description }}
</p>
</div>
<div class="px-6 pt-4 pb-2">
<span class="inline-block bg-gray-200 rounded-full px-3 py-1 text-sm font-semibold text-gray-700 mr-2 mb-2">{{ price }}</span>
</div>
</div>
</template>
<script>
export default {
props: {
title: String,
description: String,
price: String
}
}
</script>
<style scoped>
</style>
App.vue
Edit src/App.vue to include the main layout and components:
vue Copy code
<template>
<div class="min-h-screen flex flex-col">
<header class="bg-gray-800 text-white p-6">
<h1 class="text-4xl font-bold">Welcome to My Portfolio</h1>
<p class="mt-2">I'm a skilled programmer offering top-notch web development services.</p>
</header>
<main class="flex-grow p-6">
<section>
<h2 class="text-3xl font-bold mb-4">My Services</h2>
<div class="flex flex-wrap -m-4">
<PricingCard
title="Simple Website"
description="Basic website with essential features."
price="500€"
/>
<PricingCard
title="Advanced Website"
description="Website with advanced functionalities."
price="700€"
/>
<PricingCard
title="Custom Solution"
description="Tailored web solutions for your business."
price="1000€+"
/>
</div>
</section>
</main>
<footer class="bg-gray-800 text-white p-6">
<p>© 2023 Your Name. All rights reserved.</p>
</footer>
</div>
</template>
<script>
import PricingCard from './components/PricingCard.vue';
export default {
components: {
PricingCard
}
}
</script>
<style>
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap');
body {
font-family: 'Montserrat', sans-serif;
}
</style>
Step 6: Run your project
bash Copy code
npm run serve
Navigate to http://localhost:8080 to see your beautiful single-page website.
This setup provides a professional and clean look using TailwindCSS, and the Montserrat font adds a modern and trustworthy feel to your portfolio.