Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Newlayout #23

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
10 changes: 8 additions & 2 deletions src/components/blog/Post.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
import {getAuthor} from '../../utils/api.astro'
import {getAuthor} from '../../utils/api.astro';


export interface Props {
title: string;
Expand All @@ -11,12 +12,15 @@ export interface Props {
}

const { title, writer, publishDate, alt, img, tags } = Astro.props;

const { minutesRead } = Astro.props;
const {author} = await getAuthor(writer);
console.log(author);


//gets the writers name and returns the author data from JSON. Then deconstructing the data into variables
const author = await getAuthor(writer);
const { name, twitter, twitterHandle, linkedin, linkedinHandle, github, githubHandle, photo, bio } = author;

---
<div class="postContainer">
<article class="article">
Expand All @@ -26,6 +30,7 @@ const { name, twitter, twitterHandle, linkedin, linkedinHandle, github, githubHa
</div>
<div class="details">
<h1>{title}</h1>

<p>{name}</p>
<a href={twitter}><span>Twitter: {twitterHandle}</span></a>
<span>LinkedIn: <a href={linkedin}>{linkedinHandle}</a></span>
Expand Down Expand Up @@ -115,4 +120,5 @@ const { name, twitter, twitterHandle, linkedin, linkedinHandle, github, githubHa
font-size: var(--size-5);
color: var(--text3);
}

</style>
83 changes: 83 additions & 0 deletions src/styles/search.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
.searchContainer {
position: relative;
max-width: 450px;
margin: auto;
}

.search-input input {
max-width: auto;
height: 40px;
margin-top: 10px;
margin-bottom: 10px;
outline: none;
border: none;
border-radius: var(--radius-3);
padding: 0 40px 0 15px;
font-size: var(--font-size-3);
background: var(--surface2);
border: 1px solid var(--gray-1);
box-shadow: var(--surface-shadow);
transition: all 0.3s ease-in-out;
}

::placeholder{
color: var(--text2);
opacity: 1;
}

.search-input input:focus{
background: var(--surface1);
box-shadow: var(--inner-shadow-3);
border: 1px solid var(--brand);
transition: all 0.3s ease-in-out;
}

.search-input .icon{
position: absolute;
top: 0;
right: 0;
height: auto;
width: 50px;
line-height: 60px;
text-align: center;
font-size: var(--font-size-2);
}

.list{
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
padding: 0;
margin: 0;
list-style: none;
}


.searchResult{
width: 100%;
background-color: var(--surface2);
border-radius: 5px;
padding: var(--size-2);
margin-top: var(--size-1);
display: flex;
box-shadow: var(--shadow-3);
transition: all 0.3s ease-in-out;
list-style: none;
text-decoration: none;
justify-content: center;
}

.searchResult a{
color: var(--text3);
font-weight: var(--font-weight-7);
text-decoration: none;
transition: all 0.3s ease-in-out;
}

.searchResult:hover a{
padding: 10px;
transition: all 0.3s ease-in-out;
}
6 changes: 5 additions & 1 deletion src/styles/shiki.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ pre{
flex-direction: column;
justify-content: center;
padding: var(--size-3);
border-radius: var(--size-2);
border-radius: var(--size-3);
box-shadow: var(--shadow-3);
background: #36454F !important;

width: 60%;
min-width: 500px;
}

pre .language-id{
Expand Down
25 changes: 24 additions & 1 deletion src/styles/theme.postcss
Original file line number Diff line number Diff line change
Expand Up @@ -398,4 +398,27 @@ form {
::selection {
background: var(--brand);
color: var(--selection-text);
}
}


blockquote {
position: relative;
width: 60%;
min-width: 500px;
padding: 1em;
margin: 2em 10px 4em;
background: var(--surface3);
border-radius: var(--radius-3);
box-shadow: var(--shadow-4);
}
/* blockquote:before {
content: '';
position: absolute;
z-index: -2;
top: 0;
bottom: 0;
left: 15px;
right: 15px;
box-shadow: 0 0 20px rgba(0,0,0,.6);
border-radius: 250px/20px;
} */
1 change: 1 addition & 0 deletions src/utils/api.astro
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export async function getSearchData(){

import JSON from '../data/author.json';


// Data Fetch an single writer data
export async function getAuthor(writer: string){
let author = JSON[writer];
Expand Down