Skip to content

Commit

Permalink
Add introduction to twvalues and seven categories.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramirisu committed Feb 17, 2024
1 parent 747d47c commit d97a5fd
Show file tree
Hide file tree
Showing 6 changed files with 442 additions and 88 deletions.
111 changes: 111 additions & 0 deletions src/components/ValueIntro.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
import React from 'react'
import { Flex, Typography } from 'antd'
import { useBreakpoint } from '../utils/useBreakpoint'

const { Text } = Typography

const ValueIntro = ({ title, leftTitle, rightTitle, leftColor, rightColor, leftDescription, rightDescription }) => {
const screens = useBreakpoint()

const getTitleStyles = () => {
return {
sm: { fontSize: 'large' },
md: { fontSize: 'large' },
lg: { fontSize: 'x-large' },
xl: { fontSize: 'x-large' },
xxl: { fontSize: 'x-large' },
}[screens.size]
}

const getValueTitleStyles = () => {
return {
sm: { fontSize: 'large' },
md: { fontSize: 'large' },
lg: { fontSize: 'x-large' },
xl: { fontSize: 'x-large' },
xxl: { fontSize: 'x-large' },
}[screens.size]
}

const getValueDescriptionStyles = () => {
return {
sm: { fontSize: 'medium' },
md: { fontSize: 'medium' },
lg: { fontSize: 'large' },
xl: { fontSize: 'large' },
xxl: { fontSize: 'large' },
}[screens.size]
}

const SmallCard = ({ title, description, color }) => (
<Flex
vertical={true}
justify='start'
align='center'
gap={10}
style={{
margin: '5px',
}}
>
<Text
style={{
...getValueTitleStyles(),
fontWeight: 'bold',
textTransform: 'uppercase',
color: color,
}}
>
{title}
</Text>
<Text style={{ ...getValueDescriptionStyles() }}>{description}</Text>
</Flex>
)

const TitleText = () => (
<Text
style={{
...getTitleStyles(),
margin: '10px',
textTransform: 'uppercase',
textAlign: 'center',
whiteSpace: 'nowrap',
}}
>
{title}
</Text>
)
const LeftSmallCard = () => <SmallCard title={leftTitle} description={leftDescription} color={leftColor} />
const RightSmallCard = () => <SmallCard title={rightTitle} description={rightDescription} color={rightColor} />

return screens.lg ? (
<div
style={{
display: 'grid',
gridTemplateColumns: '320px auto 320px',
width: '100%',
}}
>
<LeftSmallCard />
<TitleText />
<RightSmallCard />
</div>
) : (
<Flex vertical={true} justify='center' align='center'>
<TitleText />
<div
style={{
display: 'grid',
gridTemplateColumns: screens.md ? '45% 10% 45%' : '48% 4% 48%',
alignItems: 'start',
width: '100%',
}}
>
<LeftSmallCard />
<div></div>
<RightSmallCard />
</div>
</Flex>
)
}

