From a8bf4b8a5ae3be0a13e8a3d13644f8bf27c6deac Mon Sep 17 00:00:00 2001 From: exhq Date: Sun, 23 Jun 2024 22:11:02 +0330 Subject: [PATCH] typescript more like gayscript --- index.html | 5 +- package.json | 3 +- pnpm-lock.yaml | 10 +++ public/gaybackground.png | Bin 0 -> 2326 bytes public/vite.svg | 1 - src/App.css | 58 ++++++++++++++--- src/App.jsx | 46 -------------- src/App.tsx | 79 ++++++++++++++++++++++++ src/components/api.jsx | 38 ------------ src/components/{comps.jsx => comps.tsx} | 2 +- src/components/name.jsx | 17 +---- src/components/name.tsx | 42 +++++++++++++ src/components/{utils.js => utils.ts} | 4 +- src/{index.jsx => index.tsx} | 2 +- src/vite-env.d.ts | 1 + tsconfig.app.json | 28 +++++++++ tsconfig.json | 11 ++++ tsconfig.node.json | 13 ++++ vite.config.js => vite.config.ts | 0 19 files changed, 246 insertions(+), 114 deletions(-) create mode 100644 public/gaybackground.png delete mode 100644 public/vite.svg delete mode 100644 src/App.jsx create mode 100644 src/App.tsx delete mode 100644 src/components/api.jsx rename src/components/{comps.jsx => comps.tsx} (81%) create mode 100644 src/components/name.tsx rename src/components/{utils.js => utils.ts} (84%) rename src/{index.jsx => index.tsx} (81%) create mode 100644 src/vite-env.d.ts create mode 100644 tsconfig.app.json create mode 100644 tsconfig.json create mode 100644 tsconfig.node.json rename vite.config.js => vite.config.ts (100%) diff --git a/index.html b/index.html index e2190c4..429e401 100644 --- a/index.html +++ b/index.html @@ -2,11 +2,12 @@ + - ECHO + Vite + Solid + TS
- + diff --git a/package.json b/package.json index 6b732e8..53f9dae 100644 --- a/package.json +++ b/package.json @@ -5,13 +5,14 @@ "type": "module", "scripts": { "dev": "vite", - "build": "vite build", + "build": "tsc -b && vite build", "preview": "vite preview" }, "dependencies": { "solid-js": "^1.8.17" }, "devDependencies": { + "typescript": "^5.2.2", "vite": "^5.3.1", "vite-plugin-solid": "^2.10.2" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8781414..d0afb86 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12,6 +12,9 @@ importers: specifier: ^1.8.17 version: 1.8.17 devDependencies: + typescript: + specifier: ^5.2.2 + version: 5.5.2 vite: specifier: ^5.3.1 version: 5.3.1 @@ -541,6 +544,11 @@ packages: resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==} engines: {node: '>=4'} + typescript@5.5.2: + resolution: {integrity: sha512-NcRtPEOsPFFWjobJEtfihkLCZCXZt/os3zf8nTxjVH3RvTSxjrCamJpbExGvYOF+tFHc3pA65qpdwPbzjohhew==} + engines: {node: '>=14.17'} + hasBin: true + update-browserslist-db@1.0.16: resolution: {integrity: sha512-KVbTxlBYlckhF5wgfyZXTWnMn7MMZjMu9XG8bPlliUOP9ThaF4QnhP8qrjrH7DRzHfSk0oQv1wToW+iA5GajEQ==} hasBin: true @@ -1080,6 +1088,8 @@ snapshots: to-fast-properties@2.0.0: {} + typescript@5.5.2: {} + update-browserslist-db@1.0.16(browserslist@4.23.1): dependencies: browserslist: 4.23.1 diff --git a/public/gaybackground.png b/public/gaybackground.png new file mode 100644 index 0000000000000000000000000000000000000000..daf726e0394f7599bf68290d56c7fdc15df9a523 GIT binary patch literal 2326 zcmeAS@N?(olHy`uVBq!ia0y~yU;;9k7&zE~)R&4YzZe)8TQi-V13aCb6$*;-(=u~X z85lGs)=sqbIP4(Nc7Iuxt5%bkNa2Zqxo;LJ^=;*HT_KRw8Yb(b_g8S1iHfFPUsLwM zgY%EBYVO{=j&EI)!Vl(0Zyqdpp`=)#>8wlN#);hhp}xQ&&?^ZnjYR7A`Rb-e=U-k+8BzmCC!wP@H=O_7`m8LNapY)Azju3Q3l@MwB?`=jNv7l`uFLr6!i7rYMwWmSiZn zd-?{1H}Z)yFtGjiba4!+xb^mip=g7FfXhJ^KUOu3f(99x2g+R^CJ6BsGHh9CFhP*v$4nP(# zA|yl8Ie0I0KDArRz#vCL!Gnk|rUNVt2$wqm{XjxAk*FLIat%Ox5N;qPpvf*Wle_<} z3L`hOF(xn(QJmxOkpj@OWI5XbsF8%&Kv>cM)QH0|c%&SjGw<-`<&g?Xk_PH$@O1Ta JS?83{1OUptM!Nt2 literal 0 HcmV?d00001 diff --git a/public/vite.svg b/public/vite.svg deleted file mode 100644 index e7b8dfb..0000000 --- a/public/vite.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/App.css b/src/App.css index b509da4..62159f1 100644 --- a/src/App.css +++ b/src/App.css @@ -1,6 +1,6 @@ :root { background-color: #121212; - font-family: 'Courier New', Courier, monospace; + font-family: monospace; overflow-x: hidden; color: pink; } @@ -12,13 +12,22 @@ justify-content: center; } +.header img:hover{ + animation: bigsmall .5s infinite; +} + .cardchild h1 { + font-size: 3em; text-align: center; } +.cardchild span { + font-size: 1.5em; +} + .cardchild img { - max-width: 4em; - margin: 1em; + max-width: 5em; + margin: 0.5em; } .cardchild { @@ -32,31 +41,41 @@ cursor: default; background-color: #272525; border-radius: 5%; + margin: 1em 1em .5em .5em; width: 20em; - padding: 0.5em 2em 2em 2em; + padding: 0.5em 5em 2em 5em; transform: translateY(-0em); transition: background-color 1s, transform .5s, box-shadow .5s, -webkit-box-shadow .5s, -moz-box-shadow 0.5s; } .cardchild:hover { - box-shadow: 0 0 234px -3px rgba(250, 236, 236, 0.75); - -webkit-box-shadow: 0 0 234px -3px rgba(250, 236, 236, 0.75); - -moz-box-shadow: 0 0 234px -3px rgba(250, 236, 236, 0.75); + box-shadow: 0 0 534px -3px rgba(250, 236, 236, 0.4); + -webkit-box-shadow: 0 0 534px -3px rgba(250, 236, 236, 0.4); + -moz-box-shadow: 0 0 534px -3px rgba(250, 236, 236, 0.4); background-color: #5e5a5a; animation: big 500ms infinite; transform: translateY(-0.3em); transition: background-color 1s, transform .5s, box-shadow .5s, -webkit-box-shadow .5s, -moz-box-shadow 0.5s; } +.linktree { + display: flex; + justify-content: space-around; +} + +.linktree img { + cursor: pointer; +} .parent { width: 100%; height: 100%; display: flex; + flex-wrap: wrap; justify-content: space-evenly; } .header h1 { - font-size: 2.5em; + font-size: 3.6em; color: blanchedalmond; display: inline-table; } @@ -82,6 +101,16 @@ animation: slide-left 1.5s; } +.gaybackground { + background-image: url("/gaybackground.png"); +} + +.animate { + z-index: 10000000; + transform: scale(10000); + transition: 20s; +} + @keyframes slide-left { from { transform: translateX(-10000em); @@ -102,6 +131,19 @@ } } +@keyframes bigsmall { + 0% { + max-width: 10em; + } + 50% { + width: 10.5em; + max-width: 10.5em; + } + 100% { + max-width: 10em; + } +} + @keyframes shake { 0% { transform: translate(0, 0) rotate(0deg); diff --git a/src/App.jsx b/src/App.jsx deleted file mode 100644 index f29e9e2..0000000 --- a/src/App.jsx +++ /dev/null @@ -1,46 +0,0 @@ -import { createSignal } from 'solid-js' -import './App.css' -import HoverComponent from './components/name' -import AdvancedBr from './components/comps' -import Review from './components/api' -function App() { - - return ( - <> -
- Vite logo - -
- - -

