Skip to content

Commit

Permalink
Merge pull request #1 from melissahuertadev/dev
Browse files Browse the repository at this point in the history
portfolio v1.1.0
  • Loading branch information
melissahuertadev authored Apr 26, 2022
2 parents 4b6ff5e + 6252ab1 commit f03046b
Show file tree
Hide file tree
Showing 7 changed files with 244 additions and 39 deletions.
72 changes: 72 additions & 0 deletions public/data/projects.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
[
{
"id": "proj001",
"projectName": "Prillare E-commerce",
"projectDescription": "<strong>Prillare</strong> is a local small business, with the creation of their e-commerce, we managed to get them to offer a better service and connect more with their customers. </br>You can watch the demo above or visit their site <a href='https://www.prillare.pe' target='_blank'>here</a>.",
"imgSrc": "img/project-prillare.png",
"modalType": "img",
"modalPath": "img/project-prillare.png",
"category": [
{
"categoryClass": "badge-light",
"categoryName": "E-commerce"
},
{
"categoryClass": "badge-info",
"categoryName": "React JS"
},
{
"categoryClass": "badge-secondary",
"categoryName": "Node"
},
{
"categoryClass": "badge-success",
"categoryName": "MongoDB"
}
]
},
{
"id": "proj002",
"projectName": "Warmi",
"projectDescription": "<strong>Warmi</strong> is a safe space for women, you can find more information or suscribe to the newsletter visiting this <a href='https://melissahuertadev.github.io/warmi-webapp/' target='_blank'>site</a> 😊</br>The current webpage was build with JS and Node, the mobile application is being developed with Flutter.",
"imgSrc": "img/project-warmi.png",
"modalType": "img",
"modalPath": "img/project-warmi.png",
"category": [
{
"categoryClass": "badge-light",
"categoryName": "WebPage"
},
{
"categoryClass": "badge-warning",
"categoryName": "JS"
},
{
"categoryClass": "badge-secondary",
"categoryName": "Node"
},
{
"categoryClass": "badge-info",
"categoryName": "Flutter"
}
]
},
{
"id": "proj003",
"projectName": "Dino Game - JS",
"projectDescription": "This game is 100% inspired on the Google's Chrome No Internet connection error Dino T-Rex Runner game. This one of course, is <span>purple✨</span><br/>You can watch the demo above or play it <a href='https://melissahuertadev.github.io/dino-game/' target='_blank'>here</a>.",
"imgSrc": "img/project-dinogame.png",
"modalType": "mov",
"modalPath": "img/project-dinogame.mov",
"category": [
{
"categoryClass": "badge-light",
"categoryName": "Game"
},
{
"categoryClass": "badge-warning",
"categoryName": "JS"
}
]
}
]
Binary file added public/img/project-prillare.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/project-warmi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 15 additions & 20 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@
<li class="nav-item">
<a class="nav-link scroll-soft" href="#portfolio">Portfolio</a>
</li>
<li class="nav-item">
<a class="nav-link scroll-soft" href="#blog">Blog</a>
</li>
<li class="nav-item">
<a class="nav-link scroll-soft" href="#contact">Let's work!</a>
</li>
Expand Down Expand Up @@ -195,26 +198,17 @@ <h2 class="card-title pricing-card-title price-text">$50.00 <span>$80.00</span><
<h2 class="middle-heading">The portfolio</h2>
<h6>Come on! Take a glance of the last projects I had worked on :]</h6>

<div class="row projects-gallery">
<div class="col-lg-5 col-md-8 project">
<div class="card mb-4 box-shadow">
<img class="card-img-top img-project" alt="Dino Game - JS"
style="height: 225px; width: 100%; display: block;" src="img/project-dinogame.png"
data-holder-rendered="true">
<div class="card-body">
<p class="card-text"> This game is 100% inspired on the Google's Chrome No Internet connection error
Dino T-Rex Runner game. This one of course, is <span>purple✨</span><br />
You can watch the demo above
or play it <a href="https://melissahuertadev.github.io/dino-game/">here</a>.
</p>
<div class="category">
<span class="badge badge-light">Game</span>
<span class="badge badge-warning">JS</span>
</div>
</div>
</div>
</div>
</div>
<div id="project-gallery" class="row projects-gallery"></div>
</section>

<section id="blog" class="container-fluid">
<h2 class="middle-heading">Blog</h2>
<h6>My recent posts 📝</h6>
<div class="row" id="mediumPosts"></div>
<nav>
<ul class="pagination justify-content-center" id="pagin"></ul>
</nav>
<a class="btn btn-brown" href="https://medium.com/@melissahuertadev" target="_blank" role="button">View all posts</a>
</section>

<section id="contact" class="container-fluid">
Expand Down Expand Up @@ -294,6 +288,7 @@ <h2 class="middle-heading">Let's work</h2>
crossorigin="anonymous"></script>
<script src="js/jquery-3.6.0.min.js"></script>
<script src="js/app.js"></script>
<script src="js/getData.js"></script>
</body>

