Skip to content

Commit 762c46d

Browse files
author
Ajit Kumar
committed
fix(fonts not loading, minor fixes)
1 parent dd289e4 commit 762c46d

File tree

21 files changed

+239
-189
lines changed

21 files changed

+239
-189
lines changed

src/components/logo/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import "./style.scss";
2+
3+
export default function Logo() {
4+
return <div className="logo" />;
5+
}

src/components/logo/style.scss

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
.logo {
2+
display: block;
3+
width: 150px;
4+
height: 150px;
5+
position: relative;
6+
margin: 0 auto;
7+
8+
&::after {
9+
content: '';
10+
position: absolute;
11+
top: 0;
12+
left: 0;
13+
width: 100%;
14+
height: 100%;
15+
background-image: url(./logo.png);
16+
background-size: 80px;
17+
background-repeat: no-repeat;
18+
background-position: center;
19+
}
20+
21+
&::before {
22+
content: '';
23+
position: absolute;
24+
top: 0;
25+
left: 0;
26+
width: 100%;
27+
height: 100%;
28+
background: radial-gradient(circle, rgb(68, 153, 254, 0.5), rgb(68, 153, 254, 0.1), rgb(68, 153, 254, 0), rgb(68, 153, 254, 0));
29+
overflow: visible;
30+
}
31+
}

