Skip to content

Commit

Permalink
Release 0.0.17
Browse files Browse the repository at this point in the history
  • Loading branch information
hisorange committed Nov 30, 2021
1 parent 9913a93 commit dd59f8b
Show file tree
Hide file tree
Showing 11 changed files with 299 additions and 29 deletions.
Binary file added assets/particle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
### Version 0.0.17

- New sign in page design
- Cypress testing
- Authentication is more informative
- Release flow changes

### Version 0.0.16

- Cloud Extension store working!
Expand Down
7 changes: 2 additions & 5 deletions license
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,6 @@ making the Licensed Material available under these terms and conditions.

Licensor, Varga Zsolt.

As this license if is protecting the work done by the Licensor, it is not subject the following contents:

Authentication page's photography is licensed by Maria Camila Castaño from Pexels. <3
~/hero-gate.jpg

The logo.png, and other derivatives which display the Artgen logo are commercialy licensed to Varga Zsolt.
Notable extensions:
- The logo.png, and other derivatives which display the Artgen logo are commercialy licensed to Varga Zsolt.
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@artgen/core",
"version": "0.0.16",
"version": "0.0.17",
"description": "Versatily headless CMS",
"main": "build/main.js",
"homepage": "https://artgen.io",
Expand Down Expand Up @@ -128,6 +128,7 @@
"@types/react-router-dom": "^5.3.1",
"@types/react-transition-group": "^4.4.2",
"@types/sequelize": "^4.28.10",
"@types/three": "^0.134.0",
"@types/uuid": "^8.3.1",
"@types/validator": "^13.6.5",
"antd": "^4.16.13",
Expand Down Expand Up @@ -158,11 +159,12 @@
"start-server-and-test": "^1.14.0",
"tailwindcss": "^2.2.7",
"tailwindcss-scrollbar": "^0.1.0",
"three": "^0.135.0",
"ts-jest": "^27.0.4",
"ts-node": "^10.3.0",
"ts-node-dev": "^1.1.8",
"typescript": "^4.3.5",
"vite": "^2.6.10",
"vite-react-jsx": "^1.1.2"
}
}
}
Binary file removed src/modules/admin/assets/img/hero-gate.jpg
Binary file not shown.
9 changes: 2 additions & 7 deletions src/modules/authentication/component/cover.component.css
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
.auth-layout .hero-bg {
background-color: #1a212a;
background-image: url('../../admin/assets/img/hero-gate.jpg');
}

.auth-layout .cover {
@apply absolute bg-black opacity-70 inset-0 z-0;
@apply absolute inset-0 z-0;
}

.auth-layout .misc-text {
@apply text-gray-400 hover:underline hover:text-gray-100;
}

.auth-layout .mobile-panel {
@apply fixed lg:hidden z-10 inset-0 bg-no-repeat bg-cover bg-scroll items-center;
@apply fixed lg:hidden z-10 inset-0 items-center;
}

