Skip to content
Merged

V2 #12

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions dist/build.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<body>
<ul>
<li><a href="/">Autodesk Developer</a></li>
<li style="float:right"><a href="https://github.com/Developer-Autodesk">GitHub</a></li>
<li style="float:right"><a href="https://github.com/Developer-Autodesk"><i class="fa fa-github"></i> GitHub</a></li>
</ul>
<div id="cards"></div>
<script src="dist/build.js"></script>
Expand Down
30 changes: 27 additions & 3 deletions src/Cards.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,32 @@
<div id="cards">
<div class="repo-card">
<p>We currently have {{repos.length}} repos.</p>
<p><a @click="sortByPopularity">Sort By Popularity</a></p>
<p><a @click="sortByAlphabetical">Sort By Alphabetical</a></p>
</div>
<a v-for="repo in repos" v-bind:href="repo.html_url">
<div class="repo-card">
<h3>{{ repo.name }}</h3>
<p>{{ repo.description }}</p>
<p><a v-bind:href="repo.html_url"><i class="fa fa-github" aria-hidden="true"></i> Source Code</a></p>
<p>{{ repo.stargazers_count }}</p>
<p>
<span><a v-bind:href="repo.html_url"><i class="fa fa-github" aria-hidden="true"></i> Source Code</a></span>
<span><a v-show="repo.homepage" v-bind:href="repo.homepage"><i class="fa fa-desktop" aria-hidden="true"></i> Demo</a></span>
</p>
</div>
</a>
</div>
</template>

<script>
import repos from './repos.json';
import reposJSON from './repos.json';

let repos = [];
let i = 0;
for (let repo of reposJSON) {
repos[i] = repo;
i++;
}

export default {
data () {
Expand All @@ -24,7 +37,18 @@ export default {
},

methods: {
// TODO
sortByPopularity: () => {
repos.sort((a, b) => {
return b.stargazers_count - a.stargazers_count;
});
},
sortByAlphabetical: () => {
repos.sort((a, b) => {
let aName = a.name;
let bName = b.name;
return aName.localeCompare(bName);
});
}
}
}
</script>
Expand Down
4 changes: 2 additions & 2 deletions src/styles/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,20 @@ ul {
overflow: hidden;
background-color: #fff;
}

li {
float: left;
}
li a {
display: block;
color: black;
text-align: center;
padding: 14px 16px;
padding: 24px 16px;
text-decoration: none;
}

li a:hover:not(.active) {
background-color: #D17920;
color: white;
}

.active {
Expand Down