Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sidebar for desktop layout on landing #1705

Closed
wants to merge 33 commits into from
Closed
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
604018d
add basic sidebar
meodai Jun 13, 2023
1de7159
🤖 Selenium screenshots auto-update
github-actions[bot] Jun 13, 2023
c1bf741
add dapps visual to sidebar
meodai Jun 19, 2023
f4b9b0b
Merge branch 'da-desktop-layout' of github.com:dfinity/internet-ident…
meodai Jun 19, 2023
f5dfc9c
make footer reponsive
meodai Jun 19, 2023
3ed4224
🤖 Selenium screenshots auto-update
github-actions[bot] Jun 19, 2023
8bba51a
Merge branch 'main' into da-desktop-layout
meodai Jun 19, 2023
b4a5f61
Merge branch 'da-desktop-layout' of github.com:dfinity/internet-ident…
meodai Jun 19, 2023
d1ff244
🤖 Selenium screenshots auto-update
github-actions[bot] Jun 19, 2023
689555c
Merge branch 'main' into da-desktop-layout
meodai Jun 19, 2023
c304ab2
🤖 Selenium screenshots auto-update
github-actions[bot] Jun 19, 2023
44d3c45
move sidebar contets to authenticateBox
meodai Jun 20, 2023
7119013
make sure logo is not shown when there is a sidebar
meodai Jun 20, 2023
ac8d927
Merge branch 'da-desktop-layout' of github.com:dfinity/internet-ident…
meodai Jun 20, 2023
f7d84bd
🤖 Selenium screenshots auto-update
github-actions[bot] Jun 20, 2023
7411b51
Merge branch 'main' into da-desktop-layout
meodai Jun 20, 2023
ce61f70
Dump screenshots
nmattia Jun 20, 2023
d083371
hide the sidebar so the logo is still accessible
meodai Jun 22, 2023
d3632fa
fix width of wide content
meodai Jun 22, 2023
c822f8e
fix duplicate logo id issue
meodai Jun 22, 2023
fd6d9d9
format
meodai Jun 22, 2023
09a00b7
revert width instead of min-max width
meodai Jun 22, 2023
5e85ea3
replace max and min width with width
meodai Jun 22, 2023
8226c0f
atempt to fix test
meodai Jun 22, 2023
beb39d3
adapt test so elements are scrolled into view before they are clicked
meodai Jun 22, 2023
c1ff328
adapt test so elements are scrolled into view before they are clicked
meodai Jun 22, 2023
623596a
prettier
meodai Jun 22, 2023
7416cb2
fix click tests
meodai Jun 22, 2023
feb89bd
fix click tests
meodai Jun 22, 2023
9c09619
fix click tests
meodai Jun 22, 2023
2a04e18
fix click tests
meodai Jun 22, 2023
684636f
fix click test
meodai Jun 22, 2023
0a581b9
wip
nmattia Jun 22, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified screenshots/desktop/authorizeNew.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/desktop/authorizeNewAlt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/desktop/authorizeNewAlt_open.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/desktop/authorizeNewKnown.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/desktop/authorizeNewKnownAlt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/desktop/authorizeNewKnownAlt_open.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/desktop/authorizeNewKnown_open.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/desktop/authorizePick.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/desktop/authorizePickMany.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/desktop/authorizeUseExisting.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/desktop/authorizeUseExistingKnown.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/desktop/authorizeUseExistingKnownAlt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/desktop/authorizeUseExistingKnownAlt_open.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/desktop/authorizeUseExistingKnown_open.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/desktop/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/desktop/compatibilityNotice.png
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's some padding/spacing that went missing here!

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/desktop/confirmSeedPhrase.png
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the whole page got narrower here, is that expected?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch! Il investigate!

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/desktop/displayError.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/desktop/displaySeedPhrase.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/desktop/landing_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/desktop/landing_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/desktop/landing_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/desktop/landing_4.png
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's a footer issue here; plus shouldn't there be a sidebar?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is an issue with position fixed on the screenshot thingy, at least it works in real life.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/desktop/manageNew.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/desktop/managePick.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/desktop/manageUseExisting.png
Binary file modified screenshots/desktop/recoverWithPhrase.png
Binary file modified screenshots/desktop/registerDisabled.png
Binary file modified screenshots/desktop/showSpinner.png
Binary file modified screenshots/mobile/addDeviceSuccess.png
Binary file modified screenshots/mobile/addPhrase.png
Binary file modified screenshots/mobile/addPhraseWarning.png
Binary file modified screenshots/mobile/authorizeNew.png
Binary file modified screenshots/mobile/authorizeNewAlt.png
Binary file modified screenshots/mobile/authorizeNewAlt_open.png
Binary file modified screenshots/mobile/authorizeNewKnown.png
Binary file modified screenshots/mobile/authorizeNewKnownAlt.png
Binary file modified screenshots/mobile/authorizeNewKnownAlt_open.png
Binary file modified screenshots/mobile/authorizeNewKnown_open.png
Binary file modified screenshots/mobile/authorizePick.png
Binary file modified screenshots/mobile/authorizePickMany.png
Binary file modified screenshots/mobile/authorizeUseExisting.png
Binary file modified screenshots/mobile/authorizeUseExistingKnown.png
Binary file modified screenshots/mobile/authorizeUseExistingKnownAlt.png
Binary file modified screenshots/mobile/authorizeUseExistingKnownAlt_open.png
Binary file modified screenshots/mobile/authorizeUseExistingKnown_open.png
Binary file modified screenshots/mobile/banner.png
Binary file modified screenshots/mobile/compatibilityNotice.png
Binary file modified screenshots/mobile/confirmSeedPhrase.png
Binary file modified screenshots/mobile/dappsExplorer.png
Binary file modified screenshots/mobile/deviceRegistrationDisabledInfo.png
Binary file modified screenshots/mobile/displayError.png
Binary file modified screenshots/mobile/displayManage.png
Binary file modified screenshots/mobile/displayManageSingle.png
Binary file modified screenshots/mobile/displaySeedPhrase.png
Binary file modified screenshots/mobile/displayUserNumber.png
Binary file modified screenshots/mobile/landing_1.png
Binary file modified screenshots/mobile/landing_2.png
Binary file modified screenshots/mobile/landing_3.png
Binary file modified screenshots/mobile/landing_4.png
Binary file added screenshots/mobile/landing_5.png
Binary file modified screenshots/mobile/manageNew.png
Binary file modified screenshots/mobile/managePick.png
Binary file modified screenshots/mobile/manageUseExisting.png
Binary file modified screenshots/mobile/pickRecoveryDevice.png
Binary file modified screenshots/mobile/pollForTentativeDevicePage.png
Binary file modified screenshots/mobile/promptCaptcha.png
Binary file modified screenshots/mobile/promptCaptchaReady.png
Binary file modified screenshots/mobile/promptDeviceAlias.png
Binary file modified screenshots/mobile/promptUserNumber.png
Binary file modified screenshots/mobile/recoverWithDevice.png
Binary file modified screenshots/mobile/recoverWithPhrase.png
Binary file modified screenshots/mobile/registerDisabled.png
Binary file modified screenshots/mobile/savePasskey.png
Binary file modified screenshots/mobile/showMessage.png
Binary file modified screenshots/mobile/showSpinner.png
Binary file modified screenshots/mobile/showVerificationCode.png
Binary file modified screenshots/mobile/toasts.png
Binary file modified screenshots/mobile/verifyTentativeDevice.png
17 changes: 17 additions & 0 deletions src/frontend/src/components/authenticateBox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,21 @@ import { withLoader } from "./loader";
import { mainWindow } from "./mainWindow";
import { promptUserNumber } from "./promptUserNumber";