.auth-layout .subtext {
Expand Down
17 changes: 15 additions & 2 deletions src/modules/authentication/component/cover.component.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,33 @@
import './cover.component.css';
import GalaxyComponent from './galaxy.component';
import SignInComponent from './sign-in.component';

export default function AuthLayoutComponent() {
return (
<section className="min-h-screen flex items-stretch text-white auth-layout absolute top-0 left-0 right-0 bottom-0 z-50">
<div className="left-panel hero-bg">
<GalaxyComponent />
<div className="cover" />
<div className="w-full px-24 z-10">
<div className="w-full px-24 z-10 text-white">
<h1 className="text-5xl moto font-thin text-left tracking-wide">
Welcome back!
</h1>
<p className="text-2xl font-thin my-4 italic text-gray-400">
Opportunities don't happen. You create them.
</p>
</div>
<div className="subtext">Having trouble? Click here for help.</div>
<div className="subtext">
Having trouble? Click&nbsp;
<a
href="https://github.com/ArtgenIO/Core/wiki"
target="_blank"
title="Troubleshoot"
className="text-gray-400"
>
here
</a>
&nbsp;for help.
</div>
</div>
<div className="right-panel">
<div className="mobile-panel hero-bg">
Expand Down
234 changes: 234 additions & 0 deletions src/modules/authentication/component/galaxy.component.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,234 @@
import { useEffect, useRef } from 'react';
import {
AdditiveBlending,
BufferAttribute,
BufferGeometry,
Color,
PerspectiveCamera,
Points,
PointsMaterial,
Scene,
TextureLoader,
Vector2,
WebGLRenderer,
} from 'three';
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js';
import { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer.js';
import { RenderPass } from 'three/examples/jsm/postprocessing/RenderPass.js';
import { UnrealBloomPass } from 'three/examples/jsm/postprocessing/UnrealBloomPass.js';

export default function GalaxyComponent() {
const mountRef = useRef(null);

useEffect(() => {
const textureLoader = new TextureLoader();
const scene = new Scene();
const renderer = new WebGLRenderer();

mountRef.current.appendChild(renderer.domElement);

const config = {
count: 70000,
size: 0.014,
radius: 5.5,
branches: 6,
spin: -2,
randomness: 8.5,
randomnessPower: 4.9,
stars: 18000,
starColor: '#37393f',
insideColor: '#2df0b2',
outsideColor: '#4b21a8',
};

const shape = textureLoader.load('/assets/particle.png');

let bgStarsGeometry = null;
let bgStarsMaterial = null;
let bgStars = null;

if (bgStars !== null) {
bgStarsGeometry.dispose();
bgStarsMaterial.dispose();
scene.remove(bgStars);
}

bgStarsGeometry = new BufferGeometry();
const bgStarsPositions = new Float32Array(config.stars * 3);

for (let j = 0; j < config.stars; j++) {
bgStarsPositions[j * 3 + 0] = (Math.random() - 0.5) * 20;
bgStarsPositions[j * 3 + 1] = (Math.random() - 0.5) * 20;
bgStarsPositions[j * 3 + 2] = (Math.random() - 0.5) * 20;
}

bgStarsGeometry.setAttribute(
'position',
new BufferAttribute(bgStarsPositions, 3),
);

bgStarsMaterial = new PointsMaterial({
size: config.size,
depthWrite: false,
sizeAttenuation: true,
blending: AdditiveBlending,
color: config.starColor,
transparent: true,
alphaMap: shape,
});

bgStars = new Points(bgStarsGeometry, bgStarsMaterial);

scene.add(bgStars);

// Generate the galaxy shape
let geometry = null;
let material = null;
let points = null;

if (points !== null) {
geometry.dispose();
material.dispose();
scene.remove(points);
}

geometry = new BufferGeometry();

const positions = new Float32Array(config.count * 3);
const colors = new Float32Array(config.count * 3);

const colorInside = new Color(config.insideColor);
const colorOutside = new Color(config.outsideColor);

for (let i = 0; i < config.count; i++) {
//Position
const x = Math.random() * config.radius;
const branchAngle =
((i % config.branches) / config.branches) * 2 * Math.PI;
const spinAngle = x * config.spin;

const randomX =
Math.pow(Math.random(), config.randomnessPower) *
(Math.random() < 0.5 ? 1 : -1);
const randomY =
Math.pow(Math.random(), config.randomnessPower) *
(Math.random() < 0.5 ? 1 : -1);
const randomZ =
Math.pow(Math.random(), config.randomnessPower) *
(Math.random() < 0.5 ? 1 : -1);

positions[i * 3] = Math.sin(branchAngle + spinAngle) * x + randomX;
positions[i * 3 + 1] = randomY;
positions[i * 3 + 2] = Math.cos(branchAngle + spinAngle) * x + randomZ;

// Color
const mixedColor = colorInside.clone();
mixedColor.lerp(colorOutside, x / config.radius);

colors[i * 3 + 0] = mixedColor.r;
colors[i * 3 + 1] = mixedColor.g;
colors[i * 3 + 2] = mixedColor.b;
}

geometry.setAttribute('position', new BufferAttribute(positions, 3));
geometry.setAttribute('color', new BufferAttribute(colors, 3));

material = new PointsMaterial({
color: 'white',
size: config.size,
depthWrite: false,
sizeAttenuation: true,
blending: AdditiveBlending,
vertexColors: true,
transparent: true,
alphaMap: shape,
});

points = new Points(geometry, material);
scene.add(points);

const sizes = {
width: window.innerWidth,
height: window.innerHeight,
};

const camera = new PerspectiveCamera(70, sizes.width / sizes.height, 1, 50);
camera.position.x = 5;
camera.position.y = 2.5;
camera.position.z = 3;
camera.lookAt(0, 5, 0);
scene.add(camera);

const controls = new OrbitControls(camera, renderer.domElement);
controls.enableDamping = true;

renderer.setSize(sizes.width, sizes.height);
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));

const renderScene = new RenderPass(scene, camera);

const bloomPass = new UnrealBloomPass(
new Vector2(window.innerWidth, window.innerHeight),
1.5,
0.4,
0.85,
);
bloomPass.threshold = 0.05;
bloomPass.strength = 1.0;
bloomPass.radius = -0.25;

const composer = new EffectComposer(renderer);
composer.addPass(renderScene);
composer.addPass(bloomPass);

const resizeHandler = () => {
// Update sizes
sizes.width = window.innerWidth;
sizes.height = window.innerHeight;

// Update camera
camera.aspect = sizes.width / sizes.height;
camera.updateProjectionMatrix();

// Update renderer
renderer.setSize(sizes.width, sizes.height);
composer.setSize(sizes.width, sizes.height);
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
};

resizeHandler();

camera.rotation.x = 5;
camera.rotation.y = 0.7;

const animate = () => {
//Update the camera
points.rotation.y += 0.0003;
bgStars.rotation.y += 0.0008;

// Render
composer.render();
// Call tick again on the next frame
requestAnimationFrame(animate);
};

window.addEventListener('resize', resizeHandler);

animate();

return () => {
window.removeEventListener('resize', resizeHandler);

if (mountRef.current) {
mountRef.current.removeChild(renderer.domElement);
}
};
}, []);

return (
<div
ref={mountRef}
className="absolute top-0 left-0 right-0 bottom-0"
></div>
);
}
Loading

0 comments on commit dd59f8b

Please sign in to comment.