前提・実現したいこと
githubでGBNP: Game Boy Nintendo Power ROM Builderのmasterにupload-entry-imagesの項目の一部分を追加したのですが、ファイル指定時に表示される項目が最初から表示され、レイアウトが崩れます。
どのようにしてレイアウトが崩れず、それぞれのファイルを参照することが可能でしょうか?
よろしくお願いします。
該当のソースコード
以下、index.html
html
1 2 <div id="app"> 3 <h2>0. Upload Menu ROM</h2> 4 <span v-if="menu.ready()" style="color: green">✓</span> 5 <span v-if="!menu.ready()" style="color: red">✗</span> 6 <div v-if="!menu.present()"> 7 <p>Menu is not loaded. Please upload GB Memory Multi Menu (NP M-MENU) ROM.</p> 8 </div> 9 <div v-if="menu.present() && !menu.valid()"> 10 <p>Menu is not valid. Please upload GB Memory Multi Menu (NP M-MENU) ROM.</p> 11 </div> 12 <div v-if="menu.loadedFromStorage && menu.valid()"> 13 <p>Menu loaded from storage! You're all set.</p> 14 </div> 15 <div v-if="!menu.loadedFromStorage && menu.ready()"> 16 <p>Menu loaded and cached! You're all set.</p> 17 </div> 18 <button v-on:click="triggerAddMenuLabel" class="upload" type="button"> 19 <label for="menuFileInput" ref="addMenuLabel" v-on:click="stopPropagation">Upload Menu</label> 20 </button> 21 <input style="display: none" id="menuFileInput" type="file" v-on:change="addMenu" accept=".gb,.gbc"> 22 </section> 23 24 <h2>1. Add Game ROMs</h2> 25 <section> 26 <table v-if="roms.length > 0" v-on:dragover="preventDefault" v-on:drop="dropFile"> 27 <thead> 28 <tr> 29 <th> 30 <button v-on:click="removeAllRoms" class="remove-all" :disabled="roms.length === 0" type="button" > 31 <label>Remove All</label> 32 </button> 33 </th> 34 <th>Title</th> 35 <th>Mapper</th> 36 <th>ROM</th> 37 <th>RAM</th> 38 <th>Blocks</th> 39 <th>Menu Title</th> 40 <th>Preview</th> 41 </tr> 42 </thead> 43 <tbody> 44 <tr v-for="(rom, index) in roms" v-bind:key="index"> 45 <td> 46 <button id="remove-rom" v-on:click="removeROM(index)" type="button">✗</button> 47 <button :disabled="index === 0" v-on:click="moveUp(index)" type="button">↑</button> 48 <button :disabled="index === (roms.length - 1)" v-on:click="moveDown(index)" type="button">↓</button> 49 </td> 50 <td>{{ rom.title }}</td> 51 <td>{{ rom.type }}</td> 52 <td>{{ rom.romSizeKB() + 'k'}}</td> 53 <td>{{ rom.paddedRamSizeKB() + 'k' }}</td> 54 <td>{{ rom.paddedRomSizeKB() / 128 + ' (' + rom.paddedRomSizeKB() + 'k)'}}</td> 55 <td> 56 <input type="text" class='menu-text' :value="rom.menuText" @input="e => updateMenuText(rom, e.target.value)"/> 57 </td> 58 <td> 59 <bitmap-preview :data="rom.bitmapPreviewBuffer"/> 60 </td> 61 </tr> 62 </tbody> 63 <tfoot> 64 <tr> 65 <td> 66 <button v-on:click="triggerAddRomLabel" class="upload" :disabled="!menu.present() || romOverflow" type="button"> 67 <label for="romFileInput" ref="addRomLabel" v-on:click="stopPropagation">Add Games</label> 68 </button> 69 <input style="display: none" id="romFileInput" type="file" v-on:change="addROM" :disabled="!menu.present() || romOverflow" accept=".gb,.gbc" multiple> 70 </td> 71 <td> 72 <button v-on:click="triggerAddMenuLabel" class="upload" type="button"> 73 <label for="menuFileInput" ref="addMenuLabel" v-on:click="stopPropagation">Load GBNP ROM</label> 74 </button> 75 <input style="display: none" id="menuFileInput" type="file" v-on:change="addMenu" accept=".gb,.gbc"> 76 </td> 77 <td></td> 78 <td>{{ processor.romTotalKB() + 'k' }}</td> 79 <td>{{ processor.ramUsedKB() + 'k' }}</td> 80 <td :class="overflowClassMsg.class"> 81 {{ processor.romUsedKB() / 128 + ' (' + processor.romUsedKB() + 'k)'}} 82 </td> 83 <td :class="overflowClassMsg.class"> 84 <span v-if="overflowClassMsg.msg">{{overflowClassMsg.msg}}</span> 85 </td> 86 <td></td> 87 </tr> 88 </tfoot> 89 </table> 90 91 <div class="drag-target" v-if="roms.length === 0" v-on:dragover="preventDefault" v-on:drop="dropFile" 92 v-on:dragenter="$event.target.classList.add('over')" v-on:dragleave="$event.target.classList.remove('over')" 93 > 94 <div>Drag and drop one or more ROMs to get started!</div> 95 <div style="color: grey">- or -</div> 96 <div style="padding-left: 26px;"> 97 <button v-on:click="triggerAddRomLabel" class="upload" :disabled="!menu.present() || romOverflow" type="button"> 98 <label for="romFileInput" ref="addRomLabel" v-on:click="stopPropagation">Add Games</label> 99 </button> 100 <input style="display: none" id="romFileInput" type="file" v-on:change="addROM" :disabled="!menu.present() || romOverflow" accept=".gb,.gbc" multiple> 101 102 <button v-on:click="triggerAddMenuLabel" class="upload" type="button"> 103 <label for="menuFileInput" ref="addMenuLabel" v-on:click="stopPropagation">Load GBNP ROM</label> 104 </button> 105 <input style="display: none" id="menuFileInput" type="file" v-on:change="addMenu" accept=".gb,.gbc"> 106 </div> 107 </div> 108 </section> 109 110 <h2>3. Download Files</h2> 111 <section> 112 <a class='download-link' :download="filename + '.gb'" :href="downloadEnabled ? romData : null" type="application/octet-stream" v-on:click="downloadRomFile" :class="{ disabled: !downloadEnabled }">Download ROM File ({{filename}}.gb)</a> 113 <br> 114 <a class='download-link' v-if="mapEnabled" :download="filename + '.map'" :href="downloadEnabled ? mapData : null" type="application/octet-stream" v-on:click="downloadMapFile" :class="{ disabled: !downloadEnabled }">Download MAP File ({{filename}}.map)</a> 115 116 <div v-if="singleRomMapEnabled" class="single-rom-download"> 117 <div>If you want to flash {{singleRomFilename}} without the menu, you can use this MAP file to configure the cart to work with your ROM.</div> 118 <a class='download-link' :download="singleRomFilename + '.map'" :href="singleRomMapData" type="application/octet-stream" v-on:click="downloadSingleRomMapFile"> 119 Download Single Game MAP File ({{singleRomFilename}}.map) 120 </a> 121 </div> 122 </section> 123 </div>
補足情報(FW/ツールのバージョンなど)
Microsoft VS Code バージョン1.63.2
参照元
master
upload-entry-images
あなたの回答
tips
プレビュー