Skip to content

Commit cf6159c

Browse files
authored
Allow to use images instead of icons for skills (#288)
* Added imageSrc property to portfolio skills, image rendering instead of icon under what i do * Corrected readme and added portfolio example with imageSc
1 parent c56918a commit cf6159c

File tree

5 files changed

+31
-6
lines changed

5 files changed

+31
-6
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,13 @@ You can change the personal information, experience, education, social media, ce
9797
4. Select the icon of your choice.
9898
5. Copy the text beside **Selected Icon** and replace it with `fontAwesomeClassName` of that particular softwareSkill.
9999

100+
#### How to use custom images instead of Iconify Icons?
101+
102+
1. Add a valid image file into the `public/skills` folder
103+
2. Insert the image name into the `imageSrc` attribute of the particular softwareSkill
104+
3. Remove the `fontAwesomeClassName` property or leave it empty because it takes precedence over `imageSrc`
105+
4. Add custom styling to the `img` using the `style` Property
106+
100107
### Github Information
101108

102109
You will find `git_data_fetcher.mjs` file in the main directory of the repository. This file is used to fetch the data (Pull requests, Issues, Organizations, Pinned projects etc.) from your github.
36.4 KB
Loading

src/components/softwareSkills/SoftwareSkill.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,7 @@
2121
.software-skill-inline > i:hover {
2222
color: #645beb;
2323
}
24+
25+
.skill-image {
26+
height: 48px;
27+
}

src/components/softwareSkills/SoftwareSkill.js

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,22 @@ class SoftwareSkill extends React.Component {
2727
}
2828
>
2929
<li className="software-skill-inline" name={logo.skillName}>
30-
<span
31-
className="iconify"
32-
data-icon={logo.fontAwesomeClassname}
33-
style={logo.style}
34-
data-inline="false"
35-
></span>
30+
{logo.fontAwesomeClassname && (
31+
<span
32+
className="iconify"
33+
data-icon={logo.fontAwesomeClassname}
34+
style={logo.style}
35+
data-inline="false"
36+
></span>
37+
)}
38+
{!logo.fontAwesomeClassname && logo.imageSrc && (
39+
<img
40+
className="skill-image"
41+
style={logo.style}
42+
src={`${process.env.PUBLIC_URL}/skills/${logo.imageSrc}`}
43+
alt={logo.skillName}
44+
/>
45+
)}
3646
</li>
3747
</OverlayTrigger>
3848
);

src/portfolio.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ const skills = {
125125
color: "#3776AB",
126126
},
127127
},
128+
{
129+
skillName: "Deeplearning",
130+
imageSrc: "deeplearning_ai_logo.png",
131+
},
128132
],
129133
},
130134
{

0 commit comments

Comments
 (0)