diff --git a/apps/doc/.gitignore b/apps/doc/.gitignore new file mode 100644 index 0000000..b2d6de3 --- /dev/null +++ b/apps/doc/.gitignore @@ -0,0 +1,20 @@ +# Dependencies +/node_modules + +# Production +/build + +# Generated files +.docusaurus +.cache-loader + +# Misc +.DS_Store +.env.local +.env.development.local +.env.test.local +.env.production.local + +npm-debug.log* +yarn-debug.log* +yarn-error.log* diff --git a/apps/doc/.idea/.gitignore b/apps/doc/.idea/.gitignore new file mode 100644 index 0000000..b58b603 --- /dev/null +++ b/apps/doc/.idea/.gitignore @@ -0,0 +1,5 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/apps/doc/.idea/WTF-Academy-StarkNet-Hackathon.iml b/apps/doc/.idea/WTF-Academy-StarkNet-Hackathon.iml new file mode 100644 index 0000000..0c8867d --- /dev/null +++ b/apps/doc/.idea/WTF-Academy-StarkNet-Hackathon.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/apps/doc/.idea/modules.xml b/apps/doc/.idea/modules.xml new file mode 100644 index 0000000..75ca1fa --- /dev/null +++ b/apps/doc/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/apps/doc/.idea/vcs.xml b/apps/doc/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/apps/doc/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/apps/doc/README.md b/apps/doc/README.md new file mode 100644 index 0000000..8a928d6 --- /dev/null +++ b/apps/doc/README.md @@ -0,0 +1,93 @@ +# WTF Starknet +Todo list of WTF Starknet during Starknet Building Hacker House Tel Aviv, 31st Jan-7th Feb, 2023. + +## Background +1. WTF Academy is a web3 open-source university for developers. + - WTF Solidity (5,700 ⭐): https://github.com/AmazingAng/WTF-Solidity + - WTF Ethers (1,100 ⭐): https://github.com/WTFAcademy/WTF-Ethers + - Integrated Education Platform (3,300 users): https://wtf.academy + +2. WTF Starknet is a platform to onboard developers to Starknet, which includes tutorial, examples, and on-chain certificates. + +## Todo and Progress + +### 1. Tutorials +Minimal tutorials on Starknet, assuming the learners have Ethereum development experience. +- Account Abstraction: @ocandocrypto +- Cairo: @hasselalcala [Draft] [Quiz] +- Tooling: @hasselalcala [Draft] +- Starknet.js @AmazingAng [Draft] +- Build a minimal Dapp + +### 2. Frontend + +Build a website for WTF StarkWare based on Docusaurus. + - dashboard page + - tutorial page + - quiz page + - certificate page + +### 3. Backend + - quiz backend @stoneworld @reborn-sama(huashui) + - certificate backend + +### 4. Contract +Build a SBT contract for certificates on starknet. + - certificate contract + +### 5. Design + - web design ([Figma](https://www.figma.com/file/dZiNEsfG5Nkc1uQFy3agEk)): [@tankxu](https://github.com/tankxu) + - logo design + +### 6. Project Management + - github todo list [x] + +## How to contribute + +We will manage the project on Github (yes, this repo), so you can see all the tasks and contributors here. + +1. Read [Project Brief](https://onlydust.notion.site/WTF-Academy-Starknet-cec45bfe02694dbc895eb42e8f3f1c31) +2. Contact project lead 0xAA's Telegram (@not0xAA) or [Twitter](https://twitter.com/0xAA_Science), briefly introduce yourself and which part you want to contribute to. +3. You can create a PR update your github ID after corresponding tasks, or I will do it for you. + +## Website + +This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator. + +### Installation + +``` +$ yarn +``` + +### Local Development + +``` +$ yarn start +``` + +This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. + +### Build + +``` +$ yarn build +``` + +This command generates static content into the `build` directory and can be served using any static contents hosting service. + +### Deployment + +Using SSH: + +``` +$ USE_SSH=true yarn deploy +``` + +Not using SSH: + +``` +$ GIT_USER= yarn deploy +``` + +If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch. diff --git a/apps/doc/babel.config.js b/apps/doc/babel.config.js new file mode 100644 index 0000000..e00595d --- /dev/null +++ b/apps/doc/babel.config.js @@ -0,0 +1,3 @@ +module.exports = { + presets: [require.resolve('@docusaurus/core/lib/babel/preset')], +}; diff --git a/apps/doc/blog/2023-02-04-first-blog-post.md b/apps/doc/blog/2023-02-04-first-blog-post.md new file mode 100644 index 0000000..ec03149 --- /dev/null +++ b/apps/doc/blog/2023-02-04-first-blog-post.md @@ -0,0 +1,62 @@ +--- +slug: first-blog-post +title: First Blog Post +authors: + name: "0xAA" + title: Founder of WTF Academy + url: https://github.com/AmazingAng +tags: [hola, wtfacademy] +--- + +# **WTF Academy** + +If you are reading this, thank you for choose WTF Academy! Today we want to talk about our history and how this project begins. + +![](./img/history_01.png) +![](./img/history_02.png) + +WTF Academy is a web3 open-source university aiming to onboard 10,000 developers to web3 space. After you complete the courses that we offer, you can claim your SBT certificate. + +## How to use WTF Starknet + +**To start to work in this platform.** + +1. Go to main page, and click in "Starknet tutorials". + +![](./img/main_page.png) + +2. You will see a dashboard and your progress + +![](./img/dashboard.png) + +![](./img/progress.png) + +3. Read chapter 1 about Account Abstraction. + +![](./img/AA.png) + +4. Follow the steps and create your wallet account to work in Starknet network. + +*For Argent Wallet* + +![](./img/argent_wallet.png) + +*For Braavos Wallet* + +![](./img/braavos_wallet.png) + +5. Connect your wallet to the platform. + +![](./img/connect_wallet.png) + +![](./img/connect_wallet_02.png) + + +6. Answer the quizzes for each chapter. + +![](./img/tutorials_done.png) + +7. Once you finish all quizzes, you can claim your certificate! + +![](./img/certificate.png) + diff --git a/apps/doc/blog/img/AA.png b/apps/doc/blog/img/AA.png new file mode 100644 index 0000000..e57e858 Binary files /dev/null and b/apps/doc/blog/img/AA.png differ diff --git a/apps/doc/blog/img/argent_wallet.png b/apps/doc/blog/img/argent_wallet.png new file mode 100644 index 0000000..fd2f493 Binary files /dev/null and b/apps/doc/blog/img/argent_wallet.png differ diff --git a/apps/doc/blog/img/braavos_wallet.png b/apps/doc/blog/img/braavos_wallet.png new file mode 100644 index 0000000..bebeaa3 Binary files /dev/null and b/apps/doc/blog/img/braavos_wallet.png differ diff --git a/apps/doc/blog/img/certificate.png b/apps/doc/blog/img/certificate.png new file mode 100644 index 0000000..1c74b09 Binary files /dev/null and b/apps/doc/blog/img/certificate.png differ diff --git a/apps/doc/blog/img/connect_wallet.png b/apps/doc/blog/img/connect_wallet.png new file mode 100644 index 0000000..30232ca Binary files /dev/null and b/apps/doc/blog/img/connect_wallet.png differ diff --git a/apps/doc/blog/img/connect_wallet_02.png b/apps/doc/blog/img/connect_wallet_02.png new file mode 100644 index 0000000..b645fcb Binary files /dev/null and b/apps/doc/blog/img/connect_wallet_02.png differ diff --git a/apps/doc/blog/img/dashboard.png b/apps/doc/blog/img/dashboard.png new file mode 100644 index 0000000..eaedd6d Binary files /dev/null and b/apps/doc/blog/img/dashboard.png differ diff --git a/apps/doc/blog/img/history_01.png b/apps/doc/blog/img/history_01.png new file mode 100644 index 0000000..7eb19f8 Binary files /dev/null and b/apps/doc/blog/img/history_01.png differ diff --git a/apps/doc/blog/img/history_02.png b/apps/doc/blog/img/history_02.png new file mode 100644 index 0000000..5ffae84 Binary files /dev/null and b/apps/doc/blog/img/history_02.png differ diff --git a/apps/doc/blog/img/main_page.png b/apps/doc/blog/img/main_page.png new file mode 100644 index 0000000..e76644e Binary files /dev/null and b/apps/doc/blog/img/main_page.png differ diff --git a/apps/doc/blog/img/progress.png b/apps/doc/blog/img/progress.png new file mode 100644 index 0000000..58f7f70 Binary files /dev/null and b/apps/doc/blog/img/progress.png differ diff --git a/apps/doc/blog/img/tutorials_done.png b/apps/doc/blog/img/tutorials_done.png new file mode 100644 index 0000000..8b71c70 Binary files /dev/null and b/apps/doc/blog/img/tutorials_done.png differ diff --git a/apps/doc/docs/Guide/img/5-1.png b/apps/doc/docs/Guide/img/5-1.png new file mode 100644 index 0000000..a1b9646 Binary files /dev/null and b/apps/doc/docs/Guide/img/5-1.png differ diff --git a/apps/doc/docs/Guide/readme.mdx b/apps/doc/docs/Guide/readme.mdx new file mode 100644 index 0000000..a988f75 --- /dev/null +++ b/apps/doc/docs/Guide/readme.mdx @@ -0,0 +1,7 @@ +--- + +title: Guide + +--- + +## Solive S \ No newline at end of file diff --git a/apps/doc/docs/dashboard.mdx b/apps/doc/docs/dashboard.mdx new file mode 100644 index 0000000..52a4eb5 --- /dev/null +++ b/apps/doc/docs/dashboard.mdx @@ -0,0 +1,13 @@ +--- +title: Dashboard +sidebar_position: 0 +slug: /dashboard +hide_title: true +--- + + + diff --git a/apps/doc/docusaurus.config.js b/apps/doc/docusaurus.config.js new file mode 100644 index 0000000..41dbd6d --- /dev/null +++ b/apps/doc/docusaurus.config.js @@ -0,0 +1,156 @@ +// @ts-check +// Note: type annotations allow type checking and IDEs autocompletion + +const lightCodeTheme = require('prism-react-renderer/themes/github'); +const darkCodeTheme = require('prism-react-renderer/themes/dracula'); + +function defineSection(section, version = {}, options = {}) { + return [ + '@docusaurus/plugin-content-docs', + /** @type {import('@docusaurus/plugin-content-docs').Options} */ + ({ + id: section, + path: `docs/${section}`, + routeBasePath: section, + include: ['**/*.md', '**/*.mdx'], + sidebarPath: require.resolve('./sidebars-default.js'), + breadcrumbs: false, + editUrl: 'https://github.com/WTFAcademy/frontend', // TODO: 需要更改 + versions: version && { + current: { + label: version.label, + }, + }, + ...options, + }), + ]; +} + +const SECTIONS = [ +]; + +/** @type {import('@docusaurus/types').Config} */ +const config = { + title: "WTF Starknet", + tagline: "Onboarding Developers to Starknet", + favicon: "img/favicon.ico", + + // Set the production url of your site here + url: "https://your-docusaurus-test-site.com", + // Set the // pathname under which your site is served + // For GitHub pages deployment, it is often '//' + baseUrl: "/", + + // GitHub pages deployment config. + // If you aren't using GitHub pages, you don't need these. + organizationName: "WTFAcademy", // Usually your GitHub org/user name. + projectName: "WTF-Academy-Starknet-Hackathon", // Usually your repo name. + + onBrokenLinks: "throw", + onBrokenMarkdownLinks: "warn", + + // Even if you don't use internalization, you can use this field to set useful + // metadata like html lang. For example, if your site is Chinese, you may want + // to replace "en" with "zh-Hans". + i18n: { + defaultLocale: "en", + locales: ["en", "zh"], + }, + + presets: [ + [ + "classic", + /** @type {import('@docusaurus/preset-classic').Options} */ + ({ + docs: { + sidebarPath: require.resolve("./sidebars.js"), + // Please change this to your repo. + // Remove this to remove the "edit this page" links. + editUrl: + "https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/", + }, + blog: { + showReadingTime: true, + // Please change this to your repo. + // Remove this to remove the "edit this page" links. + editUrl: + "https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/", + }, + theme: { + customCss: [require.resolve("./src/css/custom.css")], + }, + }), + ], + ], + + themeConfig: + /** @type {import('@docusaurus/preset-classic').ThemeConfig} */ + ({ + // Replace with your project's social card + image: "img/docusaurus-social-card.jpg", + navbar: { + title: "Solive", + logo: { + alt: "Solive", + src: "img/logo_300x300.png", + }, + items: [ + { + type: "doc", + docId: "dashboard", + position: "left", + label: "Tutorial", + }, + { to: "/blog", label: "Blog", position: "left" }, + ], + }, + footer: { + style: "dark", + links: [ + { + title: "Docs", + items: [ + { + label: "Tutorial", + to: "/docs/dashboard", + }, + ], + }, + { + title: "Community", + items: [ + { + label: "Discord", + href: "https://discord.com/invite/5akcruXrsk", + }, + { + label: "Twitter", + href: "https://twitter.com/WTFAcademy_", + }, + ], + }, + { + title: "More", + items: [ + { + label: "Blog", + to: "/blog", + }, + { + label: "GitHub", + href: "https://github.com/WTFAcademy/WTF-Academy-Starknet-Hackathon", + }, + ], + }, + ], + copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`, + }, + prism: { + theme: lightCodeTheme, + darkTheme: darkCodeTheme, + }, + }), + plugins: [...SECTIONS], +}; + +module.exports = config; diff --git a/apps/doc/i18n/zh/docusaurus-plugin-content-docs/current/dashboard.md b/apps/doc/i18n/zh/docusaurus-plugin-content-docs/current/dashboard.md new file mode 100644 index 0000000..b7e974a --- /dev/null +++ b/apps/doc/i18n/zh/docusaurus-plugin-content-docs/current/dashboard.md @@ -0,0 +1,6 @@ +--- +title: Dashboard +sidebar_position: 0 +--- +# 中文测试 + diff --git a/apps/doc/package.json b/apps/doc/package.json new file mode 100644 index 0000000..a99cb0f --- /dev/null +++ b/apps/doc/package.json @@ -0,0 +1,56 @@ +{ + "name": "solive-doc", + "version": "0.0.0", + "private": true, + "scripts": { + "docusaurus": "docusaurus", + "start": "docusaurus start", + "build": "docusaurus build", + "swizzle": "docusaurus swizzle", + "deploy": "docusaurus deploy", + "clear": "docusaurus clear", + "serve": "docusaurus serve", + "write-translations": "docusaurus write-translations", + "write-heading-ids": "docusaurus write-heading-ids", + "typecheck": "tsc" + }, + "dependencies": { + "@docusaurus/core": "2.3.0", + "@docusaurus/preset-classic": "2.3.0", + "@docusaurus/theme-common": "^2.4.0", + "@mdx-js/react": "^1.6.22", + "@starknet-react/core": "^0.14.8", + "@web3auth/sign-in-with-starkware": "^1.0.0", + "ahooks": "^3.7.4", + "axios": "^1.3.1", + "clsx": "^1.2.1", + "lodash": "^4.17.21", + "prism-react-renderer": "^1.3.5", + "react": "^17.0.2", + "react-dom": "^17.0.2", + "react-hot-toast": "^2.4.0", + "react-jazzicon": "^1.0.4", + "starknet": "^4.17.1" + }, + "devDependencies": { + "@docusaurus/module-type-aliases": "2.3.0", + "@docusaurus/types": "^2.4.0", + "@tsconfig/docusaurus": "^1.0.5", + "typescript": "^4.7.4" + }, + "browserslist": { + "production": [ + ">0.5%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] + }, + "engines": { + "node": ">=16.14" + } +} diff --git a/apps/doc/sidebars.js b/apps/doc/sidebars.js new file mode 100644 index 0000000..9ab54c2 --- /dev/null +++ b/apps/doc/sidebars.js @@ -0,0 +1,33 @@ +/** + * Creating a sidebar enables you to: + - create an ordered group of docs + - render a sidebar for each doc of that group + - provide next/previous navigation + + The sidebars can be generated from the filesystem, or explicitly defined here. + + Create as many sidebars as you want. + */ + +// @ts-check + +/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ +const sidebars = { + // By default, Docusaurus generates a sidebar from the docs folder structure + tutorialSidebar: [{type: 'autogenerated', dirName: '.'}], + + // But you can create a sidebar manually + /* + tutorialSidebar: [ + 'intro', + 'hello', + { + type: 'category', + label: 'Tutorial', + items: ['tutorial-basics/create-a-document'], + }, + ], + */ +}; + +module.exports = sidebars; diff --git a/apps/doc/src/components/Avatar/index.tsx b/apps/doc/src/components/Avatar/index.tsx new file mode 100644 index 0000000..52bad02 --- /dev/null +++ b/apps/doc/src/components/Avatar/index.tsx @@ -0,0 +1,21 @@ +import React from "react"; +import Jazzicon from "react-jazzicon"; +import {useAccount} from "@starknet-react/core"; + +interface AvatarProps extends React.PropsWithChildren { + address?: string; + diameter?: number; +} + +const Avatar = (props: AvatarProps) => { + const { address, diameter = 30, ...other } = props; + const { address: accountAddress } = useAccount(); + const newAddress = address || accountAddress || ''; + const seed = parseInt(newAddress.slice(2, 10), 16); + + return ( + + ) +} + +export default Avatar; \ No newline at end of file diff --git a/apps/doc/src/components/Button/index.module.css b/apps/doc/src/components/Button/index.module.css new file mode 100644 index 0000000..dd41c97 --- /dev/null +++ b/apps/doc/src/components/Button/index.module.css @@ -0,0 +1,43 @@ + +.button { + display: inline-flex; + align-items: center; + cursor: pointer; + + font-size: 16px; + padding: 4px 10px; + border-radius: 4px; +} + +.normal { + background: var(--custom-btn-bg-normal); + color: var(--custom-btn-color-normal); + border: 1px solid var(--custom-btn-border-normal); +} + +.primary { + background: var(--custom-btn-bg-primary); + color: var(--custom-btn-color-primary); + border: 1px solid var(--custom-btn-bg-primary); + transition: all .2s; +} + +.primary:hover { + background: var(--custom-btn-bg-primary-hover); + border-color: var(--custom-btn-bg-primary); +} + +.primary.disabled, .normal.disabled { + opacity: 0.6; + pointer-events: none; +} + +.primary.disabled:hover { + background: var(--custom-btn-bg-primary); + border-color: var(--custom-btn-bg-primary); +} + +.buttonLoading { + font-size: 20px; + margin-right: 2px; +} diff --git a/apps/doc/src/components/Button/index.tsx b/apps/doc/src/components/Button/index.tsx new file mode 100644 index 0000000..9b8f2d3 --- /dev/null +++ b/apps/doc/src/components/Button/index.tsx @@ -0,0 +1,41 @@ +import React from "react"; +import clsx from "clsx"; +import styles from './index.module.css'; +import LoadingSvg from "@site/src/icons/LoadingSvg"; + +interface Props extends React.PropsWithChildren { + loading?: boolean; + type?: "normal" | "primary"; + className?: string; + disabled?: boolean; +} + +const Button: React.FC = (props) => { + const { + children, + loading, + className, + type = "normal", + disabled = false, + ...other + } = props; + + return ( +
+ {loading && ( + + )} + {children} +
+ ); +}; + +export default Button; \ No newline at end of file diff --git a/apps/doc/src/components/DashboardTitle/index.tsx b/apps/doc/src/components/DashboardTitle/index.tsx new file mode 100644 index 0000000..a96c675 --- /dev/null +++ b/apps/doc/src/components/DashboardTitle/index.tsx @@ -0,0 +1,21 @@ +import React from 'react'; +import clsx from "clsx"; + +import styles from './styles.module.css'; + +export default function DashboardTitle() { + return ( + <> +

+ Welcome to the +
+

STARK Way of Building

+

+ +

+ Starknet uses the Cairo programming language both for its infrastructure and for writing Starknet + contracts. L2 <--> L1 messaging infrastructure is available and contracts are fully composable. +

+ + ) +} diff --git a/apps/doc/src/components/DashboardTitle/styles.module.css b/apps/doc/src/components/DashboardTitle/styles.module.css new file mode 100644 index 0000000..b7faba7 --- /dev/null +++ b/apps/doc/src/components/DashboardTitle/styles.module.css @@ -0,0 +1,10 @@ +.title { + font-weight: 700; + font-size: 48px; + line-height: 130%; + margin-top: 10px !important; +} + +.orangeTitle { + color: #EF740E; +} diff --git a/apps/doc/src/components/HomepageFeatures/index.tsx b/apps/doc/src/components/HomepageFeatures/index.tsx new file mode 100644 index 0000000..fac298d --- /dev/null +++ b/apps/doc/src/components/HomepageFeatures/index.tsx @@ -0,0 +1,118 @@ +import React from 'react'; +import Link from '@docusaurus/Link'; +import clsx from 'clsx'; +import styles from './styles.module.css'; + +type FeatureItem = { + title: string; + imgUrl: string; + description: JSX.Element; +}; + +const FeatureList: FeatureItem[] = [ + { + title: 'Account Abstraction', + imgUrl: require('@site/static/img/home_feature_item1.png').default, + description: ( + <> + Introduce you to account abstraction on Starknet. + + ), + }, + { + title: 'Cairo Lang', + imgUrl: require('@site/static/img/home_feature_item2.png').default, + description: ( + <> + Teach you to write a NFT contract in cairo. + + ), + }, + { + title: 'Starknet Dapp', + imgUrl: require('@site/static/img/home_feature_item3.png').default, + description: ( + <> + Build a simple NFT minting Dapp on Starknet. + + ), + }, +]; + + +function Feature({title, imgUrl, description}: FeatureItem) { + return ( +
+ +

{title}

+

{description}

+
+ ); +} + +export default function HomepageFeatures(): JSX.Element { + return ( +
+
+
+ +
+
+

Say hi to Starknet 🤟

+

Starknet is a permissionless decentralized Validity-Rollup (often referred to as ZK-Rollup). It operates as an L2 network over Ethereum, enabling any dApp to achieve unlimited scale for its computation – without compromising Ethereum's composability and security.

+ + https://starknet.io + + +
+
+
What will you learn from this tutorial
+
+ {FeatureList.map((props, idx) => ( + + ))} +
+ + Go to tutorial +
+ + + +
+ +
+ ); +} + + +function StarknetLogo() { + return ( + + + + + + + + + + + + + + + + ); +} + +function LinkIcon() { + return ( + + + + ); +} + diff --git a/apps/doc/src/components/HomepageFeatures/styles.module.css b/apps/doc/src/components/HomepageFeatures/styles.module.css new file mode 100644 index 0000000..4398549 --- /dev/null +++ b/apps/doc/src/components/HomepageFeatures/styles.module.css @@ -0,0 +1,214 @@ +.features { + display: flex; + align-items: center; + width: 100%; + flex-direction: column; + padding: 60px 20px 100px 20px; +} + +.featureImg { + height: 76px; + width: 76px; +} + +.overview{ + display: flex; + max-width: 1000px; + padding: 30px 40px; + border-radius: 6px; + border: 0.5px solid #CECECE; + box-shadow: 0px 3px 10px rgba(0, 0, 0, 0.1); + margin-bottom: 80px; +} + +.overviewLogo{ + width: 92px; + height: 92px; +} + + +.overviewText{ + padding-left: 40px; +} + +.overviewTextTitle{ + font-family: 'Inter'; + font-size: 32px; + line-height: 1.2; + color: var(--ifm-font-color-base); +} + +.overviewTextDes{ + font-family: 'Inter'; + font-size: 16px; + line-height: 1.5; + margin-bottom: 20px; + color: var(--ifm-font-color-base); +} + +.overviewLink{ + display: inline-flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + padding: 10px; + font-size: 16px; + line-height: 1; + box-sizing: border-box; + font-weight: 500; + color: #072318; + background: #F6FFF3; + border: 1px solid #37A411; + border-radius: 4px; +} + +.overviewLink:hover{ + transition: all .3s ease; + font-weight: 700; + color: #072318; + background: #E3F9DC; +} + +.overviewLinkText{ + margin-right: 16px; + font-family: 'Inter'; + font-size: 14px; + line-height: 1.2; +} + +.featureTitle{ + position: relative; + width: 100%; + font-family: 'Inter'; + font-size: 32px; + line-height: 1.2; + text-align: left; + letter-spacing: 0.01em; + max-width: 1000px; +} + +.featureList{ + position: relative; + width: 100%; + max-width: 1000px; + display: flex; + align-items: start; + justify-content: space-between; + margin-top: 40px; + margin-bottom: 70px; + gap: 20px; +} + +.featureItem{ + position: relative; + width: 320px; + min-height: 295px; + text-align: center; + box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.06); + border-radius: 6px; + padding-top: 42px; +} + +.featureItem:nth-child(1){ + background: #FAEFE4; + border: 1px solid #F8E0B8; +} + +.featureItem:nth-child(2){ + background: #F6FEE9; + border: 1px solid #C7EDBA; +} + +.featureItem:nth-child(3){ + background: #EEFFFE; + border: 1px solid #C2EAF7; +} + +.featureItemTitle{ + margin-top: 30px; + font-family: 'Inter'; + font-weight: 700; + font-size: 22px; + line-height: 1.3; + color: #0F1110; + padding: 0 16px; +} + +.featureItemDesc{ + margin-top: 20px; + font-family: 'Inter'; + font-weight: 400; + font-size: 16px; + line-height: 1.5; + color: #1C1E21; + padding: 0 16px; +} + +.tutorialsLink{ + display: inline-flex; + padding: 10px 20px; + margin: 0 auto; + align-items: center; + justify-content: center; + background: #308F0F; + box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1); + border-radius: 4px; + + font-family: 'Inter'; + font-style: normal; + font-weight: 500; + font-size: 18px; + line-height: 1.2; + text-align: center; + + color: #FFFFFF; +} +.tutorialsLink:hover{ + color: #fff; + background-color: #21610A; + transition: all .3s ease; +} + +.tutorialsLinkIcon{ + position: relative; + display: inline-flex; + align-items: center; + width: 16px; + height: auto; + margin-left: 12px; +} + +@media (max-width: 996px){ + .overview{ + flex-direction: column; + justify-content: center; + } + + .overviewLogo{ + width: 120px; + height: 120px; + margin: 0 auto; + margin-bottom: 30px; + } + + .overviewLogo svg{ + width: 100%; + height: 100%; + } + + .overviewText{ + padding-left: 0; + } + + .overviewTextTitle{ + font-size: 28px; + } + + .featureList{ + flex-direction: column; + } + + .featureItem{ + width: 100%; + } +} \ No newline at end of file diff --git a/apps/doc/src/components/LazyloadImage/index.module.css b/apps/doc/src/components/LazyloadImage/index.module.css new file mode 100644 index 0000000..9981cea --- /dev/null +++ b/apps/doc/src/components/LazyloadImage/index.module.css @@ -0,0 +1,11 @@ +.loading { + display: flex; + align-items: center; + justify-content: center; + background-color: #EDEDED; +} + +.loadingIcon { + font-size: 24px; + +} \ No newline at end of file diff --git a/apps/doc/src/components/LazyloadImage/index.tsx b/apps/doc/src/components/LazyloadImage/index.tsx new file mode 100644 index 0000000..c0b8d08 --- /dev/null +++ b/apps/doc/src/components/LazyloadImage/index.tsx @@ -0,0 +1,33 @@ +import LoadingSvg from "@site/src/icons/LoadingSvg"; +import clsx from "clsx"; +import React, { useEffect, useState } from "react"; +import styles from "./index.module.css"; + +const LazyloadImage = (props) => { + const { src, className } = props; + const [done, setDone] = useState(true); + + useEffect(() => { + if (src) { + const img = new Image(); + img.src = src; + img.onload = () => { + setDone(true); + }; + } + }, [src]); + + return ( +
+ {done ? ( + nft image + ) : ( +
+ +
+ )} +
+ ); +}; + +export default LazyloadImage; diff --git a/apps/doc/src/components/Modal/index.module.css b/apps/doc/src/components/Modal/index.module.css new file mode 100644 index 0000000..9d708a5 --- /dev/null +++ b/apps/doc/src/components/Modal/index.module.css @@ -0,0 +1,60 @@ +/** + * CSS files with the .module.css suffix will be treated as CSS modules + * and scoped locally. + */ + +.modal { + pointer-events: none; + visibility: hidden; + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + display: flex; + justify-content: center; + align-items: center; + opacity: 0; + z-index: 999; + background: rgba(0, 0, 0, 0.5); + transition-duration: .2s; + transition-timing-function: cubic-bezier(.4, 0, .2, 1); + transition-property: transform, opacity, visibility; + overflow-y: hidden; + overscroll-behavior: contain; +} + +.modal_box { + box-sizing: border-box; + position: relative; + display: flex; + flex-direction: column; + align-items: center; + overflow: hidden; + padding: 48px 20px; + gap: 40px; + isolation: isolate; + max-height: calc(100vh - 5em); + max-width: 32rem; + background: #FFFFFF; + border: 0.5px solid #CECECE; + box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.2); + border-radius: 6px; +} + +.modal_show { + pointer-events: auto; + visibility: visible; + opacity: 1; +} + +.modal_close_btn { + position: absolute; + padding: 10px; + right: 10px; + top: 10px; + outline: none; + border: none; + cursor: pointer; + background: none; +} \ No newline at end of file diff --git a/apps/doc/src/components/Modal/index.tsx b/apps/doc/src/components/Modal/index.tsx new file mode 100644 index 0000000..5fddd73 --- /dev/null +++ b/apps/doc/src/components/Modal/index.tsx @@ -0,0 +1,43 @@ +import clsx from "clsx"; +import React, { ReactNode } from "react"; +import styles from "./index.module.css"; + +type ModalProps = { + open?: boolean; + onClose?: () => void; + children?: ReactNode; +}; + +export default function Modal(props: ModalProps): JSX.Element { + const { children, open = false, onClose } = props; + return ( +
+
+ + {children} +
+
+ ); +} + +function CloseSvg() { + return ( + + + + ); +} diff --git a/apps/doc/src/constants/base.ts b/apps/doc/src/constants/base.ts new file mode 100644 index 0000000..e69de29 diff --git a/apps/doc/src/contexts/GlobalContext.ts b/apps/doc/src/contexts/GlobalContext.ts new file mode 100644 index 0000000..d5f8f84 --- /dev/null +++ b/apps/doc/src/contexts/GlobalContext.ts @@ -0,0 +1,8 @@ +import React from "react"; + +interface State { + uid?: string; + setUid?: (uid: string) => void; +} + +export default React.createContext(null); \ No newline at end of file diff --git a/apps/doc/src/css/custom.css b/apps/doc/src/css/custom.css new file mode 100644 index 0000000..d39724e --- /dev/null +++ b/apps/doc/src/css/custom.css @@ -0,0 +1,58 @@ +/** + * Any CSS included here will be global. The classic template + * bundles Infima by default. Infima is a CSS framework designed to + * work well for content-centric websites. + */ +@import url('https://fonts.googleapis.com/css2?family=Inter&display=swap'); + +/* You can override the default Infima variables here. */ +:root { + --ifm-color-primary: #2e8555; + --ifm-color-primary-dark: #29784c; + --ifm-color-primary-darker: #277148; + --ifm-color-primary-darkest: #205d3b; + --ifm-color-primary-light: #33925d; + --ifm-color-primary-lighter: #359962; + --ifm-color-primary-lightest: #3cad6e; + --ifm-code-font-size: 95%; + --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1); + --custom-btn-bg-primary: #EF740E; + --custom-btn-bg-primary-hover: #fc9738; + --custom-btn-color-primary: white; + --custom-btn-bg-normal: white; + --custom-btn-border-normal: #ffdfb3; + --custom-btn-color-normal: black; +} + +/* For readability concerns, you should choose a lighter palette in dark mode. */ +[data-theme='dark'] { + --ifm-color-primary: #25c2a0; + --ifm-color-primary-dark: #21af90; + --ifm-color-primary-darker: #1fa588; + --ifm-color-primary-darkest: #1a8870; + --ifm-color-primary-light: #29d5b0; + --ifm-color-primary-lighter: #32d8b4; + --ifm-color-primary-lightest: #4fddbf; + --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3); +} + +html,body { + font-family: 'Inter'; +} + +@keyframes ring { + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(360deg); + } +} + +.loading { + animation: ring 1.2s linear infinite; +} + +.menu__list > .menu__list-item--hide { + display: none; +} \ No newline at end of file diff --git a/apps/doc/src/icons/DropdownSvg.tsx b/apps/doc/src/icons/DropdownSvg.tsx new file mode 100644 index 0000000..b6da70a --- /dev/null +++ b/apps/doc/src/icons/DropdownSvg.tsx @@ -0,0 +1,21 @@ +import React from "react"; + +const DropdownSvg = (props) => { + + return ( + + + + ) +} + +export default DropdownSvg; \ No newline at end of file diff --git a/apps/doc/src/icons/LoadingSvg.tsx b/apps/doc/src/icons/LoadingSvg.tsx new file mode 100644 index 0000000..d2c26f9 --- /dev/null +++ b/apps/doc/src/icons/LoadingSvg.tsx @@ -0,0 +1,19 @@ +import React from "react"; + +const LoadingSvg = (props) => { + return ( + + + + ) +} + +export default LoadingSvg; \ No newline at end of file diff --git a/apps/doc/src/icons/OfflineSvg.tsx b/apps/doc/src/icons/OfflineSvg.tsx new file mode 100644 index 0000000..3419a03 --- /dev/null +++ b/apps/doc/src/icons/OfflineSvg.tsx @@ -0,0 +1,21 @@ +import React from "react"; + +const OfflineSvg = (props) => { + return ( + + + + ) +} + +export default OfflineSvg; \ No newline at end of file diff --git a/apps/doc/src/pages/index.module.css b/apps/doc/src/pages/index.module.css new file mode 100644 index 0000000..fc6fdde --- /dev/null +++ b/apps/doc/src/pages/index.module.css @@ -0,0 +1,108 @@ +/** + * CSS files with the .module.css suffix will be treated as CSS modules + * and scoped locally. + */ + +a:hover{ + text-decoration: none; +} + +.heroBanner { + position: relative; + height: 320px; + text-align: center; + overflow: hidden; + text-align: center; + color: #FFFFFF; + background: linear-gradient(180deg, #000000 0%, #082619 100%); +} + +.heroBannerLeftStar{ + position: absolute; + width: 300px; + height: 320px; + top: 0; + left: 0; + z-index: 0; +} + +.heroBannerRightStar{ + position: absolute; + width: 480px; + height: 320px; + top: 0; + right: 0; + z-index: 0; +} + +.heroBannerLeftStar svg, +.heroBannerRightStar svg{ + width: 100%; + height: 100%; +} + +.heroBannerTitle{ + position: relative; + font-family: 'Inter'; + font-weight: 700; + font-size: 48px; + line-height: 1.2; + margin-top: 75px; + padding: 0 20px; +} + +.heroBannerSubTitle{ + position: relative; + font-family: 'Inter'; + font-weight: 400; + font-size: 24px; + line-height: 1.2; + margin-top: 32px; + padding: 0 20px; +} + +.buttons { + display: flex; + align-items: center; + justify-content: center; +} + +.tutorialsLink{ + position: relative; + display: inline-block; + padding: 10px 20px; + margin: 0 auto; + margin-top: 34px; + background: #308F0F; + box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1); + border-radius: 4px; + font-family: 'Inter'; + font-style: normal; + font-weight: 500; + font-size: 18px; + line-height: 1.2; + text-align: center; + color: #FFFFFF; +} +.tutorialsLink:hover{ + color: #fff; + background-color: #21610A; + transition: all .3s ease; +} + + +@media (max-width: 996px){ + .heroBanner{ + height: 420px; + } + .heroBannerLeftStar{ + width: 100%; + height: 85%; + } + .heroBannerRightStar{ + display: none; + } + .heroBannerTitle{ + font-size: 42px; + } +} \ No newline at end of file diff --git a/apps/doc/src/pages/index.tsx b/apps/doc/src/pages/index.tsx new file mode 100644 index 0000000..208cbba --- /dev/null +++ b/apps/doc/src/pages/index.tsx @@ -0,0 +1,104 @@ +import React, {useContext} from 'react'; +import clsx from 'clsx'; +import Link from '@docusaurus/Link'; +import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; +import Layout from '@theme/Layout'; +import HomepageFeatures from "@site/src/components/HomepageFeatures"; + +import styles from "./index.module.css"; +import {useHistory} from "@docusaurus/router"; + +function HomepageHeader() { + const { siteConfig } = useDocusaurusContext(); + return ( +
+
+
+ +
+
+ +
+

{siteConfig.title}

+

{siteConfig.tagline}

+
+ + Starknet Tutorials + +
+
+
+ ); +} + +export default function Home(): JSX.Element { + const {siteConfig} = useDocusaurusContext(); + + return ( + + +
+ +
+
+ ); +} + +function HeroBannerLeftStar(){ + return ( + + + + + + + + + + + + + + + + + + + + + + + ) +} + +function HeroBannerRightStar(){ + return ( + + + + + + + + + + + + + + + + + + + + + + + ) +} diff --git a/apps/doc/src/theme/NavbarItem/ComponentTypes.js b/apps/doc/src/theme/NavbarItem/ComponentTypes.js new file mode 100644 index 0000000..34ab2d6 --- /dev/null +++ b/apps/doc/src/theme/NavbarItem/ComponentTypes.js @@ -0,0 +1,5 @@ +import ComponentTypes from "@theme-original/NavbarItem/ComponentTypes"; + +export default { + ...ComponentTypes +}; diff --git a/apps/doc/src/theme/Root.tsx b/apps/doc/src/theme/Root.tsx new file mode 100644 index 0000000..e04cc68 --- /dev/null +++ b/apps/doc/src/theme/Root.tsx @@ -0,0 +1,15 @@ +import React, { useState } from 'react'; +import GlobalContext from "@site/src/contexts/GlobalContext"; +import { Toaster } from "react-hot-toast"; + +// Default implementation, that you can customize +export default function Root({ children }) { + const [uid, setUid] = useState(undefined); + + return ( + + {children} + + + ); +} \ No newline at end of file diff --git a/apps/doc/src/typings/course.ts b/apps/doc/src/typings/course.ts new file mode 100644 index 0000000..e69de29 diff --git a/apps/doc/src/utils/truncation.ts b/apps/doc/src/utils/truncation.ts new file mode 100644 index 0000000..336bb11 --- /dev/null +++ b/apps/doc/src/utils/truncation.ts @@ -0,0 +1,6 @@ +const truncation = (value: string = '', prefix = 5, suffix = 4, flag= '***') => { + const preValue = value.slice(0, prefix); + const sufValue = value.slice(value.length - 1 - suffix, value.length - 1); + return `${preValue}${flag}${sufValue}`; +} +export default truncation; \ No newline at end of file diff --git a/apps/doc/static/.nojekyll b/apps/doc/static/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/apps/doc/static/img/SBT.svg b/apps/doc/static/img/SBT.svg new file mode 100644 index 0000000..cefdb9c --- /dev/null +++ b/apps/doc/static/img/SBT.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/apps/doc/static/img/argent.png b/apps/doc/static/img/argent.png new file mode 100644 index 0000000..608ba5f Binary files /dev/null and b/apps/doc/static/img/argent.png differ diff --git a/apps/doc/static/img/braavos.png b/apps/doc/static/img/braavos.png new file mode 100644 index 0000000..4033b29 Binary files /dev/null and b/apps/doc/static/img/braavos.png differ diff --git a/apps/doc/static/img/docusaurus-social-card.jpg b/apps/doc/static/img/docusaurus-social-card.jpg new file mode 100644 index 0000000..ffcb448 Binary files /dev/null and b/apps/doc/static/img/docusaurus-social-card.jpg differ diff --git a/apps/doc/static/img/docusaurus.png b/apps/doc/static/img/docusaurus.png new file mode 100644 index 0000000..f458149 Binary files /dev/null and b/apps/doc/static/img/docusaurus.png differ diff --git a/apps/doc/static/img/favicon.ico b/apps/doc/static/img/favicon.ico new file mode 100644 index 0000000..3daf876 Binary files /dev/null and b/apps/doc/static/img/favicon.ico differ diff --git a/apps/doc/static/img/home_banner_star1.png b/apps/doc/static/img/home_banner_star1.png new file mode 100644 index 0000000..c59aba7 Binary files /dev/null and b/apps/doc/static/img/home_banner_star1.png differ diff --git a/apps/doc/static/img/home_banner_star2.png b/apps/doc/static/img/home_banner_star2.png new file mode 100644 index 0000000..fcee336 Binary files /dev/null and b/apps/doc/static/img/home_banner_star2.png differ diff --git a/apps/doc/static/img/home_feature_item1.png b/apps/doc/static/img/home_feature_item1.png new file mode 100644 index 0000000..ad5850c Binary files /dev/null and b/apps/doc/static/img/home_feature_item1.png differ diff --git a/apps/doc/static/img/home_feature_item2.png b/apps/doc/static/img/home_feature_item2.png new file mode 100644 index 0000000..ec63b00 Binary files /dev/null and b/apps/doc/static/img/home_feature_item2.png differ diff --git a/apps/doc/static/img/home_feature_item3.png b/apps/doc/static/img/home_feature_item3.png new file mode 100644 index 0000000..33ea2da Binary files /dev/null and b/apps/doc/static/img/home_feature_item3.png differ diff --git a/apps/doc/static/img/logo.svg b/apps/doc/static/img/logo.svg new file mode 100644 index 0000000..9db6d0d --- /dev/null +++ b/apps/doc/static/img/logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/doc/static/img/logo_300x300.png b/apps/doc/static/img/logo_300x300.png new file mode 100644 index 0000000..3daf876 Binary files /dev/null and b/apps/doc/static/img/logo_300x300.png differ diff --git a/apps/doc/static/img/undraw_docusaurus_mountain.svg b/apps/doc/static/img/undraw_docusaurus_mountain.svg new file mode 100644 index 0000000..af961c4 --- /dev/null +++ b/apps/doc/static/img/undraw_docusaurus_mountain.svg @@ -0,0 +1,171 @@ + + Easy to Use + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/doc/static/img/undraw_docusaurus_react.svg b/apps/doc/static/img/undraw_docusaurus_react.svg new file mode 100644 index 0000000..94b5cf0 --- /dev/null +++ b/apps/doc/static/img/undraw_docusaurus_react.svg @@ -0,0 +1,170 @@ + + Powered by React + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/doc/static/img/undraw_docusaurus_tree.svg b/apps/doc/static/img/undraw_docusaurus_tree.svg new file mode 100644 index 0000000..d9161d3 --- /dev/null +++ b/apps/doc/static/img/undraw_docusaurus_tree.svg @@ -0,0 +1,40 @@ + + Focus on What Matters + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/doc/tsconfig.json b/apps/doc/tsconfig.json new file mode 100644 index 0000000..aea83c9 --- /dev/null +++ b/apps/doc/tsconfig.json @@ -0,0 +1,8 @@ +{ + // This file is not used in compilation. It is here just for a nice editor experience. + "extends": "@tsconfig/docusaurus/tsconfig.json", + "compilerOptions": { + "baseUrl": ".", + "resolveJsonModule": true + } +}