From 4dc99b2d0ac8cb741d1cd968d46026fae70d031e Mon Sep 17 00:00:00 2001 From: dusoleil Date: Sat, 20 Aug 2022 02:09:44 -0400 Subject: Add basic mockups of two screens and prototype navigation --- Main.gd | 16 ++++++++++++ Main.tscn | 47 ++++++++++++++++++++++++++++++++- fonts/DroidSans.ttf | Bin 0 -> 190776 bytes screens/Task/Body.tscn | 57 +++++++++++++++++++++++++++++++++++++++++ screens/Task/Header.gd | 4 +++ screens/Task/Header.tscn | 33 ++++++++++++++++++++++++ screens/Task/SubtaskItem.tscn | 23 +++++++++++++++++ screens/TimeSlot/Body.tscn | 37 ++++++++++++++++++++++++++ screens/TimeSlot/Header.gd | 4 +++ screens/TimeSlot/Header.tscn | 33 ++++++++++++++++++++++++ screens/TimeSlot/TaskItem.tscn | 53 ++++++++++++++++++++++++++++++++++++++ 11 files changed, 306 insertions(+), 1 deletion(-) create mode 100644 Main.gd create mode 100644 fonts/DroidSans.ttf create mode 100644 screens/Task/Body.tscn create mode 100644 screens/Task/Header.gd create mode 100644 screens/Task/Header.tscn create mode 100644 screens/Task/SubtaskItem.tscn create mode 100644 screens/TimeSlot/Body.tscn create mode 100644 screens/TimeSlot/Header.gd create mode 100644 screens/TimeSlot/Header.tscn create mode 100644 screens/TimeSlot/TaskItem.tscn diff --git a/Main.gd b/Main.gd new file mode 100644 index 0000000..0a80683 --- /dev/null +++ b/Main.gd @@ -0,0 +1,16 @@ +extends Control + +onready var header_container = $"%HeaderContent" +onready var body_container = $"%BodyContent" + +func nav_screen(new_screen): + if header_container.get_child_count() > 0: + header_container.get_child(0).queue_free() + header_container.add_child(load("res://screens/"+new_screen+"/Header.tscn").instance()) + if body_container.get_child_count() > 0: + body_container.get_child(0).queue_free() + body_container.add_child(load("res://screens/"+new_screen+"/Body.tscn").instance()) + +func _ready(): + nav_screen("TimeSlot") + diff --git a/Main.tscn b/Main.tscn index 29114cb..8d16835 100644 --- a/Main.tscn +++ b/Main.tscn @@ -1,5 +1,50 @@ -[gd_scene format=2] +[gd_scene load_steps=4 format=2] + +[ext_resource path="res://Main.gd" type="Script" id=1] + +[sub_resource type="StyleBoxFlat" id=2] +bg_color = Color( 0.0784314, 0.0745098, 0.0745098, 1 ) + +[sub_resource type="StyleBoxFlat" id=1] +bg_color = Color( 0.501961, 0.501961, 0.501961, 1 ) [node name="Main" type="Control"] anchor_right = 1.0 anchor_bottom = 1.0 +script = ExtResource( 1 ) + +[node name="Background" type="PanelContainer" parent="."] +anchor_right = 1.0 +anchor_bottom = 1.0 +custom_styles/panel = SubResource( 2 ) + +[node name="VBoxContainer" type="VBoxContainer" parent="Background"] +margin_right = 1080.0 +margin_bottom = 1920.0 + +[node name="HeaderBackground" type="PanelContainer" parent="Background/VBoxContainer"] +margin_right = 1080.0 +margin_bottom = 220.0 +size_flags_vertical = 3 +size_flags_stretch_ratio = 0.13 +custom_styles/panel = SubResource( 1 ) + +[node name="HeaderContent" type="MarginContainer" parent="Background/VBoxContainer/HeaderBackground"] +unique_name_in_owner = true +margin_right = 1080.0 +margin_bottom = 220.0 +custom_constants/margin_right = 20 +custom_constants/margin_top = 20 +custom_constants/margin_left = 20 +custom_constants/margin_bottom = 20 + +[node name="BodyContent" type="MarginContainer" parent="Background/VBoxContainer"] +unique_name_in_owner = true +margin_top = 224.0 +margin_right = 1080.0 +margin_bottom = 1920.0 +size_flags_vertical = 3 +custom_constants/margin_right = 20 +custom_constants/margin_top = 20 +custom_constants/margin_left = 20 +custom_constants/margin_bottom = 20 diff --git a/fonts/DroidSans.ttf b/fonts/DroidSans.ttf new file mode 100644 index 0000000..ad1efca Binary files /dev/null and b/fonts/DroidSans.ttf differ diff --git a/screens/Task/Body.tscn b/screens/Task/Body.tscn new file mode 100644 index 0000000..9185ad4 --- /dev/null +++ b/screens/Task/Body.tscn @@ -0,0 +1,57 @@ +[gd_scene load_steps=5 format=2] + +[ext_resource path="res://fonts/DroidSans.ttf" type="DynamicFontData" id=1] +[ext_resource path="res://screens/Task/SubtaskItem.tscn" type="PackedScene" id=2] + +[sub_resource type="DynamicFont" id=2] +size = 100 +font_data = ExtResource( 1 ) + +[sub_resource type="DynamicFont" id=3] +size = 50 +font_data = ExtResource( 1 ) + +[node name="TaskBody" type="VBoxContainer"] +margin_left = 20.0 +margin_top = 20.0 +margin_right = 1046.0 +margin_bottom = 1664.0 + +[node name="HBoxContainer" type="HBoxContainer" parent="."] +margin_right = 1026.0 +margin_bottom = 300.0 + +[node name="Length" type="Label" parent="HBoxContainer"] +margin_right = 511.0 +margin_bottom = 300.0 +rect_min_size = Vector2( 0, 300 ) +size_flags_horizontal = 3 +custom_fonts/font = SubResource( 2 ) +text = "10 min." +valign = 1 +clip_text = true + +[node name="Description" type="TextEdit" parent="HBoxContainer"] +margin_left = 515.0 +margin_right = 1026.0 +margin_bottom = 300.0 +size_flags_horizontal = 3 +custom_fonts/font = SubResource( 3 ) +text = "Do various stretches. +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." +readonly = true +wrap_enabled = true + +[node name="ScrollContainer" type="ScrollContainer" parent="."] +margin_top = 304.0 +margin_right = 1026.0 +margin_bottom = 1644.0 +size_flags_vertical = 3 + +[node name="SubtaskList" type="VBoxContainer" parent="ScrollContainer"] +unique_name_in_owner = true +margin_right = 1026.0 +margin_bottom = 110.0 +size_flags_horizontal = 3 + +[node name="TaskItem" parent="ScrollContainer/SubtaskList" instance=ExtResource( 2 )] diff --git a/screens/Task/Header.gd b/screens/Task/Header.gd new file mode 100644 index 0000000..ed2fe98 --- /dev/null +++ b/screens/Task/Header.gd @@ -0,0 +1,4 @@ +extends HBoxContainer + +func _on_Back_button_up(): + $"/root/Main".nav_screen("TimeSlot") diff --git a/screens/Task/Header.tscn b/screens/Task/Header.tscn new file mode 100644 index 0000000..89e488c --- /dev/null +++ b/screens/Task/Header.tscn @@ -0,0 +1,33 @@ +[gd_scene load_steps=4 format=2] + +[ext_resource path="res://fonts/DroidSans.ttf" type="DynamicFontData" id=1] +[ext_resource path="res://screens/Task/Header.gd" type="Script" id=2] + +[sub_resource type="DynamicFont" id=2] +size = 100 +font_data = ExtResource( 1 ) + +[node name="TaskHeader" type="HBoxContainer"] +margin_left = 20.0 +margin_top = 20.0 +margin_right = 1046.0 +margin_bottom = 198.0 +script = ExtResource( 2 ) + +[node name="Name" type="Label" parent="."] +margin_top = 30.0 +margin_right = 799.0 +margin_bottom = 147.0 +size_flags_horizontal = 3 +custom_fonts/font = SubResource( 2 ) +text = "Stretching" +clip_text = true + +[node name="Back" type="Button" parent="."] +margin_left = 803.0 +margin_right = 1026.0 +margin_bottom = 178.0 +custom_fonts/font = SubResource( 2 ) +text = "Back" + +[connection signal="button_up" from="Back" to="." method="_on_Back_button_up"] diff --git a/screens/Task/SubtaskItem.tscn b/screens/Task/SubtaskItem.tscn new file mode 100644 index 0000000..48fc590 --- /dev/null +++ b/screens/Task/SubtaskItem.tscn @@ -0,0 +1,23 @@ +[gd_scene load_steps=3 format=2] + +[ext_resource path="res://fonts/DroidSans.ttf" type="DynamicFontData" id=1] + +[sub_resource type="DynamicFont" id=1] +size = 72 +font_data = ExtResource( 1 ) + +[node name="TaskItem" type="MarginContainer"] +margin_right = 1026.0 +margin_bottom = 110.0 +custom_constants/margin_top = 5 +custom_constants/margin_bottom = 5 + +[node name="Button" type="Button" parent="."] +margin_top = 5.0 +margin_right = 1026.0 +margin_bottom = 105.0 +rect_min_size = Vector2( 0, 100 ) +custom_fonts/font = SubResource( 1 ) +text = "Hip Flexor" +clip_text = true +align = 0 diff --git a/screens/TimeSlot/Body.tscn b/screens/TimeSlot/Body.tscn new file mode 100644 index 0000000..2e6460a --- /dev/null +++ b/screens/TimeSlot/Body.tscn @@ -0,0 +1,37 @@ +[gd_scene load_steps=4 format=2] + +[ext_resource path="res://fonts/DroidSans.ttf" type="DynamicFontData" id=1] +[ext_resource path="res://screens/TimeSlot/TaskItem.tscn" type="PackedScene" id=2] + +[sub_resource type="DynamicFont" id=2] +size = 100 +font_data = ExtResource( 1 ) + +[node name="TimeSlotBody" type="VBoxContainer"] +margin_left = 20.0 +margin_top = 20.0 +margin_right = 1046.0 +margin_bottom = 1664.0 + +[node name="TimeRange" type="Label" parent="."] +unique_name_in_owner = true +margin_right = 1026.0 +margin_bottom = 117.0 +custom_fonts/font = SubResource( 2 ) +text = "12:30 AM - 1:00 AM" +align = 1 +valign = 1 + +[node name="ScrollContainer" type="ScrollContainer" parent="."] +margin_top = 121.0 +margin_right = 1026.0 +margin_bottom = 1644.0 +size_flags_vertical = 3 + +[node name="TaskList" type="VBoxContainer" parent="ScrollContainer"] +unique_name_in_owner = true +margin_right = 1026.0 +margin_bottom = 110.0 +size_flags_horizontal = 3 + +[node name="TaskItem" parent="ScrollContainer/TaskList" instance=ExtResource( 2 )] diff --git a/screens/TimeSlot/Header.gd b/screens/TimeSlot/Header.gd new file mode 100644 index 0000000..009a9b4 --- /dev/null +++ b/screens/TimeSlot/Header.gd @@ -0,0 +1,4 @@ +extends HBoxContainer + +func _on_Back_button_up(): + $"/root/Main".nav_screen("Task") diff --git a/screens/TimeSlot/Header.tscn b/screens/TimeSlot/Header.tscn new file mode 100644 index 0000000..2823e6a --- /dev/null +++ b/screens/TimeSlot/Header.tscn @@ -0,0 +1,33 @@ +[gd_scene load_steps=4 format=2] + +[ext_resource path="res://fonts/DroidSans.ttf" type="DynamicFontData" id=1] +[ext_resource path="res://screens/TimeSlot/Header.gd" type="Script" id=2] + +[sub_resource type="DynamicFont" id=2] +size = 100 +font_data = ExtResource( 1 ) + +[node name="TimeslotHeader" type="HBoxContainer"] +margin_left = 20.0 +margin_top = 20.0 +margin_right = 1046.0 +margin_bottom = 198.0 +script = ExtResource( 2 ) + +[node name="Name" type="Label" parent="."] +margin_top = 30.0 +margin_right = 799.0 +margin_bottom = 147.0 +size_flags_horizontal = 3 +custom_fonts/font = SubResource( 2 ) +text = "Chores" +clip_text = true + +[node name="Back" type="Button" parent="."] +margin_left = 803.0 +margin_right = 1026.0 +margin_bottom = 178.0 +custom_fonts/font = SubResource( 2 ) +text = "Back" + +[connection signal="button_up" from="Back" to="." method="_on_Back_button_up"] diff --git a/screens/TimeSlot/TaskItem.tscn b/screens/TimeSlot/TaskItem.tscn new file mode 100644 index 0000000..75ef95d --- /dev/null +++ b/screens/TimeSlot/TaskItem.tscn @@ -0,0 +1,53 @@ +[gd_scene load_steps=3 format=2] + +[ext_resource path="res://fonts/DroidSans.ttf" type="DynamicFontData" id=1] + +[sub_resource type="DynamicFont" id=1] +size = 72 +font_data = ExtResource( 1 ) + +[node name="TaskItem" type="MarginContainer"] +margin_right = 1026.0 +margin_bottom = 110.0 +custom_constants/margin_top = 5 +custom_constants/margin_bottom = 5 + +[node name="Button" type="Button" parent="."] +margin_top = 5.0 +margin_right = 1026.0 +margin_bottom = 105.0 +rect_min_size = Vector2( 0, 100 ) + +[node name="HBoxContainer" type="HBoxContainer" parent="Button"] +margin_right = 1026.0 +margin_bottom = 100.0 +alignment = 2 + +[node name="Name" type="Label" parent="Button/HBoxContainer"] +margin_top = 8.0 +margin_right = 493.0 +margin_bottom = 92.0 +size_flags_horizontal = 3 +custom_fonts/font = SubResource( 1 ) +text = "Stretching" +clip_text = true + +[node name="Length" type="Label" parent="Button/HBoxContainer"] +margin_left = 497.0 +margin_top = 8.0 +margin_right = 722.0 +margin_bottom = 92.0 +custom_fonts/font = SubResource( 1 ) +text = "10 min" +align = 2 + +[node name="Frequency" type="Label" parent="Button/HBoxContainer"] +margin_left = 726.0 +margin_top = 8.0 +margin_right = 1026.0 +margin_bottom = 92.0 +rect_min_size = Vector2( 300, 0 ) +custom_fonts/font = SubResource( 1 ) +text = "Daily" +align = 2 +clip_text = true -- cgit v1.2.3