Skip to content

Commit

Permalink
Updated code w/ web files
Browse files Browse the repository at this point in the history
  • Loading branch information
darmoment committed Oct 26, 2024
1 parent 586d90c commit 5809f00
Show file tree
Hide file tree
Showing 7 changed files with 252 additions and 108 deletions.
42 changes: 42 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
"name": "hoco-2024",
"version": "0.1.0",
"private": true,
"homepage": "https://homecoming2024.columbiaspectator.com",
"dependencies": {
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router-dom": "^6.27.0",
"react-scripts": "5.0.1",
"styled-components": "^6.1.13",
"web-vitals": "^2.1.4"
Expand Down
43 changes: 43 additions & 0 deletions public/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8">
<title></title>
<script type="text/javascript">
// Single Page Apps for GitHub Pages
// https://github.com/rafrex/spa-github-pages
// Copyright (c) 2016 Rafael Pedicini, licensed under the MIT License
// ----------------------------------------------------------------------
// This script takes the current url and converts the path and query
// string into just a query string, and then redirects the browser
// to the new url with only a query string and hash fragment,
// e.g. http://www.foo.tld/one/two?a=b&c=d#qwe, becomes
// http://www.foo.tld/?p=/one/two&q=a=b~and~c=d#qwe
// Note: this 404.html file must be at least 512 bytes for it to work
// with Internet Explorer (it is currently > 512 bytes)

// If you're creating a Project Pages site and NOT using a custom domain,
// then set segmentCount to 1 (enterprise users may need to set it to > 1).
// This way the code will only replace the route part of the path, and not
// the real directory in which the app resides, for example:
// https://username.github.io/repo-name/one/two?a=b&c=d#qwe becomes
// https://username.github.io/repo-name/?p=/one/two&q=a=b~and~c=d#qwe
// Otherwise, leave segmentCount as 0.
var segmentCount = 0;

var l = window.location;
l.replace(
l.protocol + '//' + l.hostname + (l.port ? ':' + l.port : '') +
l.pathname.split('/').slice(0, 1 + segmentCount).join('/') + '/?p=/' +
l.pathname.slice(1).split('/').slice(segmentCount).join('/').replace(/&/g, '~and~') +
(l.search ? '&q=' + l.search.slice(1).replace(/&/g, '~and~') : '') +
l.hash
);
</script>
</head>

<body>
</body>

</html>
94 changes: 73 additions & 21 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,41 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--

<head>
<meta charset="utf-8" />
<link rel="shortcut icon" href="https://s3.amazonaws.com/year-in-review-assets/CDS_Favicon.ico" type="image/x-icon">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="Homecoming 2024 Special Edition" />
<link rel="apple-touch-icon" href="https://s3.amazonaws.com/year-in-review-assets/CDS_Favicon.ico" />
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<meta name="twitter:card" content="summary_large_image">
</meta>
<meta name="twitter:title" content="Homecoming 2024 Special Edition" />
<meta name="twitter:site" content="@ColumbiaSpec" />
<meta name="twitter:image" content="https://cloudfront-us-east-1.images.arcpublishing.com/spectator/J4Q5XS4R4ZG3VNZ3YLC4LGJCGU.jpg" />
<meta property="og:title" content="Homecoming 2024 Special Edition" />
<meta property="og:image"
content="https://cloudfront-us-east-1.images.arcpublishing.com/spectator/J4Q5XS4R4ZG3VNZ3YLC4LGJCGU.jpg" />
<meta name="twitter:image"
content="https://cloudfront-us-east-1.images.arcpublishing.com/spectator/J4Q5XS4R4ZG3VNZ3YLC4LGJCGU.jpg" />

<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-33DNXV5KR7"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'G-33DNXV5KR7');
</script>
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Expand All @@ -24,12 +44,13 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
<title>Homecoming 2024 Digital Edition</title>
</head>

<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
Expand All @@ -39,5 +60,36 @@
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
</body>
<script type="text/javascript">
// Single Page Apps for GitHub Pages
// https://github.com/rafrex/spa-github-pages
// Copyright (c) 2016 Rafael Pedicini, licensed under the MIT License
// ----------------------------------------------------------------------
// This script checks to see if a redirect is present in the query string
// and converts it back into the correct url and adds it to the
// browser's history using window.history.replaceState(...),
// which won't cause the browser to attempt to load the new url.
// When the single page app is loaded further down in this file,
// the correct url will be waiting in the browser's history for
// the single page app to route accordingly.

(function (l) {
if (l.search) {
var q = {};
l.search.slice(1).split('&').forEach(function (v) {
var a = v.split('=');
q[a[0]] = a.slice(1).join('=').replace(/~and~/g, '&');
});
if (q.p !== undefined) {
window.history.replaceState(null, null,
l.pathname.slice(0, -1) + (q.p || '') +
(q.q ? ('?' + q.q) : '') +
l.hash
);
}
}
}(window.location))
</script>

</html>
14 changes: 7 additions & 7 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"short_name": "Homecoming 2024",
"name": "Columbia Daily Spectator Homecoming 2024 Issue",
"icons": [
{
"src": "favicon.ico",
"src": "https://s3.amazonaws.com/year-in-review-assets/CDS_Favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"src": "https://s3.amazonaws.com/year-in-review-assets/CDS_Favicon.ico",
"type": "image/x-icon",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"src": "https://s3.amazonaws.com/year-in-review-assets/CDS_Favicon.ico",
"type": "image/x-icon",
"sizes": "512x512"
}
],
Expand Down
89 changes: 9 additions & 80 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,87 +1,16 @@
import styled from 'styled-components';
import React from 'react';
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom';


import Section from './components/Section';
import StaffCredits from './components/StaffCredits';
import WelcomeHeader from './components/WelcomeHeader';
import homecomingImage from './homecoming.jpg';
import { device } from './device';

const FirstFold = styled.div`
display: flex;
margin-top: -3rem;
flex-direction: column-reverse;
@media ${device.tablet} {
flex-direction: row;
align-items: flex-start;
}
`;

const MainImage = styled.iframe`
display: none;
@media ${device.tablet} {
display: block;
width: 60%;
height: 35rem;
}
`;

const MobileMainImage = styled.img`
width: 100%;
height: 20rem;
display: block;
@media ${device.tablet} {
display: none;
}
`;

const Ad = styled.img`
margin: 0 2rem;
display: none;
@media ${device.tablet} {
display: block;
}
`;

const MobileAd = styled.img`
margin: 0 2rem;
display: block;
@media ${device.tablet} {
display: none;
}
`;
import Home from './Home';

function App() {
const sectionNames = ["Sports", "City", "Audio", "Crosswords"];

return (
<div className="App">
<WelcomeHeader
title="HOMECOMING 2024"
imageSrc={homecomingImage}
/>
{/* <FirstFold>
<NavTabs />
<MainImage src="https://spectatorpublishing.github.io/nsopCampusMap/" frameBorder="0" scrolling="no" />
<MobileMainImage src="https://cds-static-hosting.s3.amazonaws.com/NSOP-ILLO.jpg" />
<a href="https://212west72.com/the-building?utm_source=ColumbiaSpectator&utm_medium=columbiaspectator&utm_campaign=Columbia%20Spectator%20Banners" target="_blank">
<Ad src="https://s0.2mdn.net/10483125/212W72_061521_300x600.gif"></Ad>
</a>
</FirstFold> */}
<a href="https://212west72.com/the-building?utm_source=ColumbiaSpectator&utm_medium=columbiaspectator&utm_campaign=Columbia%20Spectator%20Banners" target="_blank">
<MobileAd src="https://s0.2mdn.net/10483125/212W72_061521_300x600.gif"></MobileAd>
</a>
{sectionNames.map((sectionName, index) => (
<Section key={sectionName} sectionName={sectionName} index={index} />
))}
<StaffCredits></StaffCredits>
</div>
<Router basename={process.env.PUBLIC_URL}>
<Routes>
<Route exact path='/' element={<Home />}/>
</Routes>
</Router>
);
}

export default App;
export default App;
Loading

0 comments on commit 5809f00

Please sign in to comment.