Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
181 changes: 181 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,178 @@
# SBTI Personality Test

> MBTI is outdated. SBTI has arrived.

An open-source, entertainment-oriented personality test project based on the original test by Bilibili creator [@蛆肉儿串儿](https://space.bilibili.com/417038183).

## Live Demo

👉 [Click here to start the test](https://pingfanfan.github.io/SBTI/)

Online sample: [https://cctor.com/sbti.html](https://cctor.com/sbti.html)

## Features

- 🧠 **27 Personality Types** — 25 standard types + 2 hidden/fallback types
- 📊 **15 Assessment Dimensions** — Covering five core models: Self, Emotion, Attitude, Action, and Social
- 🎯 **Manhattan Distance Matching** — A matching algorithm based on a 15-dimensional vector
- 🍺 **Hidden Easter Egg** — Special trigger mechanism for the "Alcoholic" personality
- 📱 **Mobile First** — Responsive design optimized for smartphone experiences
- 🔧 **Highly Customizable** — Separation of data and code; customize the test by editing JSON files

## Project Structure

```plaintext
├── data/ # Test data (edit here to customize)
│ ├── questions.json # Questions and options
│ ├── dimensions.json # Definitions for the 15 dimensions
│ ├── types.json # Personality types and matching patterns
│ └── config.json # Scoring parameters and display config
├── src/ # Source code
│ ├── engine.js # Scoring algorithm (pure functions)
│ ├── quiz.js # Quiz flow control
│ ├── result.js # Result page rendering
│ ├── chart.js # Radar chart (Canvas API)
│ ├── utils.js # Utility functions
│ ├── main.js # Entry point
│ └── style.css # Styles (themed via CSS variables)
├── docs/
│ └── analysis.md # Data analysis report
└── index.html
```

## Quick Start

```bash
# Clone the project
git clone https://github.com/pingfanfan/SBTI.git
cd SBTI

# Install dependencies
npm install

# Start development server
npm run dev

# Build for production
npm run build
```

## Customize Your Own Test

All test content is located in the `data/` directory. You can customize the entire experience by modifying JSON files without touching the core logic.

### Modify Questions

Edit `data/questions.json`. Each question follows this structure:

```json
{
"id": "q1",
"dim": "S1",
"text": "Your question text here",
"options": [
{ "label": "Option A", "value": 1 },
{ "label": "Option B", "value": 2 },
{ "label": "Option C", "value": 3 }
]
}
```

- `dim` specifies which dimension the question belongs to
- `value` scoring: 1 = Low, 2 = Medium, 3 = High
- Each dimension requires exactly 2 questions

### Add New Personality Types

Edit `data/types.json` and add an entry to the `standard` array:

```json
{
"code": "YOUR",
"pattern": "HHH-HMH-MHH-HHH-MHM",
"cn": "Type Name",
"intro": "One-line introduction",
"desc": "Detailed description..."
}
```

`pattern` is a 15-letter L/M/H combination following the dimension order `S1-S3, E1-E3, A1-A3, Ac1-Ac3, So1-So3`, with each model separated by `-`.

### Adjust Scoring Parameters

Edit `data/config.json`:

```json
{
"scoring": {
"levelThresholds": { "L": [2, 3], "M": [4, 4], "H": [5, 6] },
"fallbackThreshold": 60
}
}
```

### Modify Theme Styles

Edit the CSS variables at the top of `src/style.css`:

```css
:root {
--bg: #f0f4f1;
--accent: #4c6752;
/* ... */
}
```

## Scoring Algorithm

1. **Summation**: Add the scores from the 2 questions in each dimension (range: 2-6)
2. **Grading**: ≤3 → L (Low), 4 → M (Medium), ≥5 → H (High)
3. **Vectorization**: Convert L=1, M=2, H=3 into a 15-dimensional numerical vector
4. **Matching**: Calculate the Manhattan Distance between the user's vector and each personality type
5. **Ranking**: Sort by Distance (ascending) → Precise Hits (descending) → Similarity (descending)
6. **Override Priority**: "Alcoholic" Easter Egg > Standard Match > "Happy Fool" fallback (<60%)

For details, see the [Data Analysis Report](docs/analysis.md).

## Deployment

### GitHub Pages (Recommended)

Fork the repo, then go to Settings → Pages and select GitHub Actions for automatic deployment.

### Vercel / Netlify

Connect your GitHub repo and it will recognize the Vite project automatically.

### Manual Deployment

```bash
npm run build
# Deploy the dist/ directory to any static server
```

## Tech Stack

- [Vite](https://vitejs.dev/) — Build tool
- Vanilla JavaScript — Framework-free
- Canvas API — Radar chart rendering
- CSS Custom Properties — Theming

## Credits

- Original Test: Bilibili creator [@蛆肉儿串儿](https://space.bilibili.com/417038183) (UID: 417038183)
- Original Version: [Official Bilibili SBTI Page](https://www.bilibili.com/blackboard/era/VxiCX2CRqcqzPK9F.html)

## Disclaimer

This test is for entertainment purposes only. Do not use it for any serious psychological assessment. This project is an open-source fan creation. Please contact the maintainers if there are any copyright concerns.

## License

[MIT](LICENSE)



# SBTI 人格测试

> MBTI已经过时,SBTI来了。
Expand All @@ -8,6 +183,9 @@

👉 [点击开始测试](https://pingfanfan.github.io/SBTI/)

online sample: (https://cctor.com/sbti.html)


## 特性

- 🧠 **27种人格类型** — 25种标准类型 + 2种隐藏/兜底类型
Expand Down Expand Up @@ -168,3 +346,6 @@ npm run build
## License

[MIT](LICENSE)



37 changes: 37 additions & 0 deletions data/en/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"scoring": {
"levelThresholds": {
"L": [
2,
3
],
"M": [
4,
4
],
"H": [
5,
6
]
},
"levelNumeric": {
"L": 1,
"M": 2,
"H": 3
},
"maxDistance": 30,
"fallbackThreshold": 60
},
"display": {
"title": "SBTI personality test",
"subtitle": "MBTI is out, SBTI is here.",
"author": "B station UP master@maggotrouerchuaner original",
"funNote": "This test is for entertainment only. Do not use it as a diagnosis, interview, blind date, breakup, spiritualism, fortune telling or life judgment.",
"funNoteSpecial": "This test is for entertainment purposes only. Hiding personality and being silly are all deliberate mistakes made by the author. Please do not regard it as a basis for medicine, psychology, physiognomy, numerology or paranormal science."
},
"drinkGate": {
"questionId": "drink_gate_q1",
"triggerValue": 3,
"drunkTriggerValue": 2
}
}
Loading