Upgrade to Pro — share decks privately, control downloads, hide ads and more …

p1ass-lt-hpp

 p1ass-lt-hpp

Hayato Tsukagoshi

November 21, 2020
Tweet

More Decks by Hayato Tsukagoshi

Other Decks in Programming

Transcript

  1. ࣗݾ঺հ • ໊ݹ԰େֶ CS B4 • ݚڀ: ࣗવݴޠॲཧ (NLP) •

    झຯ: React, Rust • Twitter: @hpp_ricecake • GitHub: hpprc
  2. ࢖༻ٕज़ • React.js • Next.js • TypeScript • Tailwind CSS

    • react-three-fiber (Three.js ͷ React ༻ϥούʔ) • GitHub actions Ͱ GitHub pages ʹσϓϩΠ͍ͯ͠Δ
  3. ࢖༻ٕज़: ࠓճ঺հ͢Δ΋ͷ • React.js • Next.js • TypeScript • Tailwind

    CSS • react-three-fiber (Three.js ͷ React ༻ϥούʔ) • GitHub actions Ͱ GitHub pages ʹσϓϩΠ͍ͯ͠Δ
  4. Next.js • React ͷΊΜͲ͍͘͞ͱ͜ΖΛ͍͍ײ͡ʹͯ͘͠ΕΔϑϨʔϜϫʔΫ • SSR (Server Side Rendering) ΍

    SSG (Static Site Generation) ʹରԠ • ࠷ۙ੎͍͕͍͢͝ • GitHub pages ʹσϓϩΠ͢Δͷ͕Ұ൪؆୯ͩͬͨͨΊɺGitHub actions Λ࢖ͬͯ Next.js Ͱ SSG ͯ͠੒Ռ෺Λެ։
  5. Tailwind CSS • A utility-first CSS framework (ݪจϚϚ) • ΄΅ΠϯϥΠϯελΠϧ

    • ͍ͬ͢͝؆୯ʹελΠϦϯά͕Ͱ͖Δ + ελΠϧͷ੔߹ੑΛҡ࣋͠΍ ͍͢(ͱࢥ͏) • ࣗ෼Ͱ޷͖উखελΠϧΛఆٛͰ͖ͳ͍ͷͰɺடং͕ੜ·Ε΍͍͢ • cheat sheet: https://nerdcave.com/tailwind-cheat-sheet
  6. Tailwind CSS: ࣮ࡍͷίʔυ • A utility-first CSS framework (ݪจϚϚ) •

    ΄΅ΠϯϥΠϯελΠϧ • ͍ͬ͢͝؆୯ʹελΠϦϯά͕Ͱ͖Δ + ελΠϧͷ੔߹ੑΛҡ࣋͠΍ ͍͢(ͱࢥ͏) • ࣗ෼Ͱ޷͖উखελΠϧΛఆٛͰ͖ͳ͍ͷͰɺடং͕ੜ·Ε΍͍͢ • cheat sheet: https://nerdcave.com/tailwind-cheat-sheet
  7. react-three-fiber • Three.js Λ React ͷੈքͰѻ͏ͨΊͷϥΠϒϥϦ • Three.js ͷ scene

    ͷఆٛΛએݴతʹॻ͘͜ͱ͕Ͱ͖Δ • ݱࡏ v5 • v4ҎલͱϥΠϒϥϦͷߏ଄͕݁ߏมΘ͍ͬͯΔ(ཱͪҐஔ΋) • https://github.com/pmndrs/react-three-fiber
  8. react-three-fiber : ͍͍ͱ͜Ζ • άϥϑΟΧϧͳαΠτΛ࡞ΕΔͷ͸΍ͬͺΓָ͍͠(LPʹ͏͚ͬͯͭ) • ૉͷ Three.js ΑΓಡΈ΍ͦ͢͏ (એݴతʹॻ͚ΔͷͰ)

    • React ͷੈքʹऩ·͍ͬͯΔͷͰ - PC ʹ͸ react-three-fiber Ͱ࡞ͬͨϖʔδΛݟͤΔ - SP ʹ͸ ผͷ͍ܰϖʔδΛݟͤΔ ͕؆୯ʹͰ͖Δ
  9. react-three-fiber : Α͘ͳ͍ͱ͜Ζ • සൟʹΞοϓσʔτ͕ೖΔ • Ҏલ৮ͬͯͨͱ͖ͷίʔυ͕ͿͬյΕͯΔ͜ͱ͕··͋Δ • TypeScript ͱͷ૬ੑ͕͍͍ͱ͸ݴ͑ͳ͍

    • Three.js ͷ API ʹؔ͢Δ஌ࣝ΋ඞਢ • SSR / SSG ͱͷ૬ੑ͕͍͍ͱ͸ݴ͑ͳ͍ • ΫϥΠΞϯταΠυͰͷಈతΠϯϙʔτ͕ඞཁʹͳΔ৔߹΋͋Δ
  10. ϨεϙϯγϒσβΠϯʹ͍ͭͯ • ࠓճ͸ PC / λϒϨοτ / εϚϗ ͢΂ͯʹผʑͷίϯϙʔωϯτΛग़ ͢͜ͱͰରԠ

    • ͱ͍ͬͯ΋ɺը໘αΠζͱ͔Χϝϥͷಈ͖ํΛ੍ޚ͢Δ props Λग़ ͠෼͚͍ͯΔ͚ͩͰ͋Δ • Tailwind ʹΑΔྗۀͷग़͠Θ͚ • hidden ͨ͠Γ block ʹͨ͠Γ͢Δ͚ͩ