-
Notifications
You must be signed in to change notification settings - Fork 1
exercise page #93
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
Open
ramseycoder
wants to merge
5
commits into
master
Choose a base branch
from
ramsey/nan-20-page-dexercise
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
exercise page #93
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
f245043
add markdown file
ramseycoder 99cbe60
add: exercise page
ramseycoder db49dc8
fix: update exercise.jsx
ramseycoder 3ad8d5c
fix: adding margin and padding instead of
ramseycoder ba28c4f
fix: add review correction
ramseycoder 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,70 @@ | ||
| import { Span, Color, P, Div } from './elements.jsx' | ||
| import { css } from '../lib/dom.js' | ||
| import { NavLink } from './header.jsx' | ||
|
|
||
| css(` | ||
| li.mli { | ||
| display:block; | ||
| } | ||
|
|
||
| .warn { | ||
| outline: 1px dashed red; | ||
| padding: 0.8rem; | ||
| } | ||
|
|
||
| `) | ||
|
|
||
| export const MTitle = Object.fromEntries( | ||
| ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].map((el) => [ | ||
| el, | ||
| ({ children, ...props }) => | ||
| h( | ||
| el, | ||
| props, | ||
| <Color.Red style={{ marginRight: '1ch' }}> | ||
| {'#'.repeat(Number(el.slice(1)))} | ||
| </Color.Red>, | ||
| children, | ||
| ), | ||
| ]), | ||
| ) | ||
|
|
||
| export const MItalicWord = ({ children, color, type }) => { | ||
| return ( | ||
| <P> | ||
| <Color.Orange>{'>'}</Color.Orange> | ||
| <Color.CommentLighter>*</Color.CommentLighter> | ||
| <Span fg={color} style={{ fontStyle: 'italic' }}> | ||
| {children} | ||
| </Span> | ||
| <Color.CommentLighter>*</Color.CommentLighter> | ||
| {type === 'ps' && <Color.Orange>{'<'}</Color.Orange>} | ||
| </P> | ||
| ) | ||
| } | ||
|
|
||
| export const MLi = ({ children, link }) => { | ||
| let ColorIze = link ? Color.CyanDarker : Color.CommentLighter | ||
| return ( | ||
| <li class={`mli`}> | ||
| <NavLink href={link ? link : null} style={{ outline: !link && 'none' }}> | ||
| <Span | ||
| style={{ | ||
| padding: '0.1rem', | ||
| background: !link && 'rgba(75, 75, 75, 0.63)', | ||
| textDecoration: link && 'underline', | ||
| }} | ||
| fg={link ? 'cyan-darker' : 'white'} | ||
| > | ||
| <ColorIze>{link ? '[' : '`'}</ColorIze> | ||
| {children} | ||
| <ColorIze>{link ? ']' : '`'}</ColorIze> | ||
| </Span> | ||
| </NavLink> | ||
| </li> | ||
| ) | ||
| } | ||
|
|
||
| export const Warning = ({ children }) => { | ||
| return <Div class="warn">{children}</Div> | ||
| } | ||
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 |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| { | ||
| "name":"01 - Hello There", | ||
| "description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc sit amet dolor sit amet lectus consequat condimentum. Morbi ultrices vitae nulla a mollis. Suspendisse arcu leo, finibus in accumsan ut, ultrices dictum metus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Ut accumsan vitae nisi vel porttitor. Nullam hendrerit nibh a sapien sagittis dignissim. Fusce suscipit nisl vel eros volutpat venenatis. Duis nec vehicula magna. Sed varius dictum quam, ac tempus augue rhoncus ac.", | ||
| "instructions":["create a variable", "create a constante", "create a condition"], | ||
| "notions": ["Basics Programming","Loop","Iteraction"] | ||
| "name":"01-Hello There", | ||
| "description":"lorem ipsum", | ||
| "instructions":["do this", "do that","do like thaht"], | ||
| "notions":[{"name":"Loop","link":"/notions/js-loop"},{"name":"Variables","link":"/notions/js-variables"},{"name":"Conditions","link":"/notions/js-conditions"}] | ||
| } |
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 |
|---|---|---|
| @@ -1,134 +1,56 @@ | ||
| import { css } from '../lib/dom.js' | ||
| import { Main, Div, P } from '../component/elements.jsx' | ||
| import { name, description } from '../data/fakeExercise.json' | ||
| import { Div, P } from '../component/elements.jsx' | ||
| import { MTitle, MItalicWord, MLi, Warning } from '../component/markdown.jsx' | ||
| import exercise from '../data/fakeExercise.json' | ||
|
|
||
| css(` | ||
| .exercise{ | ||
| width:100%; | ||
| height: auto; | ||
| } | ||
|
|
||
| .exercise>h1 { | ||
| font-size: 2rem; | ||
| font-weight:bolder; | ||
| } | ||
|
|
||
|
|
||
|
|
||
| .exercise>hr { | ||
| width: 100%; | ||
| height:2px; | ||
| background: grey; | ||
| margin-top: 5px; | ||
| } | ||
|
|
||
| .exercise p.description { | ||
| white-space:normal !important; | ||
| background: #090c12a8; | ||
| color: grey; | ||
| margin: 10px auto; | ||
| padding:1rem; | ||
| border-radius:0.3rem; | ||
| } | ||
|
|
||
| .exercise .instructions h3{ | ||
| font-size:2rem; | ||
| .exercise h1,.exercise h3 { | ||
| font-weight: bolder; | ||
| } | ||
|
|
||
| .exercise .instructions ul { | ||
| margin-left:50px; | ||
| .exercise .instructions .description,.exercise .notions p{ | ||
| padding: 0.3rem; | ||
| } | ||
|
|
||
| .exercise .instructions ul li { | ||
| display:block; | ||
| margin:7px auto; | ||
| font-weight:bolder; | ||
| font-size:1.2rem; | ||
| } | ||
|
|
||
| .exercise .instructions ul li:before { | ||
| content:'👉'; | ||
| font-size: 1.5rem; | ||
| margin-right:10px; | ||
|
|
||
| } | ||
|
|
||
| .exercise .notions { | ||
| width:100%; | ||
| height: auto; | ||
| padding: 0.5rem; | ||
| border-radius: 0.7rem; | ||
| background:#110909; | ||
| margin-top: 18px; | ||
| } | ||
|
|
||
| .exercise .notions h1 { | ||
| font-size:1.7rem; | ||
| margin-top: -18px; | ||
| } | ||
|
|
||
| .exercise .notions h1 span { | ||
| color: yellow; | ||
| font-weight:bolder; | ||
| font-size: 3rem; | ||
| margin-right: 10px; | ||
| } | ||
|
|
||
| .exercise .notions p{ | ||
| white-space:normal !important; | ||
| font-size:1.2rem; | ||
| } | ||
|
|
||
| .exercise .notions ul { | ||
| margin-top: 10px; | ||
| } | ||
|
|
||
| .exercise .notions ul li { | ||
| display:block; | ||
| width:0px; | ||
| background: grey; | ||
| font-size:1rem; | ||
| margin: 7px 0; | ||
| cursor:pointer; | ||
| font-style:oblique; | ||
| } | ||
|
|
||
| .exercise .notions ul li:hover{ | ||
| color: skyblue; | ||
| font-weight:bolder; | ||
| } | ||
|
|
||
| .exercise .notions ul li:before{ | ||
| content:'🔗'; | ||
| font-size: 1rem; | ||
| } | ||
|
|
||
| `) | ||
| export const Exercise = () => ( | ||
| <Main> | ||
| export const Exercise = () => { | ||
| return ( | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. pareil ici utilise le return impllicite, ca reduit l'indentation d'un niveau |
||
| <Div class="exercise"> | ||
| <h1>✍ {name}</h1> | ||
| <hr /> | ||
| <P class="description">{description}</P> | ||
| <MTitle.h2>{exercise.name}</MTitle.h2> | ||
| {'\n'} | ||
| <Div class="instructions"> | ||
| <h3>📋 Instructions </h3> | ||
| <ul> | ||
| <li>do this</li> | ||
| <li>do that</li> | ||
| <li>do more</li> | ||
| </ul> | ||
| <MTitle.h3>Instructions</MTitle.h3> | ||
| {'\n'} | ||
| {exercise.description && ( | ||
| <P class="description">{exercise.description}</P> | ||
| )} | ||
| {'\n'} | ||
| {exercise.instructions && ( | ||
| <ul> | ||
| {exercise.instructions.map((key) => ( | ||
| <MLi key={key}>{key}</MLi> | ||
| ))} | ||
| </ul> | ||
| )} | ||
| </Div> | ||
| {'\n'} | ||
| <Div class="notions"> | ||
| <h1> | ||
| <span>⚠</span>Warning | ||
| </h1> | ||
| <P> to do this exercise you should know the following concepts : </P> | ||
| <ul> | ||
| <li> progession </li> | ||
| <li> progession </li> | ||
| <li> progession </li> | ||
| </ul> | ||
| <MTitle.h3>Warning</MTitle.h3> | ||
| {'\n'} | ||
| <Warning> | ||
| <MItalicWord color="red"> | ||
| To do this Exercise you should know the following concepts : | ||
| </MItalicWord> | ||
| {'\n'} | ||
| <ul> | ||
| {exercise.notions.map(({ name, link }) => ( | ||
| <MLi key={name} link={link}> | ||
| {name} | ||
| </MLi> | ||
| ))} | ||
| </ul> | ||
| </Warning> | ||
| </Div> | ||
| {'\n'} | ||
| </Div> | ||
| </Main> | ||
| ) | ||
| ) | ||
| } | ||
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.
pas besoin du
return {}ici, ca meriterais peu etre une classe au lieu du style direct ?