Skip to content

Commit

Permalink
Run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
nousantx committed Nov 16, 2024
1 parent 3bf7ac8 commit c134fb8
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 16 deletions.
2 changes: 0 additions & 2 deletions element-template.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

const templates = {
start: `<div class="box-1000px center family-poppins">
<div class="bg-blue fw-600 ls--0.030em box-236px text-neutral-50 fs-5rem br-1rem p-2rem">
Expand Down Expand Up @@ -60,7 +59,6 @@ const templates = {
</div>`
}


const elementTemplates = {
text: {
title: {
Expand Down
3 changes: 1 addition & 2 deletions index.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@
body {
font-family: Inter, sans-serif;
font-weight: 500;

}
}
20 changes: 10 additions & 10 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const heightInput = document.getElementById('height')
const selector = '*' // '*:not(head *, style, script, #preview, #preview *)'

// Initialize tenoxui at first render
document.querySelectorAll(selector).forEach(element => {
document.querySelectorAll(selector).forEach((element) => {
new __tenoxui_core.MakeTenoxUI({ element, ...tenoxuiConfig }).useDOM()
})

Expand Down Expand Up @@ -59,7 +59,7 @@ function loadDesign(event) {
const file = event.target.files[0]
const reader = new FileReader()

reader.onload = e => {
reader.onload = (e) => {
try {
const designData = JSON.parse(e.target.result)
document.getElementById('htmlInput').value = designData.html
Expand Down Expand Up @@ -101,10 +101,10 @@ async function getGoogleFontsStyles() {
const fontFormat = fontUrl.endsWith('woff2')
? 'woff2'
: fontUrl.endsWith('woff')
? 'woff'
: fontUrl.endsWith('ttf')
? 'truetype'
: 'opentype'
? 'woff'
: fontUrl.endsWith('ttf')
? 'truetype'
: 'opentype'
const processedRule = rule.replace(
/url\([^)]+\)/,
`url(data:application/font-${fontFormat};charset=utf-8;base64,${base64Font})`
Expand Down Expand Up @@ -139,18 +139,18 @@ async function generateSVG() {
contentDiv.classList.add(`[transform]-[scale(${scale})]`, '[transform-origin]-[top_left]')
}

temp.querySelectorAll('*').forEach(element => {
temp.querySelectorAll('*').forEach((element) => {
new __tenoxui_core.MakeTenoxUI({ element, ...tenoxuiConfig }).useDOM()
})

const removeAttributesAndElements = element => {
const removeAttributesAndElements = (element) => {
if (element.tagName.toLowerCase() !== 'style') {
Array.from(element.attributes).forEach(attr => {
Array.from(element.attributes).forEach((attr) => {
if (attr.name !== 'style') {
element.removeAttribute(attr.name)
}
})
Array.from(element.children).forEach(child => {
Array.from(element.children).forEach((child) => {
if (child.tagName.toLowerCase() !== 'style') {
removeAttributesAndElements(child)
}
Expand Down
2 changes: 1 addition & 1 deletion live-preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const tuiInstances = new Map()

function initializeTenoxUI(config) {
tuiInstances.clear()
document.querySelectorAll('#preview *').forEach(element => {
document.querySelectorAll('#preview *').forEach((element) => {
const instance = new __tenoxui_core.MakeTenoxUI({ element, ...config }).useDOM()
tuiInstances.set(element, instance)
})
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@
"scripts": {
"start": "echo 'hello world'"
}
}
}

0 comments on commit c134fb8

Please sign in to comment.