forked from jackyzha0/quartz
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
469 additions
and
16 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
import { QuartzComponentConstructor } from "./types" | ||
import landingStyle from "./styles/Landing.scss" | ||
|
||
export const TOTAL_CARDS = 8 | ||
export const CARDS = { | ||
basics: ( | ||
<a href={"/basics"}> | ||
<div class="card card-1"> | ||
<p class="card-title">The Basics</p> | ||
<p class="card-subhead">Issue 001</p> | ||
<img src="/static/1-illo.png" class="card-illustration-1" /> | ||
</div> | ||
</a> | ||
), | ||
"getting-started": ( | ||
<a href={"/getting-started"}> | ||
<div class="card card-2"> | ||
<p class="card-title">Getting Started</p> | ||
<p class="card-subhead">Issue 002</p> | ||
<img src="/static/2-illo.png" class="card-illustration-2" /> | ||
</div> | ||
</a> | ||
), | ||
"growing-people": ( | ||
<a href={"/growing-people"}> | ||
<div class="card card-3"> | ||
<p class="card-title">Growing People</p> | ||
<p class="card-subhead">Issue 003</p> | ||
<img src="/static/3-illo.png" class="card-illustration-3" /> | ||
</div> | ||
</a> | ||
), | ||
"superboosting-ideas": ( | ||
<a href={"/superboosting-ideas"}> | ||
<div class="card card-4"> | ||
<p class="card-title">Super- boosting Ideas</p> | ||
<p class="card-subhead">Issue 004</p> | ||
<img src="/static/4-illo.png" class="card-illustration-4" /> | ||
</div> | ||
</a> | ||
), | ||
maintenance: ( | ||
<a href={"/maintenance"}> | ||
<div class="card card-5"> | ||
<p class="card-title">Maintenance</p> | ||
<p class="card-subhead">Issue 005</p> | ||
<img src="/static/5-illo.png" class="card-illustration-5" /> | ||
</div> | ||
</a> | ||
), | ||
} | ||
|
||
export default (() => { | ||
function LandingComponent() { | ||
return ( | ||
<div> | ||
<div class="content-container"> | ||
<p class="landing-header">Welcome to Socratica</p> | ||
<p class="page-subhead"> | ||
This is a guide •{" "} | ||
<a href="https://www.socratica.info/" target="_blank"> | ||
Back to main site | ||
</a>{" "} | ||
•{" "} | ||
<a href="https://github.com/Socratica-Org/toolbox" target="_blank"> | ||
Contribute | ||
</a>{" "} | ||
•{" "} | ||
<a href="https://toolbox.socratica.info/credits" target="_self"> | ||
Credits | ||
</a> | ||
</p> | ||
|
||
<div class="issue-container"> | ||
{Object.values(CARDS)} | ||
{Array(TOTAL_CARDS - Object.keys(CARDS).length) | ||
.fill(0) | ||
.map(() => ( | ||
<div class="card card-coming"> | ||
<p class="card-title">Coming Soon</p> | ||
<p class="card-subhead">Issue XXX</p> | ||
</div> | ||
))} | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
LandingComponent.css = landingStyle | ||
return LandingComponent | ||
}) satisfies QuartzComponentConstructor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { QuartzComponentConstructor } from "./types" | ||
export default (() => { | ||
function LanguageToggle() { | ||
return <a class="red-text" href="https://hakuguen.github.io/design-o-sphereVN" | ||
> | ||
VIETNAMESE | ||
</a> | ||
|
||
} | ||
|
||
LanguageToggle.css = ` | ||
p.red-text { | ||
color: red; | ||
} | ||
` | ||
|
||
return LanguageToggle | ||
}) satisfies QuartzComponentConstructor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { QuartzComponentConstructor, QuartzComponentProps } from "./types" | ||
|
||
// @ts-ignore | ||
import script from "./scripts/threejs.inline" | ||
|
||
// import styles from "./styles/ThreeJsComponent.scss" | ||
|
||
export default (() => { | ||
function ThreeJsComponent() { | ||
return <div id="threejs-container"></div> | ||
} | ||
|
||
ThreeJsComponent.afterDOMLoaded = script | ||
|
||
// ThreeJsComponent.css = styles | ||
return ThreeJsComponent | ||
}) satisfies QuartzComponentConstructor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import * as THREE from "three" | ||
|
||
document.addEventListener("nav", async (e: unknown) => { | ||
var scene = new THREE.Scene() | ||
var camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000) | ||
var renderer = new THREE.WebGLRenderer() | ||
|
||
renderer.setClearColor(0xfbf8ef) | ||
|
||
renderer.setSize(window.innerWidth, window.innerHeight) | ||
document.getElementById("threejs-container")!.appendChild(renderer.domElement) | ||
|
||
var group = new THREE.Group() | ||
|
||
// Create 5 boxes, each increasing in width by 1.25 and positioned lower on the y axis | ||
for (let i = 0; i < 5; i++) { | ||
var geometry = new THREE.BoxGeometry(1 + i * 1.25, 1, 1) | ||
var material = new THREE.MeshBasicMaterial({ color: 0xffffff }) // Different color for distinction | ||
var cube = new THREE.Mesh(geometry, material) | ||
cube.position.y -= i // Adjust this value to change the height of the box | ||
var edges = new THREE.EdgesGeometry(geometry) | ||
var line = new THREE.LineSegments(edges, new THREE.LineBasicMaterial({ color: 0x000000 })) // Black color | ||
line.position.y -= i // Adjust this value to change the height of the box | ||
group.add(cube) | ||
group.add(line) | ||
scene.add(group) | ||
} | ||
|
||
var animateGroup = new THREE.Group() | ||
animateGroup.add(group) | ||
|
||
scene.add(animateGroup) | ||
|
||
camera.position.z = 5 | ||
|
||
// function animate() { | ||
// requestAnimationFrame(animate) | ||
|
||
// animateGroup.rotation.z += 0.01 | ||
// animateGroup.rotation.y += 0.01 | ||
|
||
// // Render the scene with the camera | ||
// renderer.render(scene, camera) | ||
// } | ||
|
||
// // Call the animate function | ||
// animate() | ||
|
||
// Add scroll event listener to move the second cube | ||
let previousScrollPosition = window.scrollY | ||
window.addEventListener("scroll", function () { | ||
var scrollChange = window.scrollY - previousScrollPosition | ||
previousScrollPosition = window.scrollY | ||
|
||
// Iterate over each child in the group | ||
for (let i = 0; i < group.children.length; i++) { | ||
// Apply a different speed of movement to each box | ||
let speedFactor = (i + 1) * 1.5 // Adjust this value to change the speed difference between boxes | ||
group.children[i].position.y += (scrollChange / window.innerHeight) * speedFactor | ||
} | ||
}) | ||
|
||
renderer.render(scene, camera) | ||
|
||
renderer.render(scene, camera) | ||
var leftElements = document.getElementsByClassName("left") | ||
for (let i = 0; i < leftElements.length; i++) { | ||
;(leftElements[i] as HTMLElement).style.display = "none" | ||
} | ||
|
||
var rightElements = document.getElementsByClassName("right") | ||
for (let i = 0; i < rightElements.length; i++) { | ||
;(rightElements[i] as HTMLElement).style.display = "none" | ||
} | ||
}) |
Oops, something went wrong.