-
Notifications
You must be signed in to change notification settings - Fork 6
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 #26 from itsmartashub/feat/custom-fonts
Closes #22
- Loading branch information
Showing
18 changed files
with
968 additions
and
167 deletions.
There are no files selected for viewing
File renamed without changes.
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,101 @@ | ||
export function renderFontSmallCard({ | ||
name, | ||
className, | ||
inputId, | ||
inputType, | ||
inputValue, | ||
inputPlaceholder, | ||
min = 16, | ||
max = 24, | ||
unit = 'px', | ||
}) { | ||
return ` | ||
<div class="${className} card card--small" data-gpth-err="${min}${unit} ⇔ ${max}${unit}"> | ||
<label for="${inputId}" class="rounded-full flex items-center gap-2 h-full w-full"> | ||
<input type="${inputType}" id="${inputId}" value="${inputValue}" placeholder="${inputPlaceholder}" class="rounded-full outline-none border-none font-bold" minlength="${min}" maxlength="${max}"> | ||
<div class="card__unitname-wrapper"> | ||
<p class="card__unit rounded-full flex items-center justify-center">pixels</p> | ||
<p class="card__name uppercase font-semibold">${name}</p> | ||
</div> | ||
</label> | ||
</div>` | ||
} | ||
|
||
export function renderFontBigCard({ | ||
name, | ||
className, | ||
inputId, | ||
inputType, | ||
inputValue, | ||
inputPlaceholder, | ||
min = 0, | ||
max = 20, | ||
unit = 'px', | ||
}) { | ||
return ` | ||
<div class="${className} fonts__group card card--big h-full" data-gpth-err="${min}${unit} ⇔ ${max}${unit}"> | ||
<label for="${inputId}" class="grid gap-1 h-full w-full"> | ||
<div> | ||
<p class="card__unit card__icon">PX</p> | ||
<p class="card__name uppercase font-semibold">${name}</p> | ||
</div> | ||
<input type="${inputType}" id="${inputId}" value="${inputValue}" placeholder="${inputPlaceholder}" class="outline-none border-none focus:outline-none focus:border-none font-bold" minlength="${min}" maxlength="${max}"> | ||
</label> | ||
</div>` | ||
} | ||
|
||
// export function renderFontCard({ data, cardType = 'small', includeFields = [] }) { | ||
// const { name, className, inputId, inputType, inputValue, inputPlaceholder, min = 0, max = 24, unit = 'px' } = data | ||
|
||
// let cardHtml | ||
|
||
// if (cardType === 'small') { | ||
// cardHtml = ` | ||
// <div class="${className} card card--small" data-gpth-err="${min}${unit} ⇔ ${max}${unit}"> | ||
// <label for="${inputId}" class="rounded-full flex items-center gap-2 h-full w-full"> | ||
// ${ | ||
// includeFields.includes('input') | ||
// ? `<input type="${inputType}" id="${inputId}" value="${inputValue}" placeholder="${inputPlaceholder}" class="rounded-full outline-none border-none font-bold" minlength="${min}" maxlength="${max}">` | ||
// : '' | ||
// } | ||
|
||
// <div class="card__unitname-wrapper"> | ||
// <p class="card__unit rounded-full flex items-center justify-center">${unit}</p> | ||
// <p class="card__name uppercase font-semibold">${name}</p> | ||
// </div> | ||
// </label> | ||
// </div> | ||
// ` | ||
// } else if (cardType === 'big') { | ||
// cardHtml = ` | ||
// <div class="${className} fonts__group card card--big h-full" data-gpth-err="${min}${unit} ⇔ ${max}${unit}"> | ||
// <label for="${inputId}" class="grid gap-1 h-full w-full"> | ||
// <div> | ||
// <p class="card__unit card__icon">${unit.toUpperCase()}</p> | ||
// <p class="card__name uppercase font-semibold">${name}</p> | ||
// </div> | ||
|
||
// ${ | ||
// includeFields.includes('input') | ||
// ? `<input type="${inputType}" id="${inputId}" value="${inputValue}" placeholder="${inputPlaceholder}" class="outline-none border-none focus:outline-none focus:border-none font-bold" minlength="${min}" maxlength="${max}">` | ||
// : '' | ||
// } | ||
// </label> | ||
// </div> | ||
// ` | ||
// } else { | ||
// throw new Error('Invalid card type specified.') | ||
// } | ||
|
||
// return cardHtml | ||
// } | ||
|
||
export function renderButton({ name, className, id, content, disabled = false }) { | ||
return ` | ||
<button id="${id}" class="btn block relative text-center ${className}" ${disabled ? 'disabled' : ''}> | ||
${content} | ||
</button> | ||
` | ||
} |
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
Oops, something went wrong.