Skip to content

Commit 79e1ef9

Browse files
committed
new main
0 parents  commit 79e1ef9

File tree

228 files changed

+24134
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

228 files changed

+24134
-0
lines changed

.gitignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Firebase
2+
addons/
3+
4+
#
5+
# Godot-specific ignores
6+
#
7+
.import/
8+
export.cfg
9+
export_presets.cfg
10+
override.cfg
11+
12+
#
13+
# Mono-specific ignores
14+
#
15+
.mono/
16+
.DS_Store
17+
18+
#
19+
# VSCode-specific ignores
20+
#
21+
.vscode/

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# socia.dot
2+
socia.dot is a minimalistic open frontend, social network clone (like Instagram, Facebook, Twitter) completely developed with Godot in GDScript, built on top of our GodotFirebase addon as a backend interface for Firebase. This is just a Demo to give a general overview about all the features provided by GodotFirebase (Authentication, Firestore, Realtime Database, Storage).
3+
4+
![home](./env/screenshots/home.png)

default_env.tres

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[gd_resource type="Environment" load_steps=2 format=2]
2+
3+
[sub_resource type="ProceduralSky" id=1]
4+
5+
[resource]
6+
background_mode = 2
7+
background_sky = SubResource( 1 )

env/.gdignore

Whitespace-only changes.

env/screenshots/home.png

339 KB
Loading

