Skip to content

Commit 1516101

Browse files
authored
Added Calc Project + Fixed Project Link Buttons (#14)
2 parents 7834a75 + c2b75ef commit 1516101

File tree

2 files changed

+46
-5
lines changed

2 files changed

+46
-5
lines changed

cypress/support/commands/contact.js

Whitespace-only changes.

src/views/Projects.vue

Lines changed: 46 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,27 @@ const ongoingProjects = ref([
2727
],
2828
dataTest: 'project-portfolio',
2929
images: [],
30-
}
30+
},
31+
{
32+
title: 'Calculator',
33+
description: 'A simple calculator program built with tinker and pytest',
34+
technologies: ['Python', 'Tinker', 'Pytest'],
35+
skillsLeveraged: [
36+
'Object-Oriented Programming',
37+
'Unit Testing',
38+
'Debugging',
39+
],
40+
status: 'In Development',
41+
github: 'https://github.com/jakekohl/calculator-project',
42+
features: [
43+
'Simple calculator interface',
44+
'Basic arithmetic operations',
45+
'Unit testing with pytest',
46+
'CI/CD Pipeline using GitHub Actions',
47+
],
48+
dataTest: 'project-calculator',
49+
images: [],
50+
},
3151
]);
3252
3353
// Completed projects
@@ -38,6 +58,27 @@ const completedProjects = ref([
3858
// Computed properties to check if sections have projects
3959
const hasOngoingProjects = computed(() => ongoingProjects.value.length > 0);
4060
const hasCompletedProjects = computed(() => completedProjects.value.length > 0);
61+
62+
// Methods for handling external navigation
63+
const openExternalLink = (url) => {
64+
if (url) {
65+
try {
66+
window.open(url, '_blank', 'noopener,noreferrer');
67+
} catch (error) {
68+
console.error('Failed to open external link:', error);
69+
// Fallback: try to navigate in the same window
70+
window.location.href = url;
71+
}
72+
}
73+
};
74+
75+
const openGithubRepo = (githubUrl) => {
76+
openExternalLink(githubUrl);
77+
};
78+
79+
const openLiveDemo = (demoUrl) => {
80+
openExternalLink(demoUrl);
81+
};
4182
</script>
4283

4384
<template>
@@ -146,14 +187,14 @@ const hasCompletedProjects = computed(() => completedProjects.value.length > 0);
146187
icon="pi pi-github"
147188
outlined
148189
data-test="project-code-button"
149-
@click="window.open(project.github, '_blank')"
190+
@click="openGithubRepo(project.github)"
150191
/>
151192
<PrimeButton
152193
v-if="project.demo"
153194
label="Live Demo"
154195
icon="pi pi-external-link"
155196
data-test="project-demo-button"
156-
@click="window.open(project.demo, '_blank')"
197+
@click="openLiveDemo(project.demo)"
157198
/>
158199
</div>
159200
</template>
@@ -253,13 +294,13 @@ const hasCompletedProjects = computed(() => completedProjects.value.length > 0);
253294
label="View Code"
254295
icon="pi pi-github"
255296
outlined
256-
@click="window.open(project.github, '_blank')"
297+
@click="openGithubRepo(project.github)"
257298
/>
258299
<PrimeButton
259300
v-if="project.demo"
260301
label="Live Demo"
261302
icon="pi pi-external-link"
262-
@click="window.open(project.demo, '_blank')"
303+
@click="openLiveDemo(project.demo)"
263304
/>
264305
</div>
265306
</template>

0 commit comments

Comments
 (0)