Skip to content

Commit

Permalink
add download links to homepage
Browse files Browse the repository at this point in the history
  • Loading branch information
Fallen-Breath committed Oct 24, 2023
1 parent dac3aca commit babaf8d
Show file tree
Hide file tree
Showing 8 changed files with 219 additions and 0 deletions.
134 changes: 134 additions & 0 deletions website/i18n/zh-Hans/code.json
Original file line number Diff line number Diff line change
Expand Up @@ -293,5 +293,139 @@
},
"homepage.header.rtd": {
"message": "阅读文档"
},
"homepage.downloads.title": {
"message": "下载模组"
},
"theme.SearchBar.seeAll": {
"message": "查看全部 {count} 个结果"
},
"theme.SearchPage.documentsFound.plurals": {
"message": "找到 {count} 份文件",
"description": "Pluralized label for \"{count} documents found\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
},
"theme.SearchPage.existingResultsTitle": {
"message": "「{query}」的搜索结果",
"description": "The search page title for non-empty query"
},
"theme.SearchPage.emptyResultsTitle": {
"message": "在文档中搜索",
"description": "The search page title for empty query"
},
"theme.SearchPage.inputPlaceholder": {
"message": "在此输入搜索字词",
"description": "The placeholder for search page input"
},
"theme.SearchPage.inputLabel": {
"message": "搜索",
"description": "The ARIA label for search page input"
},
"theme.SearchPage.algoliaLabel": {
"message": "通过 Algolia 搜索",
"description": "The ARIA label for Algolia mention"
},
"theme.SearchPage.noResultsText": {
"message": "未找到任何结果",
"description": "The paragraph for empty search result"
},
"theme.SearchPage.fetchingNewResults": {
"message": "正在获取新的搜索结果...",
"description": "The paragraph for fetching new search results"
},
"theme.SearchBar.label": {
"message": "搜索",
"description": "The ARIA label and placeholder for search button"
},
"theme.SearchModal.searchBox.resetButtonTitle": {
"message": "清除查询",
"description": "The label and ARIA label for search box reset button"
},
"theme.SearchModal.searchBox.cancelButtonText": {
"message": "取消",
"description": "The label and ARIA label for search box cancel button"
},
"theme.SearchModal.startScreen.recentSearchesTitle": {
"message": "最近搜索",
"description": "The title for recent searches"
},
"theme.SearchModal.startScreen.noRecentSearchesText": {
"message": "没有最近搜索",
"description": "The text when no recent searches"
},
"theme.SearchModal.startScreen.saveRecentSearchButtonTitle": {
"message": "保存这个搜索",
"description": "The label for save recent search button"
},
"theme.SearchModal.startScreen.removeRecentSearchButtonTitle": {
"message": "从历史记录中删除这个搜索",
"description": "The label for remove recent search button"
},
"theme.SearchModal.startScreen.favoriteSearchesTitle": {
"message": "收藏",
"description": "The title for favorite searches"
},
"theme.SearchModal.startScreen.removeFavoriteSearchButtonTitle": {
"message": "从收藏列表中删除这个搜索",
"description": "The label for remove favorite search button"
},
"theme.SearchModal.errorScreen.titleText": {
"message": "无法获取结果",
"description": "The title for error screen of search modal"
},
"theme.SearchModal.errorScreen.helpText": {
"message": "你可能需要检查网络连接。",
"description": "The help text for error screen of search modal"
},
"theme.SearchModal.footer.selectText": {
"message": "选中",
"description": "The explanatory text of the action for the enter key"
},
"theme.SearchModal.footer.selectKeyAriaLabel": {
"message": "Enter 键",
"description": "The ARIA label for the Enter key button that makes the selection"
},
"theme.SearchModal.footer.navigateText": {
"message": "导航",
"description": "The explanatory text of the action for the Arrow up and Arrow down key"
},
"theme.SearchModal.footer.navigateUpKeyAriaLabel": {
"message": "向上键",
"description": "The ARIA label for the Arrow up key button that makes the navigation"
},
"theme.SearchModal.footer.navigateDownKeyAriaLabel": {
"message": "向下键",
"description": "The ARIA label for the Arrow down key button that makes the navigation"
},
"theme.SearchModal.footer.closeText": {
"message": "关闭",
"description": "The explanatory text of the action for Escape key"
},
"theme.SearchModal.footer.closeKeyAriaLabel": {
"message": "Esc 键",
"description": "The ARIA label for the Escape key button that close the modal"
},
"theme.SearchModal.footer.searchByText": {
"message": "搜索提供",
"description": "The text explain that the search is making by Algolia"
},
"theme.SearchModal.noResultsScreen.noResultsText": {
"message": "没有结果:",
"description": "The text explains that there are no results for the following search"
},
"theme.SearchModal.noResultsScreen.suggestedQueryText": {
"message": "试试搜索",
"description": "The text for the suggested query when no results are found for the following search"
},
"theme.SearchModal.noResultsScreen.reportMissingResultsText": {
"message": "认为这个查询应该有结果?",
"description": "The text for the question where the user thinks there are missing results"
},
"theme.SearchModal.noResultsScreen.reportMissingResultsLinkText": {
"message": "请告知我们。",
"description": "The text for the link to report missing results"
},
"theme.SearchModal.placeholder": {
"message": "搜索文档",
"description": "The placeholder of the input of the DocSearch pop-up modal"
}
}
52 changes: 52 additions & 0 deletions website/src/components/DownloadLinks/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import React from 'react';
import styles from './styles.module.css';
import Translate from '@docusaurus/Translate';