import { getDapps } from "$src/flows/dappsExplorer/dapps";
import { dappsHeader } from "$src/flows/dappsExplorer/teaser";
import { shuffleArray } from "$src/utils/utils";

import copyJson from "./authenticateBox.json";

/** dapps visual used in sidebar */
const dappsVisual = (): TemplateResult => {
const dapps = shuffleArray(getDapps());
return dappsHeader({
dapps,
clickable: false,
});
};

/** Template used for rendering specific authentication screens. See `authnPages` below
* for meaning of "firstTime", "useExisting" and "pick". */
export type AuthnTemplates = {
Expand Down Expand Up @@ -326,6 +339,10 @@ const page = (slot: TemplateResult) => {
slot: html` <!-- The title is hidden but used for accessibility -->
<h1 data-page="authenticate" class="is-hidden">Internet Identity</h1>
${slot}`,
slotSidebar: html`<h1 class="t-title t-title--main">
Securely connect to dapps on the Internet Computer
</h1>`,
slotSidebarDecoration: dappsVisual(),
});
const container = document.getElementById("pageContent") as HTMLElement;
render(template, container);
Expand Down
45 changes: 37 additions & 8 deletions src/frontend/src/components/mainWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,17 @@ import { icLogo } from "./icons";
*/
export const mainWindow = ({
slot,
slotSidebar,
slotSidebarDecoration,
id,
showFooter = true,
showLogo = true,
isWideContainer = false,
additionalContainerClasses = [],
}: {
slot: TemplateResult;
slotSidebar?: TemplateResult;
slotSidebarDecoration?: TemplateResult;
id?: string;
showFooter?: boolean;
showLogo?: boolean;
Expand All @@ -37,16 +41,41 @@ export const mainWindow = ({
if (additionalContainerClasses.length > 0) {
containerClasses.push(...additionalContainerClasses);
}

const wrapClasses = ["l-wrap"];

if (slotSidebar !== undefined) {
wrapClasses.push("l-wrap--sidebar");
}

return html`
<div
id="${ifDefined(id !== null ? id : undefined)}"
class="${containerClasses.join(" ")}"
>
${showLogo ? html`<div class="c-logo">${icLogo}</div>` : ""}
<div class="c-card c-card--background">
<div class="c-card c-card--highlight">${slot}</div>
<div class="${wrapClasses.join(" ")}">
${slotSidebar !== undefined
? html`<div class="l-sidebar">
<div class="l-sidebar__main">
${showLogo ? html`<div class="c-logo">${icLogo}</div>` : ""}
${slotSidebar}
</div>
${slotSidebarDecoration !== undefined
? html`<div class="l-sidebar__decoration">
${slotSidebarDecoration}
</div>`
: ""}
</div>`
: ""}
<div
id="${ifDefined(id !== null ? id : undefined)}"
class="${containerClasses.join(" ")}"
>
${showLogo && slotSidebar === undefined
? html`<div class="c-logo">${icLogo}</div>`
: ""}
<div class="c-card c-card--background">
<div class="c-card c-card--highlight">${slot}</div>
</div>
</div>
${showFooter ? footer : ""}
</div>
${showFooter ? footer : ""}
<!-- /.l-wrap -->
`;
};
63 changes: 57 additions & 6 deletions src/frontend/src/styles/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@
--vs-bezel: calc(var(--vs-gutter) * 2); /* 4 */
--vs-line: 1px; /* 5 */

--vs-gutter-relative: 5vmax;

--vs-line-height: 1.4;

--vs-border-radius: 0.8rem;
Expand Down Expand Up @@ -166,6 +168,9 @@
--rc-background: var(--rc-light);
--rc-background-transparent: var(--rc-light-transparent);

--rc-sidebar: var(--vc-brand-purple);
--rc-onSidebar: var(--vc-snow);

--rc-footer: var(--rc-dark);
--rc-onFooter: var(--rc-light);

Expand Down Expand Up @@ -239,6 +244,9 @@
--rg-brand-bruised: var(--vc-brand-blue) 50%, var(--vc-brand-purple) 90%;

/* reference tokens: sizes */
--rs-bezel-layout: var(--vs-gutter-relative);
--rs-bezel-sidebar: calc(var(--vs-gutter-relative) * 0.5);

--rs-inline-grid-gap: var(--vs-inline);
--rs-inline-icon-gap: var(--vs-inline);

Expand Down Expand Up @@ -602,28 +610,62 @@ a:hover,
width: 100%;
}

#pageContent,
.l-wrap {
position: relative;
display: flex;
flex-direction: column;
align-items: center;
min-height: 100vh;
padding: 5vmax;
padding: var(--rs-bezel-layout);
}

@media (max-width: 512px) {
#pageContent,
.l-wrap {
padding: var(--rs-card-bezel);
}
}

.l-wrap--sidebar {
--sidebar-width: calc(30rem + var(--rs-bezel-sidebar) * 2);
padding-left: var(--sidebar-width);
}

.l-sidebar {
position: fixed;
left: 0;
top: 0;
bottom: 0;
display: flex;
flex-direction: column;
width: calc(30rem + var(--rs-bezel-sidebar) * 2);
background: var(--rc-sidebar);
color: var(--rc-onSidebar);
padding: var(--rs-bezel-sidebar);
}

@media (max-width: 512px) {
.l-sidebar {
display: none;
}
}

.l-sidebar__main {
flex: 1;
display: flex;
flex-direction: column;
gap: 2rem;
}

.l-sidebar__decoration {
position: relative;
margin: 0 calc(var(--rs-bezel-sidebar) * -1)
calc(var(--rs-bezel-sidebar) * -1);
}

.l-container {
position: relative;
font-size: 1.6rem;
min-width: 40rem;
max-width: 40rem;
width: 40rem;
/* centers the container and adds a bit of space to make sure the footer does not stick to it */
margin: 0 auto 2rem;
}
Expand All @@ -645,6 +687,16 @@ a:hover,
right: 0;
}

.l-wrap--sidebar .l-footer {
left: var(--sidebar-width);
}

@media (max-width: 512px) {
.l-wrap--sidebar .l-footer {
left: 0;
}
}

/**
* Title with counter and Actions
*/
Expand Down Expand Up @@ -2364,7 +2416,6 @@ a.c-action-list__item {
/** responsiveness */

@media (max-width: 512px) {
#pageContent,
.l-wrap {
justify-content: flex-start;
padding: 0;
Expand Down