From 4adf257cbfce3ad9759e4ea1ad354b80a42441f4 Mon Sep 17 00:00:00 2001 From: echo Date: Sun, 4 Aug 2024 09:46:51 +0330 Subject: [PATCH] review (solid version) (pun intented) --- review/App.tsx | 45 +++++++++++++++++++++++++++++++++++ review/index.html | 20 ++++++++++++++++ review/index.tsx | 11 +++++++++ review/reviewed.css | 53 ++++++++++++++++++++++++++++++++++++++++++ src/App.tsx | 2 +- src/components/api.tsx | 25 +++++++++++++++++--- tsconfig.app.json | 2 +- 7 files changed, 153 insertions(+), 5 deletions(-) create mode 100644 review/App.tsx create mode 100644 review/index.html create mode 100644 review/index.tsx create mode 100644 review/reviewed.css diff --git a/review/App.tsx b/review/App.tsx new file mode 100644 index 0000000..0f2116f --- /dev/null +++ b/review/App.tsx @@ -0,0 +1,45 @@ +import '../src/App.css' +import "./reviewed.css" +import { sendReview } from '../src/components/api' + +export default function App() { + const token = window.location.hash.substring(window.location.hash.indexOf("access_token") + "access_token".length + 1).substring(0, 30) + let ref!: HTMLTextAreaElement; + return
+
+ + +
+ +
+
+
+} + diff --git a/review/index.html b/review/index.html new file mode 100644 index 0000000..119f67d --- /dev/null +++ b/review/index.html @@ -0,0 +1,20 @@ + + + + + + + + ehco + + + + + + + +
+ + + + \ No newline at end of file diff --git a/review/index.tsx b/review/index.tsx new file mode 100644 index 0000000..f4c685a --- /dev/null +++ b/review/index.tsx @@ -0,0 +1,11 @@ +import { render } from 'solid-js/web' + +import App from './App' + +const root = document.getElementById('reviewroot') + +render(() => ( + <> + + +), root!) diff --git a/review/reviewed.css b/review/reviewed.css new file mode 100644 index 0000000..d27145b --- /dev/null +++ b/review/reviewed.css @@ -0,0 +1,53 @@ +textarea { + resize: none; +} + +.parent { + height: 100%; + /* just */ +} + +.reviewOuterparent { + height: 90vh; + display: flex; + flex-direction: row; + justify-content: space-around; +} + +.reviewText { + color: pink; + margin-bottom: 10%; + font-size: xx-large; + background-color: #1e1e1e; + font-family: monospace; + outline: none; + border: none; + text-align: center; + display: flex; + align-items: center; +} + +.reviewParent { + display: flex; + /* background-color: ; */ + flex-direction: column; + justify-content: center; +} + +.sendButton { + color: pink; + background-color: #0a0a0a; + font-size: 19px; + border: 2px solid #0a0a0a; + padding: 15px 50px; + cursor: pointer +} +.sendButton:hover { + background-color: #2c2c2c; + border: 2px solid #2c2c2c; +} + +.flexButton { + display: flex; + justify-content: center; +} \ No newline at end of file diff --git a/src/App.tsx b/src/App.tsx index a85d7a2..a2464c5 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -85,7 +85,7 @@ function App() { { setanimatedwoem(true) setTimeout(() => { - window.location.href = "https://woem.men/@exhq" + window.location.href = "https://woem.men/@echo" }, 200); }} classList={{ 'woemimg': true, 'animate': animatedwoem() }} src="https://woem.men/files/356134d8-df3b-41dc-ac73-c4420442bf3a" alt="LMAO IMAGINE BEING BLIND" /> diff --git a/src/components/api.tsx b/src/components/api.tsx index 7e44c0a..82d0f61 100644 --- a/src/components/api.tsx +++ b/src/components/api.tsx @@ -43,8 +43,8 @@ export default function Reviews() { return ( <> + display: ishover() ? "inline" : "none" + }} href="https://discord.com/oauth2/authorize?client_id=1208380910525743134&response_type=token&redirect_uri=https%3A%2F%2Fexhq.dev%2Freview%2F&scope=identify">

add your reviews here

Reviews

@@ -74,4 +74,23 @@ function SingleReview(props: NeoReview) {
{props.reviewText}
-} \ No newline at end of file +} + +export async function sendReview(review: string, token: string): Promise { + try { + const response = await fetch(`https://api.review.exhq.dev/sendreview?review=${review}`, { + headers: { + "Auth": token, + }, + method: "POST" + }); + + if (response.status !== 200) { + return false; + } + + return true; + } catch (error) { + return false; + } +} diff --git a/tsconfig.app.json b/tsconfig.app.json index 3bdead8..1c88222 100644 --- a/tsconfig.app.json +++ b/tsconfig.app.json @@ -24,5 +24,5 @@ "noUnusedParameters": true, "noFallthroughCasesInSwitch": true }, - "include": ["src", "hacked"] + "include": ["src", "hacked", "review"] }