export default ValueIntro
74 changes: 60 additions & 14 deletions src/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
"start": "Start Quiz!",
"privacy": "Privacy Notice: The quiz is open source and will not collect or store any personal information."
},
"introduction": {
"title": "What is TW Values ?",
"description": "TW Values is a political quiz. Users are going to be asked {{count}} questions to identify their ideologies and political party matches. There are seven categories and each has two opposing values."
},
"question_n_of_all": "Question {{index}} of {{all}}",
"answers": {
"completely_agree": "Completely Agree",
Expand Down Expand Up @@ -219,8 +223,14 @@
"axes": {
"economic": {
"title": "Economic",
"equality": "Equality",
"efficiency": "Efficiency",
"equality": {
"name": "Equality",
"description": "Those with higher Equality scores believe the economy should distribute value evenly among the populace. They tend to support progressive tax codes, social programs, and even socialism."
},
"efficiency": {
"name": "Efficiency",
"description": "Those with higher Efficiency scores believe the economy should be focused on rapid growth. They tend to support lower taxes, privatization, deregulation, and even laissez-faire capitalism."
},
"categories": {
"0": "Communist",
"1": "Socialist",
Expand All @@ -233,8 +243,14 @@
},
"diplomatic": {
"title": "Diplomatic",
"globe": "Globe",
"nation": "Nation",
"globe": {
"name": "Globe",
"description": "Those with higher Globe scores believe in a peaceful foreign policy, emphasizing diplomacy, cooperation, integration and even a world government. They are often globalists."
},
"nation": {
"name": "Nation",
"description": "Those with higher Nation scores believe in an aggressive foreign policy, valuing the military, strength, sovereignty, and even territorial expansion. They are often nationalists."
},
"categories": {
"0": "Cosmopolitan",
"1": "Internationalist",
Expand All @@ -247,8 +263,14 @@
},
"civil": {
"title": "Civil",
"authority": "Authority",
"liberty": "Liberty",
"liberty": {
"name": "Liberty",
"description": "Those with higher Liberty scores believe in strong civil liberties. They tend to support democracy and oppose state intervention in personal lives."
},
"authority": {
"name": "Authority",
"description": "Those with higher Authority scores believe in strong state power. They tend to support government surveillance and even autocracy."
},
"categories": {
"0": "Anarchist",
"1": "Libertarian",
Expand All @@ -261,8 +283,14 @@
},
"environmental": {
"title": "Environmental",
"ecology": "Ecology",
"production": "Production",
"ecology": {
"name": "Ecology",
"description": "Those with higher Ecology scores believe that climate change has become the greatest threat to humanity, including global warming, expansion of deserts, rising of sea level and wildfire. They tend to support environmental protection and development of renewable energy."
},
"production": {
"name": "Production",
"description": "Those with higher Production scores believe that economic growth is more important, even though it causes environmental pollution. They tend to use cheap fossil fuels and think that development of renewable energy is a waste of money."
},
"categories": {
"0": "Radical Environmentalism",
"1": "Environmentalism",
Expand All @@ -275,8 +303,14 @@
},
"societal": {
"title": "Societal",
"progress": "Progress",
"tradition": "Tradition",
"progress": {
"name": "Progress",
"description": "Those with higher Progress scores believe in social change and rationality. They are usually secular or atheist, and support science or modern technologies."
},
"tradition": {
"name": "Tradition",
"description": "Those with higher Tradition scores believe in traditional values and strict adherence to a moral code. They are sometimes religious and support status quo."
},
"categories": {
"0": "Revolutionary",
"1": "Very Progressive",
Expand All @@ -289,8 +323,14 @@
},
"sovereignty": {
"title": "Sovereignty",
"independence": "Independence",
"unification": "Unification",
"independence": {
"name": "Independence",
"description": "Those with higher Independence scores believe that People's Republic of China does not own sovereignty over Taiwan. They are usually Taiwanese Nationalists and tend to support liberty and democracy."
},
"unification": {
"name": "Unification",
"description": "Those with higher Unification scores believe that only one government should be formed between Chinese Mainland and Taiwan. They are usually Chinese Nationalists and tend to support the great rejuvenation of the Chinese nation."
},
"categories": {
"0": "Firm Independence",
"1": "Independence",
Expand All @@ -303,8 +343,14 @@
},
"us_vs_china": {
"title": "U.S. vs China",
"pro_american": "Pro-American",
"pro_chinese": "Pro-Chinese",
"pro_american": {
"name": "Pro-American",
"description": "Those with higher Pro-American scores believe that Taiwan's semiconductor industry, technologies and military aids rely on United States. They tend to join U.S. alliance and support democracy."
},
"pro_chinese": {
"name": "Pro-Chinese",
"description": "Those with higher Pro-Chinese scores believe that Taiwan's export reliance on Chinese market is neccesary and unable to withstand trade sanctions. They tend to keep peaceful relationship with China."
},
"categories": {
"0": "Pro-Americanism",
"1": "Pro-American",
Expand Down
74 changes: 60 additions & 14 deletions src/locales/zh-CN/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
"start": "开始测验!",
"privacy": "隐私声明:本测验原始码完全开源,绝对不会收集或是储存任何个人信息,请安心使用。"
},
"introduction": {
"title": "什么是台湾价值?",
"description": "台湾价值 是一个政治光谱测验。使用者总共会被询问 {{count}} 道题目来确认所属意识形态与政党匹配。本测试总共包含七大主题,每个主题会有两个相反的价值。"
},
"question_n_of_all": "题目 {{index}} 之 {{all}}",
"answers": {
"completely_agree": "强烈赞成",
Expand Down Expand Up @@ -219,8 +223,14 @@
"axes": {
"economic": {
"title": "经济",
"equality": "平等",
"efficiency": "效率",
"equality": {
"name": "平等",
"description": "平等分数较高的人认为经济果实应该要公平的分派给众人。他们倾向于支持累进税率、社会事业,甚至是社会主义。"
},
"efficiency": {
"name": "效率",
"description": "效率分数较高的人认为经济应专注于快速增长。他们倾向于支持低税率、私有化财产、放松金融管制,甚至是自由放任资本主义。"
},
"categories": {
"0": "共产主义",
"1": "社会主义",
Expand All @@ -233,8 +243,14 @@
},
"diplomatic": {
"title": "外交",
"globe": "地球村",
"nation": "国家",
"globe": {
"name": "国际",
"description": "国际分数较高的人支持和平的外交政策,强调外交、合作、整合甚至是统一的世界政府。他们通常是世界主义者。"
},
"nation": {
"name": "国家",
"description": "国家分数较高的人支持侵略的外交政策,重视军事、力量、主权甚至是领土侵略。他们通常是民族主义者。"
},
"categories": {
"0": "世界主义者",
"1": "国际主义者",
Expand All @@ -247,8 +263,14 @@
},
"civil": {
"title": "政治",
"authority": "威权",
"liberty": "自由",
"liberty": {
"name": "自由",
"description": "自由分数较高的人重视个人自由。他们倾向于支持民主并反对国家干预个人自由。"
},
"authority": {
"name": "威权",
"description": "威权分数较高的人重视国家权力。他们倾向于支持政府监视人民甚至是独裁。"
},
"categories": {
"0": "无政府主义",
"1": "自由主义",
Expand All @@ -261,8 +283,14 @@
},
"environmental": {
"title": "环境",
"ecology": "生态",
"production": "生产",
"ecology": {
"name": "生态",
"description": "生态分数较高的人认为气候变迁已经成为人类最大的威胁,像是全球暖化、土地沙漠化、海平面升高与森林大火。他们倾向于支持环境保护与开发再生能源。"
},
"production": {
"name": "生产",
"description": "生产分数较高的人认为经济成长更为重要,即使会造成环境污染也没关系。他们倾向于使用便宜的化石燃料而且反对开发再生能源。"
},
"categories": {
"0": "极端环境保护主义",
"1": "环境保护主义",
Expand All @@ -275,8 +303,14 @@
},
"societal": {
"title": "社会",
"progress": "进步",
"tradition": "传统",
"progress": {
"name": "进步",
"description": "进步分数较高的人相信社会变革与理性。他们通常世俗或无神论者,而且支持科学与现代科技。"
},
"tradition": {
"name": "传统",
"description": "传统分数较高的人相信传统价值与严格遵守道德规范。他们可能是宗教信仰者或倾向于维持现状。"
},
"categories": {
"0": "革命份子",
"1": "进步主义",
Expand All @@ -289,8 +323,14 @@
},
"sovereignty": {
"title": "主权",
"independence": "独立",
"unification": "统一",
"independence": {
"name": "独立",
"description": "独立分数较高的人认为中华人民共和国并未拥有台湾主权。他们通常是台湾民族主义者且倾向于支持自由与民主。"
},
"unification": {
"name": "统一",
"description": "统一分数较高的人认为应该只要有一个统一的政府来管理中国大陆与台湾。他们通常是中华民族主义者且倾向于支持实现中华民族的伟大复兴。"
},
"categories": {
"0": "顽固的台独份子",
"1": "台独份子",
Expand All @@ -303,8 +343,14 @@
},
"us_vs_china": {
"title": "美中",
"pro_american": "亲美",
"pro_chinese": "亲中",
"pro_american": {
"name": "亲美",
"description": "亲美分数较高的人认为台湾的半导体产业、技术与军事援助来自于美国的帮助。他们倾向于加入美国的联盟且支持民主。"
},
"pro_chinese": {
"name": "亲中",
"description": "亲中分数较高的人认为台湾出口导向经济重度依赖中国市场,无法承受贸易制裁。他们倾向于与中国保持友好关系。"
},
"categories": {
"0": "亲美主义",
"1": "亲美",
Expand Down
Loading

0 comments on commit d97a5fd

Please sign in to comment.