-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdata.go
242 lines (208 loc) · 6.37 KB
/
data.go
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
package main
import (
"fmt"
"strings"
"github.com/charmbracelet/lipgloss"
)
func GenerateExitView(m *Model) string {
exitStyle := lipgloss.
NewStyle().
Width(m.Window.Width*3/4 - 8).
Height(m.Window.Height - 5).
AlignVertical(lipgloss.Center).
AlignHorizontal(lipgloss.Center)
thankYou := "Thank you for visiting my Termfolio !!!\n"
thankYou = lipgloss.NewStyle().Blink(true).Foreground(lipgloss.Color("63")).Render(thankYou)
openSourceBold := lipgloss.NewStyle().Bold(true).Render("Open Source")
github := "It's " + openSourceBold + "! check it out at\n"
github += "https://github.com/rituparna-ui/termfolio"
githubRender := lipgloss.
NewStyle().
Foreground(lipgloss.Color("#FF00FF")).
AlignHorizontal(lipgloss.Center).
AlignVertical(lipgloss.Center).
Border(lipgloss.RoundedBorder()).
Padding(1, 2).
Render(github)
confirmation := lipgloss.
NewStyle().
Width(m.Window.Width*3/4 - 8).
Foreground(lipgloss.Color("#FF0000")).
Render("Are you sure you want to exit ? (y/n)")
return exitStyle.Render(
lipgloss.JoinVertical(lipgloss.Center, thankYou, githubRender, "\n", confirmation),
)
}
var contactInfo = []string{
"Portfolio", "https://rituparnawarwatkar.com/",
"LinkedIn", "https://www.linkedin.com/in/rituparna-warwatkar/",
"GitHub", "https://github.com/rituparna-ui/",
"WhatsApp", "+91 77985 16764",
"Email", "rwarwatkar@gmail.com",
"Instagram", "https://www.instagram.com/rituparna_warwatkar/",
}
func GenerateContactView(m *Model) string {
contactStyle := lipgloss.
NewStyle().
Width(m.Window.Width*3/4 - 8).
Height(m.Window.Height - 5)
contact := "Contact Me"
contact = lipgloss.
NewStyle().
Bold(true).
Background(lipgloss.Color("63")).
PaddingLeft(1).
PaddingRight(1).
Render(contact)
infoList := ""
for i := 0; i < len(contactInfo); i += 2 {
info := contactInfo[i]
link := contactInfo[i+1]
infoLink := lipgloss.JoinVertical(
lipgloss.Left,
lipgloss.NewStyle().Bold(true).Render(info),
lipgloss.NewStyle().Faint(true).Render(link),
)
infoList += infoLink + "\n\n"
}
return contactStyle.Render(
lipgloss.JoinVertical(
lipgloss.Left,
contact,
"\n\n",
infoList,
),
)
}
func GetFiglet() string {
figlet := ""
figlet += " ____ \n"
figlet += "| _ \\ \n"
figlet += "| |_) |\n"
figlet += "| _ < \n"
figlet += "|_| \\_\\ ITUPARNA WARWATKAR\n"
return figlet
}
func GenerateAboutView(m *Model) string {
figlet := GetFiglet()
building := lipgloss.
NewStyle().
Width(m.Window.Width*3/4 - 10).
Bold(true).
Border(lipgloss.RoundedBorder()).
BorderTop(true).
BorderBottom(true).
BorderLeft(false).
BorderRight(false).
PaddingLeft(1).
Render("🚀 Building Veritus.ai 🌎 Japan")
tech := []string{
"a FullStack Developer.",
"a Flutter Developer.",
"a ME(F/A/R)N Stack Developer.",
"Flutter/Angular/React.",
"a linux enthusiast.",
"also learning GenAI.",
}
stack := lipgloss.NewStyle().Bold(true).Render("I am\n")
for i, t := range tech {
stack += fmt.Sprintf("\n%d. %s", i+1, t)
}
visitorCount := fmt.Sprintf("You are visitor number: %d", m.Visitors)
return lipgloss.JoinVertical(
lipgloss.Left,
figlet,
"A high-performing engineer, passionate about tech and startups !",
building,
stack,
"\n",
lipgloss.NewStyle().Foreground(lipgloss.Color("63")).Bold(true).Render(visitorCount),
)
}
func GetNavItems() []string {
return []string{"About", "Projects", "Contact Me", "Exit"}
}
func GenerateTabView(m *Model) string {
switch cursor := m.HomeView.LeftPane.cursor; cursor {
case 0:
return GenerateAboutView(m)
case 1:
return GenerateProjectsView(m)
case 2:
return GenerateContactView(m)
case 3:
return GenerateExitView(m)
}
return "404 | Not Found"
}
type Project struct {
Name string
Description string
Link string
Tags []string
}
var projects = []Project{
{
Name: "Termfolio",
Description: "A terminal based portfolio app, served over SSH",
Link: "https://github.com/rituparna-ui/termfolio",
Tags: []string{"Go", "Bubbletea", "Lipgloss"},
},
{
Name: "HealthCare Portal",
Description: "One-stop platform for better virtual healthcare in a hassle-free manner and eliminates any stigma associated with conventional treatment.",
Link: "https://github.com/rituparna-ui/health-care-portal",
Tags: []string{"Express", "NodeJS", "MongoDB", "React", "FastAPI"},
},
{
Name: "Eligram-X",
Description: "A robust social media platform built with the MEAN stack, featuring advanced security measures like OAuth, session management, two-factor authentication along with a fully featured admin panel",
Link: "https://github.com/rituparna-ui/eligram-x",
Tags: []string{"MongoDB", "Express", "Angular", "NodeJS", "Firebase", "Redis"},
},
{
Name: "IIIT-Guwahati I-Card Portal",
Description: "This application processes around 500 ID card requests annually, benefiting the Indian Institute of Information Technology Guwahati.",
Link: "https://github.com/rituparna-ui/iiitg-icard",
Tags: []string{"MongoDB", "Express", "NodeJS"},
},
{
Name: "Multi-Threaded Kernel (On-going)",
Description: "A 32-bit multi-threaded kernel with FAT16 filesystem, utilizing Intel's memory protection mechanisms to safeguard the kernel from user program damage. Memory virtualization, virtual filesystem layer, FAT16 filesystem driver etc.",
Link: "https://github.com/rituparna-ui/kernel",
Tags: []string{"C", "Assembly"},
},
}
func GenerateProjectsList(m *Model) string {
projectsList := ""
for i, project := range projects {
title := lipgloss.NewStyle().Bold(true).Render(fmt.Sprintf("%d. %s", i+1, project.Name))
description := lipgloss.NewStyle().Faint(true).Render(project.Description)
link := lipgloss.NewStyle().Foreground(lipgloss.Color("#FF00FF")).Render("GitHub: " + project.Link)
tags := lipgloss.NewStyle().Foreground(lipgloss.Color("63")).Render("Tags: " + strings.Join(project.Tags[:], ", "))
projectsList = lipgloss.JoinVertical(
lipgloss.Left,
projectsList,
title,
description,
tags,
link,
"\n",
)
}
return projectsList
}
func GenerateProjectsView(m *Model) string {
projects := lipgloss.
NewStyle().
Bold(true).
Background(lipgloss.Color("63")).
PaddingLeft(1).
PaddingRight(1).
Render("Projects")
return lipgloss.JoinVertical(
lipgloss.Left,
projects,
GenerateProjectsList(m),
)
}