AdvancedBr my beloved

- - - -
-
-

link tree

- LMAO IMAGINE BEING BLIND - - -
- -
-

hi :3

- silly goober who does silly stuff
self proclaimed programmer and progamer
shitposts for fun
-
- -
-

reviews

- -
-
- - - ) -} - -export default App diff --git a/src/App.tsx b/src/App.tsx new file mode 100644 index 0000000..18faa61 --- /dev/null +++ b/src/App.tsx @@ -0,0 +1,79 @@ +import './App.css' +import HoverComponent from './components/name.tsx' +import AdvancedBr from './components/comps.tsx' +import { createSignal } from 'solid-js'; +function App() { + function remov() { + for (let i = 0; i < document.styleSheets.length; i++) { + let styleSheet = document.styleSheets[i]; + let rules = styleSheet.cssRules || styleSheet.rules; + for (let j = 0; j < rules.length; j++) { + let rule = rules[j]; + if (rule.type === CSSRule.KEYFRAMES_RULE && ((rule as CSSKeyframesRule).name === "slide-left")) { + styleSheet.deleteRule(j); + } + } + } + } + + const [isAnimating, setIsAnimating] = createSignal(false); + const [animatedwoem, setanimatedwoem] = createSignal(false); + let gitgay = { + setIsAnimating(true) + setTimeout(() => { + window.location.href = "https://git.gay/exhq" + }, 200); + gitgay.src = "/gaybackground.png" + }} classList={{ 'gitgayimg': true, 'animate': isAnimating(), 'gaybackground': isAnimating() }} src="https://git.gay/assets/img/logo.png" alt="LMAO IMAGINE BEING BLIND" /> as HTMLImageElement + return ( + + <> +
+ LMAO IMAGINE BEING BLIND + +
+ + +

AdvancedBr my beloved

+ + + +
+
+

link tree

+
+ {gitgay} + { + setanimatedwoem(true) + setTimeout(() => { + window.location.href = "https://woem.men/@exhq" + }, 200); + }} classList={{ 'woemimg': true, 'animate': animatedwoem() }} src="https://woem.men/files/356134d8-df3b-41dc-ac73-c4420442bf3a" alt="LMAO IMAGINE BEING BLIND" /> +
+
+
+ Git + Fedi +
+
+ +
+