</html>
19 changes: 1 addition & 18 deletions public/js/app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$(document).ready(function () {
$(function () {
let btnGobackUp = $("#btnGobackUp");

window.addEventListener("pageshow", () => {
Expand Down Expand Up @@ -45,23 +45,6 @@ $(document).ready(function () {
$("html, body").stop().animate({ scrollTop: sectionOffset }, 1000);
});

//Portfolio
$(".img-project").on("click", function () {
let videoPath = $(this).attr("src");
let videoSrc = videoPath.slice(0, -3) + "mov";

console.log(videoSrc);
let modal =
'<div class="modal" id="modal"><video autoplay> <source src="' +
videoSrc +
'" type="video/mp4"></video><div class="btn-close" id="btnClose"><i class="fa fa-times" aria-hidden="true"></i></div></div>';

$("#portfolio").after(modal);
$("#btnClose").on("click", function () {
$("#modal").remove();
});
});

$(document).on("keyup", function (e) {
if (e.which === 27) {
$("#modal").remove();
Expand Down
127 changes: 127 additions & 0 deletions public/js/getData.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
$(function () {
//Getting projects info for Portfolio section
let projectGallery = $("#project-gallery");

$.ajax({
type: "GET",
url: "../data/projects.json",
dataType: "json",
}).done((data) => {
$.each(data, function (index, project) {
let projectCategories = "";

for (let i = 0; i < project.category.length; i++) {
projectCategories += `<span class="badge ${project.category[i].categoryClass}">${project.category[i].categoryName}</span> `;
}

projectGallery.append(
`<div class="col-lg-5 col-md-8 project">
<div class="card mb-4 box-shadow">
<img class="card-img-top img-project" id="${project.id}" alt="${project.projectName}" style="height: 225px; width: 100%; display: block;" src="${project.imgSrc}" data-holder-rendered="true">
<div class="card-body">
<p class="card-text"> ${project.projectDescription}</p>
<div class="category">
${projectCategories}
</div>
</div>
</div>
</div>`
);

$(`#${project.id}`).on("click", function () {
let modal = "";

if (project.modalType === "img") {
modal =
'<div class="modal" id="modal"> <img src="' +
project.modalPath +
'"><div class="btn-close" id="btnClose"><i class="fa fa-times" aria-hidden="true"></i></div></div>';
} else if (project.modalType === "mov") {
modal =
'<div class="modal" id="modal"><video autoplay> <source src="' +
project.modalPath +
'" type="video/mp4"></video><div class="btn-close" id="btnClose"><i class="fa fa-times" aria-hidden="true"></i></div></div>';
}

$("#portfolio").after(modal);
$("#btnClose").on("click", function () {
$("#modal").remove();
});
});
});
});

//Getting medium articles for Blog section
let mediumPromise = new Promise(function (resolve) {
let $content = $("#mediumPosts");
let data = {
rss: "https://medium.com/feed/@melissahuertadev",
};
const rssJson =
"https://api.rss2json.com/v1/api.json?rss_url=https%3A%2F%2Fmedium.com%2Ffeed%2F%40melissahuertadev";

$.get(rssJson, data, function (res) {
if (res.status == "ok") {
let postCard = "";
$.each(res.items, function (k, item) {
let src = item["thumbnail"];

postCard += `<div class="postcard card mb-3 mx-auto mr-5 " style="width: 20rem;">`;
postCard += `<img src="${src}" class="card-img-top" alt="Cover image">`;
postCard += `<div class="card-body">`;
postCard += `<h5><a href="${item.link}" class="post-title">${item.title}</a></h5>`;
var postText = item.description.replace(/<img[^>]*>/g, "");
postText = postText.replace("h4", "p");
postText = postText.replace("h3", "p");
postText = postText.replace("<em>", "");
var maxLength = 100;
var trimmedString = postText.substr(0, maxLength);
trimmedString = trimmedString.substr(
0,
Math.min(trimmedString.length, trimmedString.lastIndexOf(" "))
);
postCard += `<p class="card-text">${trimmedString}...</p>`;

postCard += `<a href="${item.link}" target="_blank" class="btn btn-lilac" >Read More</a>`;
postCard += "</div></div>";
return k < 10;
});

resolve($content.html(postCard));
}
});
});

mediumPromise.then(function () {
pageSize = 3;

let pageCount = $(".postcard").length / pageSize;

for (let i = 0; i < pageCount; i++) {
$("#pagin").append(
`<li class="page-item"><a class="page-link" href="#">${i + 1}</a></li> `
);
}

$("#pagin li:nth-child(1)").addClass("active");
showPage = function (page) {
$(".postcard").hide();
$(".postcard").each(function (n) {
if (n >= pageSize * (page - 1) && n < pageSize * page) {
$(this).show();
}
});
};

showPage(1);

$("#pagin li").click(function () {
$("#pagin li").removeClass("active");
$(this).addClass("active");

showPage(parseInt($(this).text()));
return false;
});
});
});
30 changes: 29 additions & 1 deletion public/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,29 @@ h6 {
font-size: 1rem;
}

.btn-lilac {
margin-top: 7%;
background: var(--mhdev-white);
border-color: var(--mhdev-brown);
color: var(--mhdev-brown);
font-size: 1rem;
}

.btn-lilac:hover {
background: var(--mhdev-light-purple);
font-size: 1rem;
}

.page-item .page-link {
color: var(--mhdev-main);
border-color: var(--mhdev-light-purple);
}

.page-item.active .page-link {
background-color: var(--mhdev-main);
border-color: var(--mhdev-light-purple);
}

/* About */
#about .row {
text-align: left;
Expand Down Expand Up @@ -253,7 +276,7 @@ span {
align-items: center;
}

.modal video {
.modal video, .modal img {
width: 90%;
max-width: 600px;
}
Expand Down Expand Up @@ -311,6 +334,11 @@ span {
color: rgb(182, 8, 106);
}

/* Blog */
.post-title {
color: var(--mhdev-main);
}

/* Contact Me*/
.contact-data {
display: flex;
Expand Down

0 comments on commit f03046b

Please sign in to comment.