Skip to content

Commit

Permalink
Added AzuText (1/3)
Browse files Browse the repository at this point in the history
  • Loading branch information
MTSyntho authored Dec 11, 2024
1 parent 53130e8 commit 8a22fa6
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions pkgs/apps/azutext.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
var styling = (`
font-size: 20px;
font-family: 'Inter';
resize: none;
box-sizing: border-box;
`)

var filename = document.currentScript.getAttribute('script-arguments')
// let textdata;

if (filename) {
win.create(`${filename} - AzuText`, "root").then(win => win
.setWidth(700)
.setHeight(500)
.confirm()
);
fetch_file(filename, "plain")
.then(result => {
element.create('textarea', result, '').then(elm => elm
.window('root')
.css(styling)
.position('fixed')
.width('calc(100% - 6px)')
.height('calc(100% - 6px)')
.placeholder('Write Something :3')
.align('center')
.attribute('wrap', 'soft')
.color('white')
.backgroundcolor('transparent')
.border('none')
.outline('none')
.padding('20px')
);
})
.catch(error => {
console.error("[AzuText] Error:", error);
});
} else {
win.create('AzuText', "root").then(win => win
.setWidth(700)
.setHeight(500)
.confirm()
);

element.create('textarea', '', '').then(elm => elm
.window('root')
.css(styling)
.position('fixed')
.width('calc(100% - 6px)')
.height('calc(100% - 6px)')
.placeholder('Write Something :3')
.align('center')
.attribute('wrap', 'soft')
.color('white')
.backgroundcolor('transparent')
.border('none')
.outline('none')
.padding('20px')
);
}

0 comments on commit 8a22fa6

Please sign in to comment.