src/dialogs/prompt.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default function prompt(
3131
const originalExec = commands.exec;
3232
const { capitalize = true } = options;
3333

34-
commands.exec = () => { }; // Disable all shortcuts
34+
commands.exec = () => {}; // Disable all shortcuts
3535

3636
return new Promise((resolve) => {
3737
const inputType = type === "textarea" ? "textarea" : "input";

src/lib/fonts.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@ import fsOperation from "fileSystem";
22
import loader from "dialogs/loader";
33
import helpers from "utils/helpers";
44
import Url from "utils/Url";
5+
import firaCode from "../res/fonts/FiraCode.ttf";
6+
import MesloLGSNFRegular from "../res/fonts/MesloLGSNFRegular.ttf";
7+
import robotoMono from "../res/fonts/RobotoMono.ttf";
58

69
const fonts = new Map();
710

811
add(
912
"Fira Code",
1013
`@font-face {
1114
font-family: 'Fira Code';
12-
src: url(../res/fonts/FiraCode.ttf) format('truetype');
15+
src: url(${firaCode}) format('truetype');
1316
font-weight: 300 700;
1417
font-style: normal;
1518
}`,
@@ -22,7 +25,7 @@ add(
2225
font-style: normal;
2326
font-weight: 400;
2427
font-display: swap;
25-
src: url(../res/fonts/RobotoMono.ttf) format('truetype');
28+
src: url(${robotoMono}) format('truetype');
2629
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F,
2730
U+FE2E-FE2F;
2831
}`,
@@ -34,7 +37,7 @@ add(
3437
font-family: 'MesloLGS NF Regular';
3538
font-style: normal;
3639
font-weight: normal;
37-
src: url(../res/fonts/MesloLGSNFRegular.ttf) format('truetype');
40+
src: url(${MesloLGSNFRegular}) format('truetype');
3841
}`,
3942
);
4043

src/lib/run.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,13 @@ import MarkdownItGitHubAlerts from "markdown-it-github-alerts";
99
import markdownItTaskLists from "markdown-it-task-lists";
1010
import mimeType from "mime-types";
1111
import mustache from "mustache";
12-
import path from "path-browserify";
1312
import browser from "plugins/browser";
1413
import helpers from "utils/helpers";
1514
import Url from "utils/Url";
1615
import $_console from "views/console.hbs";
1716
import $_markdown from "views/markdown.hbs";
1817
import constants from "./constants";
1918
import EditorFile from "./editorFile";
20-
import EditorManager from "./editorManager";
2119
import openFolder, { addedFolder } from "./openFolder";
2220
import appSettings from "./settings";
2321

src/main.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -279,10 +279,6 @@ a.icon {
279279
background-color: var(--active-icon-color) !important;
280280
}
281281

282-
&.foxdebug {
283-
background-image: url(res/logo/favicon.ico);
284-
}
285-
286282
&.no-icon {
287283
max-width: 5px;
288284
margin-right: 5px;

src/pages/about/about.hbs

Lines changed: 0 additions & 75 deletions
This file was deleted.

src/pages/about/about.js

Lines changed: 98 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,111 @@
11
import "./about.scss";
2+
import Logo from "components/logo";
23
import Page from "components/page";
4+
import Reactive from "html-tag-js/reactive";
35
import actionStack from "lib/actionStack";
4-
import mustache from "mustache";
5-
import logo from "res/logo/logo.png";
66
import helpers from "utils/helpers";
7-
import _template from "./about.hbs";
87

98
export default function AboutInclude() {
109
const $page = Page(strings.about.capitalize());
10+
const webviewVersionName = Reactive("N/A");
11+
const webviewPackageName = Reactive("N/A");
1112

12-
system.getWebviewInfo(
13-
(res) => render(res),
14-
() => render(),
13+
$page.classList.add("about-us");
14+
$page.body = (
15+
<main id="about-page" className="main scroll">
16+
<Logo />
17+
18+
<div className="version-info">
19+
<h1 className="version-title">Acode editor</h1>
20+
<div className="version-number">
21+
Version {BuildInfo.version} ({BuildInfo.versionCode})
22+
</div>
23+
</div>
24+
25+
<div className="info-section">
26+
<a
27+
href="#"
28+
className="info-item"
29+
onclick={(e) => {
30+
e.preventDefault();
31+
system.openInBrowser(
32+
`https://play.google.com/store/apps/details?id=${webviewPackageName.value}`,
33+
);
34+
}}
35+
>
36+
<div className="info-item-icon">
37+
<span className="icon googlechrome"></span>
38+
</div>
39+
<div className="info-item-text">
40+
Webview {webviewVersionName}
41+
<div className="info-item-subtext">{webviewPackageName}</div>
42+
</div>
43+
</a>
44+
<a href="https://acode.app" className="info-item">
45+
<div className="info-item-icon">
46+
<span className="icon acode"></span>
47+
</div>
48+
<div className="info-item-text">Official webpage</div>
49+
<small>https://acode.app</small>
50+
</a>
51+
<a href="https://foxbiz.io" className="info-item">
52+
<div className="info-item-icon">
53+
<span className="icon foxbiz"></span>
54+
</div>
55+
<div className="info-item-text">Foxbiz Software Pvt. Ltd.</div>
56+
<small>https://www.foxbiz.io</small>
57+
</a>
58+
</div>
59+
60+
<div className="social-links">
61+
<a href="mailto:apps@foxdebug.com" className="social-link">
62+
<div className="social-icon">
63+
<span className="icon gmail"></span>
64+
</div>
65+
Mail
66+
</a>
67+
<a href="https://x.com/foxbiz_io" className="social-link">
68+
<div className="social-icon">
69+
<span className="icon twitter"></span>
70+
</div>
71+
Twitter
72+
</a>
73+
<a href="https://www.instagram.com/foxbiz.io/" className="social-link">
74+
<div className="social-icon">
75+
<span className="icon instagram"></span>
76+
</div>
77+
Instagram
78+
</a>
79+
<a
80+
href="https://github.com/Acode-Foundation/Acode"
81+
className="social-link"
82+
>
83+
<div className="social-icon">
84+
<span className="icon github"></span>
85+
</div>
86+
GitHub
87+
</a>
88+
<a href="https://t.me/foxdebug_acode" className="social-link">
89+
<div className="social-icon">
90+
<span className="icon telegram"></span>
91+
</div>
92+
Telegram
93+
</a>
94+
<a href="https://discord.gg/nDqZsh7Rqz" className="social-link">
95+
<div className="social-icon">
96+
<span className="icon discord"></span>
97+
</div>
98+
Discord
99+
</a>
100+
</div>
101+
</main>
15102
);
16103

104+
system.getWebviewInfo((res) => {
105+
webviewPackageName.value = res?.packageName || "N/A";
106+
webviewVersionName.value = res?.versionName || "N/A";
107+
});
108+
17109
actionStack.push({
18110
id: "about",
19111
action: $page.hide,
@@ -26,17 +118,4 @@ export default function AboutInclude() {
26118

27119
app.append($page);
28120
helpers.showAd();
29-
30-
function render(webview) {
31-
const $content = helpers.parseHTML(
32-
mustache.render(_template, {
33-
...BuildInfo,
34-
webview,
35-
logo,
36-
}),
37-
);
38-
39-
$page.classList.add("about-us");
40-
$page.body = $content;
41-
}
42121
}

0 commit comments

Comments
 (0)