From ee80c7cd9ce185ce975a867a2dfa32cf6f83eb14 Mon Sep 17 00:00:00 2001 From: Cyrbuzz Date: Tue, 14 May 2024 17:58:47 +0800 Subject: [PATCH] feat: mobile change (#518) --- docs/.vuepress/components/Banner.vue | 33 ++++++++-- docs/.vuepress/components/Typography.vue | 17 +++++ docs/.vuepress/config.ts | 6 ++ .../public/assets/style/homepage.css | 55 +++++++++++++--- docs/.vuepress/styles/index.scss | 27 ++++++++ docs/README.md | 6 +- docs/indexer/welcome.md | 35 ++++++++-- docs/subquery_network/welcome.md | 65 +++++++++++-------- 8 files changed, 196 insertions(+), 48 deletions(-) diff --git a/docs/.vuepress/components/Banner.vue b/docs/.vuepress/components/Banner.vue index cc9aad21ead..45c85093933 100644 --- a/docs/.vuepress/components/Banner.vue +++ b/docs/.vuepress/components/Banner.vue @@ -2,7 +2,7 @@
@@ -60,15 +60,40 @@ defineProps<{ diff --git a/docs/.vuepress/components/Typography.vue b/docs/.vuepress/components/Typography.vue index 7e977002e35..5de87ac715b 100644 --- a/docs/.vuepress/components/Typography.vue +++ b/docs/.vuepress/components/Typography.vue @@ -100,4 +100,21 @@ defineProps<{ color: var(--gray-400); } } + +@media screen and (max-width: 768px) { + .docsTypography { + max-width: 100% !important; + &.h1 { + font-size: 40px; + } + + &.h2 { + font-size: 40px; + } + + &.h3 { + font-size: 36px; + } + } +} diff --git a/docs/.vuepress/config.ts b/docs/.vuepress/config.ts index 949c5fc281c..0de3d343446 100644 --- a/docs/.vuepress/config.ts +++ b/docs/.vuepress/config.ts @@ -39,6 +39,12 @@ export default defineUserConfig({ href: "/assets/favicons/favicon-16x16.png", }, ], + [ + "meta", + { + content: "user-scalable=no, width=device-width, initial-scale=1.0", + }, + ], ], locales: { diff --git a/docs/.vuepress/public/assets/style/homepage.css b/docs/.vuepress/public/assets/style/homepage.css index 4ba5e5a86fd..17a636c5dc6 100644 --- a/docs/.vuepress/public/assets/style/homepage.css +++ b/docs/.vuepress/public/assets/style/homepage.css @@ -61,6 +61,11 @@ body .theme-hope-content:not(.custom) { margin-bottom: 140px; } +.grid2column { + display: grid; + grid-template-columns: 1fr 1fr +} + .grid3column { display: grid; grid-template-columns: 1fr 1fr 1fr; @@ -186,14 +191,6 @@ body .theme-hope-content:not(.custom) { flex-flow: row wrap; } -@media screen and (max-width: 720px) { - .banner { - padding: 80px 0; - } - .banner > div { - flex-direction: column; - } -} .graphGuide { background: radial-gradient( @@ -254,3 +251,45 @@ iframe { max-width: var(--max-width); } } + + +@media screen and (max-width: 768px) { + .welcomeContainer { + padding: 0 20px; + } + + .banner { + padding: 80px 0; + } + .banner > div { + flex-direction: column; + } + + .bannerImage img { + width: 100vw; + } + + .bannerImageBg { + width: 100%; + } + + .flexColMobile { + display: flex; + flex-direction: column; + } + + .bannerRow .bannerImage { + position: absolute; + transform: translate(-50%, -50%); + z-index: 0; + opacity: .5; + } + + .bannerRow .bannerImage img { + width: 100vw; + } + + .bannerRow .bannerImageBg { + display: none;; + } +} diff --git a/docs/.vuepress/styles/index.scss b/docs/.vuepress/styles/index.scss index a65b9e6e5aa..e5454dfb118 100644 --- a/docs/.vuepress/styles/index.scss +++ b/docs/.vuepress/styles/index.scss @@ -215,6 +215,33 @@ iframe { max-width: var(--max-width); } + +@media screen and (max-width: 768px) { + #navbar { + .vp-navbar-center { + display: none; + } + .vp-navbar-end { + flex: 1; + & > * { + margin: 0 !important; + } + #docsearch-container ~ div { + flex: 1; + } + .DocSearch { + width: 100%; + } + } + } + + .theme-container .vp-page { + padding-inline-start: 0; + } +} + + + html[data-theme="dark"] { --dark-grey: #fff; --primary-color: var(--theme-color); diff --git a/docs/README.md b/docs/README.md index 56216e891c8..d3ce8e6ad6f 100644 --- a/docs/README.md +++ b/docs/README.md @@ -14,7 +14,7 @@ photoSwipe: false
-
+
Learn how to build with SubQuery @@ -30,7 +30,7 @@ photoSwipe: false >
-
+
Our Most Popular Guides -
+
-
+
Build with SubQuery's Indexer SDK The SubQuery Data indexer is a open-source data indexer that provides you with custom APIs for your web3 project across all of our supported chains.
@@ -49,7 +49,7 @@ photoSwipe: false
Advanced Features from the Best Multi-chain Indexer We built the best, fully-featured indexer, so you don’t have to! -
+
{{ item.title }} @@ -60,20 +60,26 @@ photoSwipe: false
-
+
The SubQuery Network Say goodbye to relying on centralised service providers, we’re building the most open, performant, reliable and scalable data service for dApp developers. After publishing your project to the SubQuery Network, anyone can index and host it — providing data to users around the world faster and reliably.
- -
- +
@@ -82,6 +88,21 @@ photoSwipe: false