Communitygithub.com

reason-machines/design-skills

使用 Next.js、TypeScript 和 TailwindCSS 建置並自訂現代開發者/設計師作品集,具備動畫打字效果與響應式佈局。

design-skills 是什麼?

這個技能提供了一個基於 Next.js 16、TypeScript 和 TailwindCSS 的個人作品集模板,專為開發者與設計師打造。它採用暗色主題 UI,搭配紫色漸層強調色、動畫打字效果、響應式佈局,以及展示專案、經歷和創作技能的章節。此技能支援透過 Vercel 部署,並內建常見的自訂模式,例如聯絡表單、平滑滾動導覽與字型配置,有助於快速打造專業的線上形象。平台上涵蓋完整的專案結構說明、原始碼範例(包括 Hero 區塊、專案展示、經歷時間軸、技能區塊和聯絡區塊),以及疑難排解指南,讓使用者能輕鬆上手並按需調整。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/reason-machines/design-skills/tree/HEAD/skills/figma-portfolio-nextjs

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

預覽

來自技能 README

design-skills preview

說明文件

Figma 作品集 - Next.js 開發者作品集

技能由 ara.so 提供 — 設計技能系列。

一個專為開發者和設計師打造的個人作品集模板,採用 Next.js 16、TypeScript 和 TailwindCSS 建置。具備乾淨的暗色主題 UI,搭配紫色漸層強調色、動畫打字效果、響應式佈局,以及展示專案、經歷和創作技能的章節。

安裝

# 複製儲存庫
git clone [email protected]:ibrahimmemonn/Figma_Portfolio.git

# 進入專案目錄
cd Figma_Portfolio/

# 安裝相依套件
npm install

# 啟動開發伺服器
npm run dev

開發伺服器將在 http://localhost:3000 啟動。

專案結構

Figma_Portfolio/
├── app/
│   ├── page.tsx           # 主要登陸頁面
│   ├── layout.tsx         # 根佈局(含字型設定)
│   └── globals.css        # 全域樣式(含 Tailwind)
├── components/
│   ├── Hero.tsx           # 英雄區塊(含打字動畫)
│   ├── Projects.tsx       # 專案展示區塊
│   ├── Experience.tsx     # 經歷時間軸
│   ├── Skills.tsx         # 技能顯示區塊
│   └── Contact.tsx        # 聯絡區塊
├── public/
│   ├── projects/          # 專案圖片
│   └── assets/            # 圖示與媒體
└── tailwind.config.ts     # Tailwind 設定檔

主要功能與設定

字型設定

作品集使用透過 next/font 最佳化的 Poppins 字型:

// app/layout.tsx
import { Poppins } from 'next/font/google';

const poppins = Poppins({
  subsets: ['latin'],
  weight: ['300', '400', '500', '600', '700', '800', '900'],
  variable: '--font-poppins',
});

export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <html lang="en" className={poppins.variable}>
      <body>{children}</body>
    </html>
  );
}

英雄區塊(含打字動畫)

// components/Hero.tsx
'use client';
import { useState, useEffect } from 'react';

export default function Hero() {
  const [text, setText] = useState('');
  const [isDeleting, setIsDeleting] = useState(false);
  const [loopNum, setLoopNum] = useState(0);
  const [typingSpeed, setTypingSpeed] = useState(150);

  const roles = ['Software Engineer', 'UI/UX Designer', 'Full Stack Developer'];

  useEffect(() => {
    const handleType = () => {
      const i = loopNum % roles.length;
      const fullText = roles[i];

      setText(
        isDeleting
          ? fullText.substring(0, text.length - 1)
          : fullText.substring(0, text.length + 1)
      );

      setTypingSpeed(isDeleting ? 50 : 150);

      if (!isDeleting && text === fullText) {
        setTimeout(() => setIsDeleting(true), 1000);
      } else if (isDeleting && text === '') {
        setIsDeleting(false);
        setLoopNum(loopNum + 1);
      }
    };

    const timer = setTimeout(handleType, typingSpeed);
    return () => clearTimeout(timer);
  }, [text, isDeleting, loopNum, typingSpeed, roles]);

  return (
    <section className="min-h-screen flex items-center justify-center px-4">
      <div className="max-w-4xl mx-auto text-center">
        <h1 className="text-5xl md:text-7xl font-bold mb-6">
          Hi, I'm <span className="bg-gradient-to-r from-purple-400 to-pink-600 bg-clip-text text-transparent">Your Name</span>
        </h1>
        <h2 className="text-2xl md:text-4xl mb-8">
          <span className="text-gray-400">{text}</span>
          <span className="animate-pulse">|</span>
        </h2>
        <p className="text-gray-300 text-lg max-w-2xl mx-auto">
          Building digital experiences that combine aesthetic design with powerful functionality.
        </p>
      </div>
    </section>
  );
}

