-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReadMe.txt
More file actions
175 lines (110 loc) · 6.09 KB
/
ReadMe.txt
File metadata and controls
175 lines (110 loc) · 6.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
Promptopia Demo
it is an open source AI prompting tool for modern world
that helps you discover create and share creative prompts
as you're aware we're using chat GPT more and more every single day
so wouldn't it be great to have a list of all the phenomenal prompts t
hat you can immediately pass on to chatgpt.
this is what this application does, an app where you can discover and share AI powered prompts
* Log in functionality via Next authentication & Google authentication
* browsing of prompts
* searching of prompts via content or hashtags
* search for other users.
* create, copy, edit, delete prompts
Step 1: create folder "share_prompt"
Step 2: run command "npx create-next-app@latest"
- TypeScript? No
- ESLint? No
- Tailwind? Yes
- src/? No
- App Router? Yes
Step 3: Installing Other dependencies
- bcrypt: to hash passwords
- mongodb: for our database
- mongoose: for managing out database
- next-auth:
Step 4: Folders & Files Structure
- Create a new "app/" folder.
- Create a "components/" folder. our reusable components will lie here.
- Create a "models/" folder. this will be for our mongodb, mongoose models
- Create a new "public/" folder
- Create a "styles/" folder for styles
- Create a "utils/" folder for utility functions
- Create an ".env" file. our environment variables where we can store secure keys
- setup base styles
- setup tailwind customizable classes
- setup project assets
- create the "page.jsx" in "app/". this will render our homepage
- create the "layout.jsx" file in "app/".
- create a barebone functional compoment in layout.jsx
- import the css to our entire application
- change the metadata of our application using static metadata. add title & description metadata
- edit the "jsconfig.json" file change "@/*" to "@*" so that our import "@styles/globals.css" can work
Step
HOME
first, we would work on the text data in the homepage
we have a section element which comprises of an h1 tag (home-title),
a p tag (home-description), a feed component
NAVIGATION LAYOUT & STYLES
second we work on the navigation bar component.
this will be called inside layout.jsx. just after the main element where the "children" are housed.
this component renders a nav element essentially.
the navigation comprises of a nav logo, two buttons that are links ("create-post","sign-out", "sign-in"), a profile image that is also a link to users profile setting.
for small screens, only the logo & profile image shows.
when the profile image is clicked, there is a small dropdown. in this dropdown are the "create-post" & "sign-out" buttons.
the way we implemented the responsiveness in REACT is that we had two separate div that houses the buttons for desktop & mobile then using tailwind css media querry utility class we control which should display.
since our application features a login functionality,
the buttons that shows depend on if user is loggedin or not.
if user is not loggedin, a "sign-in" button shows that logs in the user using their goggle account and when user is loggedin, the profile image becomes the image that is connected to the users goggle account (pretty cool)
how do we know if a user is loggedIN?
how do we log in users?
how do we log out users?
this are all the reusable components in the "components/" folder.
Feed.jsx - where we would show all the prompts
Form.jsx -
Nav.jsx -
Profile.jsx -
PromptCard.jsx -
Provider.jsx -
USER AUTHENTICATION
CREATE-PROMPT PAGE
42:00 - 47:00 (5) --> 1hour
47:00 - 51:28 (4) --> 1hour
understanding css gradient --> 1hour + 30mins
51:28 - 54:52 (3) --> 1hour
54:53 - 55:57 (1) --> 1hour
55.57 - 1:11:05 (15) --> 3hours
linear-gradient():
- change colours alogn a line. from one edge of element to another
- two basic factors "angle of gradient" & "pure color positions"
- angle of gradient can be specified in "degress" 0deg, 54deg, 180deg
- 0deg points upwards, 90deg points right, 180deg points bottom ...e.t.c
- angle of gradient can be specified with keywords "to top" (0deg)
- "to right" (90deg), "to bottom", "to left"
- "to top right" - from the bottom left corner to the top right corner of the element
- gradients are images rendered by the processor on the fly,
- it may take a bit of processing power for devices not up for it like small devices.
- consider serving a separate stylesheet without gradient for mobile
- with the right choice, gradients are a nice way to give elements subtle shading and 3D appearance
- gradient are applied on background-image, border-image, list-style-image
Radial-gradient():
- start at a point & spread outward in a circular or elliptical shape.
- at minimum, it requires two color stops
- by default, it's center is positioned at center of element
- three basic factures govern the Radial-gradient function
- shape/size, center-position, color
- shape: with either "circle" or "ellipse" keyword
- size: specifies area of gradient ray (x, y)
- specified with length units, percentages or keywords (using one value spefies x & y)
- keywords such as "closest-side", "closest-corner", "farthest-side", "farthest-corner"
- center-position: similar syntax to the background-position property with an addition of the "at" keyword
- radial-gradient(at right bottom, aqua, green)
- radial-gradient(200px 50px, aqua, green)
- radial-gradient(circle, aqua, green)
- radial-gradient(farthest-side at right bottom, aqua, green)
Repeating Gradients:
- repeating-linear-gradient() or repeating-radial-gradient
- causes the pattern to repeat the color stops infinitely in both directions.
- repeating-linear-gradient(to bottom, white, sliver 30px);
- repeating-linear-gradient(45deg, orange, orange 12px, white 12px, white 24px);
<i class='bx bxl-github' style='color:#ffffff'></i>
<i class='bx bxl-google' style='color:#ffffff'></i>