env/screenshots/home.png.import

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[remap]
2+
3+
importer="texture"
4+
type="StreamTexture"
5+
path="res://.import/home.png-2a8e88a021115bc1845fc62c93b86beb.stex"
6+
metadata={
7+
"vram_texture": false
8+
}
9+
10+
[deps]
11+
12+
source_file="res://env/screenshots/home.png"
13+
dest_files=[ "res://.import/home.png-2a8e88a021115bc1845fc62c93b86beb.stex" ]
14+
15+
[params]
16+
17+
compress/mode=0
18+
compress/lossy_quality=0.7
19+
compress/hdr_mode=0
20+
compress/bptc_ldr=0
21+
compress/normal_map=0
22+
flags/repeat=0
23+
flags/filter=true
24+
flags/mipmaps=false
25+
flags/anisotropic=false
26+
flags/srgb=2
27+
process/fix_alpha_border=true
28+
process/premult_alpha=false
29+
process/HDR_as_SRGB=false
30+
process/invert_color=false
31+
stream=false
32+
size_limit=0
33+
detect_3d=true
34+
svg/scale=1.0
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
tool
2+
extends Control
3+
4+
export (bool) var automatic_signup : bool = true setget set_automatic_signup
5+
export (bool) var anonymous_signup : bool = false setget set_anonymous_signup
6+
7+
onready var email_field : FieldContainer = $Container/EmailField
8+
onready var password_field : FieldContainer = $Container/PasswordField
9+
10+
var email : String
11+
var password : String
12+
13+
signal logging()
14+
signal logged(login)
15+
signal signed(signup)
16+
signal error(message)
17+
18+
func _ready():
19+
if Engine.editor_hint:
20+
return
21+
Firebase.Auth.connect("login_failed", self, "_on_login_failed")
22+
Firebase.Auth.connect("login_succeeded", self, "_on_login_succeeded")
23+
Firebase.Auth.connect("signup_succeeded", self, "_on_signup_succeeded")
24+
25+
func verify_fields() -> bool:
26+
email = email_field.get_text()
27+
password = password_field.get_text()
28+
return not (email in [""," "] and password in [""," "])
29+
30+
func set_automatic_signup(automatic : bool):
31+
automatic_signup = automatic
32+
if has_node("Container/ButtonsContainer/SignupButton"):
33+
$Container/ButtonsContainer/SignupButton.visible = not automatic_signup
34+
$Container/ButtonsContainer/Separator.visible = false if (automatic_signup and not anonymous_signup) else true
35+
36+
func set_anonymous_signup(anonymous : bool):
37+
anonymous_signup = anonymous
38+
if has_node("Container/ButtonsContainer/AnonymousButton"):
39+
$Container/ButtonsContainer/AnonymousButton.visible = anonymous_signup
40+
$Container/ButtonsContainer/Separator.visible = false if (automatic_signup and not anonymous_signup) else true
41+
42+
func _on_EmailButton_pressed():
43+
if verify_fields():
44+
emit_signal("logging")
45+
Firebase.Auth.login_with_email_and_password(email, password)
46+
else:
47+
print("Email and Password must be valid and non-empty.")
48+
49+
func _on_SignupButton_pressed():
50+
if verify_fields():
51+
emit_signal("logging")
52+
Firebase.Auth.signup_with_email_and_password(email, password)
53+
else:
54+
print("Email and Password must be valid and non-empty.")
55+
56+
func _on_login_failed(code : int, message : String):
57+
print("ERROR %s: %s" % [str(code), message])
58+
match message:
59+
"EMAIL_NOT_FOUND":
60+
if automatic_signup:
61+
Firebase.Auth.signup_with_email_and_password(email, password)
62+
return
63+
"EMAIL_EXISTS":
64+
pass
65+
"INVALID_PASSWORD":
66+
pass
67+
emit_signal("error", message)
68+
69+
func _on_login_succeeded(login : Dictionary):
70+
emit_signal("logged", login)
71+
72+
func _on_signup_succeeded(signup : Dictionary):
73+
emit_signal("signed", signup)
74+
75+
func _on_AnonymousButton_pressed():
76+
Firebase.Auth.login_anonymous()
Lines changed: 211 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,211 @@
1+
[gd_scene load_steps=16 format=2]
2+
3+
[ext_resource path="res://firebase-ui/field_containers/password_field/password_field.tscn" type="PackedScene" id=1]
4+
[ext_resource path="res://firebase-ui/field_containers/email_field/email_field.tscn" type="PackedScene" id=2]
5+
[ext_resource path="res://firebase-ui/buttons/email_button/email_button.tscn" type="PackedScene" id=3]
6+
[ext_resource path="res://firebase-ui/buttons/res/icons/forward_to_inbox-24px.svg" type="Texture" id=4]
7+
[ext_resource path="res://firebase-ui/auth/sign_container/sign_container.gd" type="Script" id=5]
8+
[ext_resource path="res://firebase-ui/buttons/anonymous_button/anonymous_button.tscn" type="PackedScene" id=6]
9+
10+
[sub_resource type="StyleBoxFlat" id=1]
11+
content_margin_left = 15.0
12+
content_margin_right = 15.0
13+
content_margin_top = 15.0
14+
content_margin_bottom = 15.0
15+
bg_color = Color( 1, 0.886275, 0.639216, 0 )
16+
17+
[sub_resource type="StyleBoxFlat" id=2]
18+
resource_local_to_scene = true
19+
content_margin_left = 20.0
20+
content_margin_right = 25.0
21+
content_margin_top = 10.0
22+
content_margin_bottom = 10.0
23+
bg_color = Color( 1, 1, 1, 1 )
24+
corner_radius_top_left = 25
25+
corner_radius_top_right = 25
26+
corner_radius_bottom_right = 25
27+
corner_radius_bottom_left = 25
28+
shadow_color = Color( 0, 0, 0, 0.117647 )
29+
shadow_size = 4
30+
shadow_offset = Vector2( 0, 3 )
31+
32+
[sub_resource type="StyleBoxFlat" id=3]
33+
resource_local_to_scene = true
34+
content_margin_left = 20.0
35+
content_margin_right = 25.0
36+
content_margin_top = 10.0
37+
content_margin_bottom = 10.0
38+
bg_color = Color( 1, 1, 1, 1 )
39+
corner_radius_top_left = 25
40+
corner_radius_top_right = 25
41+
corner_radius_bottom_right = 25
42+
corner_radius_bottom_left = 25
43+
shadow_color = Color( 0, 0, 0, 0.117647 )
44+
shadow_size = 4
45+
shadow_offset = Vector2( 0, 3 )
46+
47+
[sub_resource type="StyleBoxEmpty" id=4]
48+
49+
[sub_resource type="StyleBoxFlat" id=5]
50+
resource_local_to_scene = true
51+
content_margin_left = 0.0
52+
content_margin_right = 0.0
53+
content_margin_top = 0.0
54+
content_margin_bottom = 0.0
55+
bg_color = Color( 0.815686, 0.00784314, 0.105882, 1 )
56+
corner_radius_top_left = 8
57+
corner_radius_top_right = 8
58+
corner_radius_bottom_right = 8
59+
corner_radius_bottom_left = 8
60+
corner_detail = 20
61+
shadow_color = Color( 0, 0, 0, 0.117647 )
62+
shadow_size = 4
63+
shadow_offset = Vector2( 0, 2 )
64+
65+
[sub_resource type="StyleBoxLine" id=6]
66+
color = Color( 0.458824, 0.458824, 0.458824, 1 )
67+
68+
[sub_resource type="StyleBoxEmpty" id=7]
69+
content_margin_left = 10.0
70+
content_margin_right = 10.0
71+
72+
[sub_resource type="StyleBoxFlat" id=8]
73+
resource_local_to_scene = true
74+
content_margin_left = 0.0
75+
content_margin_right = 0.0
76+
content_margin_top = 0.0
77+
content_margin_bottom = 0.0
78+
bg_color = Color( 0.815686, 0.00784314, 0.105882, 1 )
79+
corner_radius_top_left = 8
80+
corner_radius_top_right = 8
81+
corner_radius_bottom_right = 8
82+
corner_radius_bottom_left = 8
83+
corner_detail = 20
84+
shadow_color = Color( 0, 0, 0, 0.117647 )
85+
shadow_size = 4
86+
shadow_offset = Vector2( 0, 2 )
87+
88+
[sub_resource type="StyleBoxFlat" id=9]
89+
resource_local_to_scene = true
90+
resource_name = "AnonymousButtonResource"
91+
content_margin_left = 0.0
92+
content_margin_right = 0.0
93+
content_margin_top = 0.0
94+
content_margin_bottom = 0.0
95+
bg_color = Color( 0.956863, 0.705882, 0, 1 )
96+
corner_radius_top_left = 8
97+
corner_radius_top_right = 8
98+
corner_radius_bottom_right = 8
99+
corner_radius_bottom_left = 8
100+
corner_detail = 20
101+
shadow_color = Color( 0, 0, 0, 0.117647 )
102+
shadow_size = 4
103+
shadow_offset = Vector2( 0, 2 )
104+
105+
[node name="SignContainer" type="PanelContainer"]
106+
anchor_right = 0.321766
107+
anchor_bottom = 0.426667
108+
margin_right = -9.48801
109+
custom_styles/panel = SubResource( 1 )
110+
script = ExtResource( 5 )
111+
__meta__ = {
112+
"_edit_use_anchors_": true
113+
}
114+
115+
[node name="Container" type="VBoxContainer" parent="."]
116+
margin_left = 15.0
117+
margin_top = 15.0
118+
margin_right = 305.0
119+
margin_bottom = 241.0
120+
rect_min_size = Vector2( 290, 0 )
121+
custom_constants/separation = 10
122+
__meta__ = {
123+
"_edit_use_anchors_": true
124+
}
125+
126+
[node name="EmailField" parent="Container" instance=ExtResource( 2 )]
127+
anchor_right = 0.0
128+
anchor_bottom = 0.0
129+
margin_right = 290.0
130+
margin_bottom = 52.0
131+
custom_styles/panel = SubResource( 2 )
132+
133+
[node name="PasswordField" parent="Container" instance=ExtResource( 1 )]
134+
anchor_right = 0.0
135+
anchor_bottom = 0.0
136+
margin_top = 62.0
137+
margin_right = 290.0
138+
margin_bottom = 114.0
139+
custom_styles/panel = SubResource( 3 )
140+
141+
[node name="HSeparator" type="HSeparator" parent="Container"]
142+
margin_top = 124.0
143+
margin_right = 290.0
144+
margin_bottom = 154.0
145+
custom_styles/separator = SubResource( 4 )
146+
custom_constants/separation = 30
147+
148+
[node name="ButtonsContainer" type="VBoxContainer" parent="Container"]
149+
margin_top = 164.0
150+
margin_right = 290.0
151+
margin_bottom = 226.0
152+
size_flags_vertical = 10
153+
custom_constants/separation = 10
154+
155+
[node name="EmailButton" parent="Container/ButtonsContainer" instance=ExtResource( 3 )]
156+
anchor_right = 0.0
157+
anchor_bottom = 0.0
158+
margin_right = 290.0
159+
margin_bottom = 62.0
160+
custom_styles/panel = SubResource( 5 )
161+
162+
[node name="Separator" type="HBoxContainer" parent="Container/ButtonsContainer"]
163+
visible = false
164+
margin_top = 72.0
165+
margin_right = 290.0
166+
margin_bottom = 86.0
167+
168+
[node name="LSeparator" type="HSeparator" parent="Container/ButtonsContainer/Separator"]
169+
margin_right = 124.0
170+
margin_bottom = 14.0
171+
size_flags_horizontal = 3
172+
custom_styles/separator = SubResource( 6 )
173+
174+
[node name="Or" type="Label" parent="Container/ButtonsContainer/Separator"]
175+
margin_left = 128.0
176+
margin_right = 161.0
177+
margin_bottom = 14.0
178+
custom_styles/normal = SubResource( 7 )
179+
custom_colors/font_color = Color( 0.458824, 0.458824, 0.458824, 1 )
180+
text = "or"
181+
182+
[node name="RSeparator" type="HSeparator" parent="Container/ButtonsContainer/Separator"]
183+
margin_left = 165.0
184+
margin_right = 290.0
185+
margin_bottom = 14.0
186+
size_flags_horizontal = 3
187+
custom_styles/separator = SubResource( 6 )
188+
189+
[node name="SignupButton" parent="Container/ButtonsContainer" instance=ExtResource( 3 )]
190+
visible = false
191+
anchor_right = 0.0
192+
anchor_bottom = 0.0
193+
margin_top = 96.0
194+
margin_right = 290.0
195+
margin_bottom = 158.0
196+
custom_styles/panel = SubResource( 8 )
197+
texture = ExtResource( 4 )
198+
text = "Sign up with email"
199+
200+
[node name="AnonymousButton" parent="Container/ButtonsContainer" instance=ExtResource( 6 )]
201+
visible = false
202+
anchor_right = 0.0
203+
anchor_bottom = 0.0
204+
margin_top = 96.0
205+
margin_right = 290.0
206+
margin_bottom = 158.0
207+
custom_styles/panel = SubResource( 9 )
208+
209+
[connection signal="pressed" from="Container/ButtonsContainer/EmailButton" to="." method="_on_EmailButton_pressed"]
210+
[connection signal="pressed" from="Container/ButtonsContainer/SignupButton" to="." method="_on_SignupButton_pressed"]
211+
[connection signal="pressed" from="Container/ButtonsContainer/AnonymousButton" to="." method="_on_AnonymousButton_pressed"]
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
[gd_scene load_steps=4 format=2]
2+
3+
[ext_resource path="res://firebase-ui/buttons/base_button/base_button.tscn" type="PackedScene" id=1]
4+
[ext_resource path="res://firebase-ui/buttons/res/icons/anonymous.svg" type="Texture" id=2]
5+
6+
[sub_resource type="StyleBoxFlat" id=1]
7+
resource_local_to_scene = true
8+
resource_name = "AnonymousButtonResource"
9+
content_margin_left = 0.0
10+
content_margin_right = 0.0
11+
content_margin_top = 0.0
12+
content_margin_bottom = 0.0
13+
bg_color = Color( 0.956863, 0.705882, 0, 1 )
14+
corner_radius_top_left = 8
15+
corner_radius_top_right = 8
16+
corner_radius_bottom_right = 8
17+
corner_radius_bottom_left = 8
18+
corner_detail = 20
19+
shadow_color = Color( 0, 0, 0, 0.117647 )
20+
shadow_size = 4
21+
shadow_offset = Vector2( 0, 2 )
22+
23+
[node name="AnonymousButton" instance=ExtResource( 1 )]
24+
margin_bottom = 0.199997
25+
custom_styles/panel = SubResource( 1 )
26+
texture = ExtResource( 2 )
27+
text = "Sign in anonymously"
28+
text_color = Color( 1, 1, 1, 1 )
29+
30+
[node name="Icon" parent="Container/ButtonContainer" index="0"]
31+
texture = ExtResource( 2 )
32+
33+
[node name="Text" parent="Container/ButtonContainer" index="1"]
34+
custom_colors/font_color = Color( 1, 1, 1, 1 )
35+
text = "Sign in anonymously"

0 commit comments

Comments
 (0)