Skip to content

A toolbox of film styles made in code for Claude Code: 66 ready to use, and your own. Each style is a style prompt plus a demo film made entirely in code by Claude Opus 5.5, with no video model. By Lemomo. · 一套用代码做片的风格工具箱:66 种现成风格,也能做出你自己的

2.7 KB
Raw Blame
<!doctype html><html><head><style>html,body{margin:0;background:#000}canvas{display:block}</style>
<script type="importmap">{"imports":{"three":"./node_modules/three/build/three.module.js","three/addons/":"./node_modules/three/examples/jsm/"}}</script></head><body>
<script type="module">
import * as THREE from 'three';
import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
const r = new THREE.WebGLRenderer({ antialias: true, preserveDrawingBuffer: true });
r.setSize(1920, 1080); r.shadowMap.enabled = true; r.shadowMap.type = THREE.PCFSoftShadowMap;
r.toneMapping = THREE.ACESFilmicToneMapping; r.outputColorSpace = THREE.SRGBColorSpace;
document.body.appendChild(r.domElement);
const scene = new THREE.Scene(); const cam = new THREE.PerspectiveCamera(35, 16 / 9, .01, 100);
const hdrName = new URLSearchParams(location.search).get('h') || 'lythwood_lounge';
const env = await new RGBELoader().loadAsync(`assets/${hdrName}_2k.hdr`); env.mapping = THREE.EquirectangularReflectionMapping;
scene.environment = env; scene.background = env; scene.backgroundBlurriness = .3;
const tl = new THREE.TextureLoader();
const diff = tl.load('assets/walnut_diff.jpg'); diff.colorSpace = THREE.SRGBColorSpace;
const nor = tl.load('assets/walnut_nor.jpg'), rough = tl.load('assets/walnut_rough.jpg');
for (const t of [diff, nor, rough]) { t.wrapS = t.wrapT = THREE.RepeatWrapping; t.repeat.set(1.5, 1); t.anisotropy = 8; }
const desk = new THREE.Mesh(new THREE.BoxGeometry(1.6, .04, .9), new THREE.MeshStandardMaterial({ map: diff, normalMap: nor, roughnessMap: rough }));
desk.position.y = -.02; desk.receiveShadow = true; scene.add(desk);
const g = new GLTFLoader();
for (const [n, x, z, s, ry] of [['desk_lamp_arm_01', -.38, -.18, 1, .6], ['potted_plant_04', .36, -.2, 1, 0], ['tea_set_01', .45, .12, .5, -.4], ['alarm_clock_01', -.3, .15, 1, .3]]) {
  const m = (await g.loadAsync(`assets/${n}/${n}.gltf`)).scene; m.position.set(x, 0, z); m.scale.setScalar(s); m.rotation.y = ry;
  m.traverse(o => { if (o.isMesh) { o.castShadow = o.receiveShadow = true; } }); scene.add(m);
}
const book = new THREE.Mesh(new THREE.BoxGeometry(.32, .04, .24), new THREE.MeshStandardMaterial({ color: '#7a2f2a', roughness: .6 }));
book.position.set(0, .02, 0); book.castShadow = true; scene.add(book);
const sun = new THREE.DirectionalLight('#ffe2b8', 2.2); sun.position.set(-.6, 1.2, .4); sun.castShadow = true;
sun.shadow.mapSize.set(2048, 2048); Object.assign(sun.shadow.camera, { left: -.8, right: .8, top: .8, bottom: -.8, near: .1, far: 4 }); sun.shadow.radius = 4; scene.add(sun);
window.render = t => { cam.position.set(Math.sin(t) * .1, .42, .75); cam.lookAt(0, .05, 0); r.render(scene, cam); };
window.READY = true;
</script></body></html>