File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import { ShaderPass } from "https://cdn.jsdelivr.net/npm/three@0.158.0/examples/
88import { VignetteShader } from "./src/jsm/shaders/VignetteShader.js" ;
99import { DRACOLoader } from 'https://cdn.jsdelivr.net/npm/three@0.158.0/examples/jsm/loaders/DRACOLoader.js' ;
1010import { AfterimagePass } from './src/jsm/postprocessing/AfterimagePass.js' ;
11+ import { getAudiofiles } from './src/js/AudioFiles.js' ;
1112gsap . registerPlugin ( ScrollTrigger , ScrollSmoother , ( gsap . plugins . ScrollToPlugin || ScrollToPlugin ) ) ;
1213const sfx = new ( window . AudioContext || window . webkitAudioContext ) ( ) ;
1314let buffer ;
@@ -1365,6 +1366,7 @@ function animate(time){
13651366 opacity :0 ,
13661367 duration :2 ,
13671368 } , '<' )
1369+ getAudiofiles ( )
13681370
13691371} else {
13701372 Loadercanvas . remove ( )
@@ -1389,7 +1391,6 @@ function animate(time){
13891391 updateAudio ( ) ;
13901392 previousTime = elapsedTime
13911393 // camera.lookAt(new THREE.Vector3(0,activecamera.position.y ,0))
1392-
13931394 if ( config . transition ) {
13941395 if ( statue . position . x < - space ) {
13951396 statue . position . x = space
Original file line number Diff line number Diff line change 162162 font-family : 'MyCustomFont' ;
163163 src : url ('fonts/DisplayNarrowExtraLight.woff2' ) format ('woff2' );
164164 font-style : normal;
165+ font-display : swap;
165166}
166167@font-face {
167168 font-family : 'MyCustomFont1' ;
Original file line number Diff line number Diff line change 1+ import * as THREE from 'three' ;
2+
3+ const audioLoader = new THREE . AudioLoader ( ) ;
4+
5+ const sampleFiles = {
6+ '1' : 'https://cdn.jsdelivr.net/gh/Subsussp/THE@gh-pages/music/sample1.mp3' ,
7+ '2' : 'https://cdn.jsdelivr.net/gh/Subsussp/THE@gh-pages/music/sample2.mp3' ,
8+ '3' : 'https://cdn.jsdelivr.net/gh/Subsussp/THE@gh-pages/music/sample3.mp3' ,
9+ '4' : 'https://cdn.jsdelivr.net/gh/Subsussp/THE@gh-pages/music/Farfromanyroad.mp3' ,
10+ '5' : 'https://cdn.jsdelivr.net/gh/Subsussp/THE@gh-pages/music/sample5.mp3' ,
11+ '6' : 'https://cdn.jsdelivr.net/gh/Subsussp/THE@gh-pages/music/sample6.mp3' ,
12+ '7' : 'https://cdn.jsdelivr.net/gh/Subsussp/THE@gh-pages/music/sample7.mp3' ,
13+ } ;
14+ const loadedSamples = { } ;
15+ function loadSample ( file ) {
16+ return new Promise ( resolve => audioLoader . load ( file , resolve ) ) ;
17+ }
18+ function getAudiofiles ( ) {
19+ Object . entries ( sampleFiles ) . forEach ( ( [ key , path ] ) => {
20+ loadSample ( path ) . then ( buffer => {
21+ loadedSamples [ key ] = buffer ;
22+ } ) ;
23+ } ) ;
24+ }
25+ export { loadedSamples , getAudiofiles }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments