Slide 1

Slide 1 text

p1ass LT ಛઃαΠτΛࢧ͑Δٕज़ p1ass ੜ஀LT : 2020 / 11 / 21 hpp

Slide 2

Slide 2 text

ࣗݾ঺հ • ໊ݹ԰େֶ CS B4 • ݚڀ: ࣗવݴޠॲཧ (NLP) • झຯ: React, Rust • Twitter: @hpp_ricecake • GitHub: hpprc

Slide 3

Slide 3 text

ͭͬͨ͘΋ͷ

Slide 4

Slide 4 text

p1ass LT ಛઃαΠτ

Slide 5

Slide 5 text

վΊͯσϞ

Slide 6

Slide 6 text

͓खݩͷ୺຤Ͱͪ͜ΒΛͲ͏ͧ https://nama-tamago.github.io/p1ass-lt-site

Slide 7

Slide 7 text

վΊͯσϞ

Slide 8

Slide 8 text

εϚϗ൛ɺλϒϨοτ൛

Slide 9

Slide 9 text

εϚϗ λϒϨοτ

Slide 10

Slide 10 text

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

Slide 11

Slide 11 text

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

Slide 12

Slide 12 text

Next.js

Slide 13

Slide 13 text

Next.js • React ͷΊΜͲ͍͘͞ͱ͜ΖΛ͍͍ײ͡ʹͯ͘͠ΕΔϑϨʔϜϫʔΫ • SSR (Server Side Rendering) ΍ SSG (Static Site Generation) ʹରԠ • ࠷ۙ੎͍͕͍͢͝ • GitHub pages ʹσϓϩΠ͢Δͷ͕Ұ൪؆୯ͩͬͨͨΊɺGitHub actions Λ࢖ͬͯ Next.js Ͱ SSG ͯ͠੒Ռ෺Λެ։

Slide 14

Slide 14 text

Next.js • ϩʔΧϧ։ൃ࣌͸ `localhost:3000` ͰݟΕΔ͕ɺσϓϩΠઌ͕υϝΠ ϯͷϧʔτ͡Όͳ͍ (`nama-tamago.github.io/p1ass-lt-site`) ͷͰઃఆ ͕ͪΐ͍ΊΜͲ͍͘͞ • basePath ͷઃఆΛ௥Ճͯ͠ճආ (͏͡·Δ͘Μ͕΍ͬͯ͘Εͨ)

Slide 15

Slide 15 text

Tailwind CSS

Slide 16

Slide 16 text

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

Slide 17

Slide 17 text

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

Slide 18

Slide 18 text

react-three-fiber

Slide 19

Slide 19 text

react-three-fiber • Three.js Λ React ͷੈքͰѻ͏ͨΊͷϥΠϒϥϦ • Three.js ͷ scene ͷఆٛΛએݴతʹॻ͘͜ͱ͕Ͱ͖Δ • ݱࡏ v5 • v4ҎલͱϥΠϒϥϦͷߏ଄͕݁ߏมΘ͍ͬͯΔ(ཱͪҐஔ΋) • https://github.com/pmndrs/react-three-fiber

Slide 20

Slide 20 text

react-three-fiber ͷ example Λ͍͔ͭ͘Ҿ༻ / ͝঺հ

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

CodeSandbox

Slide 23

Slide 23 text

CodeSandbox

Slide 24

Slide 24 text

react-three-fiber : ͍͍ͱ͜Ζ • άϥϑΟΧϧͳαΠτΛ࡞ΕΔͷ͸΍ͬͺΓָ͍͠(LPʹ͏͚ͬͯͭ) • ૉͷ Three.js ΑΓಡΈ΍ͦ͢͏ (એݴతʹॻ͚ΔͷͰ) • React ͷੈքʹऩ·͍ͬͯΔͷͰ - PC ʹ͸ react-three-fiber Ͱ࡞ͬͨϖʔδΛݟͤΔ - SP ʹ͸ ผͷ͍ܰϖʔδΛݟͤΔ ͕؆୯ʹͰ͖Δ

Slide 25

Slide 25 text

react-three-fiber : Α͘ͳ͍ͱ͜Ζ • සൟʹΞοϓσʔτ͕ೖΔ • Ҏલ৮ͬͯͨͱ͖ͷίʔυ͕ͿͬյΕͯΔ͜ͱ͕··͋Δ • TypeScript ͱͷ૬ੑ͕͍͍ͱ͸ݴ͑ͳ͍ • Three.js ͷ API ʹؔ͢Δ஌ࣝ΋ඞਢ • SSR / SSG ͱͷ૬ੑ͕͍͍ͱ͸ݴ͑ͳ͍ • ΫϥΠΞϯταΠυͰͷಈతΠϯϙʔτ͕ඞཁʹͳΔ৔߹΋͋Δ

Slide 26

Slide 26 text

ϨεϙϯγϒσβΠϯʹ͍ͭͯ • ࠓճ͸ PC / λϒϨοτ / εϚϗ ͢΂ͯʹผʑͷίϯϙʔωϯτΛग़ ͢͜ͱͰରԠ • ͱ͍ͬͯ΋ɺը໘αΠζͱ͔Χϝϥͷಈ͖ํΛ੍ޚ͢Δ props Λग़ ͠෼͚͍ͯΔ͚ͩͰ͋Δ • Tailwind ʹΑΔྗۀͷग़͠Θ͚ • hidden ͨ͠Γ block ʹͨ͠Γ͢Δ͚ͩ

Slide 27

Slide 27 text

ϨεϙϯγϒσβΠϯʹ͍ͭͯ

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

ϨϏϡʔײँ

Slide 30

Slide 30 text

஀ੜ೔͓ΊͰͱ͏ʂʂʂ☺