const DownloadWebsites = [
{
name: 'GitHub',
Svg: require('@site/static/img/github.svg').default,
url: "https://github.com/TISUnion/Carpet-TIS-Addition/releases",
color: '#24292F',
},
{
name: 'CurseForge',
Svg: require('@site/static/img/curseforge.svg').default,
url: "https://legacy.curseforge.com/minecraft/mc-mods/carpet-tis-addition/files",
color: '#F16436',
},
{
name: 'Modrinth',
Svg: require('@site/static/img/modrinth.svg').default,
url: "https://modrinth.com/mod/carpet-tis-addition/versions",
color: '#00AF5C',
},
]

function DownloadLink({name, Svg, url, color}) {
return (
<>
<a href={url} className={styles.brandContainer} style={{background: color}}>
<Svg className={styles.downloadSvg}/>
<p>{name}</p>
</a>
</>
);
}

export default function DownloadLinks() {
return (
<>
<section className={styles.brandsContainer}>
<h2 className="hero__title text--center">
<Translate id="homepage.downloads.title">
Download Mod
</Translate>
</h2>
{DownloadWebsites.map((props, idx) => (
<DownloadLink key={idx} {...props} />
))}
</section>
</>
);
}
27 changes: 27 additions & 0 deletions website/src/components/DownloadLinks/styles.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.brandsContainer {
padding: 2rem 0;
width: 100%;
}

.downloadSvg {
width: 40px;
height: 40px;
margin: 10px;
}

.brandContainer {
display: flex;
border-radius: 10px;
width: 240px;
margin: 10px auto;
}

.brandContainer:hover {
text-decoration: none;
}

.brandContainer p {
color: white;
font-size: 1.2rem;
margin: auto 0 auto 1rem;
}
2 changes: 2 additions & 0 deletions website/src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Link from '@docusaurus/Link';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import Translate, {translate} from '@docusaurus/Translate';
import Layout from '@theme/Layout';
import DownloadLinks from '@site/src/components/DownloadLinks';
import HomepageFeatures from '@site/src/components/HomepageFeatures';

import styles from './index.module.css';
Expand Down Expand Up @@ -41,6 +42,7 @@ export default function Home() {
<main>
<HomepageFeatures />
</main>
<DownloadLinks />
</Layout>
);
}
1 change: 1 addition & 0 deletions website/src/pages/index.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@

.downloadsContainer {
text-align: center;
text-decoration: none;
}
1 change: 1 addition & 0 deletions website/static/img/curseforge.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions website/static/img/github.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions website/static/img/modrinth.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit babaf8d

Please sign in to comment.