From b32329935c837cf1a0657260b7846df57aa9facf Mon Sep 17 00:00:00 2001 From: Araozu Date: Fri, 28 Jun 2024 21:37:20 -0500 Subject: [PATCH] Component for Hero sections --- src/components/HeroSection.astro | 36 ++++ src/pages/index.astro | 275 ++++++++++++++++--------------- 2 files changed, 176 insertions(+), 135 deletions(-) create mode 100644 src/components/HeroSection.astro diff --git a/src/components/HeroSection.astro b/src/components/HeroSection.astro new file mode 100644 index 0000000..9885af9 --- /dev/null +++ b/src/components/HeroSection.astro @@ -0,0 +1,36 @@ +--- +import CodeEditor from "./CodeEditor.astro"; + +const { title, thpcode, subtitle } = Astro.props; + +if (!subtitle) { + throw new Error("subtitle is required"); +} + +if (!thpcode) { + throw new Error("thpcode is required"); +} + +if (!title) { + throw new Error("title is required"); +} +--- + +
+
+

+ {subtitle} {title} +

+
+ +
+
+
+ +
+
+
+ +
+
+
diff --git a/src/pages/index.astro b/src/pages/index.astro index 3a55630..012cdce 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -2,156 +2,161 @@ import BaseLayout from "../layouts/BaseLayout.astro"; import Navbar from "../components/Navbar.astro"; import CodeEditor from "../components/CodeEditor.astro"; +import HeroSection from "../components/HeroSection.astro"; --- - + -
-
-
-

- A modern, type safe, - - secure language - - compiled to PHP -

-

- Inspired by Rust, Zig and Kotlin, THP has a modern syntax, - semantics, type system and stdlib. -

-
-
- +
+
-
-
-
-
-
+ + + + + + + +
+
+
+
+ + -
-
-

- THP is actually typed -

-
+ -
-
- THP enforces type safety at compile time and, at the programmer's - request, at runtime. -
-
- Everything has a type. - There are generics. - No implicit type conversions. No mixed. - No client Any .Type inference included. -
-
- All possible checks are made at compile time. Runtime checks - have a small performance penalty. -
-
-
- Any { ... } - // Any is available, but it's not usable without an explicit cast - fun mock() -> Any { ... } + // Compile error: Cannot use \`Any\` without an explicit cast + val result = mock() + // Ok + val result = mock() as String + `} + > + THP enforces type safety at compile time and, at the programmer's + request, at runtime. +
+
+ Everything has a type. There are generics. No implicit type conversions. + No mixed. No client Any .Type inference included. +
+
+ All possible checks are made at compile time. Runtime checks have a small + performance penalty. + - // Compile error: Cannot use \`Any\` without an explicit cast - val result = mock() - // Ok - val result = mock() as String - `} /> -
-
- + + :D (carita feliz) + - - + +