Skip to content

Commit

Permalink
Merged Article Grid, fixed font
Browse files Browse the repository at this point in the history
  • Loading branch information
tsakshi011 committed Oct 30, 2024
2 parents 2842727 + d99b0d9 commit d77582b
Show file tree
Hide file tree
Showing 13 changed files with 133 additions and 27,023 deletions.
16,718 changes: 0 additions & 16,718 deletions package-lock.json

This file was deleted.

2 changes: 1 addition & 1 deletion src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
}

.App-header {
background-color: #282c34;
background-color: #265CA9;;
min-height: 100vh;
display: flex;
flex-direction: column;
Expand Down
15 changes: 9 additions & 6 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import React, { useState, useEffect } from "react";
import './App.css';
import Header from './components/Header';
import Footer from './components/Footer';
import ArticleGrid from "./components/articlegrid/articlegrid";
import ArticleGrid from "./components/ArticleGrid";
import Landing from './components/Landing';
import Cursor from './images/PencilCursor.svg';

function App() {
const [data, setData] = useState(null);
Expand All @@ -16,12 +18,13 @@ function App() {
}, []);

return data && (
<div className="App">
/*<div className="App" style={{cursor: `url(${Cursor}), auto`}}>*/
<div className="App" style={{background: `#ADD8E6`}}>
<Header/>
Hello Daily Bruin!
<ArticleGrid articles={data.national} title="National" />
<ArticleGrid articles={data.state} title="State" />
<ArticleGrid articles={data.local} title="Local" />
<Landing landing={data.landing_image}/>
<ArticleGrid articles={data.national} title="NATIONAL" />
<ArticleGrid articles={data.state} title="STATE" />
<ArticleGrid articles={data.local} title="LOCAL" />
<Footer/>
</div>
);
Expand Down
9 changes: 4 additions & 5 deletions src/components/ArticleCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const ArticleContainer = styled("div")`
`;

const TitleContainer = styled("div")`
margin-top: 1em;
font-size: 33px;
font-weight: 500;
line-height: 43px; /* 130.303% */
Expand All @@ -35,17 +36,15 @@ const ArticleCard = ({ props }) => {
<ArticleContainer>
<ImgContainer>
<img
src={props.article_img}
src={props.article_image}
alt="Article"
style={{ width: "100%", height: "100%" }}
></img>
</ImgContainer>
<div>
<TitleContainer>{props.article_title}</TitleContainer>
<TitleContainer>{props.article_title}</TitleContainer>
<div style={{ fontSize: "28px", fontWeight: 300, lineHeight: "34px" }}>
{props.article_byline}
<br></br>
{props.article_url}
{props.article_byline}
</div>
</div>
</ArticleContainer>
Expand Down
62 changes: 62 additions & 0 deletions src/components/ArticleGrid.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import React from 'react';
import styled from 'styled-components';
import ArticleCard from "../components/ArticleCard.js";

const Container = styled.div`
width: 60%;
margin: 0 auto;
justify-content: center;
padding: 1em;
background: white;
`;

const TitleContainer = styled.div`
gap: 0px;
width: 62.5%;
margin: 0 auto;
justify-content: center;
opacity: 0px;
background: #265CA9;
`
const Title = styled.div`
font-family: BruinBlock;
font-size: 75px;
font-weight: 900;
line-height: 90px;
text-align: center;
color: #FBFBFB;
`

const WhiteStripe = styled.div`
width: 62.5%;
height: 1em;
margin: 0 auto;
background: #FFFFFF;
`;

const RedStripe= styled.div`
width: 62.5%;
height: 1em;
margin: 0 auto;
background: #CD2027;
`;

const ArticleGrid = ({ articles, title }) => {
return (
<>
<TitleContainer>
<Title>{title}</Title>
</TitleContainer>
<WhiteStripe />
<RedStripe />
<Container>
{articles.map((article) => {
return <ArticleCard props={article} />;
})}
</Container>
</>
);
};

export default ArticleGrid;
2 changes: 1 addition & 1 deletion src/components/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const DBHeader = styled("div")`
position: -webkit-sticky;
position: sticky;
top: 0;
background: black;
background: #265CA9;
width: 100%;
padding: 0.2em 0;
color: white;
Expand Down
33 changes: 33 additions & 0 deletions src/components/Landing.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import React from "react";
import styled from "styled-components";

const Container = styled.div`
width: 100%;
height: fit-content;
position: relative;
margin: auto;
display: flex;
justify-content: center;
align-items: center;
background: #D5E7F2;
overflow: hidden;
`;

const Image = styled.img`
width: 100vw;
height: auto;
object-fit: cover;
`;

const Landing = ({landing}) => {

return (
<>
<Container>
<Image src={landing}/>
</Container>
</>
);
}
export default Landing;

7 changes: 0 additions & 7 deletions src/components/articlegrid/articlegrid.css

This file was deleted.

18 changes: 0 additions & 18 deletions src/components/articlegrid/articlegrid.js

This file was deleted.

Binary file added src/fonts/BruinBlock.otf
Binary file not shown.
16 changes: 16 additions & 0 deletions src/images/PencilCursor.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,10 @@ code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
}

@font-face {
font-family: "BruinBlock";
src: local("BruinBlock"),
url("./fonts/BruinBlock.otf") format("opentype");
font-weight: 400;
}
Loading

0 comments on commit d77582b

Please sign in to comment.