@yannosay/sinth 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +660 -0
- package/README.md +30 -0
- package/bin/sinth.js +5 -0
- package/components/Card.sinth +21 -0
- package/components/Navbar.sinth +38 -0
- package/package.json +13 -0
- package/pages/index.sinth +46 -0
- package/sinth.config.json +7 -0
- package/src/sinth.ts +2046 -0
- package/styles/reset.css +3 -0
- package/test-project/components/Card.sinth +21 -0
- package/test-project/components/Navbar.sinth +38 -0
- package/test-project/package.json +13 -0
- package/test-project/pages/index.sinth +46 -0
- package/test-project/sinth.config.json +7 -0
- package/test-project/styles/reset.css +3 -0
- package/tsconfig.json +23 -0
package/styles/reset.css
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
-- Card component
|
|
2
|
+
|
|
3
|
+
component Card(title, color = "blue") {
|
|
4
|
+
Div(class: "card") {
|
|
5
|
+
Heading(level: 2) { "$title" }
|
|
6
|
+
Div(class: "card-body") { "$slot" }
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
style {
|
|
10
|
+
.card {
|
|
11
|
+
backgroundColor: "#f7f7f7"
|
|
12
|
+
borderRadius: "1rem"
|
|
13
|
+
padding: "1.5rem"
|
|
14
|
+
textAlign: "center"
|
|
15
|
+
marginBottom: "1rem"
|
|
16
|
+
}
|
|
17
|
+
.card-body {
|
|
18
|
+
marginTop: "0.75rem"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
-- Navbar component
|
|
2
|
+
|
|
3
|
+
component Navbar {
|
|
4
|
+
Header {
|
|
5
|
+
Nav {
|
|
6
|
+
Link(href: "/", class: "logo") { "MySite" }
|
|
7
|
+
Div(class: "nav-links") {
|
|
8
|
+
NavLink(href: "/") { "Home" }
|
|
9
|
+
NavLink(href: "/about") { "About" }
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
style {
|
|
15
|
+
Header {
|
|
16
|
+
display: "flex"
|
|
17
|
+
alignItems: "center"
|
|
18
|
+
padding: "1rem 2rem"
|
|
19
|
+
backgroundColor: "#1a1a2e"
|
|
20
|
+
color: "white"
|
|
21
|
+
}
|
|
22
|
+
.logo {
|
|
23
|
+
fontSize: "1.5rem"
|
|
24
|
+
fontWeight: "700"
|
|
25
|
+
color: "white"
|
|
26
|
+
textDecoration: "none"
|
|
27
|
+
}
|
|
28
|
+
.nav-links {
|
|
29
|
+
marginLeft: "auto"
|
|
30
|
+
display: "flex"
|
|
31
|
+
gap: "1.5rem"
|
|
32
|
+
}
|
|
33
|
+
.nav-links a {
|
|
34
|
+
color: "rgba(255,255,255,0.8)"
|
|
35
|
+
textDecoration: "none"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
-- My Sinth Site
|
|
2
|
+
|
|
3
|
+
page
|
|
4
|
+
|
|
5
|
+
import "../components/Navbar.sinth"
|
|
6
|
+
import css "../styles/reset.css"
|
|
7
|
+
|
|
8
|
+
title = "My Site"
|
|
9
|
+
fav = "assets/favicon.ico"
|
|
10
|
+
descr = "Built with Sinth."
|
|
11
|
+
|
|
12
|
+
Navbar
|
|
13
|
+
|
|
14
|
+
Hero {
|
|
15
|
+
Heading(level: 1) { "Welcome to Sinth" }
|
|
16
|
+
Paragraph { "A declarative, component-based web UI language." }
|
|
17
|
+
Button(onClick: "handleCTA") { "Get Started" }
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
Main {
|
|
21
|
+
Section {
|
|
22
|
+
Heading(level: 2) { "Features" }
|
|
23
|
+
CardGrid {
|
|
24
|
+
-- Add cards here
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
style {
|
|
30
|
+
Hero {
|
|
31
|
+
padding: "4rem 2rem"
|
|
32
|
+
textAlign: "center"
|
|
33
|
+
backgroundColor: "#f0f4ff"
|
|
34
|
+
}
|
|
35
|
+
Main {
|
|
36
|
+
maxWidth: "1100px"
|
|
37
|
+
margin: "0 auto"
|
|
38
|
+
padding: "2rem"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
script {
|
|
43
|
+
function handleCTA() {
|
|
44
|
+
alert("Hello from Sinth!")
|
|
45
|
+
}
|
|
46
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"module": "commonjs",
|
|
5
|
+
"lib": ["ES2020"],
|
|
6
|
+
"outDir": "./dist",
|
|
7
|
+
"rootDir": "./src",
|
|
8
|
+
"strict": false,
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"skipLibCheck": true,
|
|
11
|
+
"noImplicitAny": false,
|
|
12
|
+
"strictNullChecks": false,
|
|
13
|
+
"types": ["node"],
|
|
14
|
+
"typeRoots": ["./node_modules/@types", "../node_modules/@types"]
|
|
15
|
+
},
|
|
16
|
+
"include": ["src/**/*"],
|
|
17
|
+
"exclude": ["node_modules", "dist"],
|
|
18
|
+
"ts-node": {
|
|
19
|
+
"compilerOptions": {
|
|
20
|
+
"module": "commonjs"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|