Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CSS Element Studio

🚀 Live Demo: https://tsig057.github.io/css-button-generator/

ลิงก์จะใช้งานได้ทันทีหลังเจ้าของโปรเจกต์เปิดใช้งาน GitHub Pages (ดูวิธีด้านล่าง)

เครื่องมือออนไลน์สำหรับออกแบบ ปรับแต่ง และส่งออกโค้ด CSS แบบ Real-time รองรับทั้งปุ่มและ Element ประเภทอื่น ๆ ไม่ต้องติดตั้งอะไรเพิ่มเติม เปิดเว็บแล้วใช้งานได้เลย

สาธิตการใช้งาน


✨ ฟีเจอร์หลัก

Presets จำนวน 36 สไตล์

  • แบ่งเป็น 9 หมวดหมู่: Game UI, Minimal, Solid, Gradient, Outline, Glass, Glow, 3D, Elements
  • ค้นหาและกรองหมวดหมู่ได้รวดเร็ว
  • ปุ่ม Randomize สุ่มคู่สี รูปทรง และเอฟเฟกต์ในคลิกเดียว
  • หมวด Game UI มีทั้ง RPG Button, HP/Mana Bar, Item Card, Skill Badge, Damage Number, Coin Pill, Quest Panel, HUD Neon และ Inventory Slot

ออกแบบ Element ได้หลายประเภท

  • รองรับ button, div (card), span (badge/pill), a (link), input, alert, avatar
  • ตั้งชื่อ Class ที่ส่งออกได้เอง (ค่าเริ่มต้น cbg-el)
  • ปรับ Typography, Solid/Gradient, ขอบ, ความโค้งมน, Padding, Box Shadow, Hover/Active

Custom CSS แบบอิสระ

  • Declarations: พิมพ์ property: value; ทีละบรรทัด แล้วจะถูกเพิ่มเข้าไปใน Element ที่ออกแบบ
  • Full CSS Rules: เขียนกฎ CSS ได้อิสระ เช่น .my-class:hover { ... }
  • แสดงผลบน Preview แบบ Real-time และ ส่งออกร่วมกับโค้ด ทุกครั้ง

Code Exporter

  • สลับระหว่าง Vanilla CSS และ CSS Variables
  • คัดลอก HTML + CSS ได้ในคลิกเดียว พร้อมสถานะแจ้งเตือน

UI / UX

  • การ์ดจัดระเบียบเป็นสัดส่วน ยุบ/ขยายได้
  • โหมดสว่าง / มืด (จำการตั้งค่าไว้ใน Browser)
  • จำลองบริบทจริง: พื้นหลังปกติ, การ์ดสินค้า, แถบเมนู, ฟอร์ม
  • รองรับหน้าจอมือถือ (Responsive)

📂 โครงสร้างไฟล์

css-button-generator/
├── index.html     # โครงสร้างหน้าเว็บ (Control Panel, Preview, Code Exporter)
├── style.css      # สไตล์แอปพลิเคชัน + ระบบ Theme
├── script.js      # จัดการ Event, CSS Variables, Presets, Custom CSS, ส่งออกโค้ด
├── presets.js     # ข้อมูล Preset 36 สไตล์ (แยกออกจาก Logic)
├── demo.gif       # ภาพเคลื่อนไหวสาธิตการทำงาน
└── README.md      # เอกสารนี้

Zero-dependency — ไม่มี Build step ไม่มี Package Manager ใช้แค่ HTML/CSS/JavaScript ล้วน ๆ


🖥️ ใช้งานในเครื่อง

เปิดไฟล์ index.html ด้วยเบราว์เซอร์ได้ทันที หรือรันเซิร์ฟเวอร์ภายในเครื่อง:

python -m http.server 8000

แล้วเปิด http://localhost:8000


🌐 นำไปใช้งาน / Deploy ด้วย GitHub Pages

# 1. สร้าง Repository ใหม่บน GitHub (ชื่อ css-button-generator) แล้วเชื่อม remote
git remote add origin https://github.com/<username>/css-button-generator.git
git push -u origin main

# 2. ที่หน้า Repository → Settings → Pages
#    Source: Deploy from a branch → Branch: main / (root) → Save

จากนั้นเว็บจะพร้อมใช้งานที่ https://<username>.github.io/css-button-generator/


จัดทำโดย: TSignature
ติดต่อ: t.signature89@gmail.com

Releases

Packages

Contributors

Languages