新增專案

// components/Projects.tsx
interface Project {
  title: string;
  description: string;
  image: string;
  link: string;
  github?: string;
  tags: string[];
}

const projects: Project[] = [
  {
    title: 'E-Commerce Platform',
    description: 'Full-stack e-commerce solution with Next.js, Stripe, and MongoDB',
    image: '/projects/ecommerce.png',
    link: 'https://example.com',
    github: 'https://github.com/username/project',
    tags: ['Next.js', 'TypeScript', 'Stripe', 'MongoDB'],
  },
  {
    title: 'Portfolio Dashboard',
    description: 'Analytics dashboard for tracking portfolio metrics',
    image: '/projects/dashboard.png',
    link: 'https://example.com',
    tags: ['React', 'Chart.js', 'TailwindCSS'],
  },
];

export default function Projects() {
  return (
    <section className="py-20 px-4">
      <h2 className="text-4xl font-bold text-center mb-12">
        Featured <span className="bg-gradient-to-r from-purple-400 to-pink-600 bg-clip-text text-transparent">Projects</span>
      </h2>
      <div className="grid md:grid-cols-2 lg:grid-cols-3 gap-8 max-w-6xl mx-auto">
        {projects.map((project, index) => (
          <div key={index} className="bg-gray-800/50 rounded-lg overflow-hidden hover:transform hover:scale-105 transition-all duration-300">
            <img src={project.image} alt={project.title} className="w-full h-48 object-cover" />
            <div className="p-6">
              <h3 className="text-xl font-semibold mb-2">{project.title}</h3>
              <p className="text-gray-400 mb-4">{project.description}</p>
              <div className="flex flex-wrap gap-2 mb-4">
                {project.tags.map((tag, i) => (
                  <span key={i} className="px-3 py-1 bg-purple-500/20 text-purple-300 rounded-full text-sm">
                    {tag}
                  </span>
                ))}
              </div>
              <div className="flex gap-4">
                <a href={project.link} className="text-purple-400 hover:text-purple-300">
                  Live Demo →
                </a>
                {project.github && (
                  <a href={project.github} className="text-gray-400 hover:text-gray-300">
                    GitHub →
                  </a>
                )}
              </div>
            </div>
          </div>
        ))}
      </div>
    </section>
  );
}

自訂主題色彩

// tailwind.config.ts
import type { Config } from 'tailwindcss';

const config: Config = {
  content: [
    './pages/**/*.{js,ts,jsx,tsx,mdx}',
    './components/**/*.{js,ts,jsx,tsx,mdx}',
    './app/**/*.{js,ts,jsx,tsx,mdx}',
  ],
  theme: {
    extend: {
      colors: {
        primary: {
          50: '#faf5ff',
          100: '#f3e8ff',
          500: '#a855f7',
          600: '#9333ea',
          700: '#7e22ce',
        },
      },
      backgroundImage: {
        'gradient-radial': 'radial-gradient(var(--tw-gradient-stops))',
        'gradient-conic': 'conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))',
      },
    },
  },
  plugins: [],
};

export default config;

加入分析工具

// app/layout.tsx
import { Analytics } from '@vercel/analytics/react';

