-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #237 from Lemoncode/epic/new-template-html
merged Epic/new template html
- Loading branch information
Showing
114 changed files
with
1,103 additions
and
145 deletions.
There are no files selected for viewing
This file contains 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 +1 @@ | ||
export * from './modal.component' | ||
export * from './modal.component'; |
This file contains 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 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
1 change: 1 addition & 0 deletions
1
apps/react-app/src/pods/template-export/components/customSelectColor/components/index.ts
This file contains 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 @@ | ||
export * from './inputRadioButton.component'; |
22 changes: 22 additions & 0 deletions
22
...ds/template-export/components/customSelectColor/components/inputRadioButton.component.tsx
This file contains 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,22 @@ | ||
import { HexColor, ColorTheme } from '@lemoncode/manfred2html'; | ||
import * as classes from './inputRadioButton.styles'; | ||
|
||
interface Props { | ||
value: ColorTheme; | ||
hexColor: HexColor; | ||
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void; | ||
} | ||
|
||
export const InputRadioButton: React.FC<Props> = ({ value, hexColor, onChange }) => { | ||
return ( | ||
<input | ||
type="radio" | ||
id={value} | ||
name="color" | ||
value={value} | ||
className={classes.inputRadioButton(hexColor)} | ||
onChange={onChange} | ||
defaultChecked={value === 'default'} | ||
/> | ||
); | ||
}; |
17 changes: 17 additions & 0 deletions
17
...c/pods/template-export/components/customSelectColor/components/inputRadioButton.styles.ts
This file contains 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,17 @@ | ||
import { css } from '@emotion/css'; | ||
import { theme } from '@/core/theme'; | ||
|
||
export const inputRadioButton = (color: string) => css` | ||
appearance: none; | ||
width: 82px; | ||
height: 82px; | ||
box-shadow: 8px 8px 16px 0px rgba(0, 0, 0, 0.25); | ||
border-radius: 50%; | ||
background-color: ${color}; | ||
cursor: pointer; | ||
outline: none; | ||
border: 15px solid ${theme.palette.info[50]}; | ||
&[type='radio']:checked { | ||
box-shadow: 0px 0px 0px 4px ${theme.palette.dark[200]}; | ||
} | ||
`; |
This file contains 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 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 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 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 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
4 changes: 0 additions & 4 deletions
4
packages/manfred2html/src/engine/html-parts/html-document-start/html-document-start.part.ts
This file was deleted.
Oops, something went wrong.
This file contains 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,57 +1,20 @@ | ||
import { ManfredAwesomicCV, ExportHTMLSettings } from '@/model'; | ||
import { | ||
generateHtmlDocumentStart, | ||
generateHtmlDocumentEnd, | ||
generateHeaderElementStart, | ||
generateHeaderElementEnd, | ||
generateAboutMeSection, | ||
generateAsideElementStart, | ||
generateAsideElementEnd, | ||
generateRelevantsLinksSection, | ||
generateLanguageSection, | ||
generateHardSkillsSection, | ||
generateSoftSkillsSection, | ||
generateMainElementStart, | ||
generateMainElementEnd, | ||
generateExperiencesSection, | ||
generateStudiesSection, | ||
} from './html-parts'; | ||
import { mapExportHTMLSettingsToSettings } from '@/mappers'; | ||
import { exportManfredJSonToHTMLTemplateA } from './template-a'; | ||
import { exportManfredJSonToHTMLTemplateB } from './template-b'; | ||
|
||
export const exportManfredJSonToHTML = ( | ||
export const exportHTMLTemplate = ( | ||
manfredJsonContent: ManfredAwesomicCV, | ||
exportHTMLSettings: ExportHTMLSettings | ||
): string => { | ||
const htmlDocumentStart = generateHtmlDocumentStart(exportHTMLSettings.primaryColor); | ||
const htmlDocumentEnd = generateHtmlDocumentEnd(); | ||
const headerElementStart = generateHeaderElementStart(); | ||
const headerElementEnd = generateHeaderElementEnd(); | ||
const aboutMeSection = generateAboutMeSection(manfredJsonContent); | ||
const asideElementStart = generateAsideElementStart(); | ||
const asideElementEnd = generateAsideElementEnd(); | ||
const relevantsLinksSection = generateRelevantsLinksSection(manfredJsonContent); | ||
const mainElementStart = generateMainElementStart(); | ||
const mainElementEnd = generateMainElementEnd(); | ||
const languageSection = generateLanguageSection(manfredJsonContent); | ||
const hardSkillsSection = generateHardSkillsSection(manfredJsonContent); | ||
const softSkillsSection = generateSoftSkillsSection(manfredJsonContent); | ||
const experienceSection = generateExperiencesSection(manfredJsonContent); | ||
const studiesSection = generateStudiesSection(manfredJsonContent); | ||
const settings = mapExportHTMLSettingsToSettings(exportHTMLSettings); | ||
|
||
return ` | ||
${htmlDocumentStart} | ||
${headerElementStart} | ||
${aboutMeSection} | ||
${headerElementEnd} | ||
${asideElementStart} | ||
${relevantsLinksSection} | ||
${languageSection} | ||
${hardSkillsSection} | ||
${softSkillsSection} | ||
${asideElementEnd} | ||
${mainElementStart} | ||
${experienceSection} | ||
${studiesSection} | ||
${mainElementEnd} | ||
${htmlDocumentEnd} | ||
`; | ||
switch (settings.template) { | ||
case 'default': | ||
return exportManfredJSonToHTMLTemplateA(manfredJsonContent, settings); | ||
case 'CV-1': | ||
return exportManfredJSonToHTMLTemplateB(manfredJsonContent, settings); | ||
default: | ||
throw new Error('Template not found'); | ||
} | ||
}; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
...ml-document-start/html-document-start.ejs → ...ml-document-start/html-document-start.ejs
This file contains 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
5 changes: 5 additions & 0 deletions
5
...red2html/src/engine/template-a/html-parts/html-document-start/html-document-start.part.ts
This file contains 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,5 @@ | ||
import ejs from 'ejs'; | ||
import { HexColor } from '@/model'; | ||
import htmlDocumentStartTemplate from './html-document-start.ejs?raw'; | ||
|
||
export const generateHtmlDocumentStart = (color: HexColor): string => ejs.render(htmlDocumentStartTemplate, { color }); |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.