Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fries-byte/svelteplus


https://github.com/fries-byte/svelteplus

Last synced: 11 days ago
JSON representation

Awesome Lists containing this project

README

        

![Svelte+](https://github.com/user-attachments/assets/7f66c2e0-a695-4c66-b3ae-236aeb090ea0)
# About
Pages:

[How to use](https://github.com/fries-byte/Svelte-Plus/README.md#how-to-use)

[Code](https://github.com/fries-byte/Svelte-Plus?tab=readme-ov-file#code)


Svelte+ was coded in [StackBlitz](https://stackblitz.com) with its build in Svelte kit.

Svelte plus will create Svelte code with simple and short terms.

Svelte plus is a programming tool made to build a website easier with little to no effort.

Svelte plus is not accosiated in any way with the official Svelte.

Svelte plus is also in development

Svelte plus has been tested and might give you double-code, where it gives you two of the exact same code.

# How to use
1, 2, 3, 4, 5, stands for h1, h2 and so on.

!addcss, adds css.

!addscript, adds javascript to the Svelte code.

bgc , will add a background color if css code is added.

ff , ff is a short term of family font, i recommend sans-serif if you want a nice font.

img , after typing img, put the image link.

# Code
```ts
let svelte = `
1 Thank you for using Svelt-Plus,
2 making developing websites easier.

!addcss
ff sans-serif
bg grey
`;

let imgsrc = '';
let font = '';
let sveltecss = '';
let sveltecode = '';
let svelteSCRIPTADD = 'console.log("Added script");';

const lines = svelte.split('\n').map(line => line.trim()).filter(line => line);

lines.forEach((line) => {
if (line.startsWith('!addscript')) {
sveltecode += `${svelteSCRIPTADD}\n`;
}

if (line.startsWith('1 ')) {
const content = line.substring(2).trim();
sveltecode += `

${content}

\n`;
}

if (line.startsWith('2 ')) {
const content = line.substring(2).trim();
sveltecode += `

${content}

\n`;
}

if (line.startsWith('img ')) {
imgsrc = line.substring(4).trim();
sveltecode += `Image\n`;
}

if (line.startsWith('bg ')) {
const bgColor = line.substring(3).trim();
sveltecss += ` background-color: ${bgColor};\n`;
}

if (line.startsWith('ff ')) {
font = line.substring(3).trim();
sveltecss += ` font-family: ${font};\n`;
}

if (line.startsWith('!addcss')) {
sveltecode += `\nbody {\n${sveltecss}}\n\n`;
}
});

console.log(sveltecode);
console.log(sveltecss);
```