-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add results page #6
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
959e127
feat: update welcome panel text
arnest00 36141a8
fix: apply welcome panel css correctly
arnest00 8bc4ca2
feat: add results panel HTML and CSS
arnest00 3ced62f
feat: add logic to navigate between welcome and results panels
arnest00 b50a5f9
fix: update results.css location
arnest00 1e02add
fix: only one panel open at a time
arnest00 29b6495
fix: unable to scroll on smaller browser window
arnest00 7cd774f
fix: match CSS to `main`
arnest00 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8"> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
| </head> | ||
| <body> | ||
| <div id="cv-panel-content"> | ||
| <header class="cv-panel__header"> | ||
| <h1 class="cv-panel__title">Carbon Visualizer</h1> | ||
| </header> | ||
|
|
||
| <main class="cv-panel__content"> | ||
| <div class="cv-results"> | ||
| <div class="cv-results__icon"> | ||
| 🌱 | ||
| </div> | ||
| <h2 class="cv-results__title">Results</h2> | ||
| <p class="cv-results__description"> | ||
| This is where you'd see the results of the analysis. Coming soon! | ||
| </p> | ||
|
|
||
| <button class="cv-btn cv-btn--primary" id="back-to-welcome-btn"> | ||
| Analyze another page | ||
| </button> | ||
| </div> | ||
| </main> | ||
| </div> | ||
| </body> | ||
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| // Results panel JavaScript | ||
| import { extensionManager } from "../../core/ExtensionManager.js"; | ||
|
|
||
| export function initializePanel(panelType, data) { | ||
| // Get the container element | ||
| const container = data.container; | ||
|
|
||
| if (!container) { | ||
| return; | ||
| } | ||
|
|
||
| // Get back to welcome button from within the container | ||
| const backToWelcomeBtn = container.querySelector('#back-to-welcome-btn'); | ||
|
|
||
| // Check if button exists before adding event listener | ||
| if (!backToWelcomeBtn) { | ||
| return; | ||
| } | ||
|
|
||
| // Event listener for back to welcome button | ||
| backToWelcomeBtn.addEventListener('click', async () => { | ||
| await extensionManager.openPanel('welcome'); | ||
| }); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
|
|
||
| /* Results panel variant styles */ | ||
|
|
||
| .cv-panel--results { | ||
| text-align: center; | ||
| background: linear-gradient(to bottom,var(--cv-primary-green-10), var(--cv-primary-green-70) 80%); | ||
| color: var(--cv-white); | ||
| } | ||
|
|
||
| .cv-results__icon { | ||
| font-size: 3rem; | ||
| margin-bottom: 1rem; | ||
| } | ||
|
|
||
| .cv-results__title { | ||
| margin: 0 0 1rem 0; | ||
| font-size: 1.25rem; | ||
| font-weight: 600; | ||
| color: var(--cv-white); | ||
| } | ||
|
|
||
| .cv-results__description { | ||
| margin: 0 0 2rem 0; | ||
| color: var(--cv-white); | ||
| line-height: 1.5; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noting that the button from the welcome panel (and all of the other welcome panel elements) are still in the DOM when I'm on the results panel because the welcome panel is still open, would we want to remove those? Maybe over here when we open the results panel, also close the panel? (I think that may visually animate the welcome panel to slide out then slide in the results panel though, is that undesirable?)