export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <html lang="en">
      <body>
        {children}
        <Analytics />
      </body>
    </html>
  );
}

部署

部署到 Vercel

# 安裝 Vercel CLI
npm i -g vercel

# 部署
vercel

# 部署到正式環境
vercel --prod

或者將您的 GitHub 儲存庫連接到 Vercel,即可在每次推送到 main 分支時自動部署。

環境變數

# .env.local(不會提交到 git)
NEXT_PUBLIC_SITE_URL=https://your-domain.com
NEXT_PUBLIC_GA_ID=your-google-analytics-id

常見自訂模式

新增聯絡表單

// components/Contact.tsx
'use client';
import { useState } from 'react';

export default function Contact() {
  const [formData, setFormData] = useState({
    name: '',
    email: '',
    message: '',
  });

  const handleSubmit = async (e: React.FormEvent) => {
    e.preventDefault();
    // 整合您偏好的電子郵件服務
    const response = await fetch('/api/contact', {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify(formData),
    });
    
    if (response.ok) {
      alert('訊息已成功送出!');
      setFormData({ name: '', email: '', message: '' });
    }
  };

  return (
    <section className="py-20 px-4">
      <div className="max-w-2xl mx-auto">
        <h2 className="text-4xl font-bold text-center mb-12">與我聯絡</h2>
        <form onSubmit={handleSubmit} className="space-y-6">
          <input
            type="text"
            placeholder="您的姓名"
            value={formData.name}
            onChange={(e) => setFormData({ ...formData, name: e.target.value })}
            className="w-full px-4 py-3 bg-gray-800 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500"
            required
          />
          <input
            type="email"
            placeholder="您的電子郵件"
            value={formData.email}
            onChange={(e) => setFormData({ ...formData, email: e.target.value })}
            className="w-full px-4 py-3 bg-gray-800 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500"
            required
          />
          <textarea
            placeholder="您的訊息"
            value={formData.message}
            onChange={(e) => setFormData({ ...formData, message: e.target.value })}
            rows={5}
            className="w-full px-4 py-3 bg-gray-800 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500"
            required
          />
          <button
            type="submit"
            className="w-full py-3 bg-gradient-to-r from-purple-500 to-pink-600 rounded-lg font-semibold hover:opacity-90 transition-opacity"
          >
            傳送訊息
          </button>
        </form>
      </div>
    </section>
  );
}

平滑滾動導覽

// components/Navigation.tsx
export default function Navigation() {
  const scrollToSection = (id: string) => {
    const element = document.getElementById(id);
    element?.scrollIntoView({ behavior: 'smooth' });
  };

  return (
    <nav className="fixed top-0 w-full bg-gray-900/80 backdrop-blur-sm z-50">
      <div className="max-w-6xl mx-auto px-4 py-4 flex justify-between items-center">
        <div className="text-xl font-bold">作品集</div>
        <div className="flex gap-6">
          <button onClick={() => scrollToSection('projects')} className="hover:text-purple-400">
            專案
          </button>
          <button onClick={() => scrollToSection('experience')} className="hover:text-purple-400">
            經歷
          </button>
          <button onClick={() => scrollToSection('contact')} className="hover:text-purple-400">
            聯絡
          </button>
        </div>
      </div>
    </nav>
  );
}

疑難排解

圖片無法載入

請確保圖片位於 public 目錄,並使用絕對路徑引用:

<img src="/projects/myproject.png" alt="Project" />

打字動畫無作用

確認元件已標記為 'use client' 以啟用客戶端互動:

'use client';
import { useState, useEffect } from 'react';

Tailwind 樣式未生效

驗證 tailwind.config.ts 中的 content 路徑是否包含所有元件目錄:

content: [
  './app/**/*.{js,ts,jsx,tsx,mdx}',
  './components/**/*.{js,ts,jsx,tsx,mdx}',
],

建置錯誤

清除 Next.js 快取並重新建置:

rm -rf .next
npm run build

相關技能