Skip to content

Commit 11c8f94

Browse files
committed
load more projects
1 parent 5c70a47 commit 11c8f94

File tree

2 files changed

+59
-11
lines changed

2 files changed

+59
-11
lines changed

dynamicProjects.js

+55-7
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,6 @@ var all_projects = [
4040
}
4141
]
4242

43-
//Source: https://stackoverflow.com/questions/10123953/how-to-sort-an-object-array-by-date-property
44-
all_projects.sort(function(a,b){
45-
// Turn your strings into dates, and then subtract them
46-
// to get a value that is either negative, positive, or zero.
47-
return new Date(b.date) - new Date(a.date);
48-
});
49-
5043
function displayLatestProject(){
5144
//Source: https://stackoverflow.com/questions/10123953/how-to-sort-an-object-array-by-date-property
5245
all_projects.sort(function(a,b){
@@ -98,4 +91,59 @@ function displayLatestProject(){
9891
`;
9992
}
10093

94+
function remainingProjects(){
95+
//Source: https://stackoverflow.com/questions/10123953/how-to-sort-an-object-array-by-date-property
96+
all_projects.sort(function(a,b){
97+
// Turn your strings into dates, and then subtract them
98+
// to get a value that is either negative, positive, or zero.
99+
return new Date(b.date) - new Date(a.date);
100+
});
101+
102+
103+
for (let i=1; i<all_projects.length; i++){
104+
project_to_add = all_projects[i]
105+
document.getElementById("previous-projects").innerHTML += `
106+
<div class="row">
107+
<div class="col s12 m6 l4">
108+
<div class="card medium">
109+
<div class="card-image waves-effect waves-block waves-light">
110+
<img alt="` + project_to_add.img_alt +`" src="` + project_to_add.img_src + `" style="height: 100%; width: 100%" class="activator" />
111+
</div>
112+
<div class="card-content">
113+
<span class="card-title activator red-text hoverline">`+ project_to_add.title + `<i
114+
class="mdi-navigation-more-vert right"></i></span>
115+
<p>
116+
`+ project_to_add.description+`
117+
</p>
118+
</div>
119+
<div class="card-reveal">
120+
<span class="card-title grey-text"><small>Accomplishments</small><i
121+
class="mdi-navigation-close right"></i></span>
122+
<ul>
123+
<li><b>Tools:</b> `+ project_to_add.tools + `</li>
124+
<li>` + project_to_add.accomplishments[0] + `.</li>
125+
<li>` + project_to_add.accomplishments[1] + `</li>
126+
<li>` + project_to_add.accomplishments[2] + `</li>
127+
<li>` + project_to_add.date + `</li>
128+
129+
</ul>
130+
<div class="card-action">
131+
<a aria-label="Visit " href="` + project_to_add.online_src + `" target="_blank" data-position="top"
132+
data-tooltip="View Presentation Online"
133+
class="btn-floating btn-large waves-effect waves-light blue-grey tooltipped"><i
134+
class="fa fa-external-link"></i></a>
135+
<a aria-label="Visit the GitHub repo for project" href="` + project_to_add.github_src + `"
136+
target="_blank" data-position="top" data-tooltip="View Source"
137+
class="btn-floating btn-large waves-effect waves-light blue-grey tooltipped"><i
138+
class="fa fa-github"></i></a>
139+
</div>
140+
</div>
141+
</div>
142+
</div>
143+
` ;
144+
145+
}
146+
147+
}
148+
101149
displayLatestProject()

index.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -355,11 +355,11 @@ <h3 class="page-title white-text red">Projects</h3>
355355
</div>
356356

357357
<div class="button", id="load-more-btn">
358-
<button class="waves-effect waves-light btn maroon"> Load More</button>
358+
<button class="waves-effect waves-light btn maroon" onclick="remainingProjects()"> Load More</button>
359359
</div>
360360

361361
<div class="container" id="previous-projects">
362-
<p> TO DO </p>
362+
</div>
363363
<!-- <div class="row">
364364
365365
<div class="col s12 m6 l4">
@@ -458,8 +458,8 @@ <h3 class="page-title white-text red">Projects</h3>
458458
</div>
459459
</div>
460460
461-
</div> -->
462-
</div>
461+
</div>
462+
</div>-->
463463
</section>
464464

465465
<!-- Fifth Section: Skills -->

0 commit comments

Comments
 (0)