Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Nexory.org
Website for this organisation, informations and more
Website for this organisation, informations and more
65 changes: 47 additions & 18 deletions public/dashboard/home.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,42 @@
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600&display=swap');

:root {
/* -- Background -- */
--color-bg: #0d1117;
--color-bg-surface: #161b22;
--color-bg-surface-2: rgba(22, 27, 34, 0.92);

/* -- Borders -- */
--color-border: #30363d;
--color-border-subtle: #21262d;

/* -- Accent (blue) -- */
--color-accent: #58a6ff;

/* -- Gradient stops -- */
--color-grad-1: #7ee8fa;
--color-grad-2: #58a6ff;
--color-grad-3: #a78bfa;
--color-grad-4: #c084fc;

/* -- Text -- */
--color-text: #c9d1d9;
--color-text-muted: #6e7681;

/* -- Dot colors -- */
--color-dot-red: #ff5f57;
--color-dot-yellow: #ffbd2e;
--color-dot-green: #28c940;
}

*, *::before, *::after {
box-sizing: border-box;
}

body {
margin: 0;
font-family: 'Fira Code', monospace;
background-color: #0d1117;
background-color: var(--color-bg);
}

/* -- Preloader -- */
Expand All @@ -25,7 +54,7 @@ body {
position: fixed;
inset: 0;
z-index: 9999;
background: #0d1117;
background: var(--color-bg);
display: flex;
flex-direction: column;
justify-content: center;
Expand All @@ -42,7 +71,7 @@ body {
.preloader-logo {
font-size: 2rem;
font-weight: 600;
background: linear-gradient(135deg, #7ee8fa 0%, #58a6ff 35%, #a78bfa 70%, #c084fc 100%);
background: linear-gradient(135deg, var(--color-grad-1) 0%, var(--color-grad-2) 35%, var(--color-grad-3) 70%, var(--color-grad-4) 100%);
background-size: 200% auto;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
Expand All @@ -53,15 +82,15 @@ body {
.preloader-bar {
width: 200px;
height: 3px;
background: #21262d;
background: var(--color-border-subtle);
border-radius: 99px;
overflow: hidden;
}

.preloader-bar-inner {
height: 100%;
width: 0%;
background: linear-gradient(90deg, #58a6ff, #a78bfa);
background: linear-gradient(90deg, var(--color-grad-2), var(--color-grad-3));
border-radius: 99px;
animation: load-bar 1.2s ease forwards;
}
Expand Down Expand Up @@ -120,8 +149,8 @@ body {
font-weight: 600;
margin: 0 0 0.75rem;
letter-spacing: -0.02em;
background: linear-gradient(135deg, #7ee8fa 0%, #58a6ff 35%, #a78bfa 70%, #c084fc 100%);
background-size: 200% auto;
background: linear-gradient(135deg, var(--color-grad-1) 0%, var(--color-grad-2) 25%, #7b9fff 45%, var(--color-grad-3) 65%, var(--color-grad-4) 85%, var(--color-grad-1) 100%);
background-size: 300% auto;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
Expand All @@ -134,16 +163,16 @@ body {

.info p {
font-size: clamp(0.8rem, 2vw, 0.95rem);
color: #6e7681;
color: var(--color-text-muted);
margin: 0;
letter-spacing: 0.04em;
}

/* -- Coding animation -- */
.terminal {
width: 100%;
background: rgba(22, 27, 34, 0.92);
border: 1px solid #30363d;
background: var(--color-bg-surface-2);
border: 1px solid var(--color-border);
border-radius: 12px;
overflow: hidden;
backdrop-filter: blur(8px);
Expand All @@ -154,25 +183,25 @@ body {
}

.terminal-header {
background: #161b22;
background: var(--color-bg-surface);
padding: 11px 16px;
display: flex;
align-items: center;
gap: 8px;
border-bottom: 1px solid #21262d;
border-bottom: 1px solid var(--color-border-subtle);
}

.dot {
width: 12px;
height: 12px;
border-radius: 50%;
}
.dot.red { background: #ff5f57; box-shadow: 0 0 5px rgba(255,95,87,0.6); }
.dot.yellow { background: #ffbd2e; box-shadow: 0 0 5px rgba(255,189,46,0.6); }
.dot.green { background: #28c940; box-shadow: 0 0 5px rgba(40,201,64,0.6); }
.dot.red { background: var(--color-dot-red); box-shadow: 0 0 5px rgba(255,95,87,0.6); }
.dot.yellow { background: var(--color-dot-yellow); box-shadow: 0 0 5px rgba(255,189,46,0.6); }
.dot.green { background: var(--color-dot-green); box-shadow: 0 0 5px rgba(40,201,64,0.6); }

.terminal-title {
color: #6e7681;
color: var(--color-text-muted);
font-size: 0.76rem;
margin-left: 6px;
}
Expand All @@ -183,7 +212,7 @@ body {
}

#code-output {
color: #c9d1d9;
color: var(--color-text);
font-size: 0.875rem;
line-height: 1.65;
white-space: pre;
Expand All @@ -196,7 +225,7 @@ body {
display: inline-block;
width: 2px;
height: 0.9em;
background: #58a6ff;
background: var(--color-accent);
margin-left: 1px;
vertical-align: text-bottom;
animation: blink 1s step-end infinite;
Expand Down
136 changes: 3 additions & 133 deletions public/dashboard/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ function Preloader() {
ReactDOM.createRoot(document.getElementById('preloader-root')).render(<Preloader />);

/* -- start animation for home page after page loaded -- */

function startAnimations() {
const canvas = document.getElementById('code-canvas');
const ctx = canvas.getContext('2d');
Expand All @@ -48,6 +47,7 @@ function startAnimations() {
const SPEED = 0.4;
let particles = [];


function resize() {
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
Expand Down Expand Up @@ -115,10 +115,7 @@ function startAnimations() {

def join(self, new_user):
self.people.append(new_user)
print(f"Success, {new_user} joined")

def run(self):
print(f"Welcome to {self.org}!")
print(f"Welcome to {self.org}, {new_user}!")

if __name__ == "__main__":
org = NexoryOrg("Nexory.Org")
Expand All @@ -144,131 +141,4 @@ if __name__ == "__main__":
type();
}
startTyping();
}

/* -- Hero Section with Canvas and Typewriter -- */
function Hero() {
const canvasRef = useRef(null);
const outputRef = useRef(null);

useEffect(() => {
const canvas = canvasRef.current;
const ctx = canvas.getContext('2d');
const FONT_SIZE = 14;
const CHARS = 'abcdefghijklmnopqrstuvwxyz0123456789<>=+-*/[]{}();:#'.split('');
let drops = [];

function resize() {
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
const cols = Math.floor(canvas.width / FONT_SIZE);
drops = Array.from({ length: cols }, () =>
Math.floor(Math.random() * -(canvas.height / FONT_SIZE))
);
}
resize();
window.addEventListener('resize', resize);

const interval = setInterval(() => {
ctx.fillStyle = 'rgba(13, 17, 23, 0.07)';
ctx.fillRect(0, 0, canvas.width, canvas.height);
ctx.font = `${FONT_SIZE}px "Fira Code", monospace`;

drops.forEach((y, i) => {
const char = CHARS[Math.floor(Math.random() * CHARS.length)];
const alpha = Math.random() * 0.5 + 0.05;
ctx.fillStyle = `rgba(88, 166, 255, ${alpha})`;
ctx.fillText(char, i * FONT_SIZE, y * FONT_SIZE);
if (y * FONT_SIZE > canvas.height && Math.random() > 0.975) drops[i] = 0;
drops[i]++;
});
}, 40);

return () => {
clearInterval(interval);
window.removeEventListener('resize', resize);
};
}, []);

useEffect(() => {
const CODE =
`class NexoryOrg:
def __init__(self, org_name):
self.org = org_name
self.people = []

def join(self, new_user):
self.people.append(new_user)
print(f"Success, {new_user} joined")

def run(self):
print(f"Welcome to {self.org}!")

if __name__ == "__main__":
org = NexoryOrg("Nexory.Org")
org.join("Your Name")
org.run()`;

const TYPE_SPEED = 58;
const WAIT_MS = 20000;
let timeout;

function startTyping() {
outputRef.current.textContent = '';
let i = 0;
function type() {
if (i < CODE.length) {
outputRef.current.textContent = CODE.slice(0, i + 1);
i++;
timeout = setTimeout(type, TYPE_SPEED);
} else {
timeout = setTimeout(startTyping, WAIT_MS);
}
}
type();
}
startTyping();

return () => clearTimeout(timeout);
}, []);

return (
<section className="hero">
<canvas ref={canvasRef} id="code-canvas"></canvas>

<div className="hero-content">
<div className="info">
<h1>Nexory.Org</h1>
<p>Open source projects · Python, JavaScript, PHP and more</p>
</div>

<div className="terminal">
<div className="terminal-header">
<span className="dot red"></span>
<span className="dot yellow"></span>
<span className="dot green"></span>
<span className="terminal-title">nexory.py</span>
</div>
<div className="terminal-body">
<pre ref={outputRef} id="code-output"></pre>
<span className="cursor"></span>
</div>
</div>
</div>
</section>
);
}

/* -- App -- */
function App() {
const [loaded, setLoaded] = useState(false);

return (
<>
{!loaded && <Preloader onDone={() => setLoaded(true)} />}
<Hero />
</>
);
}

ReactDOM.createRoot(document.getElementById('root')).render(<App />);
}
2 changes: 1 addition & 1 deletion public/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
header('Strict-Transport-Security: max-age=63072000; includeSubDomains; preload');
}

$csp = "default-src 'self'; base-uri 'self'; frame-ancestors 'none'; img-src 'self' data: blob:; script-src 'self' https://cdnjs.cloudflare.com https://unpkg.com 'unsafe-inline' blob:; worker-src 'self' blob:; style-src 'self' 'unsafe-inline' https://cdnjs.cloudflare.com https://fonts.googleapis.com; font-src 'self' data: https://fonts.gstatic.com https://cdnjs.cloudflare.com; connect-src 'self' https://cdnjs.cloudflare.com;";
$csp = "default-src 'self'; base-uri 'self'; frame-ancestors 'none'; img-src 'self' data: blob:; script-src 'self' https://cdnjs.cloudflare.com https://unpkg.com 'unsafe-inline' blob:; worker-src 'self' blob:; style-src 'self' 'unsafe-inline' https://cdnjs.cloudflare.com https://fonts.googleapis.com; font-src 'self' data: https://fonts.gstatic.com https://cdnjs.cloudflare.com; connect-src 'self' https://cdnjs.cloudflare.com https://unpkg.com;";
header("Content-Security-Policy: $csp");

$secure = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || ($_SERVER['SERVER_PORT'] ?? '') == 443;
Expand Down
Loading