Affective Polarization Test
Check your level of polarization through an interactive questionnaire.
Castas is a web application designed to assess the level of affective polarization in individuals through a simple online questionnaire. The purpose of this app is to offer a diagnostic tool for one of the most challenging phenomena in modern democracies.
When polarization divides society into groups that begin to see each other as morally incompatible, coexistence and mobility between these groups diminish. Over time, rigid social barriers emerge, forming informal "castes" that deepen inequality and segregation.
- 40-Question Test: Organized in 5 dimensions with 8 questions each
- Detailed Results: Progress bars showing percentage for each dimension
- Emoji Grid Visualization: 5x5 grid using π and π€¬ to represent scores
- Custom Emoji Selection: Full emoji picker to personalize your result
- Shareable Results: Copy results to clipboard in a formatted text
- Multilingual Support: Complete translations for Portuguese (BR), English, and Spanish
- Privacy First: No tracking, no cookies, results stored locally only
- Responsive Design: Works on desktop and mobile devices
| Technology | Purpose |
|---|---|
| React 18 | UI Framework |
| TypeScript | Type Safety |
| Vite | Build Tool |
| Tailwind CSS | Styling |
| React Router | SPA Navigation |
| i18next | Internationalization |
| Framer Motion | Animations |
| Emoji Picker React | Emoji Selection |
| Lucide React | Icons |
- Node.js 18+
- npm
# Clone the repository
git clone https://github.com/teknolista/castas.git
# Navigate to the project folder
cd castas
# Install dependencies
npm install
# Start development server
npm run dev# Build the application
npm run build
# Preview the production build
npm run previewcastas/
βββ .github/workflows/ # GitHub Actions for deployment
β βββ deploy.yml
βββ .etc/ # Project specifications and assets
β βββ artifacts/ # Wireframes, documents, mockups
β βββ assets/ # Icons and images
βββ public/ # Static assets served directly
β βββ images/
β βββ favicon.ico
βββ src/
β βββ components/ # Reusable UI components
β β βββ EmojiPicker.tsx # Emoji picker with Emoji Picker React
β β βββ EmojiGrid.tsx # 5x5 emoji grid display
β β βββ LanguageSelector.tsx # Language dropdown
β β βββ ProgressBar.tsx # Score progress bars
β βββ pages/ # Page components
β β βββ Home.tsx # Landing page
β β βββ Test.tsx # Question flow
β β βββ Result.tsx # Results display
β β βββ About.tsx # About page
β β βββ PoliticalFanatic.tsx # Political fanatic text
β β βββ TermsOfUse.tsx # Terms of use
β β βββ PrivacyPolicy.tsx # Privacy policy
β βββ hooks/ # Custom React hooks
β β βββ useLocalStorage.ts # localStorage management
β β βββ useTestState.ts # Test state management
β βββ data/ # Test questions and dimensions
β β βββ questions.ts # 40 test questions
β β βββ dimensions.ts # 5 dimension definitions
β βββ i18n/ # Translation files
β β βββ index.ts # i18next configuration
β β βββ pt-BR.json # Portuguese (Brazil)
β β βββ en.json # English
β β βββ es.json # Spanish
β βββ utils/ # Utility functions
β β βββ scoring.ts # Score calculation logic
β βββ lib/ # Library utilities
β β βββ utils.ts # cn() helper function
β βββ App.tsx # Main app with routes
β βββ main.tsx # Entry point
β βββ index.css # Global styles + theme
βββ package.json
βββ vite.config.ts
βββ tailwind.config.js
βββ tsconfig.json
βββ README.md
The test measures affective polarization across 5 dimensions:
| Dimension | Portuguese | Description |
|---|---|---|
| A | Emotional Hostility | Irritation and negative reactions to opposing groups |
| B | Moral Devaluation | Seeing opponents as ignorant or malicious |
| C | Social Distance | Discomfort with close relationships across groups |
| D | Democratic Delegitimization | Viewing opponents as threats to democracy |
| E | Identity Segregation | Living in a political bubble |
58% 67% 58% 54% 67%
Each question uses a 4-point Likert scale:
- 3 points: Strongly agree
- 2 points: Somewhat agree
- 1 point: Somewhat disagree
- 0 points: Strongly disagree
Score calculation: round((sum of 8 questions / 24) Γ 100)
Emoji representation based on percentage:
| Score | Emoji Pattern |
|---|---|
| 0% | πππππ |
| 1-24% | πππππ€¬ |
| 25-50% | ππππ€¬π€¬ |
| 51-74% | πππ€¬π€¬π€¬ |
| 75-99% | ππ€¬π€¬π€¬π€¬ |
| 100% | π€¬π€¬π€¬π€¬π€¬ |
The project is configured for automatic deployment to GitHub Pages using GitHub Actions.
Every push to the main branch triggers:
- Build the application
- Deploy to GitHub Pages
- Create a repository on GitHub
- Enable GitHub Pages in Settings β Pages β Source: GitHub Actions
- Push your code:
git add -A
git commit -m "Initial commit"
git remote add origin https://github.com/your-username/castas.git
git push -u origin mainThe site will be available at: https://your-username.github.io/castas/
- No personal data is collected
- No cookies are used for tracking
- Test results are stored only in your browser's localStorage
- No server-side storage of individual responses
- Users can clear all data by clearing browser storage
This project is licensed under the GPL v3.0 License.
See LICENSE for more details.
Copyleft Β© 2026 Raul Bras π§π· Published under the GPL v3.0 license.
Made in Brazil, in the Land of Oz (SP) , with π π and AI π€.