var iceLocation6 = ["M563.55,388.57l8.56,3.35,9.47,3.78,6.75,2.49,6.68,1.51,4.36-.31,5.11,4.09,2.9,3.76,2.76,1.78.25,3.45.32,4.43.32,4.43.46,6.41-3.66,10.16,0,6.44-5,3.82-2.74,4.65-2.32,10.56-1.39,17.43L593.18,488l-11.74,4.3L571,493l-3.32-9.67-11.43-19-5.31-13-8.32.1s.31-7.95-.63-8.87,1.56-15,1.56-15l8.61-14.48,4.29-13.68,2.84-3.17Z", "626.79 524.17 619.93 531.29 616.1 534.31 612.53 538.7 610.61 543.63 610.61 550.48 611.71 554.05 618.7 551.31 621.03 551.85 624.59 554.05 625.69 555.42 630.62 555.42 636.11 555.42 643.78 552.13 645.43 547.19 644.06 538.7 641.32 529.65 639.4 524.17 635.83 523.07 629.8 521.7 626.79 524.17", "628.02 561.45 635.28 557.61 647.89 552.4 656.39 548.84 656.39 551.03 658.86 555.42 662.15 559.53 664.62 566.38 664.62 567.75 662.15 567.75 653.38 567.75 642.14 564.46 636.11 562.82 631.17 562.54 628.02 561.45", "580.75 629.29 587.74 625.73 592.95 622.99 596.78 620.52 601.17 620.52 606.93 620.52 611.59 620.52 613.78 623.26 617.34 628.47 623.1 633.68 619.81 637.79 617.34 645.47 612.41 650.4 605.28 650.4 595.69 650.4 586.64 643.55 583.9 637.52 580.75 631.49 580.75 629.29", "M506,494.95h8.76l7.68,1.1,7.4,1.64,9.32,3,10.42,4.66,6.4,3,7,2.74,3,2.47-3.84,3.84s3.29,2.19-1.64,6l-4.93,3.84s-4.93-.55-5.76-1.1-7.4-2.74-7.4-2.74l-8.59-2.19-5.67-3.56-4.11-3.29-3.29-4.66s-4.39-2.47-5.21-2.74-4.74-2.19-4.74-2.19L506,502.63a13.78,13.78,0,0,1,0-3.7Z", "674 623.48 666.97 628.69 659.7 636.36 649.35 647.86 644.79 653.32 650.13 655.88 656.56 657.28 662.9 653.89 669.11 645.98 676.74 636.7 684.75 630.79 680.65 627.73 676.72 622.56 674 623.48", "616.67 688.91 610.91 694.12 609.54 698.78 609.54 704.53 611.88 707.78 614.06 707.77 615.54 707.77 618.9 707.77 621.31 707.68 623.4 707.77 626.06 707.68 628.15 707.68 631.74 702.07 629 698.5 624.34 694.94 620.64 692.75 616.67 688.91", "516.45 615.52 520.84 613.6 524.4 610.86 530.51 608.12 534.54 606.2 541.12 607.57 545.24 609.76 548.52 611.96 550.54 615.52 547.7 619.9 543.59 622.65 540.85 625.11 530.51 630.6 524.4 634.84 521.93 629.77 519.19 626.48 516.45 622.37 513.73 618.81 516.45 615.52", "M511.22,270.34l15.9-3,4.11,1.51,4.66,2.6V275l-2.47,7.13.82,6,4.66,1.92,2.19,3v15.35l-4.66,8.5L531,320.23l.27,3.29-1.1,3.2-4,5v4.11l-2.6,3.84-1.1,6.58h-3l-2.19,3.84L514,358.88l-2.74-1.1-6-1.1s-2.47-3.29-4.39-6.58a72,72,0,0,1-4.11-9.59V328.45l2.47-6.85-.55-12.34,1.92-4.93,1.64-11,.82-6.3,1.92-5.76c.27-.82,2.74-3.29,2.74-3.29l1.1-3,.27-2.74Z", "304.72 224.89 310.2 200.59 312.39 190.47 316.5 185.41 329.66 185.41 337.88 185.41 342.82 197.56 346.66 205.15 346.66 219.83 345.29 237.04 341.17 245.13 328.84 236.02 314.04 232.99 308.83 232.99 304.72 232.99 304.72 224.89", "394.53 171.85 402.48 166.65 406.04 169.25 415.09 173.77 420.57 181.17 422.49 187.2 422.49 192.14 415.36 194.6 413.17 198.44 410.43 200.36 406.59 193.24 402.48 188.57 399.19 181.17 396.45 176.24 394.53 173.22 394.53 171.85", "M441.52,131.32l9-6,11.79-7.13,12.34-4.93,4.11-2.47,1.92,6,2.47,6.3v6.3l-2.74,4.39.27,6.3,2.47,7.95,1.64,2.74v1.64L481,155.17l-9,3.29-8.77,3.29v1.64l-2.47,1.92S455,162.57,455,161.2s-.27-6.3-.82-7.68-2.47-8.22-2.47-8.22L446.18,138l-4.66-2.33Z", "M0,.14V29.83H27.42l8.22,11,5.76-6.85v4.11L48,40.79v7.95l11.51,4.93H71L91.56,47.1l4.93-6.3h12.34l9,12.88,11.51,6.58L136,68.07,152.41,54.5l13.16-9.87h10.69c2.47,0,20.56,6.58,20.56,6.58l14-10.42,20.56-6.85H261v4.11l15.62,2.74,9,3.84L293,33.94h7.4s0-2.47,4.93-3.29,21-1.64,21-1.64l14.39-4.11,6.58-3.29,8.77-4.11s17.54-2.47,19.19,0S399.4,30.65,399.4,30.65l12.34,10.14L422.15,54.5l7.4,3.29,12.34-6.58,21.38-10.42L474,33.94V49.57l5.76,1.64,7.4,16.86,5.76,4.52,7.68,3.29,4.65,7.4v4.11l9,7.95h14.17l17.91-7.13,4.2-3.29,16.35-16.86h12.34l15.62-4.52,10.69,4.52,4.11,12.75,9.87,14.53,4.11,8.5L644.19,117v15.62l10.69,8.22,16.45,18.64h25.49l6.58-7.95L710,131l6.58-8.22,9-13.16,14-9.87,26.32,1.64,14,4.11,4.93,4.11,4.93,6.58v6.58c0,2.47,4.93,18.91,4.93,18.91l6.58,11.51,23,6.3h23.85l4.93-21.93s-14-15.62-15.62-17.27,2.47-10.69,2.47-10.69l13.16-4.93,15.62,2.47,9,7.4,7.4,8.22,15.62,5.76,18.91,14v28.78l11.51,14,19.74,9.46,11.51-9.46L974,167.57v-8.09l6.58-17.82v-5.76l9-10.69,5.76-4.93,4.66-2V0Z", "M486.85,381.43l-2,5.29-2.24,5.85-1.48,4.17-.93,4.15.11,2.74L478,406.74l-2.13,1.73-1,1.69-1.92.08-2.47.1-2.47.1-3.56.14L458.82,408l-3.57-.13-2-3.21-2.54-1.82-5.83-1.69-9.65-1.27-3.93-2.18L429,390.29l-.26-6.57,5.41-1.86,10.71-6.73,7.29-3,.07-5.22s4.4.38,4.93-.19,8.28,1.32,8.28,1.32l7.91,5.72,7.52,3,1.72,1.85Z", "427.58 438.03 420.19 431.46 417.03 427.74 412.5 424.35 407.5 422.63 400.65 422.9 397.13 424.13 400.15 431.01 399.69 433.36 397.64 437.01 396.31 438.16 396.51 443.09 396.72 448.57 400.31 456.11 405.3 457.56 413.74 455.85 422.67 452.76 428.07 450.63 429.03 447.02 430.16 440.94 427.58 438.03", "374.7 426.87 378.28 435.48 383.03 450.38 386.29 460.42 384.1 460.35 379.63 463.1 375.4 466.82 368.46 469.5 367.09 469.45 367.18 466.57 367.49 456.31 371.18 443.28 373.04 436.28 373.49 430.52 374.7 426.87", "M367.11,282.75l.34,8.75-.79,7.71-1.35,7.46-2.65,9.43-4.25,10.59-2.76,6.51-2.46,7.14-2.35,3.11-4-3.68s-2.06,3.37-6.09-1.41l-4-4.78s.35-5,.87-5.8,2.45-7.5,2.45-7.5l1.85-8.67,3.34-5.8,3.13-4.24,4.53-3.47s2.29-4.48,2.53-5.31,2-4.82,2-4.82l2-4.93a13.78,13.78,0,0,1,3.7-.15Z", "648.5 261.73 656.02 263.94 661.69 265.52 666.18 266.36 669.37 269.37 673.55 273.32 676.94 276.52 676.65 280.02 675.67 286.25 676.28 293.99 671.07 294.72 664 298.61 657.03 298.81 651.85 293.92 644.87 287.33 643 276.14 645.14 269.87 646.99 263.32 648.5 261.73", "648.53 367.44 640.63 369.03 631.21 372.56 617.47 378.07 611.21 380.83 613.65 385.02 617.51 388.67 623.93 388.32 632.72 384.18 643.28 379.45 652.28 377.66 651 373.54 651 367.73 648.53 367.44", "564.57 305.54 556.81 305.38 552.61 307.82 548.66 312.01 547.86 318.05 547.26 323.88 549.13 328.29 550.45 326.89 551.72 330.73 553.16 333.6 555.09 333.16 560.17 327.77 566.5 325.46 566.95 320.99 566.01 315.2 564.82 311.06 564.57 305.54", "M912.13,205.81l1.95,5.3L916.2,217l1.6,4.13,2,3.75,1.87,2,.25,3.89-.48,2.7.32,2-1.4,1.31-1.8,1.68-1.8,1.68-2.61,2.43-5.88,1.74-2.79,2.23-3.65-1.1-3.11.28-5.52,2.52-8.14,5.34-4.4.91-6.55-4.2-4.49-4.81,2.89-4.94,3.72-12.09,3.54-7.05-3.35-4S880,214.79,880,214s7.13-4.41,7.13-4.41l9.73-.83,7.66-2.64,2.51.28Z", "913.34 334.81 903.45 334.66 898.63 333.91 892.99 334.3 888.07 336.26 883.06 340.94 881.2 344.17 887.98 347.41 889.17 349.49 889.99 353.59 889.74 355.33 893.11 358.93 896.85 362.94 904.49 366.31 909.22 364.15 914.5 357.35 919.24 349.17 921.94 344.03 920.31 340.67 917.2 335.33 913.34 334.81", "656.82 442.77 673.47 437.17 697.95 431.57 714.61 427.65 707.92 433.89 696.24 448.17 685.95 462.27 666.74 483.56 662.56 487.46 660.88 485.66 654.9 479.24 657.26 461.67 658.15 452.58 655.62 448.2 656.82 442.77", "M803.23,205.81l6.3,13.73,3.8,12.82,2.74,12.78,2,16.77.18,19.67-.13,12.19.76,13-1.7,6.5L808.39,310s-1.07,6.73-10.63,1.76l-9.56-5s-2.69-8.13-2.42-9.81-1-13.57-1-13.57l-2.73-15,1.51-11.44,2.2-8.81,4.94-8.5s.71-8.65.55-10.13,0-9,0-9l0-9.18a23.77,23.77,0,0,1,5.8-2.66Z", "276.02 441.31 266.47 433.19 262.5 428.74 256.58 424.45 249.76 421.9 240.1 421.24 234.99 422.09 238.34 429.93 237.4 432.41 234.04 436.06 232.03 437.12 231.66 442.48 231.25 448.43 235.33 457.07 242.16 459.33 254.25 458.66 267.21 456.55 275.09 455 276.9 451.24 279.28 444.82 276.02 441.31", "609.17 263.54 616.7 265.75 622.37 267.33 626.85 268.17 630.04 271.18 634.23 275.13 637.61 278.33 637.33 281.83 636.34 288.07 636.95 295.81 631.74 296.54 624.68 300.42 617.7 300.63 612.52 295.73 605.54 289.15 603.67 277.95 605.82 271.69 607.66 265.14 609.17 263.54", "341.29 598.23 346.98 590.15 350.32 586.59 353.18 581.71 354.32 576.54 353.29 569.77 351.66 566.41 345.17 570.18 342.78 569.99 338.93 568.37 337.64 567.18 332.76 567.92 327.34 568.76 320.25 573.17 319.37 578.3 322.02 586.49 326.1 595.01 328.82 600.14 332.51 600.69 338.68 601.13 341.29 598.23", "337.86 489 331.85 494.6 321.04 502.93 313.77 508.59 313.2 506.47 309.67 502.88 305.42 499.77 301.25 493.8 300.89 492.48 303.27 491.83 311.74 489.54 323.44 489.78 329.69 489.79 334.53 488.76 337.86 489", "M431.56,662.19l2.69-3.18,3.18-1.71,4.64-2.93,3.42-2.93,2.44-2s-1.47.24,3.42,0a21.06,21.06,0,0,1,9.53,2.2l3.66,1,3.42,1.71,3.91,2.93,3.91,2.44,3.46,1.22,4.85,2.93v2.44l-3.42,2.2L473.09,671h-29.8l-5.86-3.42-5.86-2.69Z", "513.73 698.56 518.58 693.18 526.64 685.86 531.77 681.95 534.7 678.04 539.1 678.04 539.1 682.19 540.08 688.3 540.08 693.92 540.08 696.36 535.19 698.56 528.6 698.56 522.49 698.56 517.12 699.78 513.73 698.56", "M173.31,165.31h8.76l7.68,1.1,7.4,1.64,9.32,3,10.42,4.66,6.4,3,7,2.74,3,2.47-3.84,3.84s3.29,2.19-1.64,6l-4.93,3.84s-4.93-.55-5.76-1.1-7.4-2.74-7.4-2.74l-8.59-2.19-5.67-3.56-4.11-3.29-3.29-4.66s-4.39-2.47-5.21-2.74-4.74-2.19-4.74-2.19L173.31,173a13.78,13.78,0,0,1,0-3.7Z", "260.45 257.17 267.75 263.96 274.64 268.77 284.88 278.18 291.72 284.33 299.24 297 302.86 305.71 305.4 312.93 305.15 318.65 297.89 316.12 290.28 310.32 284.69 306.82 266.69 291.4 255.25 282.88 256.11 275.44 255.18 268.57 254.91 261.2 254.22 254.2 260.45 257.17", "M205.43,298.37l4.15.31,3.25,1.56,5.1,2,4.38,1,3,.83s-1.06-1,2,2.77a21.06,21.06,0,0,1,3.82,9l1.36,3.54.63,3.77-.07,4.88.32,4.6,1,3.51.48,5.64-2,1.44-3.79-1.47-6.43-4.69-7.61-10.47-6.89-9.48-3-4.15-.68-6.75L203.26,300Z", "156 368.05 163.19 368.81 173.86 371.02 180.04 372.87 184.92 372.94 187.51 376.5 184.15 378.94 179.79 383.32 175.24 386.62 173.27 388.06 168.62 385.4 164.74 380.07 161.15 375.13 157 371.5 156 368.05"]; window.onload = function () { var s = Snap('#glacialLakes'); var sd = Snap('#glacialDates'); Snap.load("https://fortress.wa.gov/dnr/geologydata/photos/web_images/ger_explore_glacial_dates.svg", function (f) { if (!f) { console.log('error loading radiocarbon image') } else { sd.append(f); var slideArr = []; var index = 1; var forward = sd.select("#gdForward"); var back = sd.select("#gdBack"); for(var i = 1; i <=19; i++){ slideArr[i] = sd.select("#slide_" + i); } forward.click(function(){ if(index < 19 ){ slideArr[index+1].attr('opacity', 1); slideArr[index].animate({opacity: 0}, 250); index++; } }); back.click(function(){ if(index > 1){ slideArr[index-1].attr('opacity', 1); slideArr[index].animate({opacity: 0}, 250); index--; } }); } }); Snap.load("https://fortress.wa.gov/dnr/geologydata/photos/web_images/ger_explore_glacial_lake_intro.svg", function (f) { if(!f){ console.log('error loading glacial lake image') } else{ s.append(f); var index = 0; var currentSlide = null; var started = false; var forward = s.select("#glForward"); var back = s.select("#glBack"); var screen = s.select("#filter"); var slideArr = []; forward.click(function(){ if(index <=18 && started){ if(slideArr[index+1]){ index++; if(!currentSlide) { s.select("#Layer_26").attr({opacity:0}) } else { currentSlide.remove(); } currentSlide = slideArr[index]; screen.after(currentSlide); } } }); back.click(function(){ if(index > 1 && started && currentSlide){ if(slideArr[index-1]){ index--; currentSlide.remove(); currentSlide = slideArr[index]; screen.after(currentSlide); } } }); s.click(function(){ s.unclick(); Snap.load("https://fortress.wa.gov/dnr/geologydata/photos/web_images/ger_explore_glacial_lake_slides.svg", function(slideshow){ started = true; for(var i = 1; i<=18; i++){ slideArr[i] = slideshow.select("#stage_" + i); } }); var icePaths = []; for(var i = 1; i<34; i++){ icePaths.push(s.select('#_' + i + '-6')); } s.select('#click_me').attr({opacity: 0}); var animate = function(pathArr, dur){ for(i = 0; i < icePaths.length; i++){ if(icePaths[i]){ if(icePaths[i].type === 'path'){ icePaths[i].stop().animate({d: pathArr[i]}, dur); } else { icePaths[i].stop().animate({points: pathArr[i]}, dur) } } } }; animate(iceLocation6, 2000); setTimeout(function(){ for(i = 0; i < icePaths.length; i++){ if(icePaths[i]){ if(i===icePaths.length-1) icePaths[i].stop().animate({opacity: 0}, 1500, startSlides()); else icePaths[i].stop().animate({opacity: 0}, 1500); } } },2500); var startSlides = function(){ var buttons = s.select("#navigation"); buttons.animate({opacity: 1}, 500); forward.attr({ fill: 'transparent', cursor: 'pointer' }); back.attr({ fill: 'transparent', cursor: 'pointer' }); }; }); } }); };