@@ -54,6 +54,7 @@ <h2> 3D perspective transformations </h2>
5454 var bonesImageData = null ;
5555 var flightAnimGif = null ;
5656 var skpData = null ;
57+ var cdn = 'https://storage.googleapis.com/skia-cdn/misc/' ;
5758 const ckLoaded = CanvasKitInit ( {
5859 locateFile : ( file ) => '/node_modules/canvaskit/bin/' + file ,
5960 } ) . ready ( ) ;
@@ -78,36 +79,36 @@ <h2> 3D perspective transformations </h2>
7879 SkpExample ( CanvasKit , skpData ) ;
7980 } ) ;
8081
81- fetch ( 'https://storage.googleapis.com/skia- cdn/misc/ lego_loader.json') . then ( ( resp ) => {
82+ fetch ( cdn + ' lego_loader.json') . then ( ( resp ) => {
8283 resp . text ( ) . then ( ( str ) => {
8384 legoJSON = str ;
8485 SkottieExample ( CanvasKit , 'sk_legos' , legoJSON ,
8586 { fLeft : - 50 , fTop : 0 , fRight : 350 , fBottom : 300 } ) ;
8687 } ) ;
8788 } ) ;
8889
89- fetch ( 'https://storage.googleapis.com/skia- cdn/misc/ drinks.json') . then ( ( resp ) => {
90+ fetch ( cdn + ' drinks.json') . then ( ( resp ) => {
9091 resp . text ( ) . then ( ( str ) => {
9192 drinksJSON = str ;
9293 SkottieExample ( CanvasKit , 'sk_drinks' , drinksJSON , fullBounds ) ;
9394 } ) ;
9495 } ) ;
9596
96- fetch ( 'https://storage.googleapis.com/skia- cdn/misc/ confetti.json') . then ( ( resp ) => {
97+ fetch ( cdn + ' confetti.json') . then ( ( resp ) => {
9798 resp . text ( ) . then ( ( str ) => {
9899 confettiJSON = str ;
99100 SkottieExample ( CanvasKit , 'sk_party' , confettiJSON , fullBounds ) ;
100101 } ) ;
101102 } ) ;
102103
103- fetch ( 'https://storage.googleapis.com/skia- cdn/misc/ onboarding.json') . then ( ( resp ) => {
104+ fetch ( cdn + ' onboarding.json') . then ( ( resp ) => {
104105 resp . text ( ) . then ( ( str ) => {
105106 onboardingJSON = str ;
106107 SkottieExample ( CanvasKit , 'sk_onboarding' , onboardingJSON , fullBounds ) ;
107108 } ) ;
108109 } ) ;
109110
110- fetch ( 'https://storage.googleapis.com/skia- cdn/misc/ skottie_sample_multiframe.json') . then ( ( resp ) => {
111+ fetch ( cdn + ' skottie_sample_multiframe.json') . then ( ( resp ) => {
111112 resp . text ( ) . then ( ( str ) => {
112113 multiFrameJSON = str ;
113114 SkottieExample ( CanvasKit , 'sk_animated_gif' , multiFrameJSON , fullBounds , {
@@ -116,7 +117,7 @@ <h2> 3D perspective transformations </h2>
116117 } ) ;
117118 } ) ;
118119
119- fetch ( 'https://storage.googleapis.com/skia- cdn/misc/ flightAnim.gif') . then ( ( resp ) => {
120+ fetch ( cdn + ' flightAnim.gif') . then ( ( resp ) => {
120121 resp . arrayBuffer ( ) . then ( ( buffer ) => {
121122 flightAnimGif = buffer ;
122123 SkottieExample ( CanvasKit , 'sk_animated_gif' , multiFrameJSON , fullBounds , {
@@ -125,22 +126,22 @@ <h2> 3D perspective transformations </h2>
125126 } ) ;
126127 } ) ;
127128
128- fetch ( './ Roboto-Regular.ttf') . then ( ( resp ) => {
129+ fetch ( cdn + ' Roboto-Regular.ttf') . then ( ( resp ) => {
129130 resp . arrayBuffer ( ) . then ( ( buffer ) => {
130131 robotoData = buffer ;
131132 ParagraphAPI1 ( CanvasKit , robotoData ) ;
132133 } ) ;
133134 } ) ;
134135
135- fetch ( './ red_line.skp') . then ( ( response ) => response . arrayBuffer ( ) ) . then ( ( buffer ) => {
136+ fetch ( cdn + ' red_line.skp') . then ( ( response ) => response . arrayBuffer ( ) ) . then ( ( buffer ) => {
136137 skpData = buffer ;
137138 SkpExample ( CanvasKit , skpData ) ;
138139 } ) ;
139140
140- const loadDog = fetch ( 'https://storage.googleapis.com/skia- cdn/misc/ dog.jpg') . then ( ( response ) => response . arrayBuffer ( ) ) ;
141- const loadMandrill = fetch ( 'https://storage.googleapis.com/skia- cdn/misc/ mandrill_256.png') . then ( ( response ) => response . arrayBuffer ( ) ) ;
142- const loadBrickTex = fetch ( './ brickwork-texture.jpg') . then ( ( response ) => response . arrayBuffer ( ) ) ;
143- const loadBrickBump = fetch ( './ brickwork_normal-map.jpg') . then ( ( response ) => response . arrayBuffer ( ) ) ;
141+ const loadDog = fetch ( cdn + ' dog.jpg') . then ( ( response ) => response . arrayBuffer ( ) ) ;
142+ const loadMandrill = fetch ( cdn + ' mandrill_256.png') . then ( ( response ) => response . arrayBuffer ( ) ) ;
143+ const loadBrickTex = fetch ( cdn + ' brickwork-texture.jpg') . then ( ( response ) => response . arrayBuffer ( ) ) ;
144+ const loadBrickBump = fetch ( cdn + ' brickwork_normal-map.jpg') . then ( ( response ) => response . arrayBuffer ( ) ) ;
144145 Promise . all ( [ ckLoaded , loadBrickTex , loadBrickBump ] ) . then ( ( results ) => { Camera3D ( ...results ) } ) ;
145146
146147 function SkottieExample ( CanvasKit , id , jsonStr , bounds , assets ) {
0 commit comments