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

Feat: Add support for text mints #411

Merged
merged 30 commits into from
Jun 6, 2024
Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
9497134
feat: Add support for typed based nfts
kittypurrry Mar 28, 2024
a5f11b0
Some updates to display token's displayuri instead of artifact
kittypurrry Apr 7, 2024
3ddd0b6
Update Monotype art to use 'IBM Mono Plex' to be consistent with type…
kittypurrry Apr 7, 2024
8aa8566
Remove monaco
kittypurrry Apr 7, 2024
9baff04
Merge branch 'teia-community:main' into feat/typed-nft
kittypurrry Apr 8, 2024
4328cc0
Fix lint errors
kittypurrry Apr 13, 2024
1c48db3
Merge branch 'teia-community:main' into feat/typed-nft
kittypurrry Apr 14, 2024
8fef7bc
Fix some UI issues while minting - switching between preview and edit…
kittypurrry Apr 14, 2024
9616958
Minor UI updates for very long text mints
kittypurrry Apr 14, 2024
6424135
Some minor adjustments
kittypurrry Apr 16, 2024
4e81265
Replace UltimateTextToImage with canvas solution
kittypurrry Apr 21, 2024
629db11
Merge branch 'main' into feat/typed-nft
kittypurrry Apr 21, 2024
b219adf
chore: ♻️ apply format
melMass May 2, 2024
3b836bf
fix: ✨ minor edits
melMass May 2, 2024
c7feab5
Fix font issue for generated thumbnail and changed mono font to Iosevka
kittypurrry May 5, 2024
aaea30c
Add comments and refactor thumbnail generation a bit
kittypurrry May 5, 2024
5777d40
Update char length before ellipsis since text size can accomodate for…
kittypurrry May 5, 2024
25ab072
Merge branch 'main' into feat/typed-nft
melMass May 11, 2024
b993686
style: 💎 fix various styles issues
melMass May 11, 2024
dbcf13d
chore: 🧹 convert typed_art utils to ts
melMass May 11, 2024
324478f
refactor: 📦 image generation logic
melMass May 11, 2024
9f21675
fix: 🐛 issues reported by CI
melMass May 11, 2024
1ebe8a1
fix: preview generation
melMass May 20, 2024
45e243e
chore: 🧹 prefer const
melMass May 20, 2024
8934d88
hide scrollbars and add text feed to the menu
Zir0h May 26, 2024
f5afa3c
disable description in preview cards for text/plain tokens
Zir0h May 26, 2024
7190069
use overflow:scroll
Zir0h Jun 5, 2024
e15a53f
mess around with overflow / whitespace
Zir0h Jun 6, 2024
481c8cf
Merge branch 'main' into feat/typed-nft
Zir0h Jun 6, 2024
747143a
added padding
Zir0h Jun 6, 2024
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
Prev Previous commit
Next Next commit
Update Monotype art to use 'IBM Mono Plex' to be consistent with type…
…d.art
kittypurrry committed Apr 7, 2024
commit 3ddd0b6facf5368cc84d532a044c5df3b1d96e50
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -9,6 +9,7 @@
"axios": "^0.27.2",
"base-x": "^4.0.0",
"bs58check": "^2.1.2",
"canvas": "^2.11.2",
"classnames": "^2.3.2",
"compressorjs": "^1.1.1",
"fflate": "^0.7.4",
2 changes: 1 addition & 1 deletion src/components/form/MintForm.jsx
Original file line number Diff line number Diff line change
@@ -41,7 +41,7 @@ export default function MintForm() {
let typedTextArea = document.querySelector("textarea[name='typedinput']")

if (isMonoType && typedTextArea) {
typedTextArea.style.fontFamily = 'Monaco, Consolas, monospace'
typedTextArea.style.fontFamily = 'IBM Plex Mono, monospace'
} else if (typedTextArea) {
// default font to use for typed inputs
typedTextArea.style.fontFamily = 'Source Sans Pro, sans-serif'
2 changes: 1 addition & 1 deletion src/components/form/index.module.scss
Original file line number Diff line number Diff line change
@@ -22,5 +22,5 @@
}

.typed_field textarea.mono {
font-family: 'Monaco', monospace !important;
font-family: 'IBM Plex Mono', monospace !important;
}
2 changes: 1 addition & 1 deletion src/components/media-types/text/index.jsx
Original file line number Diff line number Diff line change
@@ -63,7 +63,7 @@ export const TXT = ({
<pre
style={{
fontFamily: isMonoType
? 'Monaco, monospace'
? 'IBM Plex Mono, monospace'
: 'Source Sans Pro, sans-serif',
}}
>
9 changes: 1 addition & 8 deletions src/styles/typography.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans+Thai&display=swap');
// @import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400&display=swap');
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400&display=swap');

@font-face {
font-family: 'Iosevka';
@@ -50,13 +50,6 @@
to ensure that it displays as intended on secondary marketplaces like OBJKT
*/

@font-face {
font-family: 'Monaco';
font-weight: 400;
font-style: normal;
src: url('fonts/monaco.woff2') format('woff2');
}

@font-face {
font-family: 'Source Sans Pro';
font-weight: 400;
6 changes: 3 additions & 3 deletions src/utils/mint.ts
Original file line number Diff line number Diff line change
@@ -118,13 +118,13 @@ export const generateCoverAndThumbnail = async (
}

export const generateTypedArtImage = async(
textContent: string
textContent: string,
isMono: boolean
): Promise<File | void> => {

if (textContent) {
const textToImage = await new UltimateTextToImage(textContent, {
fontColor: "#FFFFFF",
align: "center",
fontFamily: isMono ? 'IBM Plex Mono' : 'Source Sans Pro',
backgroundColor: "transparent",
margin: 20
}).render();
2 changes: 1 addition & 1 deletion src/utils/typed-art.js
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ export const processTypedInput = async (data) => {
data.artifact.reader = URL.createObjectURL(blob)

// generate cover automatically
let coverFile = await generateTypedArtImage(data.typedinput)
let coverFile = await generateTypedArtImage(data.typedinput, data.isMonoType)
data.cover = await convertFileToFileForm(coverFile)

// add monospace to tags if not already available so that it can be rendered