diff --git a/Assets/Icons/23x23-empty.svg b/Assets/Icons/23x23-empty.svg
new file mode 100644
index 0000000..585211f
--- /dev/null
+++ b/Assets/Icons/23x23-empty.svg
@@ -0,0 +1,2 @@
+
\ No newline at end of file
diff --git a/Scripts/youtube.png.import b/Assets/Icons/23x23-empty.svg.import
similarity index 60%
rename from Scripts/youtube.png.import
rename to Assets/Icons/23x23-empty.svg.import
index 82be867..3e79677 100644
--- a/Scripts/youtube.png.import
+++ b/Assets/Icons/23x23-empty.svg.import
@@ -2,16 +2,16 @@
importer="texture"
type="CompressedTexture2D"
-uid="uid://dioe63fr47oq7"
-path="res://.godot/imported/youtube.png-5feacc6342e9a438cbbd6a63702ea1ce.ctex"
+uid="uid://dglkjumm1q4lo"
+path="res://.godot/imported/23x23-empty.svg-f79aa182e01c658978086a2615b5cbce.ctex"
metadata={
"vram_texture": false
}
[deps]
-source_file="res://Scripts/youtube.png"
-dest_files=["res://.godot/imported/youtube.png-5feacc6342e9a438cbbd6a63702ea1ce.ctex"]
+source_file="res://Assets/Icons/23x23-empty.svg"
+dest_files=["res://.godot/imported/23x23-empty.svg-f79aa182e01c658978086a2615b5cbce.ctex"]
[params]
@@ -32,3 +32,6 @@ process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
+svg/scale=1.0
+editor/scale_with_editor_scale=false
+editor/convert_colors_with_editor_theme=false
diff --git a/Icons/arrow-left.svg b/Assets/Icons/arrow-left.svg
similarity index 100%
rename from Icons/arrow-left.svg
rename to Assets/Icons/arrow-left.svg
diff --git a/Icons/arrow-left.svg.import b/Assets/Icons/arrow-left.svg.import
similarity index 74%
rename from Icons/arrow-left.svg.import
rename to Assets/Icons/arrow-left.svg.import
index 855fcba..6033883 100644
--- a/Icons/arrow-left.svg.import
+++ b/Assets/Icons/arrow-left.svg.import
@@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://bp42ccs2nmbmw"
-path="res://.godot/imported/arrow-left.svg-6665bd65bdc7655f58ffd2c77101e033.ctex"
+path="res://.godot/imported/arrow-left.svg-5f99da4595c3d8d0d08c3c956ebfe3c3.ctex"
metadata={
"vram_texture": false
}
[deps]
-source_file="res://Icons/arrow-left.svg"
-dest_files=["res://.godot/imported/arrow-left.svg-6665bd65bdc7655f58ffd2c77101e033.ctex"]
+source_file="res://Assets/Icons/arrow-left.svg"
+dest_files=["res://.godot/imported/arrow-left.svg-5f99da4595c3d8d0d08c3c956ebfe3c3.ctex"]
[params]
diff --git a/Icons/arrow-right.svg b/Assets/Icons/arrow-right.svg
similarity index 100%
rename from Icons/arrow-right.svg
rename to Assets/Icons/arrow-right.svg
diff --git a/Icons/arrow-right.svg.import b/Assets/Icons/arrow-right.svg.import
similarity index 74%
rename from Icons/arrow-right.svg.import
rename to Assets/Icons/arrow-right.svg.import
index 9eae9b6..c33c38a 100644
--- a/Icons/arrow-right.svg.import
+++ b/Assets/Icons/arrow-right.svg.import
@@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://dyyylow47qd0k"
-path="res://.godot/imported/arrow-right.svg-952a316afcd4823b2076bf76a665b17d.ctex"
+path="res://.godot/imported/arrow-right.svg-c769bf30dd1a5a6c76e989455e94e01b.ctex"
metadata={
"vram_texture": false
}
[deps]
-source_file="res://Icons/arrow-right.svg"
-dest_files=["res://.godot/imported/arrow-right.svg-952a316afcd4823b2076bf76a665b17d.ctex"]
+source_file="res://Assets/Icons/arrow-right.svg"
+dest_files=["res://.godot/imported/arrow-right.svg-c769bf30dd1a5a6c76e989455e94e01b.ctex"]
[params]
diff --git a/Icons/chevron-down.svg b/Assets/Icons/chevron-down.svg
similarity index 100%
rename from Icons/chevron-down.svg
rename to Assets/Icons/chevron-down.svg
diff --git a/Icons/chevron-down.svg.import b/Assets/Icons/chevron-down.svg.import
similarity index 74%
rename from Icons/chevron-down.svg.import
rename to Assets/Icons/chevron-down.svg.import
index 03bf3d4..c005fa6 100644
--- a/Icons/chevron-down.svg.import
+++ b/Assets/Icons/chevron-down.svg.import
@@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://df1m4j7uxi63v"
-path="res://.godot/imported/chevron-down.svg-484378157f0927346bbcbdbf4232b051.ctex"
+path="res://.godot/imported/chevron-down.svg-549b6fd6d6d40e9ebd832012d163f272.ctex"
metadata={
"vram_texture": false
}
[deps]
-source_file="res://Icons/chevron-down.svg"
-dest_files=["res://.godot/imported/chevron-down.svg-484378157f0927346bbcbdbf4232b051.ctex"]
+source_file="res://Assets/Icons/chevron-down.svg"
+dest_files=["res://.godot/imported/chevron-down.svg-549b6fd6d6d40e9ebd832012d163f272.ctex"]
[params]
diff --git a/Assets/Icons/loader-circle.svg b/Assets/Icons/loader-circle.svg
new file mode 100644
index 0000000..b53caf3
--- /dev/null
+++ b/Assets/Icons/loader-circle.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/Assets/Icons/loader-circle.svg.import b/Assets/Icons/loader-circle.svg.import
new file mode 100644
index 0000000..c6d6026
--- /dev/null
+++ b/Assets/Icons/loader-circle.svg.import
@@ -0,0 +1,37 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://cttplkybt1dxv"
+path="res://.godot/imported/loader-circle.svg-c17ccf4fea88a610c3708518f9137af7.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://Assets/Icons/loader-circle.svg"
+dest_files=["res://.godot/imported/loader-circle.svg-c17ccf4fea88a610c3708518f9137af7.ctex"]
+
+[params]
+
+compress/mode=0
+compress/high_quality=false
+compress/lossy_quality=0.7
+compress/hdr_compression=1
+compress/normal_map=0
+compress/channel_pack=0
+mipmaps/generate=false
+mipmaps/limit=-1
+roughness/mode=0
+roughness/src_normal=""
+process/fix_alpha_border=true
+process/premult_alpha=false
+process/normal_map_invert_y=false
+process/hdr_as_srgb=false
+process/hdr_clamp_exposure=false
+process/size_limit=0
+detect_3d/compress_to=1
+svg/scale=1.0
+editor/scale_with_editor_scale=false
+editor/convert_colors_with_editor_theme=false
diff --git a/Icons/plus.svg b/Assets/Icons/plus.svg
similarity index 100%
rename from Icons/plus.svg
rename to Assets/Icons/plus.svg
diff --git a/Icons/plus.svg.import b/Assets/Icons/plus.svg.import
similarity index 76%
rename from Icons/plus.svg.import
rename to Assets/Icons/plus.svg.import
index 87d39b8..30cfacf 100644
--- a/Icons/plus.svg.import
+++ b/Assets/Icons/plus.svg.import
@@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://cehbtwq6gq0cn"
-path="res://.godot/imported/plus.svg-dfcf01023e04ffbd2a1c50b2672d981c.ctex"
+path="res://.godot/imported/plus.svg-f4b3570cb7fae700c6a08ebce6d60d56.ctex"
metadata={
"vram_texture": false
}
[deps]
-source_file="res://Icons/plus.svg"
-dest_files=["res://.godot/imported/plus.svg-dfcf01023e04ffbd2a1c50b2672d981c.ctex"]
+source_file="res://Assets/Icons/plus.svg"
+dest_files=["res://.godot/imported/plus.svg-f4b3570cb7fae700c6a08ebce6d60d56.ctex"]
[params]
diff --git a/Icons/rotate-cw.svg b/Assets/Icons/rotate-cw.svg
similarity index 100%
rename from Icons/rotate-cw.svg
rename to Assets/Icons/rotate-cw.svg
diff --git a/Icons/rotate-cw.svg.import b/Assets/Icons/rotate-cw.svg.import
similarity index 75%
rename from Icons/rotate-cw.svg.import
rename to Assets/Icons/rotate-cw.svg.import
index bdc56f8..c29ffcd 100644
--- a/Icons/rotate-cw.svg.import
+++ b/Assets/Icons/rotate-cw.svg.import
@@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://cu4hjoba6etf"
-path="res://.godot/imported/rotate-cw.svg-868e19f6bcf83d62897eb2ac44a0b471.ctex"
+path="res://.godot/imported/rotate-cw.svg-dc1ce1f9471720aef7c52da0114941eb.ctex"
metadata={
"vram_texture": false
}
[deps]
-source_file="res://Icons/rotate-cw.svg"
-dest_files=["res://.godot/imported/rotate-cw.svg-868e19f6bcf83d62897eb2ac44a0b471.ctex"]
+source_file="res://Assets/Icons/rotate-cw.svg"
+dest_files=["res://.godot/imported/rotate-cw.svg-dc1ce1f9471720aef7c52da0114941eb.ctex"]
[params]
diff --git a/Icons/search.svg b/Assets/Icons/search.svg
similarity index 100%
rename from Icons/search.svg
rename to Assets/Icons/search.svg
diff --git a/Icons/search.svg.import b/Assets/Icons/search.svg.import
similarity index 75%
rename from Icons/search.svg.import
rename to Assets/Icons/search.svg.import
index 1d4d79a..0328218 100644
--- a/Icons/search.svg.import
+++ b/Assets/Icons/search.svg.import
@@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://bf0vx7qwo28k6"
-path="res://.godot/imported/search.svg-597dbc74e85ee7dfea046ab610b3d4ad.ctex"
+path="res://.godot/imported/search.svg-1a2b06368a6d95d720ef3acf028b44e6.ctex"
metadata={
"vram_texture": false
}
[deps]
-source_file="res://Icons/search.svg"
-dest_files=["res://.godot/imported/search.svg-597dbc74e85ee7dfea046ab610b3d4ad.ctex"]
+source_file="res://Assets/Icons/search.svg"
+dest_files=["res://.godot/imported/search.svg-1a2b06368a6d95d720ef3acf028b44e6.ctex"]
[params]
diff --git a/Icons/x.svg b/Assets/Icons/x.svg
similarity index 100%
rename from Icons/x.svg
rename to Assets/Icons/x.svg
diff --git a/Icons/x.svg.import b/Assets/Icons/x.svg.import
similarity index 77%
rename from Icons/x.svg.import
rename to Assets/Icons/x.svg.import
index 757408a..521d0ae 100644
--- a/Icons/x.svg.import
+++ b/Assets/Icons/x.svg.import
@@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://gq8g7t4s3ryg"
-path="res://.godot/imported/x.svg-4402340e2f725e924f2e7d83afde3bea.ctex"
+path="res://.godot/imported/x.svg-0cde62f4f4d7229f6d4217f24c8f641d.ctex"
metadata={
"vram_texture": false
}
[deps]
-source_file="res://Icons/x.svg"
-dest_files=["res://.godot/imported/x.svg-4402340e2f725e924f2e7d83afde3bea.ctex"]
+source_file="res://Assets/Icons/x.svg"
+dest_files=["res://.godot/imported/x.svg-0cde62f4f4d7229f6d4217f24c8f641d.ctex"]
[params]
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..8ca1494
--- /dev/null
+++ b/README.md
@@ -0,0 +1,7 @@
+TODO:
+1. Write a new **selection system**. Godot's built-in `RichTextLabel` selection is limited by the node's boundaries. In normal web, holding click and dragging your mouse across the screen will select text across multiple nodes. Godot doesn't have a "set_selected_text" property, despite having one for "get_selected_text".
+2. **Right-click Dropdown** for basic text operations (Copy, Paste, Cut). Download options for images
+3. **Select-all CTRL+A shortcut**
+4. **Scrolling** in the website container
+5. **Store** tab containers so switching tabs won't erase previous tab.
+6. **GIF** support
\ No newline at end of file
diff --git a/Ref/methods.gd b/Ref/methods.gd
index 1ef10f8..701b587 100644
--- a/Ref/methods.gd
+++ b/Ref/methods.gd
@@ -69,4 +69,4 @@ func _log_element_tree(element: HTMLParser.HTMLElement, depth: int):
_log_result(element_info)
for child in element.children:
- _log_element_tree(child, depth + 1)
\ No newline at end of file
+ _log_element_tree(child, depth + 1)
diff --git a/Scenes/Styles/BrowserText.tres b/Scenes/Styles/BrowserText.tres
new file mode 100644
index 0000000..4580c8a
--- /dev/null
+++ b/Scenes/Styles/BrowserText.tres
@@ -0,0 +1,32 @@
+[gd_resource type="Theme" load_steps=7 format=3 uid="uid://bn6rbmdy60lhr"]
+
+[sub_resource type="SystemFont" id="SystemFont_jecr6"]
+font_names = PackedStringArray("Serif")
+font_weight = 700
+
+[sub_resource type="SystemFont" id="SystemFont_75mhk"]
+font_names = PackedStringArray("Serif")
+font_italic = true
+font_weight = 700
+
+[sub_resource type="SystemFont" id="SystemFont_3k2jb"]
+font_names = PackedStringArray("Serif")
+font_italic = true
+
+[sub_resource type="SystemFont" id="SystemFont_u0shw"]
+font_names = PackedStringArray("Monospace")
+
+[sub_resource type="SystemFont" id="SystemFont_g4dwp"]
+font_names = PackedStringArray("Serif")
+
+[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_jecr6"]
+
+[resource]
+RichTextLabel/colors/font_selected_color = Color(1, 1, 1, 1)
+RichTextLabel/colors/selection_color = Color(0.313726, 0.403922, 0.8, 1)
+RichTextLabel/fonts/bold_font = SubResource("SystemFont_jecr6")
+RichTextLabel/fonts/bold_italics_font = SubResource("SystemFont_75mhk")
+RichTextLabel/fonts/italics_font = SubResource("SystemFont_3k2jb")
+RichTextLabel/fonts/mono_font = SubResource("SystemFont_u0shw")
+RichTextLabel/fonts/normal_font = SubResource("SystemFont_g4dwp")
+RichTextLabel/styles/focus = SubResource("StyleBoxEmpty_jecr6")
diff --git a/Scenes/Tab.tscn b/Scenes/Tab.tscn
index 178a919..b97d65f 100644
--- a/Scenes/Tab.tscn
+++ b/Scenes/Tab.tscn
@@ -1,11 +1,12 @@
-[gd_scene load_steps=11 format=3 uid="uid://sqhcxhcre081"]
+[gd_scene load_steps=12 format=3 uid="uid://sqhcxhcre081"]
[ext_resource type="Script" uid="uid://crpnnfqm3k5xv" path="res://Scripts/Tab.gd" id="1_q3baj"]
-[ext_resource type="Texture2D" uid="uid://gq8g7t4s3ryg" path="res://Icons/x.svg" id="2_pisds"]
+[ext_resource type="Texture2D" uid="uid://gq8g7t4s3ryg" path="res://Assets/Icons/x.svg" id="2_pisds"]
[ext_resource type="StyleBox" uid="uid://fd1nftmqox32" path="res://Scenes/Styles/TabHoverDefault.tres" id="3_kjcxk"]
[ext_resource type="Texture2D" uid="uid://c7u7a1u1v04bx" path="res://Scenes/Styles/TabGradientDefault.tres" id="3_q3baj"]
[ext_resource type="StyleBox" uid="uid://bx3sgro1ageff" path="res://Scenes/Styles/TabDefault.tres" id="4_ib6pj"]
-[ext_resource type="Texture2D" uid="uid://dioe63fr47oq7" path="res://Scripts/youtube.png" id="6_bdsd2"]
+[ext_resource type="Texture2D" uid="uid://dglkjumm1q4lo" path="res://Assets/Icons/23x23-empty.svg" id="5_ib6pj"]
+[ext_resource type="Texture2D" uid="uid://70k6bw18rsri" path="res://icon.svg" id="6_ib6pj"]
[ext_resource type="StyleBox" uid="uid://dn8exdnk8tjce" path="res://Scenes/Styles/CloseButtonHover.tres" id="6_pisds"]
[ext_resource type="StyleBox" uid="uid://dn6r16retee3l" path="res://Scenes/Styles/CloseButtonNormal.tres" id="7_1ohlo"]
@@ -45,10 +46,20 @@ theme_override_styles/pressed = ExtResource("3_kjcxk")
theme_override_styles/normal = ExtResource("4_ib6pj")
action_mode = 0
text = "(2) YouTube - STOP PLAYING WITH ME BITCHES FR"
-icon = ExtResource("6_bdsd2")
+icon = ExtResource("5_ib6pj")
alignment = 0
text_overrun_behavior = 3
+[node name="Icon" type="TextureRect" parent="."]
+custom_minimum_size = Vector2(23, 23)
+layout_mode = 0
+offset_left = 8.0
+offset_top = 13.0
+offset_right = 31.0
+offset_bottom = 36.0
+texture = ExtResource("6_ib6pj")
+expand_mode = 1
+
[node name="CloseButton" type="Button" parent="."]
z_index = 2
custom_minimum_size = Vector2(34, 34)
diff --git a/Scenes/Tags/bold.tscn b/Scenes/Tags/bold.tscn
new file mode 100644
index 0000000..2101c2c
--- /dev/null
+++ b/Scenes/Tags/bold.tscn
@@ -0,0 +1,23 @@
+[gd_scene load_steps=3 format=3 uid="uid://ijrbim6j8e36"]
+
+[ext_resource type="Script" uid="uid://chdftsciuecfk" path="res://Scripts/Tags/bold.gd" id="1_04sgx"]
+[ext_resource type="Theme" uid="uid://bn6rbmdy60lhr" path="res://Scenes/Styles/BrowserText.tres" id="1_mtsji"]
+
+[node name="BOLD" type="VBoxContainer"]
+anchors_preset = 10
+anchor_right = 1.0
+grow_horizontal = 2
+theme = ExtResource("1_mtsji")
+script = ExtResource("1_04sgx")
+
+[node name="RichTextLabel" type="RichTextLabel" parent="."]
+layout_mode = 2
+size_flags_horizontal = 3
+focus_mode = 2
+mouse_default_cursor_shape = 1
+theme = ExtResource("1_mtsji")
+theme_override_colors/default_color = Color(0, 0, 0, 1)
+bbcode_enabled = true
+text = "What the sigma"
+fit_content = true
+selection_enabled = true
diff --git a/Scenes/Tags/br.tscn b/Scenes/Tags/br.tscn
new file mode 100644
index 0000000..1d9f528
--- /dev/null
+++ b/Scenes/Tags/br.tscn
@@ -0,0 +1,10 @@
+[gd_scene load_steps=2 format=3 uid="uid://dmnpful5xhtrk"]
+
+[ext_resource type="Script" uid="uid://csd2kcqixac65" path="res://Scripts/Tags/br.gd" id="1_7hb8m"]
+
+[node name="BR" type="Control"]
+layout_mode = 3
+anchors_preset = 10
+anchor_right = 1.0
+grow_horizontal = 2
+script = ExtResource("1_7hb8m")
diff --git a/Scenes/Tags/code.tscn b/Scenes/Tags/code.tscn
new file mode 100644
index 0000000..5e2cab9
--- /dev/null
+++ b/Scenes/Tags/code.tscn
@@ -0,0 +1,22 @@
+[gd_scene load_steps=3 format=3 uid="uid://i5otagppegeo"]
+
+[ext_resource type="Script" uid="uid://c3dnmqsnj0akr" path="res://Scripts/Tags/code.gd" id="1_g4dwp"]
+[ext_resource type="Theme" uid="uid://bn6rbmdy60lhr" path="res://Scenes/Styles/BrowserText.tres" id="2_u0shw"]
+
+[node name="CODE" type="VBoxContainer"]
+anchors_preset = 10
+anchor_right = 1.0
+grow_horizontal = 2
+script = ExtResource("1_g4dwp")
+
+[node name="RichTextLabel" type="RichTextLabel" parent="."]
+layout_mode = 2
+size_flags_horizontal = 3
+focus_mode = 2
+mouse_default_cursor_shape = 1
+theme = ExtResource("2_u0shw")
+theme_override_colors/default_color = Color(0, 0, 0, 1)
+bbcode_enabled = true
+text = "What the sigma"
+fit_content = true
+selection_enabled = true
diff --git a/Scenes/Tags/h1.tscn b/Scenes/Tags/h1.tscn
new file mode 100644
index 0000000..e69de29
diff --git a/Scenes/Tags/img.tscn b/Scenes/Tags/img.tscn
new file mode 100644
index 0000000..7092cb6
--- /dev/null
+++ b/Scenes/Tags/img.tscn
@@ -0,0 +1,10 @@
+[gd_scene load_steps=2 format=3 uid="uid://b5rpke43iqfkt"]
+
+[ext_resource type="Script" uid="uid://dgakysfyq773t" path="res://Scripts/Tags/img.gd" id="1_clm6l"]
+
+[node name="TextureRect" type="TextureRect"]
+size_flags_horizontal = 0
+size_flags_vertical = 0
+expand_mode = 1
+stretch_mode = 2
+script = ExtResource("1_clm6l")
diff --git a/Scenes/Tags/italic.tscn b/Scenes/Tags/italic.tscn
new file mode 100644
index 0000000..0de7c4f
--- /dev/null
+++ b/Scenes/Tags/italic.tscn
@@ -0,0 +1,22 @@
+[gd_scene load_steps=3 format=3 uid="uid://bdw0ahhesgnvr"]
+
+[ext_resource type="Script" uid="uid://bamty87whxwxi" path="res://Scripts/Tags/italic.gd" id="1_ch1cm"]
+[ext_resource type="Theme" uid="uid://bn6rbmdy60lhr" path="res://Scenes/Styles/BrowserText.tres" id="1_vh1cg"]
+
+[node name="ITALIC" type="VBoxContainer"]
+anchors_preset = 10
+anchor_right = 1.0
+grow_horizontal = 2
+theme = ExtResource("1_vh1cg")
+script = ExtResource("1_ch1cm")
+
+[node name="RichTextLabel" type="RichTextLabel" parent="."]
+layout_mode = 2
+size_flags_horizontal = 3
+focus_mode = 2
+mouse_default_cursor_shape = 1
+theme_override_colors/default_color = Color(0, 0, 0, 1)
+bbcode_enabled = true
+text = "What the sigma"
+fit_content = true
+selection_enabled = true
diff --git a/Scenes/Tags/mark.tscn b/Scenes/Tags/mark.tscn
new file mode 100644
index 0000000..f59d724
--- /dev/null
+++ b/Scenes/Tags/mark.tscn
@@ -0,0 +1,22 @@
+[gd_scene load_steps=3 format=3 uid="uid://dlj64k35igexw"]
+
+[ext_resource type="Script" uid="uid://c2i8dwyyuufff" path="res://Scripts/Tags/mark.gd" id="1_j8rvb"]
+[ext_resource type="Theme" uid="uid://bn6rbmdy60lhr" path="res://Scenes/Styles/BrowserText.tres" id="1_jr508"]
+
+[node name="MARK" type="VBoxContainer"]
+anchors_preset = 10
+anchor_right = 1.0
+grow_horizontal = 2
+theme = ExtResource("1_jr508")
+script = ExtResource("1_j8rvb")
+
+[node name="RichTextLabel" type="RichTextLabel" parent="."]
+layout_mode = 2
+size_flags_horizontal = 3
+focus_mode = 2
+mouse_default_cursor_shape = 1
+theme_override_colors/default_color = Color(0, 0, 0, 1)
+bbcode_enabled = true
+text = "What the sigma"
+fit_content = true
+selection_enabled = true
diff --git a/Scenes/Tags/p.tscn b/Scenes/Tags/p.tscn
new file mode 100644
index 0000000..576101c
--- /dev/null
+++ b/Scenes/Tags/p.tscn
@@ -0,0 +1,22 @@
+[gd_scene load_steps=3 format=3 uid="uid://fr6lovy4ikok"]
+
+[ext_resource type="Script" uid="uid://cg6kjvlx3an1j" path="res://Scripts/Tags/p.gd" id="1_pnbfg"]
+[ext_resource type="Theme" uid="uid://bn6rbmdy60lhr" path="res://Scenes/Styles/BrowserText.tres" id="2_1glvj"]
+
+[node name="P" type="VBoxContainer"]
+anchors_preset = 10
+anchor_right = 1.0
+grow_horizontal = 2
+script = ExtResource("1_pnbfg")
+
+[node name="RichTextLabel" type="RichTextLabel" parent="."]
+layout_mode = 2
+size_flags_horizontal = 3
+focus_mode = 2
+mouse_default_cursor_shape = 1
+theme = ExtResource("2_1glvj")
+theme_override_colors/default_color = Color(0, 0, 0, 1)
+bbcode_enabled = true
+text = "What the sigma"
+fit_content = true
+selection_enabled = true
diff --git a/Scenes/Tags/pre.tscn b/Scenes/Tags/pre.tscn
new file mode 100644
index 0000000..d352134
--- /dev/null
+++ b/Scenes/Tags/pre.tscn
@@ -0,0 +1,22 @@
+[gd_scene load_steps=3 format=3 uid="uid://byt2tvxanciuk"]
+
+[ext_resource type="Script" uid="uid://8mam5rvtx72x" path="res://Scripts/Tags/pre.gd" id="1_7hb8m"]
+[ext_resource type="Theme" uid="uid://bn6rbmdy60lhr" path="res://Scenes/Styles/BrowserText.tres" id="1_xp1ft"]
+
+[node name="PRE" type="VBoxContainer"]
+anchors_preset = 10
+anchor_right = 1.0
+grow_horizontal = 2
+theme = ExtResource("1_xp1ft")
+script = ExtResource("1_7hb8m")
+
+[node name="RichTextLabel" type="RichTextLabel" parent="."]
+layout_mode = 2
+size_flags_horizontal = 3
+focus_mode = 2
+mouse_default_cursor_shape = 1
+theme_override_colors/default_color = Color(0, 0, 0, 1)
+bbcode_enabled = true
+text = "What the sigma"
+fit_content = true
+selection_enabled = true
diff --git a/Scenes/Tags/separator.tscn b/Scenes/Tags/separator.tscn
new file mode 100644
index 0000000..c8d7f71
--- /dev/null
+++ b/Scenes/Tags/separator.tscn
@@ -0,0 +1,8 @@
+[gd_scene load_steps=2 format=3 uid="uid://drfl5d5o2cudk"]
+
+[ext_resource type="Script" uid="uid://rol353cupbbf" path="res://Scripts/Tags/separator.gd" id="1_pu577"]
+
+[node name="Separator" type="Control"]
+layout_mode = 3
+anchors_preset = 0
+script = ExtResource("1_pu577")
diff --git a/Scenes/Tags/small.tscn b/Scenes/Tags/small.tscn
new file mode 100644
index 0000000..03a490a
--- /dev/null
+++ b/Scenes/Tags/small.tscn
@@ -0,0 +1,22 @@
+[gd_scene load_steps=3 format=3 uid="uid://btiiex1eu1krs"]
+
+[ext_resource type="Script" uid="uid://xr7n1lat501x" path="res://Scripts/Tags/small.gd" id="1_5vt6h"]
+[ext_resource type="Theme" uid="uid://bn6rbmdy60lhr" path="res://Scenes/Styles/BrowserText.tres" id="1_yi3vu"]
+
+[node name="SMALL" type="VBoxContainer"]
+anchors_preset = 10
+anchor_right = 1.0
+grow_horizontal = 2
+theme = ExtResource("1_yi3vu")
+script = ExtResource("1_5vt6h")
+
+[node name="RichTextLabel" type="RichTextLabel" parent="."]
+layout_mode = 2
+size_flags_horizontal = 3
+focus_mode = 2
+mouse_default_cursor_shape = 1
+theme_override_colors/default_color = Color(0, 0, 0, 1)
+bbcode_enabled = true
+text = "What the sigma"
+fit_content = true
+selection_enabled = true
diff --git a/Scenes/Tags/underline.tscn b/Scenes/Tags/underline.tscn
new file mode 100644
index 0000000..dfaa164
--- /dev/null
+++ b/Scenes/Tags/underline.tscn
@@ -0,0 +1,22 @@
+[gd_scene load_steps=3 format=3 uid="uid://br7ys1wgsp5om"]
+
+[ext_resource type="Script" uid="uid://x0hphtm8kf12" path="res://Scripts/Tags/underline.gd" id="1_7hb8m"]
+[ext_resource type="Theme" uid="uid://bn6rbmdy60lhr" path="res://Scenes/Styles/BrowserText.tres" id="1_xp1ft"]
+
+[node name="UNDERLINE" type="VBoxContainer"]
+anchors_preset = 10
+anchor_right = 1.0
+grow_horizontal = 2
+theme = ExtResource("1_xp1ft")
+script = ExtResource("1_7hb8m")
+
+[node name="RichTextLabel" type="RichTextLabel" parent="."]
+layout_mode = 2
+size_flags_horizontal = 3
+focus_mode = 2
+mouse_default_cursor_shape = 1
+theme_override_colors/default_color = Color(0, 0, 0, 1)
+bbcode_enabled = true
+text = "What the sigma"
+fit_content = true
+selection_enabled = true
diff --git a/Scenes/main.tscn b/Scenes/main.tscn
index 797da50..3b6b536 100644
--- a/Scenes/main.tscn
+++ b/Scenes/main.tscn
@@ -1,14 +1,14 @@
-[gd_scene load_steps=22 format=3 uid="uid://bytm7bt2s4ak8"]
+[gd_scene load_steps=23 format=3 uid="uid://bytm7bt2s4ak8"]
[ext_resource type="Script" uid="uid://bg5iqnwic1rio" path="res://Scripts/main.gd" id="1_8q3xr"]
-[ext_resource type="Texture2D" uid="uid://df1m4j7uxi63v" path="res://Icons/chevron-down.svg" id="2_6bp64"]
+[ext_resource type="Texture2D" uid="uid://df1m4j7uxi63v" path="res://Assets/Icons/chevron-down.svg" id="2_6bp64"]
[ext_resource type="Script" uid="uid://cy0c74thgjwok" path="res://Scripts/TabContainer.gd" id="2_hptm8"]
-[ext_resource type="Texture2D" uid="uid://bf0vx7qwo28k6" path="res://Icons/search.svg" id="3_8gbba"]
-[ext_resource type="Texture2D" uid="uid://bp42ccs2nmbmw" path="res://Icons/arrow-left.svg" id="3_21xkr"]
-[ext_resource type="Texture2D" uid="uid://dyyylow47qd0k" path="res://Icons/arrow-right.svg" id="4_6bp64"]
+[ext_resource type="Texture2D" uid="uid://bf0vx7qwo28k6" path="res://Assets/Icons/search.svg" id="3_8gbba"]
+[ext_resource type="Texture2D" uid="uid://bp42ccs2nmbmw" path="res://Assets/Icons/arrow-left.svg" id="3_21xkr"]
+[ext_resource type="Texture2D" uid="uid://dyyylow47qd0k" path="res://Assets/Icons/arrow-right.svg" id="4_6bp64"]
[ext_resource type="PackedScene" uid="uid://sqhcxhcre081" path="res://Scenes/Tab.tscn" id="4_344ge"]
-[ext_resource type="Texture2D" uid="uid://cu4hjoba6etf" path="res://Icons/rotate-cw.svg" id="5_344ge"]
-[ext_resource type="Texture2D" uid="uid://cehbtwq6gq0cn" path="res://Icons/plus.svg" id="5_ynf5e"]
+[ext_resource type="Texture2D" uid="uid://cu4hjoba6etf" path="res://Assets/Icons/rotate-cw.svg" id="5_344ge"]
+[ext_resource type="Texture2D" uid="uid://cehbtwq6gq0cn" path="res://Assets/Icons/plus.svg" id="5_ynf5e"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_344ge"]
@@ -61,13 +61,16 @@ expand_margin_left = 40.0
LineEdit/styles/focus = SubResource("StyleBoxEmpty_8gbba")
LineEdit/styles/normal = SubResource("StyleBoxFlat_8gbba")
+[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_white"]
+bg_color = Color(1, 1, 1, 1)
+
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_6iyac"]
bg_color = Color(0.105882, 0.105882, 0.105882, 1)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_21xkr"]
bg_color = Color(0.168627, 0.168627, 0.168627, 1)
-[node name="Control" type="Control"]
+[node name="Main" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
@@ -187,17 +190,23 @@ stretch_mode = 5
custom_minimum_size = Vector2(0, 5)
layout_mode = 2
-[node name="BottomContainer" type="Control" parent="VBoxContainer"]
+[node name="WebsiteContainer" type="VBoxContainer" parent="VBoxContainer"]
+unique_name_in_owner = true
layout_mode = 2
size_flags_vertical = 3
+theme_override_constants/separation = 22
-[node name="ColorRect2" type="ColorRect" parent="VBoxContainer/BottomContainer"]
+[node name="WebsiteBackground" type="Panel" parent="."]
+z_index = -1
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
+offset_top = 125.0
grow_horizontal = 2
grow_vertical = 2
+mouse_filter = 2
+theme_override_styles/panel = SubResource("StyleBoxFlat_white")
[node name="Panel" type="Panel" parent="."]
z_index = -5
@@ -212,7 +221,7 @@ theme_override_styles/panel = SubResource("StyleBoxFlat_6iyac")
z_index = -6
layout_mode = 2
offset_right = 1920.0
-offset_bottom = 117.0
+offset_bottom = 125.0
mouse_filter = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_21xkr")
diff --git a/Scripts/B9/HTMLParser.gd b/Scripts/B9/HTMLParser.gd
index 7964c18..447dac6 100644
--- a/Scripts/B9/HTMLParser.gd
+++ b/Scripts/B9/HTMLParser.gd
@@ -23,6 +23,18 @@ class HTMLElement:
func get_id() -> String:
return get_attribute("id")
+
+ func get_collapsed_text() -> String:
+ # Collapse whitespace: replace multiple spaces, tabs, newlines with single space
+ var collapsed = text_content.strip_edges()
+ # Replace multiple whitespace characters with single space
+ var regex = RegEx.new()
+ regex.compile("\\s+")
+ return regex.sub(collapsed, " ", true)
+
+ func get_preserved_text() -> String:
+ # For pre tags - preserve all whitespace
+ return text_content
class ParseResult:
var root: HTMLElement
@@ -149,6 +161,10 @@ func get_title() -> String:
var title_element = find_first("title")
return title_element.text_content if title_element != null else ""
+func get_icon() -> String:
+ var icon_element = find_first("icon")
+ return icon_element.get_attribute("src")
+
func get_meta_content(name_: String) -> String:
var meta_elements = find_all("meta", "name")
for element in meta_elements:
diff --git a/Scripts/Network.gd b/Scripts/Network.gd
new file mode 100644
index 0000000..d0882c4
--- /dev/null
+++ b/Scripts/Network.gd
@@ -0,0 +1,61 @@
+extends Node
+
+func fetch_image(url: String) -> ImageTexture:
+ var http_request = HTTPRequest.new()
+ add_child(http_request)
+
+ var error = http_request.request(url)
+ if error != OK:
+ print("Error making HTTP request: ", error)
+ http_request.queue_free()
+ return null
+
+ var response = await http_request.request_completed
+
+ var result = response[0] # HTTPClient.Result
+ var response_code = response[1] # int
+ var headers = response[2] # PackedStringArray
+ var body = response[3] # PackedByteArray
+
+ http_request.queue_free()
+
+ if result != HTTPRequest.RESULT_SUCCESS or response_code != 200:
+ print("Failed to fetch image. Result: ", result, " Response code: ", response_code)
+ return null
+
+ # Get content type from headers
+ var content_type = ""
+ for header in headers:
+ if header.to_lower().begins_with("content-type:"):
+ content_type = header.split(":")[1].strip_edges().to_lower()
+ break
+
+ var image: Image = Image.new()
+ var load_error
+
+ # Load image based on content type
+ if content_type.contains("png") or url.to_lower().ends_with(".png"):
+ load_error = image.load_png_from_buffer(body)
+ elif content_type.contains("jpeg") or content_type.contains("jpg") or url.to_lower().ends_with(".jpg") or url.to_lower().ends_with(".jpeg"):
+ load_error = image.load_jpg_from_buffer(body)
+ elif content_type.contains("webp") or url.to_lower().ends_with(".webp"):
+ load_error = image.load_webp_from_buffer(body)
+ elif content_type.contains("bmp"):
+ load_error = image.load_bmp_from_buffer(body)
+ elif content_type.contains("tga"):
+ load_error = image.load_tga_from_buffer(body)
+ else:
+ print("Unknown or missing content-type. Attempting bruteforce converting across PNG, JPG and WebP...")
+ load_error = image.load_png_from_buffer(body)
+ if load_error != OK:
+ load_error = image.load_jpg_from_buffer(body)
+ if load_error != OK:
+ load_error = image.load_webp_from_buffer(body)
+
+ if load_error != OK:
+ print("Failed to load image from buffer. Content-Type: ", content_type, " Error: ", load_error)
+ return null
+
+ var texture = ImageTexture.create_from_image(image)
+
+ return texture
diff --git a/Scripts/Network.gd.uid b/Scripts/Network.gd.uid
new file mode 100644
index 0000000..44bfee9
--- /dev/null
+++ b/Scripts/Network.gd.uid
@@ -0,0 +1 @@
+uid://bbfpng3opsnyp
diff --git a/Scripts/Tab.gd b/Scripts/Tab.gd
index 4e9ba1d..49ebbd2 100644
--- a/Scripts/Tab.gd
+++ b/Scripts/Tab.gd
@@ -7,6 +7,7 @@ signal tab_closed
@onready var gradient_texture: TextureRect = $GradientTexture
@onready var button: Button = $Button
@onready var close_button: Button = $CloseButton
+@onready var icon: TextureRect = $Icon
const TAB_GRADIENT: GradientTexture2D = preload("res://Scenes/Styles/TabGradient.tres")
const TAB_GRADIENT_DEFAULT: GradientTexture2D = preload("res://Scenes/Styles/TabGradientDefault.tres")
@@ -36,6 +37,13 @@ func _process(_delta):
else:
close_button.add_theme_stylebox_override("normal", CLOSE_BUTTON_NORMAL)
+func set_title(title: String) -> void:
+ button.text = title
+
+func set_icon(new_icon: Texture) -> void:
+ icon.texture = new_icon
+ icon.rotation = 0
+
func _on_button_mouse_entered() -> void:
mouse_over_tab = true
if is_active: return
diff --git a/Scripts/TabContainer.gd b/Scripts/TabContainer.gd
index 876461a..82f388f 100644
--- a/Scripts/TabContainer.gd
+++ b/Scripts/TabContainer.gd
@@ -1,8 +1,11 @@
+class_name TabManager
extends HFlowContainer
var tabs: Array[Tab] = []
var active_tab := 0
+@onready var main: Main = $"../.."
+
const TAB = preload("res://Scenes/Tab.tscn")
const TAB_NORMAL: StyleBoxFlat = preload("res://Scenes/Styles/TabNormal.tres")
@@ -79,6 +82,9 @@ func create_tab() -> void:
h_box_container.add_child(tab)
set_active_tab(index)
+
+ # WARNING: temporary
+ main.render()
func _input(event: InputEvent) -> void:
if Input.is_action_just_pressed("NewTab"):
diff --git a/Scripts/Tags/bold.gd b/Scripts/Tags/bold.gd
new file mode 100644
index 0000000..b7c7403
--- /dev/null
+++ b/Scripts/Tags/bold.gd
@@ -0,0 +1,5 @@
+extends VBoxContainer
+
+func init(element: HTMLParser.HTMLElement) -> void:
+ var label: RichTextLabel = $RichTextLabel
+ label.text = "[font_size=24][b]%s[/b][/font_size]" % element.get_collapsed_text()
diff --git a/Scripts/Tags/bold.gd.uid b/Scripts/Tags/bold.gd.uid
new file mode 100644
index 0000000..9fb8059
--- /dev/null
+++ b/Scripts/Tags/bold.gd.uid
@@ -0,0 +1 @@
+uid://chdftsciuecfk
diff --git a/Scripts/Tags/br.gd b/Scripts/Tags/br.gd
new file mode 100644
index 0000000..74b39c1
--- /dev/null
+++ b/Scripts/Tags/br.gd
@@ -0,0 +1,4 @@
+extends Control
+
+func init(element: HTMLParser.HTMLElement) -> void:
+ custom_minimum_size.y = 24
diff --git a/Scripts/Tags/br.gd.uid b/Scripts/Tags/br.gd.uid
new file mode 100644
index 0000000..f137bb5
--- /dev/null
+++ b/Scripts/Tags/br.gd.uid
@@ -0,0 +1 @@
+uid://csd2kcqixac65
diff --git a/Scripts/Tags/code.gd b/Scripts/Tags/code.gd
new file mode 100644
index 0000000..670d888
--- /dev/null
+++ b/Scripts/Tags/code.gd
@@ -0,0 +1,5 @@
+extends VBoxContainer
+
+func init(element: HTMLParser.HTMLElement) -> void:
+ var label: RichTextLabel = $RichTextLabel
+ label.text = "[font_size=20][code]%s[/code][/font_size]" % element.get_collapsed_text()
diff --git a/Scripts/Tags/code.gd.uid b/Scripts/Tags/code.gd.uid
new file mode 100644
index 0000000..2d000d1
--- /dev/null
+++ b/Scripts/Tags/code.gd.uid
@@ -0,0 +1 @@
+uid://c3dnmqsnj0akr
diff --git a/Scripts/Tags/img.gd b/Scripts/Tags/img.gd
new file mode 100644
index 0000000..f89b735
--- /dev/null
+++ b/Scripts/Tags/img.gd
@@ -0,0 +1,11 @@
+extends TextureRect
+
+func init(element: HTMLParser.HTMLElement) -> void:
+ var src = element.get_attribute("src")
+ if !src: return print("Ignoring tag without \"src\" attribute.")
+
+ texture = await Network.fetch_image(src)
+
+ var texture_size = texture.get_size()
+ custom_minimum_size = texture_size
+ size = texture_size
diff --git a/Scripts/Tags/img.gd.uid b/Scripts/Tags/img.gd.uid
new file mode 100644
index 0000000..2a7471f
--- /dev/null
+++ b/Scripts/Tags/img.gd.uid
@@ -0,0 +1 @@
+uid://dgakysfyq773t
diff --git a/Scripts/Tags/italic.gd b/Scripts/Tags/italic.gd
new file mode 100644
index 0000000..68f5577
--- /dev/null
+++ b/Scripts/Tags/italic.gd
@@ -0,0 +1,5 @@
+extends VBoxContainer
+
+func init(element: HTMLParser.HTMLElement) -> void:
+ var label: RichTextLabel = $RichTextLabel
+ label.text = "[font_size=24][i]%s[/i][/font_size]" % element.get_collapsed_text()
diff --git a/Scripts/Tags/italic.gd.uid b/Scripts/Tags/italic.gd.uid
new file mode 100644
index 0000000..ca360bd
--- /dev/null
+++ b/Scripts/Tags/italic.gd.uid
@@ -0,0 +1 @@
+uid://bamty87whxwxi
diff --git a/Scripts/Tags/mark.gd b/Scripts/Tags/mark.gd
new file mode 100644
index 0000000..c6e3e1c
--- /dev/null
+++ b/Scripts/Tags/mark.gd
@@ -0,0 +1,5 @@
+extends VBoxContainer
+
+func init(element: HTMLParser.HTMLElement) -> void:
+ var label: RichTextLabel = $RichTextLabel
+ label.text = "[font_size=24][bgcolor=#FFFF00]%s[/bgcolor][/font_size]" % element.get_collapsed_text()
diff --git a/Scripts/Tags/mark.gd.uid b/Scripts/Tags/mark.gd.uid
new file mode 100644
index 0000000..57a6073
--- /dev/null
+++ b/Scripts/Tags/mark.gd.uid
@@ -0,0 +1 @@
+uid://c2i8dwyyuufff
diff --git a/Scripts/Tags/p.gd b/Scripts/Tags/p.gd
new file mode 100644
index 0000000..1b83ded
--- /dev/null
+++ b/Scripts/Tags/p.gd
@@ -0,0 +1,5 @@
+extends Control
+
+func init(element: HTMLParser.HTMLElement) -> void:
+ var label: RichTextLabel = $RichTextLabel
+ label.text = "[font_size=24]%s[/font_size]" % element.get_collapsed_text()
diff --git a/Scripts/Tags/p.gd.uid b/Scripts/Tags/p.gd.uid
new file mode 100644
index 0000000..31a189f
--- /dev/null
+++ b/Scripts/Tags/p.gd.uid
@@ -0,0 +1 @@
+uid://cg6kjvlx3an1j
diff --git a/Scripts/Tags/pre.gd b/Scripts/Tags/pre.gd
new file mode 100644
index 0000000..9da741e
--- /dev/null
+++ b/Scripts/Tags/pre.gd
@@ -0,0 +1,5 @@
+extends VBoxContainer
+
+func init(element: HTMLParser.HTMLElement) -> void:
+ var label: RichTextLabel = $RichTextLabel
+ label.text = "[font_size=20][code]%s[/code][/font_size]" % element.get_preserved_text()
diff --git a/Scripts/Tags/pre.gd.uid b/Scripts/Tags/pre.gd.uid
new file mode 100644
index 0000000..da86787
--- /dev/null
+++ b/Scripts/Tags/pre.gd.uid
@@ -0,0 +1 @@
+uid://8mam5rvtx72x
diff --git a/Scripts/Tags/separator.gd b/Scripts/Tags/separator.gd
new file mode 100644
index 0000000..b2da732
--- /dev/null
+++ b/Scripts/Tags/separator.gd
@@ -0,0 +1,26 @@
+extends Control
+
+var separator_node: Separator
+
+func init(element: HTMLParser.HTMLElement) -> void:
+ var direction = element.get_attribute("direction")
+
+ if direction == "vertical":
+ separator_node = VSeparator.new()
+ separator_node.size_flags_vertical = Control.SIZE_EXPAND_FILL
+ separator_node.custom_minimum_size.x = 2
+ separator_node.layout_mode = 1
+ separator_node.anchors_preset = Control.PRESET_LEFT_WIDE
+ else:
+ separator_node = HSeparator.new()
+ separator_node.size_flags_horizontal = Control.SIZE_EXPAND_FILL
+ separator_node.custom_minimum_size.y = 2
+ separator_node.layout_mode = 1
+ separator_node.anchors_preset = Control.PRESET_FULL_RECT
+
+ add_child(separator_node)
+
+ # Make the parent control also expand to fill available space
+ size_flags_horizontal = Control.SIZE_EXPAND_FILL
+ if direction == "vertical":
+ size_flags_vertical = Control.SIZE_EXPAND_FILL
diff --git a/Scripts/Tags/separator.gd.uid b/Scripts/Tags/separator.gd.uid
new file mode 100644
index 0000000..892cffe
--- /dev/null
+++ b/Scripts/Tags/separator.gd.uid
@@ -0,0 +1 @@
+uid://rol353cupbbf
diff --git a/Scripts/Tags/small.gd b/Scripts/Tags/small.gd
new file mode 100644
index 0000000..4dd1ad4
--- /dev/null
+++ b/Scripts/Tags/small.gd
@@ -0,0 +1,5 @@
+extends VBoxContainer
+
+func init(element: HTMLParser.HTMLElement) -> void:
+ var label: RichTextLabel = $RichTextLabel
+ label.text = "[font_size=18]%s[/font_size]" % element.get_collapsed_text()
diff --git a/Scripts/Tags/small.gd.uid b/Scripts/Tags/small.gd.uid
new file mode 100644
index 0000000..74fc901
--- /dev/null
+++ b/Scripts/Tags/small.gd.uid
@@ -0,0 +1 @@
+uid://xr7n1lat501x
diff --git a/Scripts/Tags/underline.gd b/Scripts/Tags/underline.gd
new file mode 100644
index 0000000..e3726ea
--- /dev/null
+++ b/Scripts/Tags/underline.gd
@@ -0,0 +1,5 @@
+extends VBoxContainer
+
+func init(element: HTMLParser.HTMLElement) -> void:
+ var label: RichTextLabel = $RichTextLabel
+ label.text = "[font_size=24][u]%s[/u][/font_size]" % element.get_collapsed_text()
diff --git a/Scripts/Tags/underline.gd.uid b/Scripts/Tags/underline.gd.uid
new file mode 100644
index 0000000..9e71dc7
--- /dev/null
+++ b/Scripts/Tags/underline.gd.uid
@@ -0,0 +1 @@
+uid://x0hphtm8kf12
diff --git a/Scripts/main.gd b/Scripts/main.gd
index 3f605f0..e050d00 100644
--- a/Scripts/main.gd
+++ b/Scripts/main.gd
@@ -1,12 +1,32 @@
+class_name Main
extends Control
-func _ready():
- render()
+@onready var website_container: Control = %WebsiteContainer
+@onready var tab_container: TabManager = $VBoxContainer/TabContainer
+const LOADER_CIRCLE = preload("res://Assets/Icons/loader-circle.svg")
+
+var loading_tween: Tween
+
+const P = preload("res://Scenes/Tags/p.tscn")
+const IMG = preload("res://Scenes/Tags/img.tscn")
+const SEPARATOR = preload("res://Scenes/Tags/separator.tscn")
+const BOLD = preload("res://Scenes/Tags/bold.tscn")
+const ITALIC = preload("res://Scenes/Tags/italic.tscn")
+const UNDERLINE = preload("res://Scenes/Tags/underline.tscn")
+const SMALL = preload("res://Scenes/Tags/small.tscn")
+const MARK = preload("res://Scenes/Tags/mark.tscn")
+const CODE = preload("res://Scenes/Tags/code.tscn")
+const PRE = preload("res://Scenes/Tags/pre.tscn")
+const BR = preload("res://Scenes/Tags/br.tscn")
func render():
+ # Clear existing content
+ for child in website_container.get_children():
+ child.queue_free()
+
var html_bytes = "
Hey there! this is a test
+ This is bold + This is italic + This is underline + this is small + this is marked +this is code
+
+ +Text in a pre element +is displayed in a fixed-width +font, and it preserves +both spaces and +line breaks +- +
+
+