-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: clean some stuff * feat: extract emojis in text & use appropriate font to generate & integrate them into final mesh * chore: add a "bug" section & rearrange top bar * chore: try to fix this f******* test
- Loading branch information
Showing
35 changed files
with
475 additions
and
118 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,32 +1,36 @@ | ||
<calcite-button | ||
appearance="transparent" | ||
kind="neutral" | ||
scale="m" | ||
id="about-button" | ||
icon-start="information" | ||
appearance='transparent' | ||
kind='neutral' | ||
scale='m' | ||
id='about-button' | ||
icon-start='information' | ||
...attributes | ||
/> | ||
<calcite-tooltip reference-element='about-button' placement='bottom'> | ||
<span>{{t 'info.label'}}</span> | ||
</calcite-tooltip> | ||
|
||
<calcite-popover | ||
label={{t "info.label"}} | ||
heading={{t "info.label"}} | ||
reference-element="about-button" | ||
label={{t 'info.label'}} | ||
heading={{t 'info.label'}} | ||
reference-element='about-button' | ||
closable | ||
auto-close | ||
> | ||
<div class="m-2"> | ||
<p class="center"> | ||
{{t "info.made_by" | ||
<div class='m-2'> | ||
<p class='center'> | ||
{{t | ||
'info.made_by' | ||
author=this.authorLink | ||
ember=this.emberLink | ||
three=this.threeLink | ||
htmlSafe=true | ||
}} | ||
</p> | ||
<p class="center"> | ||
<a href="https://github.com/romgere/text2stl" target="_blank" rel="noopener noreferrer">{{t "info.github"}}</a> | ||
</p> | ||
<p class="center"> | ||
<a href="https://github.com/romgere/text2stl/issues/new" target="_blank" rel="noopener noreferrer">{{t "info.issue"}}</a> | ||
<p class='center'> | ||
<a href='https://github.com/romgere/text2stl' target='_blank' rel='noopener noreferrer'>{{t | ||
'info.github' | ||
}}</a> | ||
</p> | ||
</div> | ||
</calcite-popover> |
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,50 @@ | ||
<calcite-button | ||
appearance='transparent' | ||
kind='neutral' | ||
scale='m' | ||
id='issue-button' | ||
icon-start='debug' | ||
...attributes | ||
/> | ||
|
||
<calcite-tooltip reference-element='issue-button' placement='bottom'> | ||
<span>{{t 'issue.label'}}</span> | ||
</calcite-tooltip> | ||
|
||
<calcite-popover | ||
label={{t 'issue.label'}} | ||
heading={{t 'issue.label'}} | ||
reference-element='issue-button' | ||
closable | ||
auto-close | ||
> | ||
<div class='m-2 w-40'> | ||
<h2 class='center'>{{t 'issue.info'}}</h2> | ||
|
||
<p class='center'>{{t 'issue.know_bug.free' htmlSafe=true}}</p> | ||
<hr class='w-30p' /> | ||
|
||
<p class='center'>{{t 'issue.know_bug.font' htmlSafe=true}}</p> | ||
<p class='center'>{{t 'issue.know_bug.font1'}}</p> | ||
<hr class='w-30p' /> | ||
|
||
<p class='center'>{{t 'issue.know_bug.emoji' htmlSafe=true}}</p> | ||
<p class='center'>{{t 'issue.know_bug.emoji1'}}</p> | ||
<p class='center'>{{t 'issue.know_bug.emoji2'}}</p> | ||
<hr class='w-30p' /> | ||
|
||
<p class='center'>{{t 'issue.know_bug.three_js' htmlSafe=true}}</p> | ||
|
||
<p class='center mt-5'> | ||
|
||
<calcite-button | ||
icon-start='debug' | ||
target='_blank' | ||
rel='noopener noreferrer' | ||
href='https://github.com/romgere/text2stl/issues/new' | ||
>{{t 'issue.know_bug.submit'}}</calcite-button> | ||
<br /> | ||
<small>{{t 'issue.know_bug.gh_account' htmlSafe=true}}</small> | ||
</p> | ||
</div> | ||
</calcite-popover> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
<calcite-button | ||
appearance="transparent" | ||
kind="neutral" | ||
scale="m" | ||
id="theme-switcher" | ||
icon-start={{if this.isLightTheme "brightness" "moon"}} | ||
appearance='transparent' | ||
kind='neutral' | ||
scale='m' | ||
id='theme-switcher' | ||
icon-start={{if this.isLightTheme 'brightness' 'moon'}} | ||
...attributes | ||
{{on "click" this.switchTheme}} | ||
{{on 'click' this.switchTheme}} | ||
/> | ||
<calcite-tooltip reference-element="theme-switcher"> | ||
<span>{{t "switch_theme_tooltip" current=this.theme}}</span> | ||
<calcite-tooltip reference-element='theme-switcher' placement='bottom'> | ||
<span>{{t 'switch_theme_tooltip' current=this.theme}}</span> | ||
</calcite-tooltip> |
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,59 @@ | ||
export type StringPart = { | ||
type: 'text' | 'emoji'; | ||
value: string; | ||
}; | ||
|
||
export default function extractEmoji(str: string) { | ||
const emojiRE = /(\p{EPres}|\p{ExtPict})+/gu; | ||
|
||
const extraction: StringPart[] = []; | ||
const execList: RegExpExecArray[] = []; | ||
let exec: RegExpExecArray | null = null; | ||
|
||
while ((exec = emojiRE.exec(str))) { | ||
execList.push(exec); | ||
} | ||
|
||
// No emoji at all | ||
if (!execList.length) { | ||
extraction.push({ | ||
type: 'text', | ||
value: str, | ||
}); | ||
} else { | ||
if (execList[0].index) { | ||
extraction.push({ | ||
type: 'text', | ||
value: str.substring(0, execList[0].index), | ||
}); | ||
} | ||
|
||
for (const [i, e] of execList.entries()) { | ||
extraction.push({ | ||
type: 'emoji', | ||
value: e[0], | ||
}); | ||
|
||
const eLength = e[0].length; // Emoji lenght | ||
const eEndIdx = e.index + eLength; // Emoji end index in string | ||
const nextEmojiIdx = execList[i + 1]?.index ?? 0; // Next emoji index | ||
|
||
// Handle text between current emoji & next one | ||
if (nextEmojiIdx > eEndIdx) { | ||
extraction.push({ | ||
type: 'text', | ||
value: str.substring(eEndIdx, execList[i + 1].index), | ||
}); | ||
} | ||
// Handle text between last emoji & end of string | ||
else if (i === execList.length - 1 && eEndIdx < str.length) { | ||
extraction.push({ | ||
type: 'text', | ||
value: str.substring(eEndIdx, str.length), | ||
}); | ||
} | ||
} | ||
} | ||
|
||
return extraction; | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
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
Oops, something went wrong.