Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update netuid module-register.mdx #88

Open
wants to merge 161 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
161 commits
Select commit Hold shift + click to select a range
f5e09f4
feature: implement all landing page sections with texts and theis com…
vinicius-sacramento Jan 17, 2024
2eef7a2
refactor: sections and components of the landing page (#2)
vinicius-sacramento Jan 19, 2024
109c835
feature: improve seo and page performance (#3)
vinicius-sacramento Jan 19, 2024
fb2ee6b
feature: new CTA to discord channel (#4)
vinicius-sacramento Jan 19, 2024
dc590ca
fix: call to action section (#5)
vinicius-sacramento Jan 19, 2024
d8f9f9e
feature/discord-widget (#6)
vinicius-sacramento Jan 26, 2024
d4feefa
feature: new header style (#7)
vinicius-sacramento Jan 26, 2024
30c00c4
fix: scroll flickering (#8)
vinicius-sacramento Jan 27, 2024
afb7bcc
feature: reorganize header options and improve style (#9)
vinicius-sacramento Jan 28, 2024
e06f22b
feature: implement suspense loading (#10)
vinicius-sacramento Jan 28, 2024
167aabe
feature: add css native animations on cards (#11)
vinicius-sacramento Jan 29, 2024
a40b861
fix: page scrolling up on first render(#12)
vinicius-sacramento Jan 29, 2024
8d04fa9
fix: page scrolling adding suspense wrapping the whole page (#13)
vinicius-sacramento Jan 29, 2024
ec2ea32
fix: remove suspense from page.tsx (#14)
vinicius-sacramento Jan 29, 2024
7494734
feature: refactor components and enhance layout effects (#15)
vinicius-sacramento Jan 29, 2024
c1a199c
feature: create faq and new animations (#16)
vinicius-sacramento Jan 29, 2024
ae94d04
feature: create a new cta to docs and improve animations and layout (…
vinicius-sacramento Jan 30, 2024
2bdf690
feature: enhance animation performance on hero (#18)
vinicius-sacramento Jan 30, 2024
76d7bc5
fix: header overlay (#19)
vinicius-sacramento Jan 30, 2024
9c022bd
fix: header overlay height (#20)
vinicius-sacramento Jan 30, 2024
53a2d74
fix: animation order (#21)
vinicius-sacramento Jan 30, 2024
083c987
Revert "fix: animation order" (#22)
vinicius-sacramento Jan 30, 2024
35d53b4
update package-lock.json
steinerkelvin Feb 4, 2024
a682be8
fix: horizontal scroll issue and reduce hero height (#26)
vinicius-sacramento Feb 5, 2024
788d802
feature: footer (#27)
vinicius-sacramento Feb 6, 2024
85d696b
feature: add metatag robots and increase contrast on footer (#28)
vinicius-sacramento Feb 6, 2024
fa81b6b
fix: header blur and remove icons (#30)
vinicius-sacramento Feb 8, 2024
b344a26
fix: hero gradient background position in small screens (#32)
vinicius-sacramento Feb 8, 2024
1d81e1d
dev into main (#33)
vinicius-sacramento Mar 1, 2024
1675c43
feature/docs (#34)
vinicius-sacramento Mar 10, 2024
12095cf
feature: improve padding and scroll on docs page (#35)
vinicius-sacramento Mar 22, 2024
2c3e3ff
feature: new telegram icon (#37)
vinicius-sacramento Mar 22, 2024
e43f5d8
fix: merge conflicts
vinicius-sacramento Mar 22, 2024
dc6dd43
Merge branch 'main' into dev
vinicius-sacramento Mar 22, 2024
8fd0dff
fix: merge conflicts
vinicius-sacramento Mar 22, 2024
203e7a4
dev into main(#38)
vinicius-sacramento Mar 22, 2024
d0c9fe3
feature: new landing page layout (#39)
vinicius-sacramento Mar 27, 2024
d48a253
fix: merge conflicts
vinicius-sacramento Mar 27, 2024
16f8a95
fix: merge conflicts
vinicius-sacramento Mar 27, 2024
07b63b7
dev into main (#40)
vinicius-sacramento Mar 27, 2024
6d9211d
fix: favicon icon (#41)
vinicius-sacramento Mar 27, 2024
d76cabd
fix: section content (#49)
vinicius-sacramento Mar 27, 2024
e276e38
feature: update icons in generic section
EdSDR Mar 27, 2024
7920462
feature: add basic transition effects
EdSDR Mar 27, 2024
a821490
feature: basic discord widget on call to action
EdSDR Mar 27, 2024
334b65a
fix: docs screen size in bigger displays
EdSDR Mar 28, 2024
969097b
feature: edit button on docs
EdSDR Mar 28, 2024
cfbd3d3
feature: dark mode
EdSDR Mar 27, 2024
34d56b1
fix: remove unnecessary prop
EdSDR Mar 27, 2024
6755084
feature: dark mode on docs
EdSDR Mar 28, 2024
42869dc
fix: unused styles
EdSDR Mar 28, 2024
2b4fa8d
feature: new edit button dark styles
EdSDR Mar 28, 2024
94fe9b6
fix: merge conflicts - main into dev
vinicius-sacramento Apr 2, 2024
30f3f80
main into dev (#56)
vinicius-sacramento Apr 2, 2024
76b51a6
Feature/code highlights and line enumerators (#57)
vinicius-sacramento Apr 2, 2024
92e09e1
feature: new telegram icon (#37)
vinicius-sacramento Mar 22, 2024
b237842
feature: new landing page layout (#39)
vinicius-sacramento Mar 27, 2024
9ca944f
main into dev (#56)
vinicius-sacramento Apr 2, 2024
704e402
Feature/code highlights and line enumerators (#57)
vinicius-sacramento Apr 2, 2024
4ae0540
feature: theme toggle and theme auto detection
vinicius-sacramento Apr 3, 2024
b33f458
feature: substuting swich structure for object literals structure
vinicius-sacramento Apr 3, 2024
bafc952
fix: remove unused return statement
vinicius-sacramento Apr 3, 2024
d635c28
fix: Theme types that were breaking the pipeline
vinicius-sacramento Apr 3, 2024
6a36198
fix: merge conflicts dev
vinicius-sacramento Apr 4, 2024
3379a17
fix: edit button and mobile header (#64)
vinicius-sacramento Apr 4, 2024
1846241
feature: add shadow and border to code blocks on docs (#66)
vinicius-sacramento Apr 4, 2024
bc05815
dev into main (#63)
EdSDR Apr 4, 2024
d306fab
fix: remove unused function on header
EdSDR Apr 6, 2024
1f5f103
feature: new governance button (#70)
vinicius-sacramento Apr 13, 2024
8c85004
Merge branch 'dev' into main
vinicius-sacramento Apr 18, 2024
246634a
main into dev (#74)
vinicius-sacramento Apr 18, 2024
54a4687
feat: visual standard (#75)
EdSDR Apr 18, 2024
5112217
feature: restyle header buttons and hero buttons (#76)
vinicius-sacramento Apr 18, 2024
8f56a38
fix: include whitepaper
vinicius-sacramento Apr 18, 2024
90988fb
Merge branch 'main' into dev
vinicius-sacramento Apr 18, 2024
e676da7
feature: enhance theme toggle (#78)
vinicius-sacramento Apr 20, 2024
a253612
fix: toggle hover bg
vinicius-sacramento Apr 20, 2024
b9928ef
dev into main (#77)
vinicius-sacramento Apr 20, 2024
1a5a5d7
feat: docs new structure
EdSDR Apr 25, 2024
f4a7cbf
feat: introduction
EdSDR Apr 25, 2024
42100f0
feat: basics
EdSDR Apr 25, 2024
eb5e30a
feat: setting up a wallet
EdSDR Apr 25, 2024
1a5f408
feat: governance
EdSDR Apr 25, 2024
5366303
feat: requirements
EdSDR Apr 25, 2024
49ab696
feat: setup commune
EdSDR Apr 25, 2024
06c0dbb
feat: key basics
EdSDR Apr 25, 2024
7d49f78
wip
Apr 26, 2024
bbb6fb1
Refactor tutorials index.tsx to update titles and tutorial IDs
Apr 26, 2024
4e8f994
adding subnet section
Apr 26, 2024
7598a64
WIP
Apr 27, 2024
4029360
wip
Apr 27, 2024
9f560aa
Add explanation about SubnetStakeThreshold in Yuma subnets
Apr 27, 2024
1a68c77
more docs
PsicoThePato Apr 28, 2024
008cfc8
:fire: deleted some pages
PsicoThePato Apr 28, 2024
461a4c1
wip
Apr 28, 2024
e1f6acc
DONE
Apr 28, 2024
a7305ca
.
Apr 28, 2024
449cbd2
finished docs
Apr 28, 2024
1a6978f
Merge pull request #81 from agicommies/feat-docs
functor-flow Apr 28, 2024
6ba3b66
Merge branch 'main' into dev
PsicoThePato Apr 28, 2024
41c46a4
changing details
Apr 28, 2024
baabe3a
Merge pull request #83 from agicommies/dev
functor-flow Apr 28, 2024
355e833
.
Apr 28, 2024
735dfb6
fix link
Apr 28, 2024
5641caf
Merge pull request #84 from agicommies/dev
functor-flow Apr 28, 2024
1a53f46
Update building-a-subnet.mdx
rad2520 Apr 28, 2024
1b4755e
feat: update metadata description
EdSDR Apr 29, 2024
5ccb1d0
Update intro.mdx
rad2520 Apr 29, 2024
7894eed
Update basics.mdx
rad2520 Apr 29, 2024
b546688
fix: FAQ
Apr 30, 2024
ffe8f90
Update basics.mdx
rad2520 Apr 30, 2024
57fa43d
naming consistency
Apr 30, 2024
b587a07
Update components.tsx
functor-flow May 1, 2024
5bd594a
Update yuma-consensus.mdx
rad2520 May 2, 2024
ee50778
Update yuma-consensus.mdx
rad2520 May 2, 2024
cdb3d11
Update yuma-consensus.mdx
rad2520 May 3, 2024
554dbda
feature: desktop restyle
vinicius-sacramento May 7, 2024
8de8e6d
feature: responsive page
vinicius-sacramento May 7, 2024
1bf9514
fix: minor layout issues
vinicius-sacramento May 7, 2024
f7b5db5
feature: add asci art
vinicius-sacramento May 7, 2024
4bbc7b9
feature: add view more anchor
vinicius-sacramento May 7, 2024
18c8ffa
feature: change docs style and adoption of our new design pattern
vinicius-sacramento May 7, 2024
87ab68a
feature: wip
vinicius-sacramento May 9, 2024
cf16ff0
feature: hero responsivity wip
vinicius-sacramento May 9, 2024
08e9753
feat: animation
EdSDR May 10, 2024
039f62c
feature: remove gui from animation
vinicius-sacramento May 10, 2024
9718238
feat: new animation
EdSDR May 12, 2024
9376867
fix: dark background
EdSDR May 12, 2024
437a985
fix: double rendering component
EdSDR May 12, 2024
97ddaa6
fix: container width on desktop
EdSDR May 12, 2024
a3f60c2
fix: model position
EdSDR May 12, 2024
c566f81
fix: padding
EdSDR May 12, 2024
cdf3eee
feat: update color spectrum
EdSDR May 12, 2024
f0a4156
feat: add basic initial animation
EdSDR May 12, 2024
9c26565
feature: change faq structure and styles around the page
vinicius-sacramento May 13, 2024
32c5065
feat: multiple page upgrades
EdSDR May 13, 2024
2b699df
feat: final polish
EdSDR May 13, 2024
50e03af
feat: articles, less dense animation and logo
EdSDR May 13, 2024
98d14a6
feat: update density and labels
EdSDR May 13, 2024
6b8f092
feat: visual fixes
EdSDR May 13, 2024
1731797
feat: count up
EdSDR May 13, 2024
11263fa
feat: count up component
EdSDR May 13, 2024
25b52e3
feat: update data
EdSDR May 13, 2024
55e0f76
fix: unused use client
EdSDR May 13, 2024
dde4359
fix: loyer count up time
EdSDR May 13, 2024
5a700b9
fix: animation on mobile and labels
EdSDR May 13, 2024
313f743
feat: new texts
EdSDR May 13, 2024
b4a3a1d
Merge branch 'dev'
EdSDR May 13, 2024
38018be
fix: smal fixes
EdSDR May 13, 2024
a1b2ecc
fix: discord icon
EdSDR May 13, 2024
f91e3b9
fix: mobile graph view
EdSDR May 13, 2024
c12c61a
style: change label from blocs to blogs
EdSDR May 17, 2024
9128383
feat: wallet button on commune page
EdSDR May 19, 2024
498e557
fix: subnet list
May 21, 2024
aa4802b
Update key-basics.mdx
functor-flow May 27, 2024
92b5819
fix: docs typo
EdSDR Jun 10, 2024
7d60976
Update running-local-node.mdx
functor-flow Jun 16, 2024
2f75a04
Update running-local-node.mdx
functor-flow Jun 16, 2024
e1a8dec
feat: add stats link on footer text
EdSDR Jun 20, 2024
5b8e08a
fix: footer text
EdSDR Jun 20, 2024
cc5d40c
Update netuid module-register.mdx
smyja Aug 28, 2024
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
12 changes: 11 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
{
"extends": "next/core-web-vitals"
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"next/core-web-vitals",
"prettier"
],
"rules": {
"@typescript-eslint/no-unused-vars": 1
},
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"]
}
8 changes: 8 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"trailingComma": "es5",
"semi": false,
"tabWidth": 2,
"singleQuote": true,
"jsxSingleQuote": true,
"plugins": ["prettier-plugin-tailwindcss"]
}
371 changes: 371 additions & 0 deletions app/components/Animation/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,371 @@
'use client'

import React, { useEffect, useRef } from 'react'
import * as dat from 'lil-gui'
import * as THREE from 'three'
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js'

import pointsVertexShader from '!!raw-loader!./shaders/points/vertex.glsl'
import linesFragmentShader from '!!raw-loader!./shaders/lines/fragment.glsl'
import pointsFragmentShader from '!!raw-loader!./shaders/points/fragment.glsl'

const getRandNum = (min, max) => {
return Math.random() * (max - min) + min
}

function createAnimation({ container, debug }) {
const canvas = document.createElement('canvas')
canvas.classList.add('webgl')
container.appendChild(canvas)

const sizes = {
width: window.screen.availWidth,
height: 600,
}
const clock = new THREE.Clock()

const debugObject = {
tubeRadius: 4,
torusRadius: 4.5,
radialSegments: 27,
tabularSegments: 56,
}

let scene, camera, renderer, controls, objectsGroup

function init() {
createScene()
createCamera()
playIntroAnimation()
createRenderer()
createControls()
createObjects()

if (debug) {
addDebugUI()
}

tick()
}
function createObjects() {
const points = createPoints()
const lines = createLines(points.geometry)

objectsGroup = new THREE.Group()
objectsGroup.add(points)
objectsGroup.add(lines)
objectsGroup.rotation.x = -Math.PI * 0.35
objectsGroup.position.y = 1.3
scene.add(objectsGroup)
}

function createLines(pointsGeomtry) {
// Access pointsGeomtry attributes
const positions = pointsGeomtry.attributes.position.array
const colors = pointsGeomtry.attributes.color.array
const normals = pointsGeomtry.attributes.normal.array

const linePositions = []
const lineColors = []
const lineNormals = []
const lineOpacity = []

const addLine = (vertexIndex1, vertexIndex2) => {
const baseIndex1 = vertexIndex1 * 3
const baseIndex2 = vertexIndex2 * 3

if (!positions[baseIndex1]) return
if (!positions[baseIndex2]) return

linePositions.push(
positions[baseIndex1],
positions[baseIndex1 + 1],
positions[baseIndex1 + 2],
positions[baseIndex2],
positions[baseIndex2 + 1],
positions[baseIndex2 + 2]
)

lineColors.push(
colors[baseIndex1],
colors[baseIndex1 + 1],
colors[baseIndex1 + 2],
colors[baseIndex2],
colors[baseIndex2 + 1],
colors[baseIndex2 + 2]
)
lineNormals.push(
normals[baseIndex1],
normals[baseIndex1 + 1],
normals[baseIndex1 + 2],
normals[baseIndex2],
normals[baseIndex2 + 1],
normals[baseIndex2 + 2]
)

const [oMin, oMax] = [0.01, 0.15]

lineOpacity.push(getRandNum(oMin, oMax), getRandNum(oMin, oMax))
}

// Randomly connect each vertex with up to 2 random neighbors that follow it in the array
const numVertices = positions.length / 3
for (let i = 0; i < numVertices; i++) {
const numConnections = Math.floor(Math.random() * 3) // Random number of connections (0, 1, or 2)
const possibleConnections = []

// Find possible connections
for (let j = i + 1; j < numVertices / 2; j++) {
possibleConnections.push(j)
}

// Shuffle possible connections to randomize which vertices are selected
for (let k = possibleConnections.length - 1; k > 0; k--) {
const index = Math.floor(Math.random() * (k + 1))
;[possibleConnections[k], possibleConnections[index]] = [
possibleConnections[index],
possibleConnections[k],
]
}

// Add line positions for the selected number of connections
for (
let m = 0;
m < numConnections && m < possibleConnections.length;
m++
) {
addLine(i, possibleConnections[m])
}
}

const lineGeometry = new THREE.BufferGeometry()

lineGeometry.setAttribute(
'position',
new THREE.BufferAttribute(new Float32Array(linePositions), 3)
)

lineGeometry.setAttribute(
'color',
new THREE.BufferAttribute(new Float32Array(lineColors), 3)
)

lineGeometry.setAttribute(
'normal',
new THREE.BufferAttribute(new Float32Array(lineNormals), 3)
)

lineGeometry.setAttribute(
'aOpacity',
new THREE.BufferAttribute(new Float32Array(lineOpacity), 1)
)

const { torusRadius, tubeRadius } = debugObject

const lineMaterial = new THREE.ShaderMaterial({
vertexShader: pointsVertexShader,
fragmentShader: linesFragmentShader,
wireframe: false,
depthWrite: false,
blending: THREE.AdditiveBlending,
vertexColors: true,
uniforms: {
uColorOpacity: { value: 0 },
uTime: { value: 0 },
uWeight: { value: 0 },
uTorusRadius: { value: torusRadius },
uTubeRadius: { value: tubeRadius },
},
})

const lines = new THREE.Line(lineGeometry, lineMaterial)
return lines
}

function createPoints() {
const { torusRadius, tubeRadius, radialSegments, tabularSegments } =
debugObject

const torusGeometry = new THREE.TorusGeometry(
torusRadius,
tubeRadius,
radialSegments,
tabularSegments
)

torusGeometry.computeVertexNormals()

// Copy the positions from the TorusGeometry
const positions = torusGeometry.attributes.position.array
const normals = torusGeometry.attributes.normal.array
const maxPosition = Math.max(...positions)

const customGeometry = new THREE.BufferGeometry()

const colors = []
const scales = []

for (let i = 0; i < positions.length; i += 3) {
const r = positions[i] / maxPosition + 0.3
const g = positions[i] / maxPosition + 3
const b = positions[i] / maxPosition + 0.3

colors.push(r, g * 2, b)
scales.push(getRandNum(0.5, 3))
}
customGeometry.setAttribute(
'position',
new THREE.BufferAttribute(new Float32Array(positions), 3)
)

customGeometry.setAttribute(
'color',
new THREE.BufferAttribute(new Float32Array(colors), 3)
)

customGeometry.setAttribute(
'normal',
new THREE.BufferAttribute(new Float32Array(normals), 3)
)
customGeometry.setAttribute(
'aScale',
new THREE.BufferAttribute(new Float32Array(scales), 1)
)
const torusMaterial = new THREE.ShaderMaterial({
vertexShader: pointsVertexShader,
fragmentShader: pointsFragmentShader,
wireframe: false,
depthWrite: false,
blending: THREE.AdditiveBlending,
vertexColors: true,

uniforms: {
uColorOpacity: { value: 1.0 },
uTime: { value: 0 },
uWeight: { value: 0 },
uTorusRadius: { value: torusRadius },
uTubeRadius: { value: tubeRadius },
},
})
const points = new THREE.Points(customGeometry, torusMaterial)
return points
}

function addDebugUI() {
const gui = new dat.GUI({ width: 340 })
Object.keys(debugObject).map((fieldName) => {
gui
.add(debugObject, fieldName)
.name(fieldName)
.onChange(() => {
scene.clear()
createObjects()
})
})

gui.add(camera.position, 'z').name('camera z position').min(10).max(30)
}

function createScene() {
scene = new THREE.Scene()
}

const fov = window.innerWidth <= 768 ? 74 : 47

function createCamera() {
camera = new THREE.PerspectiveCamera(
fov,
sizes.width / sizes.height,
0.1,
200
)
camera.position.set(0, 10, 30) // Set initial position (zoomed out)
camera.rotation.x = -Math.PI / 4 // Set initial rotation (tilted)
scene.add(camera)
}

function createRenderer() {
renderer = new THREE.WebGLRenderer({
canvas: canvas,
antialias: true,
alpha: true,
})
renderer.setSize(sizes.width, sizes.height)
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2))
}

function createControls() {
controls = new OrbitControls(camera, canvas)
controls.enableDamping = true
}

function playIntroAnimation() {
const targetPosition = new THREE.Vector3(0, 0.5, 20) // Target position after the animation
const targetRotation = new THREE.Euler(0, 0, 0) // Target rotation after the animation
const duration = 12 // Duration of the animation in seconds

const startTime = performance.now()

function animate() {
const currentTime = performance.now()
const elapsedTime = (currentTime - startTime) / 4000

if (elapsedTime <= duration) {
const t = elapsedTime / duration

// Interpolate position
camera.position.lerpVectors(camera.position, targetPosition, t)

// Interpolate rotation
camera.rotation.x = THREE.MathUtils.lerp(
camera.rotation.x,
targetRotation.x,
t
)
camera.rotation.y = THREE.MathUtils.lerp(0, Math.PI * 2, t) // Spin around the y-axis

requestAnimationFrame(animate)
} else {
// Animation finished, set the final position and rotation
camera.position.copy(targetPosition)
camera.rotation.copy(targetRotation)
}
}

animate()
}

function tick() {
const elapsedTime = clock.getElapsedTime() * 0.25

objectsGroup.children.forEach((child) => {
const material = child.material

material.uniforms.uTime.value = elapsedTime
material.uniforms.uWeight.value = 0.05 * Math.sin(elapsedTime) + 1.2
})

// Update controls
controls.update()

// Render
renderer.render(scene, camera)

// Call tick again on the next frame
window.requestAnimationFrame(() => tick())
}

init()
}

export default function Animation() {
const graphRef = useRef(null)

useEffect(() => {
if (graphRef.current) {
createAnimation({ container: graphRef.current, debug: false })
}
}, [])

return <div ref={graphRef} id='graph' />
}
Loading