From 10e90339336f1aa3db3f516dde15d01f4b8c8775 Mon Sep 17 00:00:00 2001 From: Joshua Sigona Date: Sat, 26 Jun 2021 17:30:18 +0900 Subject: [PATCH] Added Paged Navigation --- ngoplanner/src/App.css | 7 ++- ngoplanner/src/App.js | 107 ++++++++++++++++++++++++++++------------- 2 files changed, 79 insertions(+), 35 deletions(-) diff --git a/ngoplanner/src/App.css b/ngoplanner/src/App.css index 10c57c9..490303b 100644 --- a/ngoplanner/src/App.css +++ b/ngoplanner/src/App.css @@ -200,10 +200,12 @@ td:last-child { background: linear-gradient(135deg,#60461b,#b0a34e); border-bottom: 4px solid #ffd602; }*/ -.boxmenu li:first-child { +.boxmenu .selected{ background: linear-gradient(135deg,#60461b,#b0a34e); border-bottom: 4px solid #ffd602; - margin-left: 15px; +} +.boxmenu .selected:hover{ + cursor:pointer; } .boxmenu li { background-color: silver; @@ -217,6 +219,7 @@ td:last-child { .boxmenu li:hover { background: linear-gradient(135deg,#b0a34e,#ffd602); border-bottom: 4px solid #ffd602; + cursor:pointer; } .box h3 { background-image: url("tr_bg.png"); diff --git a/ngoplanner/src/App.js b/ngoplanner/src/App.js index a6bff9d..737edac 100644 --- a/ngoplanner/src/App.js +++ b/ngoplanner/src/App.js @@ -174,19 +174,35 @@ function EffectListing(p) { } +function PageControlButton(p) { + return
  • {p.setCurrentPage(p.page)}} className={(p.currentPage==p.page)?"selected":""}>{p.pageName?p.pageName:p.page}
  • +} + +function PageControl(p) { + var pages = [] + for (var i=0;i) + } + return +} + function EffectsBox(p) { - const [page,setPage] = useState(1) + const [currentPage,setCurrentPage]=useState(1) + return -
      -
    • 1
    • -
    • 2
    • -
    +

    Effect Name

    -
      - {p.effectList.map((ef,i)=>{ - return - })} -
    + { + currentPage==1? +
      + {p.effectList.map((ef,i)=>{ + return + })} +
    : + <> + }
    } @@ -202,30 +218,54 @@ function EquipBox(p) { } function EquippedWeaponBox(p) { - console.log(p.weaponAbilityList) + const [currentPage,setCurrentPage] = useState(1) + const [selectedEquip,setSelectedEquip] = useState(p.weapon) + const [selectedEquipEnhancementLv,setSelectedEquipEnhancementLv] = useState(p.weaponEnhancementLv) + const [selectedEquipAbilities,setSelectedEquipAbilities] = useState(p.weaponAbilityList) + + useEffect(()=>{ + switch (currentPage) { + case 2:{ + setSelectedEquip(p.armorSlot1) + setSelectedEquipEnhancementLv(p.armorSlot1EnhancementLv) + setSelectedEquipAbilities(p.armorSlot1AbilityList) + }break; + case 3:{ + setSelectedEquip(p.armorSlot2) + setSelectedEquipEnhancementLv(p.armorSlot2EnhancementLv) + setSelectedEquipAbilities(p.armorSlot2AbilityList) + }break; + case 4:{ + setSelectedEquip(p.armorSlot3) + setSelectedEquipEnhancementLv(p.armorSlot3EnhancementLv) + setSelectedEquipAbilities(p.armorSlot3AbilityList) + }break; + default:{ + setSelectedEquip(p.weapon) + setSelectedEquipEnhancementLv(p.weaponEnhancementLv) + setSelectedEquipAbilities(p.weaponAbilityList) + } + } + },[currentPage]) + return -

    {p.weapon}+{p.weaponEnhancementLv}

    -
      -
    • W
    • -
    • 1
    • -
    • 2
    • -
    • 3
    • -
    +

    {selectedEquip}+{selectedEquipEnhancementLv}

    +

    Abilitiy Details

      { - p.weaponAbilityList.map((ability,i)=>{ + selectedEquipAbilities?selectedEquipAbilities.map((ability,i)=>{ return
    • {ability}
    • - }) + }):<> }

    Properties

      -
    • Enhancement Lv. +{p.weaponEnhancementLv}
    • +
    • Enhancement Lv. +{selectedEquipEnhancementLv}
    • Multi-Weapon -
    • Element -
    @@ -235,20 +275,21 @@ function EquippedWeaponBox(p) { } function DamageBox(p) { + const [currentPage,setCurrentPage] = useState(1) + return -
      -
    • 1
    • -
    • 2
    • -
    • 3
    • -
    +

    - - {p.criticalHitRate*100}% - {p.criticalMultiplier*100}% - {p.midRange} - {p.critical} - {p.effective} -
    + { + currentPage==1&& + + {p.criticalHitRate*100}% + {p.criticalMultiplier*100}% + {p.midRange} + {p.critical} + {p.effective} +
    + }
    }