Skip to content

Commit

Permalink
Merge pull request #8 from J-onasJones/better-projects-page
Browse files Browse the repository at this point in the history
new Projects layout
  • Loading branch information
JonasunderscoreJones authored Oct 1, 2023
2 parents 7054a8b + b462844 commit 5da18b6
Show file tree
Hide file tree
Showing 7 changed files with 425 additions and 318 deletions.
125 changes: 125 additions & 0 deletions src/components/ProjectComponent.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
<script>
export let project;
import ProjectsLinks from "./ProjectsLinks.svelte";
import ProjectLanguageIndicator from "./ProjectLanguageIndicator.svelte";
import "../routes/+page.css";
</script>

<div class="top">
<img class="image" src="/project-banners{project.backgroud}" alt=" " />
</div>
<div class="project-languages">
<ProjectLanguageIndicator {project} />
</div>
<div class="project-links">
<ProjectsLinks {project} />
</div>
<div class="bottom">
<div class="content">
<div />
<div class="project-topline">
<div class="project-title">{project.title}</div>
<div class="project-titleinfo">
<a
class="project-status"
style="color: {project.statuscolor};border-color:{project.statuscolor}"
>{project.status}</a
><a class="project-version">{project.version}</a>
</div>
</div>
<div class="project-description">{project.description}</div>
</div>
</div>

<style>
.project-title {
font-size: 24px;
font-weight: bold;
margin-bottom: 10px;
text-align: left;
}
.project-status {
font-size: 20px;
font-weight: bold;
margin-bottom: 10px;
margin-left: 10px;
margin-right: 10px;
padding: 2px;
padding-left: 5px;
padding-right: 5px;
border: 3px solid #dcdcdc;
border-radius: 3px;
}
.project-version {
font-size: 20px;
font-weight: bold;
color: var(--project-version-color);
margin-bottom: 10px;
margin-left: 10px;
margin-right: 10px;
margin-top: -4px;
padding: 2px;
border: 3px solid var(--project-version-color);
border-radius: 100px;
float: right;
}
.project-description {
margin-top: 20px;
margin-bottom: 10px;
margin-right: 12px;
text-align: left;
}
.project-links {
display: flex;
align-items: right;
text-align: right;
align-content: right;
width: 100%;
border-bottom: 1px solid var(--project-border-color);
}
.top {
flex: 2;
display: flex;
align-items: center;
}
.bottom {
flex: 1;
display: flex;
flex-direction: column;
}
.image {
width: 100%;
height: 150px;
object-fit: cover;
}
.content {
margin: 20px;
}
.project-topline {
display: flex;
justify-content: space-between;
align-items: center;
}
.project-languages {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
}
.project-titleinfo {
display: flex;
align-items: center;
}
</style>
46 changes: 46 additions & 0 deletions src/components/ProjectLanguageIndicator.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<script>
export let project;
import { onMount } from "svelte";
import { language_colors } from "../scripts/langs";
let languageLength = Object.values(project.languages).reduce(
(acc, curr) => acc + curr,
0
);
</script>

<div class="indicator">
{#each Object.keys(project.languages) as language}
<div
class="language-color"
style="background-color: {language_colors[
language
]}; width: {(project.languages[language] / languageLength) * 100}%"
>
<p>{language}</p>
</div>
{/each}
</div>

<style>
.indicator {
display: flex;
height: 20px;
width: 100%;
}
.language-color {
flex: 1;
height: 100%;
width: 100%;
}
.language-color p {
color: white;
font-size: 0.9rem;
margin: 0;
padding: 0;
}
</style>
59 changes: 59 additions & 0 deletions src/components/ProjectsLinks.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<script>
export let project;
import "../routes/+page.css";
</script>

<div class="project-links">
{#each Object.entries(project.links) as [platform, link]}
<a
class="project-link"
href={link}
target="_blank"
rel="noopener noreferrer"
>
{#if platform === "GH"}
<i class="fa fa-github" aria-hidden="true" />
{:else if platform === "WB"}
<i class="fa fa-globe" aria-hidden="true" />
{:else if platform === "YT"}
<i class="fa fa-youtube" aria-hidden="true" />
{:else if platform === "TW"}
<i class="fa fa-twitter" aria-hidden="true" />
{:else if platform === "DC"}
<i class="fa fa-discord" aria-hidden="true" />
{:else if platform === "PT"}
<i class="fa fa-patreon" aria-hidden="true" />
{:else if platform === "SP"}
<i class="fa fa-spotify" aria-hidden="true" />
{:else if platform === "IG"}
<i class="fa fa-instagram" aria-hidden="true" />
{:else}
{platform}
{/if}
</a>
{/each}
</div>

<style>
.project-links {
display: flex;
width: 100%;
}
.project-link {
color: var(--project-link-color);
background-color: var(--project-link-background-color);
text-decoration: none;
transition: color 0.3s;
margin-top: 3px;
font-size: 25px;
width: 100%;
align-items: center;
text-align: center;
}
.project-link:hover {
color: var(--project-link-color-hover);
background-color: var(--project-link-background-color-hover);
}
</style>
15 changes: 9 additions & 6 deletions src/routes/+page.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
}

:root {
--background-color: #202324;
--background-color: #202324;
--font-color: rgb(0, 255, 0);
--font-hover-color: green;
--header-background-color: rgba(0, 0, 0, 0.4);
Expand All @@ -22,17 +22,19 @@
--footer-background-color: #000;
--footer-font-color: #fff;
--projects-background-color: rgba(0, 0, 0, 0.8);
--project-link-background-color: var(--projects-background-color);
--project-border-color: white;
--project-link-color: white;
--project-link-color-hover: #666;
--project-version-color: white;
--project-search-background-color: rgba(0, 0, 0, 0.678);
--project-search-input-font-color: white;
--nav-menu-background-color: rgba(0, 0, 0, 0.8)
}

@media (prefers-color-scheme: light) {
:root {
--background-color: #dfdcdb;
:root {
--background-color: #dfdcdb;
--font-color: green;
--font-hover-color: rgb(0, 255, 0);
--header-background-color: rgba(255, 255, 255, 0.5);
Expand All @@ -44,12 +46,13 @@
--footer-font-color: #000;
--projects-background-color: rgba(255, 255, 255, 0.4);
--project-border-color: black;
--project-link-color: white;
--project-link-color: black;
--project-link-color-hover: #666;
--project-version-color: black;
--project-search-background-color: rgba(255, 255, 255, 0.5);
--project-search-input-font-color: black;
--nav-menu-background-color: rgba(255, 255, 255, 0.8)
}
}
}


Expand Down Expand Up @@ -93,7 +96,7 @@ a:hover {

@media screen and (max-width: 768px) {
.parallax-background {
transform:none;
transform: none;
}

}
Expand Down
Loading

0 comments on commit 5da18b6

Please sign in to comment.