diff --git a/src/components/MedalPlayer.jsx b/src/components/MedalPlayer.jsx deleted file mode 100644 index e30fbbb..0000000 --- a/src/components/MedalPlayer.jsx +++ /dev/null @@ -1,60 +0,0 @@ -import React from 'react'; - -export class MedalPlayer extends React.Component { - constructor(props) { - super(props); - - this.state = { - clip: null - } - } - - componentDidMount() { - fetch("https://developers.medal.tv/v1/latest?userId=215577&limit=1", { - method: 'get', - headers: { - 'content-type': "application/json", - 'accept': "application/json", - 'authorization': 'pub_RwznDA6FJLbPmRMSBH57iJetpujJUu6a' - } - }).then(async response => { - let j = await response.json(); - await this.setState({ - clip: j.contentObjects[0] - }) - }) - } - - playerRenderer() { - if (this.state.clip) { - return ( -
-
- -
-

{this.state.clip.contentTitle} -- recorded with Medal.tv

-
- ) - } else { - return ( -
-

wasn't able to get response

-
- ) - } - } - - render() { - if (this.state.clip !== null) return this.playerRenderer() - } -} \ No newline at end of file diff --git a/src/components/PageComponents.jsx b/src/components/PageComponents.jsx index 0846065..7b04ca4 100644 --- a/src/components/PageComponents.jsx +++ b/src/components/PageComponents.jsx @@ -1,8 +1,7 @@ import React from 'react'; // components -import { MedalPlayer } from "./MedalPlayer"; -import { Href } from "./Utils"; +import { Href, QueryStringObject } from "./Utils"; export class ShowcaseBar extends React.Component { render() { @@ -26,8 +25,7 @@ export class ShowcaseBar extends React.Component { export class ShowcaseColumns extends React.Component { render() { return ( -
-
+

