Skip to content

Commit 7a765dd

Browse files
authored
feat: phone and table rendering for main DevPortal page (#71)
# Description Render responsive design for phone & tablet. - Closes #33 ## Screenshot(s) <img width="378" alt="image" src="https://github.com/user-attachments/assets/0535423c-2327-42fb-9d10-a9d4517a7125"> <img width="378" alt="image" src="https://github.com/user-attachments/assets/36297975-8722-47a1-9da6-3b66b253f196"> <img width="378" alt="image" src="https://github.com/user-attachments/assets/7c371658-3718-4272-a358-304585d4fbeb"> - [x] New Feature # How to Test? 1. Pull and run locally 2. Go to "Developer Portal" page 3. See that the design at different sizes responds appropriately # Checklist: - [x] I have performed a self-review of my code - [x] I have commented my code & PR, particularly in hard-to-understand areas - [x] I have checked at all the breakpoints to make sure it works on all screen sizes
1 parent 3a993b9 commit 7a765dd

File tree

8 files changed

+126
-76
lines changed

8 files changed

+126
-76
lines changed

package-lock.json

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"svelte": "^5.1.3",
4040
"svelte-check": "^4.0.5",
4141
"tailwindcss": "^3.4.14",
42+
"tailwindcss-debug-screens": "^2.2.1",
4243
"tslib": "^2.8.0",
4344
"typescript": "^5.6.3",
4445
"typescript-eslint": "^8.11.0",

src/components/HAccordion.svelte

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
1717
let { isOpen = $bindable(false), sectionNumber, sectionLabel, iconSrc, children, url }: HAccordionProps = $props();
1818
19+
let isEven: boolean = parseInt(sectionNumber, 10) % 2 === 0;
20+
let textAlignClasses = `lg:text-left vertical-md:text-left ${isEven ? 'text-right' : ''}`;
21+
let borderClasses = `lg:border-l-[1.5px] lg:pl-f12 lg:border-r-0 lg:pr-3 vertical-md:border-l-[1.5px] vertical-md:pl-f12 vertical-md:border-r-0 vertical-md:pr-3 ${isEven ? 'border-r-[1.5px] pr-f12' : 'border-l-[1.5px] pl-f12'}`;
22+
let contentAlignClasses = `lg:justify-normal vertical-md:justify-normal ${isEven ? 'justify-end' : ''}`;
23+
1924
function toggle() {
2025
if (!isOpen) {
2126
isOpen = true;
@@ -29,31 +34,39 @@
2934
<div
3035
id={`explore_${sectionNumber}`}
3136
onclick={toggle}
32-
class={`w-min-[150px] m:pr-3 flex cursor-pointer flex-col border-l-[1.5px] border-grayBorder border-opacity-25 pl-3 transition-all lg:pr-3 ${isOpen ? 'w-f320' : 'w-[132px]'}`}
37+
class="{`lg:w-min-[150px] vertical-md:w-min-[150px] flex cursor-pointer flex-col ${borderClasses} border-grayBorder px-f32 lg:transition-all vertical-md:transition-all ${isOpen ? 'lg:w-f320 vertical-md:w-f320' : 'lg:w-[132px] vertical-md:w-[132px]'}`}}"
3338
>
34-
<span class="-mt-[9px] text-clip text-nowrap font-title text-h3 font-normal text-white"
35-
>.{parseInt(sectionNumber, 10).toString().padStart(2, '0')}</span
36-
>
39+
<div class={`-mt-[9px] text-clip text-nowrap font-title text-h3 font-normal text-white ${textAlignClasses}`}>
40+
.{parseInt(sectionNumber, 10).toString().padStart(2, '0')}
41+
</div>
3742
{#if iconSrc}
38-
<div id={`explore_${sectionNumber}_icon`} class="pt-[6px]">
43+
<div
44+
id={`explore_${sectionNumber}_icon`}
45+
class={`flex w-full flex-row pt-[6px] lg:justify-normal vertical-md:justify-normal ${contentAlignClasses} `}
46+
>
3947
<img src={iconSrc as string} alt="" class="h-[65px] w-[65px]" />
4048
</div>
4149
{/if}
42-
<div id={`explore_${sectionNumber}_label`} class="pt-6">
43-
<span class="text-clip text-wrap font-title text-h6 font-normal text-white">
44-
{@render sectionLabel()}
45-
</span>
50+
<div
51+
id={`explore_${sectionNumber}_label`}
52+
class={`text-clip text-wrap pt-6 font-title text-h6 font-normal text-white ${textAlignClasses}`}
53+
>
54+
{@render sectionLabel()}
4655
</div>
4756

48-
<div class={`transition-all ${isOpen ? 'block' : 'hidden'}`}>
57+
<div
58+
class={`lg:transition-all vertical-md:transition-all ${isOpen ? 'block' : 'block lg:hidden vertical-md:hidden'}`}
59+
>
4960
<div
5061
id={`explore_${sectionNumber}_content`}
51-
class={`lg:max-w-auto m:max-w-[280px] sm max-h-f224 overflow-hidden pb-f12 pt-4 text-white sm:max-w-[515px] sm:pr-f8 lg:max-w-[280px] lg:pl-0`}
62+
class={`sm max-h-f224 max-w-[515px] overflow-hidden pb-f12 pl-0 pr-f8 pt-4 text-white md:max-w-full lg:max-w-[280px] vertical-md:max-w-[280px] ${textAlignClasses}`}
5263
>
5364
{@render children()}
5465
</div>
55-
<Button id={`explore_${sectionNumber}_button`} size="xs" type="primary" href={url} target="_blank">
56-
<span class=" text-xs text-black">Learn</span> <img src={Vector} width="12px" height="12px" alt="" />
57-
</Button>
66+
<div class={`flex flex-row ${contentAlignClasses}`}>
67+
<Button id={`explore_${sectionNumber}_button`} size="xs" type="primary" href={url} target="_blank">
68+
<span class=" text-xs text-black">Learn</span> <img src={Vector} width="12px" height="12px" alt="" />
69+
</Button>
70+
</div>
5871
</div>
5972
</div>

src/routes/+layout.svelte

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,26 @@
11
<script lang="ts">
2+
import { type Snippet } from 'svelte';
23
import Header from '../components/Header/Header.svelte';
34
import { Footer } from '@frequency-chain/style-guide';
5+
6+
let { children } = $props();
7+
const debugScreens = false; // set to true to enable debugging CSS size breaks
48
</script>
59

6-
<Header />
7-
<div class="w-full">
8-
<slot />
9-
</div>
10-
<div class="w-full bg-navy px-[5%] lg:px-[20%]">
11-
<Footer type="dark" class="w-full border-grayBorder border-opacity-25 vertical-lg:w-[100%]" />
12-
</div>
10+
{#snippet mainPage(content: Snippet)}
11+
<Header />
12+
<div class="w-full">
13+
{@render content()}
14+
</div>
15+
<div class="w-full bg-navy px-[5%] lg:px-[20%]">
16+
<Footer type="dark" class="w-full border-grayBorder vertical-lg:w-[100%]" />
17+
</div>
18+
{/snippet}
19+
20+
{#if debugScreens}
21+
<div class="debug-screens">
22+
{@render mainPage(children)}
23+
</div>
24+
{:else}
25+
{@render mainPage(children)}
26+
{/if}

src/routes/docs/components/DocsMain.svelte

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
import DocsMainImage from './DocsMainImage.svelte';
33
</script>
44

5-
<section class="freq-container flex sm:flex-col lg:min-h-[800px] lg:flex-row">
6-
<div class="sm:w-full lg:block lg:w-1/2">
5+
<section class="freq-container flex flex-col lg:min-h-[800px] lg:flex-row vertical-md:flex-row">
6+
<div class="vertical-md::w-1/2 block w-full justify-center lg:w-1/2 lg:justify-start vertical-md:justify-start">
77
<DocsMainImage />
88
</div>
9-
<div class="flex flex-col gap-6 sm:pt-f32 lg:w-1/2 lg:pt-f224">
10-
<h2 class=" title-75 text-navy sm:text-h2">Get Started with Frequency Development</h2>
9+
<div class="flex flex-col gap-6 pt-f32 lg:w-1/2 lg:pt-f224 vertical-md:pt-f224">
10+
<h2 class=" title-75 text-h2 text-navy">Get Started with Frequency Development</h2>
1111
<p class="body text-h5 font-bold text-black sm:text-normal">
1212
Frequency offers a variety of open source tools and documentation in the Developers Portal to help you rapidly get
1313
applications up and running on Frequency.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<!-- Desktop -->
22
<div
3-
class="relative w-full bg-[url(/src/lib/assets/dev-portal.svg)] bg-cover bg-center bg-no-repeat sm:h-[300px] lg:h-full"
3+
class="relative min-h-[300px] w-full bg-[url(/src/lib/assets/dev-portal.svg)] bg-cover bg-center bg-no-repeat md:mt-0 md:min-h-[600px]
4+
lg:h-full"
45
></div>

src/routes/docs/components/Explore.svelte

Lines changed: 54 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,12 @@
2626

2727
<div
2828
id="explore_section"
29-
class="mt-f96 flex w-full flex-row bg-navy sm:px-f64 sm:py-f80 lg:px-f128 lg:py-f96 vertical-lg:min-h-[550-px] vertical-lg:w-[100%]"
29+
class="freq-container mt-f96 flex w-full flex-col gap-f12 sm:pt-f20 lg:flex-row lg:gap-0 lg:bg-navy lg:px-f128 lg:py-f96 vertical-lg:min-h-[550-px] vertical-lg:w-[100%] vertical-md:flex-row vertical-md:gap-0"
3030
>
31-
<div id="explore_description" class="relative flex flex-row bg-navy pr-f12 text-teal vertical-lg:min-h-[550px]">
31+
<div
32+
id="explore_description"
33+
class="relative flex flex-row bg-navy pr-f12 text-teal sm:px-f32 vertical-lg:min-h-[550px]"
34+
>
3235
<div class="flex flex-col gap-f32">
3336
<span class="h1 mt-f8 text-clip text-wrap font-title font-normal">Explore &amp; Build</span>
3437

@@ -50,55 +53,57 @@
5053
</div>
5154

5255
<!-- min width selected based on description section + 1 open accordion + 3 closed accordions -->
53-
<div class="flex flex-row lg:min-w-[716px]">
54-
<HAccordion
55-
sectionNumber="1"
56-
iconSrc={ProviderIcon}
57-
on:toggled={handleToggled}
58-
bind:isOpen={sectionOpenStates[1]}
59-
url="https://docs.frequency.xyz/Guides/BecomeAProvider.html"
60-
>
61-
{#snippet sectionLabel()}Quick Start/<br />Become a Provider{/snippet}
62-
In 5 minutes, you can become a provider, set up the Social App Template Example Application that uses Gateway Services.
63-
This will give you a quick introduction to a working integration with Gateway Services and a starting place to explore
64-
the possibilities.
65-
</HAccordion>
56+
<div class="w-full bg-navy sm:px-f32 sm:py-f16">
57+
<div class="flex flex-col gap-f4 lg:min-w-[716px] lg:flex-row vertical-md:flex-row">
58+
<HAccordion
59+
sectionNumber="1"
60+
iconSrc={ProviderIcon}
61+
on:toggled={handleToggled}
62+
bind:isOpen={sectionOpenStates[1]}
63+
url="https://docs.frequency.xyz/Guides/BecomeAProvider.html"
64+
>
65+
{#snippet sectionLabel()}Quick Start/<br />Become a Provider{/snippet}
66+
In 5 minutes, you can become a provider, set up the Social App Template Example Application that uses Gateway Services.
67+
This will give you a quick introduction to a working integration with Gateway Services and a starting place to explore
68+
the possibilities.
69+
</HAccordion>
6670

67-
<HAccordion
68-
sectionNumber="2"
69-
iconSrc={GatewayIcon}
70-
on:toggled={handleToggled}
71-
bind:isOpen={sectionOpenStates[2]}
72-
url="https://docs.frequency.xyz/Guides/Gateway.html"
73-
>
74-
{#snippet sectionLabel()}Frequency<br />Gateway{/snippet}
75-
is a collection of easy-to-deploy: microservices that provide simple REST APIs for interacting with Frequency. Configure
76-
and deploy only the components you need, including.
77-
</HAccordion>
71+
<HAccordion
72+
sectionNumber="2"
73+
iconSrc={GatewayIcon}
74+
on:toggled={handleToggled}
75+
bind:isOpen={sectionOpenStates[2]}
76+
url="https://docs.frequency.xyz/Guides/Gateway.html"
77+
>
78+
{#snippet sectionLabel()}Frequency<br />Gateway{/snippet}
79+
is a collection of easy-to-deploy microservices that provide simple REST APIs for interacting with Frequency. Configure
80+
and deploy only the components you need.
81+
</HAccordion>
7882

79-
<HAccordion
80-
sectionNumber="3"
81-
iconSrc={SsoIcon}
82-
on:toggled={handleToggled}
83-
bind:isOpen={sectionOpenStates[3]}
84-
url="https://docs.frequency.xyz/Guides/SSO.html"
85-
>
86-
{#snippet sectionLabel()}Add Single<br />Sign-on to<br />your App{/snippet}
87-
SIWF provides comprehensive documentation and tools to integrate with Frequency Access, an easy-to-use single sign-on
88-
identity solution for users on Frequency. SIWF simplifies the authentication process, allowing users to access the
89-
entire Frequency ecosystem effortlessly while maintaining control over their personal data.</HAccordion
90-
>
83+
<HAccordion
84+
sectionNumber="3"
85+
iconSrc={SsoIcon}
86+
on:toggled={handleToggled}
87+
bind:isOpen={sectionOpenStates[3]}
88+
url="https://docs.frequency.xyz/Guides/SSO.html"
89+
>
90+
{#snippet sectionLabel()}Add Single<br />Sign-on to<br />your App{/snippet}
91+
SIWF provides comprehensive documentation and tools to integrate with Frequency Access, an easy-to-use single sign-on
92+
identity solution for users on Frequency. SIWF simplifies the authentication process, allowing users to access the
93+
entire Frequency ecosystem effortlessly while maintaining control over their personal data.</HAccordion
94+
>
9195

92-
<HAccordion
93-
sectionNumber="4"
94-
iconSrc={CoreIcon}
95-
on:toggled={handleToggled}
96-
bind:isOpen={sectionOpenStates[4]}
97-
url="https://docs.frequency.xyz/"
98-
>
99-
{#snippet sectionLabel()}Frequency<br />Core{/snippet}
100-
Here you will find detailed information about the building blocks of Frequency including technical overviews, advanced
101-
tutorials, API documentation, code samples and more–everything you need to build your first Frequency application.</HAccordion
102-
>
96+
<HAccordion
97+
sectionNumber="4"
98+
iconSrc={CoreIcon}
99+
on:toggled={handleToggled}
100+
bind:isOpen={sectionOpenStates[4]}
101+
url="https://docs.frequency.xyz/"
102+
>
103+
{#snippet sectionLabel()}Frequency<br />Core{/snippet}
104+
Here you will find detailed information about the building blocks of Frequency including technical overviews, advanced
105+
tutorials, API documentation, code samples and more&mdash;everything you need to build your first Frequency application.</HAccordion
106+
>
107+
</div>
103108
</div>
104109
</div>

tailwind.config.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
/** @type {import('tailwindcss').Config} */
22
import frequencyConfig from '@frequency-chain/style-guide/tailwind.config';
3+
import debugScreens from 'tailwindcss-debug-screens';
34

45
import { MAX_PAGE_WIDTH } from './src/lib/consts';
56

67
export default {
78
content: ['./src/**/*.{html,js,svelte,ts}', './node_modules/@frequency-chain/style-guide/**/*.{html,js,svelte,ts}'],
89
theme: {
10+
debugScreens: {
11+
ignore: ['vertical', 'horizontal'],
12+
},
913
extend: {
1014
fontFamily: {
1115
title: ['Newake', 'sans-serif'],
@@ -17,7 +21,7 @@ export default {
1721
colors: {
1822
darkIndigo: '#445BC3',
1923
tealBright: '#00B6AF',
20-
grayBorder: '#E5E7E7',
24+
grayBorder: '#C8CDD0',
2125
},
2226
width: {
2327
page: `${MAX_PAGE_WIDTH}px`,
@@ -37,5 +41,6 @@ export default {
3741
},
3842
},
3943
safelist: ['after:bg-navy', 'after:bg-cream', 'invalid:border-red'],
44+
plugins: [debugScreens],
4045
presets: [frequencyConfig],
4146
};

0 commit comments

Comments
 (0)