Skip to content

Commit

Permalink
Cleanup.
Browse files Browse the repository at this point in the history
- Removed unused state and comments.
- Remove unused imports.
  • Loading branch information
vegetableman committed Jan 31, 2025
1 parent 25735bc commit 85b8125
Show file tree
Hide file tree
Showing 11 changed files with 7 additions and 160 deletions.
1 change: 0 additions & 1 deletion app/blog/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { usePathname } from "next/navigation";

export default function Layout({ children }: PropsWithChildren) {
const pathname = usePathname();
const isMainBlogPage = pathname !== '/blog/the-threeVs-of-data';

return (
<main>
Expand Down
4 changes: 0 additions & 4 deletions app/federated.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
'use client';

import { DINish } from "./fonts";
// Using ES6 import syntax
import { useEffect, useRef, useState } from "react";
// import hljs from 'highlight.js';
import 'highlight.js/styles/base16/materia.css';
// import javascript from 'highlight.js/lib/languages/javascript';
// hljs.registerLanguage('javascript', javascript);

export default function Federated() {
const federatedRef = useRef(null);
Expand Down
130 changes: 2 additions & 128 deletions app/hero.tsx
Original file line number Diff line number Diff line change
@@ -1,70 +1,10 @@
"use client";

import Navbar from "@/components/navbar";
import { useEffect, useRef } from "react";

// function calculate3DPosition(x: number, y: number, z: number, gridUnit: number) {
// const cosX = Math.cos(50 * Math.PI / 180);
// const sinX = Math.sin(50 * Math.PI / 180);
// const cos45 = Math.cos(Math.PI / 4);
// const sin45 = Math.sin(Math.PI / 4);

// // Adjust for 50-degree X rotation and 45-degree Z rotation
// const x2D = (x * cos45 - z * cos45) * gridUnit;
// const y2D = (y * cosX - z * sinX - x * sin45) * gridUnit;

// return { x: x2D, y: y2D };
// }
import { useRef } from "react";

const Hero = () => {

// const GRID_UNIT = 90;
const networkRef = useRef<HTMLDivElement>(null);
const linesContainer = useRef<SVGSVGElement>(null);

useEffect(() => {

// const positions = {
// db: { x: 1.7, y: 7.5, z: 0 },
// ai: { x: 4, y: 4, z: 0 },
// edgeset: { x: 5, y: 4.4, z: 0 },
// docs: { x: 5.6, y: 4.8, z: 0 },
// semi: { x: 9, y: 3.1, z: 0 },
// };

// // console.log(networkRef.current.childNodes);
// networkRef.current.childNodes.forEach((child) => {
// if (!child.id) return;
// const { x, y, z } = positions[child.id];
// const pos = calculate3DPosition(x, y, z, GRID_UNIT);
// // console.log(pos);
// // child.style.transform = `translate(${pos.x}px, ${pos.y}px)`;
// child.setAttribute('transform', `translate(${pos.x}, ${pos.y})`);
// // console.log(child);
// // child.style.transform = `translate(${positions[child.id].x}px, ${positions[child.id].y}px)`;
// });

// function connectShapes(shape1Id, shape2Id) {
// const shape1 = positions[shape1Id];
// const shape2 = positions[shape2Id];

// const pos1 = calculate3DPosition(shape1.x, shape1.y, shape1.z, GRID_UNIT);
// const pos2 = calculate3DPosition(shape2.x, shape2.y, shape2.z, GRID_UNIT);

// console.log(pos1, pos2);

// const line = document.createElementNS('http://www.w3.org/2000/svg', 'line');
// line.setAttribute('x1', pos1.x);
// line.setAttribute('y1', pos1.y);
// line.setAttribute('x2', pos2.x);
// line.setAttribute('y2', pos2.y);
// line.setAttribute('stroke', 'black');
// linesContainer.current.appendChild(line);
// }

// connectShapes('db', 'edgeset');

}, []);

return (
<div className=" bg-zinc-50">
Expand Down Expand Up @@ -150,50 +90,6 @@ const Hero = () => {
</animateMotion>
</circle>
</svg>
{/* <svg viewBox="0 0 1000 800" xmlns="http://www.w3.org/2000/svg">
<g transform="translate(100, 330)" id="db" width="157" height="176" viewBox="0 30 157 176" fill="none">
<path d="M78.5 61.6C104.513 61.6 125.6 53.7202 125.6 44C125.6 34.2798 104.513 26.4 78.5 26.4C52.4874 26.4 31.4 34.2798 31.4 44C31.4 53.7202 52.4874 61.6 78.5 61.6Z" fill="#EC9355" />
<path d="M125.6 44H31.4V132H125.6V44Z" fill="#EC9355" />
<path d="M78.5 149.6C104.513 149.6 125.6 141.72 125.6 132C125.6 122.28 104.513 114.4 78.5 114.4C52.4874 114.4 31.4 122.28 31.4 132C31.4 141.72 52.4874 149.6 78.5 149.6Z" fill="#EC9355" />
<path d="M78.5 149.6C104.513 149.6 125.6 141.72 125.6 132C125.6 122.28 104.513 114.4 78.5 114.4C52.4874 114.4 31.4 122.28 31.4 132C31.4 141.72 52.4874 149.6 78.5 149.6Z" fill="#EC9355" />
<path d="M78.5 61.6C104.513 61.6 125.6 53.7202 125.6 44C125.6 34.2798 104.513 26.4 78.5 26.4C52.4874 26.4 31.4 34.2798 31.4 44C31.4 53.7202 52.4874 61.6 78.5 61.6Z" fill="#EC9355" stroke="white" />
<path d="M78.5 149.6C104.513 149.6 125.6 141.72 125.6 132C125.6 122.28 104.513 114.4 78.5 114.4C52.4874 114.4 31.4 122.28 31.4 132C31.4 141.72 52.4874 149.6 78.5 149.6Z" stroke="white" />
<path d="M31.4 44V132" stroke="white" />
<path d="M125.6 44V132" stroke="white" />
</g>
<g transform="translate(290, 150)" id="ai" width="303" height="203" viewBox="0 0 303 203" fill="none">
<path d="M58 110L150.486 60.2538L244.069 108.844L151.218 163.25L58 110Z" fill="#275DF1" stroke="#E1E1E1" strokeOpacity="0.501961" />
<path d="M57.5707 109.902L58.7672 130.152L153.774 180.982L151.594 162.502L57.5707 109.902Z" fill="#275DF1" stroke="#E1E1E1" strokeOpacity="0.501961" />
<path d="M151.594 162.502L154.274 180.977L243.734 125.857L243.569 108.858L151.594 162.502Z" fill="#275DF1" stroke="#E1E1E1" strokeOpacity="0.501961" />
</g>
<g transform="translate(340, 340)" id="edgeset" width="185" height="211" viewBox="0 0 185 211" fill="none">
<path d="M7.9022 107.422L3.5 75L70.1048 32.6684L157.204 42.8456L176.891 103.505L179.269 135.192L115.025 181.437L29.9659 167.903L7.9022 107.422Z" fill="#008D92" />
<path d="M4.49999 74.5L7.9022 107.422L29.9659 167.903M4.49999 74.5L70.1048 32.6684L157.204 42.8456L176.891 103.505M4.49999 74.5L27.4993 135.028ZM176.891 103.505L179.269 135.192L115.025 181.437L29.9659 167.903M176.891 103.505L112.618 149.354L27.4993 135.028M29.9659 167.903L27.4993 135.028Z" fill="#008D92" />
<path d="M4.49999 74.5L7.9022 107.422L29.9659 167.903M4.49999 74.5L70.1048 32.6684L157.204 42.8456L176.891 103.505M4.49999 74.5L27.4993 135.028M29.9659 167.903L115.025 181.437L179.269 135.192L176.891 103.505M29.9659 167.903L27.4993 135.028M176.891 103.505L112.618 149.354L27.4993 135.028" stroke="#DDDDDD" strokeWidth="0.794393" />
<path d="M114.659 181.862L112.222 149.384Z" fill="#008D92" />
<path d="M114.659 181.862L112.222 149.384" stroke="#DDDDDD" strokeWidth="0.794393" />
</g>
<g transform="translate(362, 560)" id="docs" width="140" height="149" viewBox="0 0 140 149" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M10.11 97.3197L6.07748 51.8019L67.2324 7.63584L127.849 47.8076L131.606 88.8148L67.2324 142.5L10.11 97.3197Z" fill="#F72585" stroke="#DDDDDD" />
<path d="M7.14705 51.2903L67.7176 95.0837L128.521 48.3773" fill="#F72585" />
<path d="M7.14705 51.2903L67.7176 95.0837L128.521 48.3773" stroke="#DDDDDD" />
<path d="M67.1926 94.5635L67.1926 142Z" fill="#F72585" />
<path d="M67.1926 94.5635L67.1926 142" stroke="#DDDDDD" />
</g>
<g transform="translate(610, 320)" id="semi" width="139" height="125" viewBox="0 0 139 125" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M67.499 2.83187L10.4896 92.4091L69.8474 124.792L92.7978 106.025L115.748 87.2579L67.499 2.83187Z" fill="#B5179E" stroke="#DDDDDD" />
<path d="M68.3074 3.82233L68.852 123.516Z" fill="#B5179E" />
<path d="M68.3074 3.82233L68.852 123.516" stroke="#DDDDDD" />
</g>
<g transform="translate(219, 470)" width="141" height="54" viewBox="0 0 141 54" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M1 1L69 52L139.5 5.5" stroke="#333333" strokeWidth="2" />
</g>
</svg> */}
</div>

<div className="iso-grid-container">
Expand All @@ -205,26 +101,4 @@ const Hero = () => {
)
}

export default Hero;


/*
background: hsla(212, 38%, 50%, 1);
background: linear-gradient(180deg, hsla(212, 38%, 50%, 1) 5%, hsla(200, 41%, 51%, 1) 29%, hsla(184, 42%, 48%, 1) 57%, hsla(180, 38%, 53%, 1) 90%);
background: -moz-linear-gradient(180deg, hsla(212, 38%, 50%, 1) 5%, hsla(200, 41%, 51%, 1) 29%, hsla(184, 42%, 48%, 1) 57%, hsla(180, 38%, 53%, 1) 90%);
background: -webkit-linear-gradient(180deg, hsla(212, 38%, 50%, 1) 5%, hsla(200, 41%, 51%, 1) 29%, hsla(184, 42%, 48%, 1) 57%, hsla(180, 38%, 53%, 1) 90%);
filter: progid: DXImageTransform.Microsoft.gradient( startColorstr="#4E7CAF", endColorstr="#4E93B5", GradientType=1 );
https://coolors.co/palette/0081a7-00afb9-fdfcdc-fed9b7-f07167
https://coolors.co/palette/119da4-0c7489-13505b-040404-d7d9ce
https://coolors.co/palette/03045e-0077b6-00b4d8-90e0ef-caf0f8
https://unstructured.io/product
https://www.singlestore.com/
https://coolors.co/palettes/popular/#215f74
https://colordesigner.io/gradient-generator
https://mercury.com/
https://coolors.co/gradient-maker/4e7caf-4e93b5-4e93b5-47a7ae-5ab5b5?position=7,34,35,58,89&opacity=100,100,100,100,100&type=linear&rotation=180
https://dgraph.io/
https://www.ketch.com/
*/
export default Hero;
2 changes: 1 addition & 1 deletion app/interactive.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import React, { ReactElement, useEffect, useRef, useState } from "react";
import React, { useEffect, useRef } from "react";
import { DINish } from "./fonts";

export default function Interactive() {
Expand Down
1 change: 0 additions & 1 deletion app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { Metadata } from 'next'
import { Inter, Work_Sans } from 'next/font/google'
import './globals.css'

export const metadata: Metadata = {
Expand Down
2 changes: 0 additions & 2 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import Summary from './summary';
import Security from './security';
import Federated from './federated';
import RealTime from './realtime';
// import Interactive from './interactive';
import Hero from './hero_v2';
import riveWASMResource from '@rive-app/canvas/rive.wasm';
import Resources from './resources';
Expand All @@ -22,7 +21,6 @@ export default function Home() {
<Summary />
<Federated />
<RealTime />
{/* <Interactive /> */}
<Gallery />
<Security />
<Resources />
Expand Down
2 changes: 1 addition & 1 deletion app/platform.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client'

import { useEffect, useRef, useState } from "react";
import { useRef, useState } from "react";
import { DINish } from "./fonts";

const lines = [
Expand Down
2 changes: 1 addition & 1 deletion app/realtime.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import React, { ReactElement, useEffect, useRef, useState } from "react";
import React, { useEffect, useRef } from "react";
import { DINish } from "./fonts";

const DataFlowDiagram = () => {
Expand Down
1 change: 0 additions & 1 deletion app/resources.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { DINish, Inter } from "./fonts";
import { getSortedPostsData } from "../lib/posts";
import Image from 'next/image'
import Link from "next/link";
// Define the Post type
interface Post {
Expand Down
8 changes: 2 additions & 6 deletions app/security.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import useIsMobile from "@/hooks/useIsMobile";
import { DINish } from "./fonts";

import Rive, { useRive, Layout, Fit, Alignment, Rive as RType, RuntimeLoader } from "@rive-app/react-canvas";
import { useEffect, useMemo, useRef, useState } from "react";
import { useRive, Layout, Fit, Alignment } from "@rive-app/react-canvas";
import { useEffect, useMemo, useRef } from "react";

export default function App() {
const granularRef = useRef(null);
Expand All @@ -13,7 +13,6 @@ export default function App() {
const granularInlineRef = useRef(null);
const internalInlineRef = useRef(null);
const encryptionInlineRef = useRef(null);
const [showHalo, toggleHalo] = useState(false);
const isMobile = useIsMobile();

let { RiveComponent, rive } = useRive({
Expand Down Expand Up @@ -153,8 +152,6 @@ export default function App() {
let observer = new IntersectionObserver((entries) => {
entries.map((entry) => {
if (entry.isIntersecting) {
console.log('entry', entry.target.id);
toggleHalo(true);
if (entry.target.id === 'encryption' && rive) {
rive.reset({ artboard: "Encryption_Artboard" });
try {
Expand All @@ -172,7 +169,6 @@ export default function App() {
}
}
else if (rive) {
toggleHalo(true)
rive.reset({ artboard: "Granular_Artboard" });
try {
rive.play("Granular");
Expand Down
14 changes: 0 additions & 14 deletions components/mobileMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,8 @@ import { CSSTransition } from "react-transition-group";


const Menu = ({ showMenu }: { showMenu: boolean }) => {
const [isWhite, setIsWhite] = useState(false);

useEffect(() => {
document.documentElement.dataset.showMenu = `${showMenu}`;
document.addEventListener('security-enter', () => {
setIsWhite(true);
});
document.addEventListener('security-exit', () => {
setIsWhite(false);
});
document.addEventListener('platform-enter', () => {
setIsWhite(true);
});
document.addEventListener('platform-exit', () => {
setIsWhite(false);
});
}, [showMenu]);

return (typeof window !== 'undefined' ?
Expand Down

0 comments on commit 85b8125

Please sign in to comment.