mirror of
https://github.com/lavafroth/lavafroth.github.io.git
synced 2026-06-07 10:01:15 -03:00
fix: theme switcher is gone
This commit is contained in:
@@ -21,5 +21,3 @@ Frames for the outline animation will be recomputed on the fly! The hardcoded du
|
||||
is 5 seconds in this example.
|
||||
|
||||
{{< rawhtml "content/post/project_mana.html" >}}
|
||||
|
||||
Try toggling the theme switcher: the sun or moon icon up in the header.
|
||||
|
||||
@@ -111,10 +111,10 @@ void main() {
|
||||
import * as THREE from 'three';
|
||||
import {OrbitControls} from 'three/addons/controls/OrbitControls.js';
|
||||
|
||||
let dark = true
|
||||
var renderer = new THREE.WebGLRenderer({antialias: true, alpha: true});
|
||||
var width = document.querySelector('#stage').offsetWidth;
|
||||
var height = Math.round(9/16 * width);
|
||||
const dark = window.matchMedia("(prefers-color-scheme: dark)");
|
||||
let renderer = new THREE.WebGLRenderer({antialias: true, alpha: true});
|
||||
let width = document.querySelector('#stage').offsetWidth;
|
||||
let height = Math.round(9/16 * width);
|
||||
renderer.setSize(width, height);
|
||||
document.querySelector('#stage').appendChild(renderer.domElement);
|
||||
|
||||
@@ -128,15 +128,15 @@ const maskScene = new THREE.Scene();
|
||||
const evolveScene = new THREE.Scene();
|
||||
const camera = new THREE.PerspectiveCamera(45, width / height, 0.1, 1000);
|
||||
const color = 0xFFFFFF;
|
||||
var ambientLight = new THREE.AmbientLight(color, dark ? 1: 10);
|
||||
let ambientLight = new THREE.AmbientLight(color, dark ? 1: 10);
|
||||
solidScene.add(ambientLight);
|
||||
var light = new THREE.PointLight(color, 200);
|
||||
let light = new THREE.PointLight(color, 200);
|
||||
light.position.set(10, 10, 15);
|
||||
solidScene.add(light);
|
||||
camera.position.set(6,8,14);
|
||||
|
||||
var buffer = new THREE.WebGLRenderTarget(width, height, {format: THREE.RGBAFormat})
|
||||
var outlineBuffer = new THREE.WebGLRenderTarget(width, height, {format: THREE.RGBAFormat})
|
||||
let buffer = new THREE.WebGLRenderTarget(width, height, {format: THREE.RGBAFormat})
|
||||
let outlineBuffer = new THREE.WebGLRenderTarget(width, height, {format: THREE.RGBAFormat})
|
||||
|
||||
const orbit = new OrbitControls(camera, renderer.domElement);
|
||||
orbit.update();
|
||||
@@ -157,7 +157,7 @@ const material = new THREE.ShaderMaterial({
|
||||
transparent: true,
|
||||
});
|
||||
|
||||
var solidMeshMaterial = new THREE.MeshPhysicalMaterial({
|
||||
let solidMeshMaterial = new THREE.MeshPhysicalMaterial({
|
||||
color: dark ? 0xaaeadb : 0xffffff,
|
||||
metalness: 0.8,
|
||||
clearcoat: 0.4,
|
||||
|
||||
Reference in New Issue
Block a user