Skip to content

Commit

Permalink
Adding background styling to all webpages
Browse files Browse the repository at this point in the history
  • Loading branch information
RodneyWotton committed Dec 1, 2023
1 parent 4bc3cdb commit 779ae5f
Show file tree
Hide file tree
Showing 18 changed files with 169 additions and 15 deletions.
6 changes: 5 additions & 1 deletion digital-memory-book/src/ContactUs.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import React from 'react';
import backgroundImage from './Photos/triangle-mosaic.png'

const ContactUs = () => {
const pageStyles = {
textAlign: 'center',
padding: '20px',
backgroundColor: '#f4f4f4',
backgroundImage: `url(${backgroundImage})`,
backgroundSize: '500px 500px',
backgroundPosition: 'center',
backgroundRepeat: 'repeat',
height: '100vh',
};

Expand Down
2 changes: 2 additions & 0 deletions digital-memory-book/src/DigitalTimeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ const DigitalTimeline = ({ isAuth }) => {
};

return (
<div className="page">
<div style={centeredContainer}>
<div style={buttonContainer}>
{isCreatingNewFamily ? (
Expand Down Expand Up @@ -188,6 +189,7 @@ const DigitalTimeline = ({ isAuth }) => {
)}
</div>
</div>
</div>
);
};

Expand Down
13 changes: 13 additions & 0 deletions digital-memory-book/src/FamilyView.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import TrashCanIcon from './Photos/trashcan.png';
import Modal from 'react-modal';
import { useNavigate } from 'react-router-dom';
import { db } from './firebase';
import backgroundImage from './Photos/triangle-mosaic.png'
import {
setDoc,
getDocs,
Expand All @@ -18,6 +19,16 @@ import {
} from 'firebase/firestore';

const FamilyView = ({ isAuth }) => {
const pageStyles = {
textAlign: 'center',
padding: '20px',
backgroundImage: `url(${backgroundImage})`, // Add this line
backgroundSize: '500px 500px',
backgroundPosition: 'center',
backgroundRepeat: 'repeat',
height: '100vh',
};

Modal.setAppElement('#root');

const [showPasswordChange, setShowPasswordChange] = useState(false);
Expand Down Expand Up @@ -189,6 +200,7 @@ const FamilyView = ({ isAuth }) => {
};

return (
<div style={pageStyles}>
<div style={centerContentStyle}>
<h2>My Family View</h2>
<p> Your family code is: {code}</p>
Expand Down Expand Up @@ -300,6 +312,7 @@ const FamilyView = ({ isAuth }) => {
</div>
</Modal>
</div>
</div>
);
};

Expand Down
Empty file.
7 changes: 6 additions & 1 deletion digital-memory-book/src/Home.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import React from 'react';
import { useNavigate } from "react-router-dom";
import "./Interactable.css"
import backgroundImage from './Photos/triangle-mosaic.png'

const Home = ({ isAuth}) => {
const pageStyles = {
textAlign: 'center',
padding: '20px',
backgroundColor: '#f4f4f4',
backgroundImage: `url(${backgroundImage})`, // Add this line
backgroundSize: '500px 500px',
backgroundPosition: 'center',
backgroundRepeat: 'repeat',
height: '100vh',
};

Expand Down
11 changes: 11 additions & 0 deletions digital-memory-book/src/Interactable.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,17 @@
transition: background-color 0.3s ease;
}

.page {
text-align: center;
padding: 20px;
background-image: url('./Photos/triangle-mosaic.png'); /* Replace with the correct path */
background-size: 500px 500px;
background-position: center;
background-repeat: repeat;
height: 100vh;
}


.Login {
display: flex;
flex-direction: column;
Expand Down
13 changes: 13 additions & 0 deletions digital-memory-book/src/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { signInWithEmailAndPassword } from "firebase/auth";
import { db } from "./firebase";
import { collection, query, where, getDocs } from "firebase/firestore";
import "./Interactable.css";
import backgroundImage from './Photos/triangle-mosaic.png'

function Login({ setIsAuth }) {
const [username, setUsername] = useState("");
Expand Down Expand Up @@ -65,7 +66,18 @@ function Login({ setIsAuth }) {
});
};

const pageStyles = {
textAlign: 'center',
padding: '20px',
backgroundImage: `url(${backgroundImage})`, // Add this line
backgroundSize: '500px 500px',
backgroundPosition: 'center',
backgroundRepeat: 'repeat',
height: '100vh',
};

return (
<div className="page">
<div className="Login">
<div className="box">
<div>
Expand Down Expand Up @@ -111,6 +123,7 @@ function Login({ setIsAuth }) {
</div>
</div>
</div>
</div>
);
}

Expand Down
20 changes: 15 additions & 5 deletions digital-memory-book/src/MeetTheCreators.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import React from 'react';
import backgroundImage from './Photos/triangle-mosaic.png'


const teamMembers = [
{
Expand Down Expand Up @@ -42,8 +44,11 @@ const MeetTheCreators = () => {
const pageStyles = {
textAlign: 'center',
padding: '20px',
backgroundColor: '#f4f4f4',
};
backgroundImage: `url(${backgroundImage})`,
backgroundSize: '500px 500px',
backgroundPosition: 'center',
backgroundRepeat: 'repeat',
height: '100%', };

const headingStyles = {
fontSize: '36px',
Expand All @@ -56,7 +61,12 @@ const MeetTheCreators = () => {
marginBottom: '40px',
padding: '20px',
backgroundColor: '#fff',
borderRadius: '5px',
background: '#FFFFFF',
border: '1px gray solid',
borderRadius: '75px',
margin: '50px auto',
maxWidth: '800px',
position: 'relative',
};

const memberNameStyles = {
Expand All @@ -81,7 +91,7 @@ const MeetTheCreators = () => {
<div style={pageStyles}>
<h1 style={headingStyles}>Meet the Creators</h1>
{teamMembers.map((member, index) => (
<div data-testid="people" key={index} style={memberStyles}>
<div data-testid="people" key={index} style={memberStyles}> {/* Use className instead of style */}
<img src={`team_member_${index + 1}.jpg`} alt={member.name} />
<h2 style={memberNameStyles}>{member.name}</h2>
<p style={memberRoleStyles}>{member.role}</p>
Expand All @@ -90,6 +100,6 @@ const MeetTheCreators = () => {
))}
</div>
);
};
};

export default MeetTheCreators;
6 changes: 5 additions & 1 deletion digital-memory-book/src/OurMission.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import React from 'react';
import backgroundImage from './Photos/triangle-mosaic.png'

const OurMission = () => {
const pageStyles = {
textAlign: 'center',
padding: '20px',
backgroundColor: '#f4f4f4',
backgroundImage: `url(${backgroundImage})`, // Add this line
backgroundSize: '500px 500px',
backgroundPosition: 'center',
backgroundRepeat: 'repeat',
height: '100vh',
};

Expand Down
1 change: 1 addition & 0 deletions digital-memory-book/src/PhotoBook.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* PhotoBook.css */

#post-container {
background-color: white;
width: 50%;
height: 75%;
margin: 0 auto;
Expand Down
13 changes: 13 additions & 0 deletions digital-memory-book/src/PhotoBook.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,19 @@ import {
import { db } from "./firebase";
import { useNavigate } from "react-router-dom";
import "./PhotoBook.css"; // Import the CSS file
import backgroundImage from './Photos/triangle-mosaic.png'

const PhotoBook = ({ isAuth }) => {
const pageStyles = {
textAlign: 'center',
padding: '20px',
backgroundImage: `url(${backgroundImage})`, // Add this line
backgroundSize: '500px 500px',
backgroundPosition: 'center',
backgroundRepeat: 'repeat',
height: '100vh',
};

const [posts, setPosts] = useState([]);
const [currentPage, setCurrentPage] = useState(1);
const [code, setCode] = useState(localStorage.getItem("code"));
Expand Down Expand Up @@ -64,6 +75,7 @@ const PhotoBook = ({ isAuth }) => {
const currentPosts = posts.slice(indexOfFirstPost, indexOfLastPost);

return (
<div style={pageStyles}>
<div id="post-container" onLoad={fetchPosts}>
<h1 className="post-heading">Photobook</h1>
{currentPosts.map((post) => (
Expand All @@ -88,6 +100,7 @@ const PhotoBook = ({ isAuth }) => {
</button>
</div>
</div>
</div>
);
};

Expand Down
Binary file added digital-memory-book/src/Photos/team_member_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added digital-memory-book/src/Photos/triangle-mosaic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 36 additions & 5 deletions digital-memory-book/src/Post.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { useState, useEffect } from 'react';
import backgroundImage from './Photos/triangle-mosaic.png'
import { useRef } from 'react';
import {
setDoc,
Expand All @@ -15,6 +16,15 @@ import {
import { db } from './firebase';
import { useNavigate } from 'react-router-dom';

const pageStyles = {
padding: '20px',
backgroundImage: `url(${backgroundImage})`, // Add this line
backgroundSize: '500px 500px',
backgroundPosition: 'center',
backgroundRepeat: 'repeat',
height: '100%',
};

const Slideshow = ({ images, onClose, currentSlide, onNext, onPrev, intervalDuration }) => {

const [showEscapeMessage, setShowEscapeMessage] = useState(true);
Expand Down Expand Up @@ -97,7 +107,13 @@ const Post = ({ isAuth }) => {
const [code, setCode] = useState(localStorage.getItem("code"));
const [uid, setUid] = useState(localStorage.getItem("uid"));

const [errorMessage, setErrorMessage] = useState('');

const startSlideshow = () => {
if (posts.length === 0) {
setErrorMessage('There are no posts to start a slideshow.');
return;
}
setSlideshowActive(true);
setFullscreen(true);
setCurrentSlide(0);
Expand Down Expand Up @@ -213,6 +229,7 @@ const Post = ({ isAuth }) => {
};

const postContainer = {
backgroundColor: 'white',
width: '50%',
margin: '0 auto',
padding: '20px',
Expand All @@ -229,7 +246,7 @@ const Post = ({ isAuth }) => {
};

const postItem = {
display: 'flex',
sdisplay: 'flex',
flexDirection: 'column',
marginBottom: '20px',
border: '4px solid #eeee',
Expand Down Expand Up @@ -266,6 +283,7 @@ const Post = ({ isAuth }) => {
border: '1px solid #ccc',
borderRadius: '5px',
cursor: 'pointer',

};

const postEditButton2 = {
Expand All @@ -274,6 +292,7 @@ const Post = ({ isAuth }) => {
border: '1px solid #ccc',
borderRadius: '5px',
cursor: 'pointer',
margin: '10 auto',
};

const postEditButton3 = {
Expand All @@ -282,10 +301,18 @@ const Post = ({ isAuth }) => {
border: '1px solid #ccc',
borderRadius: '5px',
cursor: 'pointer',
margin: '10s auto',
};

return (
<div style={pageStyles}>
<div onLoad={fetchPosts} style={postContainer}>
{/* Display error message below the button */}
{errorMessage && (
<div style={{ color: 'red', marginTop: '10px' }}>
{errorMessage}
</div>
)}
<button
onClick={makePost}
style={{
Expand All @@ -303,6 +330,11 @@ const Post = ({ isAuth }) => {
>
{slideshowActive ? 'Pause Slideshow' : 'Start Slideshow'}
</button>
<button onClick = {viewFamily} style = {postEditButton3}>
View Family
</button>

<div>
{[3, 5, 7, 10].map((interval) => (
<button
key={interval}
Expand All @@ -314,11 +346,9 @@ const Post = ({ isAuth }) => {
onClick={() => handleIntervalChange(interval)}
>
{`${interval}s`}
</button>
</button>
))}
<button onClick = {viewFamily} style = {postEditButton3}>
View Family
</button>
</div>
<h1 style={postHeading}>Posts</h1>
{posts.map((post, index) => (
<div key={post.id} style={postItem}>
Expand Down Expand Up @@ -379,6 +409,7 @@ const Post = ({ isAuth }) => {
)}
<button style={postEditButton2} onClick={handleClose}>Close the Final Chapter</button>
</div>
</div>
);
};

Expand Down
Loading

0 comments on commit 779ae5f

Please sign in to comment.