hi :3

+ silly goober who does silly stuff
self proclaimed programmer and progamer
shitposts for fun
+
+ +
+

reviews

+ {/* */} +
+
+ + + ) +} + +export default App diff --git a/src/components/api.jsx b/src/components/api.jsx deleted file mode 100644 index e7f3881..0000000 --- a/src/components/api.jsx +++ /dev/null @@ -1,38 +0,0 @@ -import { createSignal, createEffect } from 'solid-js'; - -const Review = () => { - // State to store the fetched data - const [data, setData] = createSignal([]); - const [name, setName] = createSignal([]); - let colontree = {} - - - createEffect(() => { - - fetch('https://api.review.exhq.dev/getreviews/') - .then(res => res.json()) - .then(jsonData => { - setData(jsonData); - }) - .catch(error => { - console.error('Error fetching data:', error); - }); - - - for (let i = 0; i < data().length; i++) { - - fetch(`https://discordlookup.mesalytic.moe/v1/user/${data()[i].discordID}`) - .then(res => res.json()).then(console.log) - } - }); - - return ( -
- {data().reverse().map(i => ( -
  • {i.discordID}
  • - ))} -
    - ); -}; - -export default Review; \ No newline at end of file diff --git a/src/components/comps.jsx b/src/components/comps.tsx similarity index 81% rename from src/components/comps.jsx rename to src/components/comps.tsx index 4202ee2..d4d19db 100644 --- a/src/components/comps.jsx +++ b/src/components/comps.tsx @@ -1,6 +1,6 @@ // warning: this IS horrible code. its a joke. DO NOT try this at home because // your local senior programmer CAN and WILL hunt you down // you have been warned. -export default function AdvancedBr({ count }) { +export default function AdvancedBr({count}: any) { return new Array(count).fill(null).map(_=>(
    )) } \ No newline at end of file diff --git a/src/components/name.jsx b/src/components/name.jsx index 1ca4650..7dacb4b 100644 --- a/src/components/name.jsx +++ b/src/components/name.jsx @@ -4,12 +4,11 @@ import { removethething } from "./utils"; function HoverComponent() { let timerId; - const [isHovered, setIsHovered] = createSignal(false); const [name, setname] = createSignal(true) const startTimer = () => { timerId = setTimeout(() => { - executeFunction(); + setname(!name()) }, 3000); }; @@ -19,22 +18,12 @@ function HoverComponent() { timerId = null; } }; - - const executeFunction = () => { - setname(!name()) - }; - + const handleMouseEnter = () => { removethething() - setIsHovered(true); startTimer(); }; - const handleMouseLeave = () => { - setIsHovered(false); - clearTimer(); - }; - onCleanup(() => { clearTimer(); }); @@ -43,7 +32,7 @@ function HoverComponent() {

    {name() ? "ECHO" : "exhq"}

    diff --git a/src/components/name.tsx b/src/components/name.tsx new file mode 100644 index 0000000..4749985 --- /dev/null +++ b/src/components/name.tsx @@ -0,0 +1,42 @@ +import { createSignal, onCleanup } from "solid-js"; +import { removethething } from "./utils.ts"; + +function HoverComponent() { + let timerId: number|null; + + const [name, setname] = createSignal(true) + + const startTimer = () => { + timerId = setTimeout(() => { + setname(!name()) + }, 3000); + }; + + const clearTimer = () => { + if (timerId) { + clearTimeout(timerId); + timerId = null; + } + }; + + const handleMouseEnter = () => { + removethething() + startTimer(); + }; + + onCleanup(() => { + clearTimer(); + }); + + return ( +

    + {name() ? "ECHO" : "exhq"} +

    + ); +} + +export default HoverComponent; \ No newline at end of file diff --git a/src/components/utils.js b/src/components/utils.ts similarity index 84% rename from src/components/utils.js rename to src/components/utils.ts index aa70b07..1492251 100644 --- a/src/components/utils.js +++ b/src/components/utils.ts @@ -4,14 +4,14 @@ export function removethething() { let rules = styleSheet.cssRules || styleSheet.rules; for (let j = 0; j < rules.length; j++) { let rule = rules[j]; - if (rule.type === CSSRule.KEYFRAMES_RULE && rule.name === "slide-right") { + if (rule.type === CSSRule.KEYFRAMES_RULE && ((rule as CSSKeyframesRule).name === "slide-right" )) { styleSheet.deleteRule(j); } } } } -export async function getLatestItems(apiUrl) { +export async function getLatestItems(apiUrl: string) { try { const response = await fetch(apiUrl); if (!response.ok) { diff --git a/src/index.jsx b/src/index.tsx similarity index 81% rename from src/index.jsx rename to src/index.tsx index fd68080..ddc0c79 100644 --- a/src/index.jsx +++ b/src/index.tsx @@ -5,4 +5,4 @@ import App from './App' const root = document.getElementById('root') -render(() => , root) +render(() => , root!) diff --git a/src/vite-env.d.ts b/src/vite-env.d.ts new file mode 100644 index 0000000..11f02fe --- /dev/null +++ b/src/vite-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/tsconfig.app.json b/tsconfig.app.json new file mode 100644 index 0000000..348fb41 --- /dev/null +++ b/tsconfig.app.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "composite": true, + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", + "target": "ES2020", + "useDefineForClassFields": true, + "module": "ESNext", + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "moduleDetection": "force", + "noEmit": true, + "jsx": "preserve", + "jsxImportSource": "solid-js", + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["src"] +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..ea9d0cd --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,11 @@ +{ + "files": [], + "references": [ + { + "path": "./tsconfig.app.json" + }, + { + "path": "./tsconfig.node.json" + } + ] +} diff --git a/tsconfig.node.json b/tsconfig.node.json new file mode 100644 index 0000000..3afdd6e --- /dev/null +++ b/tsconfig.node.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "composite": true, + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo", + "skipLibCheck": true, + "module": "ESNext", + "moduleResolution": "bundler", + "allowSyntheticDefaultImports": true, + "strict": true, + "noEmit": true + }, + "include": ["vite.config.ts"] +} diff --git a/vite.config.js b/vite.config.ts similarity index 100% rename from vite.config.js rename to vite.config.ts