{this.props.column1.title} @@ -53,7 +51,6 @@ export class ShowcaseColumns extends React.Component {

-
) } } @@ -76,24 +73,88 @@ export class Footer extends React.Component { } export class ContactForm extends React.Component { - sendResponse() { - // todo: logic to send message via api endpoint + sendResponse(obj) { + console.log(obj) + if (!obj.name || !obj.message || !obj.email) { + document.getElementById("notification").innerText = "ensure all fields are filled out" + setTimeout(() => { + document.getElementById("notification").innerText = ""; + }, 5000) + } else { + fetch("https://api.zephmakes.tech/v2/tools/contact", { + method: 'post', + headers: { + 'content-type': 'application/json' + }, + body: JSON.stringify({ + email: obj.email, + subject: obj.name, + message: obj.message + }) + }) + .then(response => { + if (response.ok) window.location.href = "/?ref=contact" + else { + document.getElementById("notification").innerText = "something went wrong, server returned status code " + response.status + setTimeout(() => { + document.getElementById("notification").innerText = ""; + }, 5000) + } + }) + .catch(err => { + document.getElementById("notification").innerText = "something went wrong!" + setTimeout(() => { + document.getElementById("notification").innerText = ""; + }, 5000) + }) + } } render() { return (
- + - +

- + + + +

+
+ ) + } +} + +export class NotiModal extends React.Component { + componentDidMount() { + let div = document.getElementById("modal_container"); + setTimeout(() => { + div.style.display = "none"; + },10000) + } + + render() { + return ( +
+
+

{this.props.headline}

+

{this.props.subheading}

+
) } @@ -110,7 +171,7 @@ export class NotFound extends React.Component { } if (e.key.toLowerCase() === "backspace") { keys.pop(); - } else if (keys.join('') === "thisisnotadrill") { + } else if (keys.join('') === "capybara") { if (count >= 5) { window.location.href = "/capy"; } else { @@ -124,7 +185,7 @@ export class NotFound extends React.Component { count++; console.log("count: " + count) - }, 4000) + }, 3000) } } }) @@ -132,7 +193,7 @@ export class NotFound extends React.Component { render() { return ( -
+
{"jeremi"}

well that's not good.

@@ -146,4 +207,63 @@ export class NotFound extends React.Component {
) } +} + +export class MedalPlayer extends React.Component { + constructor(props) { + super(props); + + this.state = { + clip: null + } + } + + componentDidMount() { + fetch("https://developers.medal.tv/v1/latest?userId=215577&limit=1", { + method: 'get', + headers: { + 'content-type': "application/json", + 'accept': "application/json", + 'authorization': 'pub_RwznDA6FJLbPmRMSBH57iJetpujJUu6a' + } + }).then(async response => { + let j = await response.json(); + await this.setState({ + clip: j.contentObjects[0] + }) + }) + } + + playerRenderer() { + if (this.state.clip) { + return ( +
+
+ +
+

{this.state.clip.contentTitle} -- recorded with Medal.tv

+
+ ) + } else { + return ( +
+

wasn't able to get response

+
+ ) + } + } + + render() { + if (this.state.clip !== null) return this.playerRenderer() + } } \ No newline at end of file diff --git a/src/components/Pages/Home.jsx b/src/components/Pages/Home.jsx index 39937b7..74d9609 100644 --- a/src/components/Pages/Home.jsx +++ b/src/components/Pages/Home.jsx @@ -1,9 +1,14 @@ import React from 'react'; // components -import { ShowcaseBar,ShowcaseColumns } from '../PageComponents'; +import { ShowcaseBar,ShowcaseColumns,NotiModal,MedalPlayer } from '../PageComponents'; +import { QueryStringObject } from "../Utils"; export class Home extends React.Component { + componentDidMount() { + console.log(QueryStringObject("ref")) + } + render() { return (
@@ -13,7 +18,7 @@ export class Home extends React.Component { column1={ { title: "wow cool stuff i've been workin on extra long too", - description: "look at me go" + description: "look at me go, super fast. anyway so i was like and then but he and she and they and lololoolollolol" } } column2={ @@ -24,11 +29,20 @@ export class Home extends React.Component { } column3={ { - title: "columns! pog pog pog pog pog pog pog pog pog pog pog pogpo ogpogpogpggpogogp'oi", - description: "The Tsunami wave crashed against the raised houses and broke the pilings as if they were toothpicks." + title: "columns! pretty cool, right? like i said before?", + description: "The Tsunami wave crashed against the raised houses and broke the pilings as if they were toothpicks. wowowowowoo wowowwowoow wowowowowo" } } /> + + {/**/} + + { QueryStringObject("ref") === "contact" + ? + + + : "" + }
) } diff --git a/src/components/Utils.jsx b/src/components/Utils.jsx index 6f72e67..f95781f 100644 --- a/src/components/Utils.jsx +++ b/src/components/Utils.jsx @@ -10,4 +10,11 @@ export class Href extends React.Component { >{this.props.content} ) } +} + +export function QueryStringObject(string) { + let params = new URLSearchParams(window.location.search); + + if (params.get(string)) return params.get(string); + else return false; } \ No newline at end of file diff --git a/src/styling/main.css b/src/styling/main.css index abba97e..596d210 100644 --- a/src/styling/main.css +++ b/src/styling/main.css @@ -3,7 +3,12 @@ html, body { padding:0; background-color:#3E3E3E; font-family: 'IBM Plex Sans', sans-serif; - overflow-x:hidden; + -ms-overflow-style:none; + scrollbar-width:none; +} + +body::-webkit-scrollbar { + display:none; } /* nav styling */ @@ -71,36 +76,55 @@ html, body { margin:0; } +@media screen and (min-width: 992px) { + .column { + width: 50%; + float:none; + } +} + +@media screen and (min-width: 600px) { + .row { + padding-left:19%; + } + + .column { + width: 75%; + float:none; + } +} + +@media screen and (min-width:1100px) { + .column { + width: 25%; + float: left; + } +} + .column { - width:25%; - height:55vh; + height:510px; background-color:gray; border:3px black solid; - float:left; } .column-header { float:left; - width:90%; + width:95%; font-size:25px; padding:0 1vw; + position:relative; } .column-subheader { padding: 0 1vw; } -@media screen and (min-width:900px) { - #clip { - padding:10vh 15vw; - } -} - -#iframe { +#player { position:relative; + padding-top:10px; + padding-bottom:10vh; } - .cliptitle { color:white; } @@ -146,9 +170,31 @@ a:hover { padding:0 10px; } +#modal { + position:fixed; + z-index:10; + bottom:0; + left:0; + height:25%; + background-color:black; + color:white; + padding:2vh 2vw; + border-top-right-radius:30%; +} + +.modal_header { + padding-left:10px; +} + +.center { + margin-left: auto; + margin-right:auto; + text-align:center; +} + @keyframes goRight { from { - transform: translate(0,0); + transform: translate(-250px,0); } to {