This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function SomePage() { | |
const [count, setCount] = React.useState(0) | |
return ( | |
<> | |
<div className="SomePage"> | |
THIS IS SOMEPAGE | |
</div> | |
<br></br> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import streamlit as st | |
import imutils | |
from PIL import Image | |
import numpy as np | |
st.title("My Streamlit Image Resizer") | |
content_file = st.sidebar.file_uploader("Choose a Content Image", type=["png", "jpg", "jpeg"]) | |
imgWidth = st.sidebar.number_input('Resized Image Width', 1, step=1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ReactDom from "react-dom" | |
interface MyModalProps { | |
openModal: boolean; | |
closeModal: (onClose: boolean) => void | |
} | |
export default function ModalPortal(modalProps: MyModalProps) { | |
if(!modalProps.openModal){ | |
return null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ReactPortalPage() { | |
const [openModal1, setOpenModal1] = useState(false) | |
return ( | |
<div className="ReactPortalPage"> | |
THIS IS THE REACT PORTAL PAGE (TO DEMO REACT PORTALS W MODALS) | |
{/* ...commented out for brevity */} | |
<div className="withPortal"> | |
Demo With Portal | |
<div className="sectionContent" onClick={() => console.log("clicked withPortal")}> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "../AllStyles.css" | |
interface MyModalProps { | |
openModal: boolean; | |
closeModal: (onClose: boolean) => void | |
} | |
export default function MyModal(modalProps: MyModalProps) { | |
if(!modalProps.openModal){ | |
return null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ReactPortalPage() { | |
const [openModal, setOpenModal] = useState(false) | |
return ( | |
<div className="ReactPortalPage"> | |
THIS IS THE REACT PORTAL PAGE (TO DEMO REACT PORTALS W MODALS) | |
<div className="withoutPortal" onClick={() => console.log("clicked withoutPortal")}> | |
Demo Without Portal | |
<div className="sectionContent"> | |
<button onClick={() => setOpenModal(true)}>Click Me To Open Modal</button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { | |
Switch, | |
Route, | |
BrowserRouter as Router, | |
} from "react-router-dom"; | |
import NavBar from './components/NavBar'; | |
import HomePage from './pages/homePage/HomePage'; | |
import ReactPortalPage from './pages/reactPortalPage/ReactPortalPage'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Note that this isn't the full code for this js file, please refer to the repo for the full code | |
const linspaceFn = (startValue, stopValue, cardinality) => { | |
var arr = []; | |
var step = (stopValue - startValue) / (cardinality - 1); | |
for (var i = 0; i < cardinality; i++) { | |
arr.push(parseFloat((startValue + (step * i)).toFixed(3))); | |
} | |
return arr; | |
} | |
const t = linspaceFn(0, 20, 100) |