diff options
| author | Terry Truong <terry06890@gmail.com> | 2022-03-27 08:30:45 +1100 |
|---|---|---|
| committer | Terry Truong <terry06890@gmail.com> | 2022-03-27 08:30:45 +1100 |
| commit | 4a469f8f6fab97d591929933b8cc73085955ab25 (patch) | |
| tree | c8c632348971e61176eda5fb97cceeef80e4554c | |
| parent | 3cfe6761b450ab2d31c71e06bb83de3f057f1923 (diff) | |
Move svg details to index.html
| -rw-r--r-- | index.html | 53 | ||||
| -rw-r--r-- | src/App.vue | 1 | ||||
| -rw-r--r-- | src/components/HelpModal.vue | 8 | ||||
| -rw-r--r-- | src/components/SearchModal.vue | 7 | ||||
| -rw-r--r-- | src/components/Settings.vue | 8 | ||||
| -rw-r--r-- | src/components/TileImg.vue | 8 | ||||
| -rw-r--r-- | src/components/TileInfoModal.vue | 8 | ||||
| -rw-r--r-- | src/components/TileTree.vue | 45 |
8 files changed, 73 insertions, 65 deletions
@@ -9,5 +9,58 @@ <body> <div id="app"></div> <script type="module" src="/src/main.ts"></script> + <!-- SVGs --> + <svg style="display:none"> + <defs> + <svg id="svg-info" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" + stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> + <circle cx="12" cy="12" r="10"/> + <line x1="12" y1="16" x2="12" y2="12"/> + <line x1="12" y1="8" x2="12.01" y2="8"/> + </svg> + <svg id="svg-settings" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" + stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> + <circle cx="12" cy="12" r="3"/> + <path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 + 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 + 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 + 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 + 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 + 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 + 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 + 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 + 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 + 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 + 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"/> + </svg> + <svg id="svg-search" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" + stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> + <circle cx="11" cy="11" r="8"/> + <line x1="21" y1="21" x2="16.65" y2="16.65"/> + </svg> + <svg id="svg-play" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" + stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> + <circle cx="12" cy="12" r="10"/> + <polygon points="10 8 16 12 10 16 10 8"/> + </svg> + <svg id="svg-help" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" + stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> + <circle cx="12" cy="12" r="10"/> + <path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/> + <line x1="12" y1="17" x2="12.01" y2="17"/> + </svg> + <svg id="svg-close" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" + stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> + <line x1="18" y1="6" x2="6" y2="18"/> + <line x1="6" y1="6" x2="18" y2="18"/> + </svg> + </defs> + </svg> </body> </html> diff --git a/src/App.vue b/src/App.vue index b4254e7..2cae3af 100644 --- a/src/App.vue +++ b/src/App.vue @@ -12,4 +12,3 @@ export default defineComponent({ <template> <tile-tree/> </template> - diff --git a/src/components/HelpModal.vue b/src/components/HelpModal.vue index fff1b8d..e76254d 100644 --- a/src/components/HelpModal.vue +++ b/src/components/HelpModal.vue @@ -20,12 +20,8 @@ export default defineComponent({ <div class="fixed left-0 top-0 w-full h-full bg-black/40" @click="closeClicked"> <div class="absolute left-1/2 -translate-x-1/2 w-4/5 top-1/2 -translate-y-1/2 p-4 bg-stone-50 rounded-md shadow shadow-black"> - <svg class="block absolute top-2 right-2 w-6 h-6 hover:cursor-pointer" - @click="closeClicked" ref="closeIcon" - xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" - stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> - <line x1="18" y1="6" x2="6" y2="18"/> - <line x1="6" y1="6" x2="18" y2="18"/> + <svg class="block absolute top-2 right-2 w-6 h-6 hover:cursor-pointer" @click="closeClicked" ref="closeIcon"> + <use href="#svg-close"/> </svg> <h1 class="text-center text-xl font-bold mb-2">Help Info</h1> <hr class="mb-4 border-stone-400"/> diff --git a/src/components/SearchModal.vue b/src/components/SearchModal.vue index 7e32236..ee1cc2e 100644 --- a/src/components/SearchModal.vue +++ b/src/components/SearchModal.vue @@ -44,11 +44,8 @@ export default defineComponent({ bg-stone-50 rounded-md shadow shadow-black flex gap-1"> <input type="text" class="block border" @keyup.enter="onSearchEnter" @keyup.esc="closeClicked" ref="searchInput"/> - <svg class="block w-6 h-6 ml-1 hover:cursor-pointer hover:bg-stone-200" @click="onSearchEnter" - xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" - stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> - <circle cx="11" cy="11" r="8"/> - <line x1="21" y1="21" x2="16.65" y2="16.65"/> + <svg class="block w-6 h-6 ml-1 hover:cursor-pointer hover:bg-stone-200" @click="onSearchEnter"> + <use href="#svg-search"/> </svg> </div> </div> diff --git a/src/components/Settings.vue b/src/components/Settings.vue index c364924..2b8cd35 100644 --- a/src/components/Settings.vue +++ b/src/components/Settings.vue @@ -39,12 +39,8 @@ export default defineComponent({ <template> <div class="absolute bottom-4 right-4 min-w-[5cm] p-3 bg-stone-50 visible rounded-md shadow shadow-black"> - <svg class="block absolute top-2 right-2 w-6 h-6 hover:cursor-pointer" - @click="closeClicked" ref="closeIcon" - xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" - stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> - <line x1="18" y1="6" x2="6" y2="18"/> - <line x1="6" y1="6" x2="18" y2="18"/> + <svg class="block absolute top-2 right-2 w-6 h-6 hover:cursor-pointer" @click="closeClicked" ref="closeIcon"> + <use href="#svg-close"/> </svg> <h1 class="text-xl font-bold mb-2">Settings</h1> <hr class="border-stone-400"/> diff --git a/src/components/TileImg.vue b/src/components/TileImg.vue index 849be8c..00cc2e6 100644 --- a/src/components/TileImg.vue +++ b/src/components/TileImg.vue @@ -98,12 +98,8 @@ export default defineComponent({ <h1 :style="headerStyles">{{layoutNode.tolNode.name}}</h1> <svg :style="infoIconStyles" class="hover:cursor-pointer" @mouseenter="onInfoMouseEnter" @mouseleave="onInfoMouseLeave" - @click.stop="onInfoClick" @mousedown.stop @mouseup.stop - xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" - stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> - <circle cx="12" cy="12" r="10"/> - <line x1="12" y1="16" x2="12" y2="12"/> - <line x1="12" y1="8" x2="12.01" y2="8"/> + @click.stop="onInfoClick" @mousedown.stop @mouseup.stop> + <use href="#svg-info"/> </svg> </div> </template> diff --git a/src/components/TileInfoModal.vue b/src/components/TileInfoModal.vue index f15781a..51f3b26 100644 --- a/src/components/TileInfoModal.vue +++ b/src/components/TileInfoModal.vue @@ -33,12 +33,8 @@ export default defineComponent({ <div class="fixed left-0 top-0 w-full h-full bg-black/40" @click="closeClicked"> <div class="absolute left-1/2 -translate-x-1/2 w-4/5 top-1/2 -translate-y-1/2 p-4 bg-stone-50 rounded-md shadow shadow-black"> - <svg class="block absolute top-2 right-2 w-6 h-6 hover:cursor-pointer" - @click="closeClicked" ref="closeIcon" - xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" - stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> - <line x1="18" y1="6" x2="6" y2="18"/> - <line x1="6" y1="6" x2="18" y2="18"/> + <svg class="block absolute top-2 right-2 w-6 h-6 hover:cursor-pointer" @click="closeClicked" ref="closeIcon"> + <use href="#svg-close"/> </svg> <h1 class="text-center text-xl font-bold mb-2">{{tolNode.name}}</h1> <hr class="mb-4 border-stone-400"/> diff --git a/src/components/TileTree.vue b/src/components/TileTree.vue index b6daadf..9f64252 100644 --- a/src/components/TileTree.vue +++ b/src/components/TileTree.vue @@ -479,48 +479,23 @@ export default defineComponent({ <div v-else class="absolute bottom-0 right-0 w-[100px] h-[100px]"> <div class="absolute bottom-[-50px] right-[-50px] w-[100px] h-[100px] visible -rotate-45 bg-black text-white hover:cursor-pointer" @click="onSettingsIconClick"> - <svg class="w-6 h-6 mx-auto mt-2" - xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" - stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> - <circle cx="12" cy="12" r="3"/> - <path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 - 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 - 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 - 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 - 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 - 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 - 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 - 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 - 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 - 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 - 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"/> - </svg> + <svg class="w-6 h-6 mx-auto mt-2"><use href="#svg-settings"/></svg> </div> </div> </transition> </div> <!-- Icons --> - <svg @click="onSearchIconClick" - class="absolute top-[6px] right-[54px] w-[18px] h-[18px] text-white/40 hover:text-white hover:cursor-pointer" - xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" - stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> - <circle cx="11" cy="11" r="8"/> - <line x1="21" y1="21" x2="16.65" y2="16.65"/> + <svg class="absolute top-[6px] right-[54px] w-[18px] h-[18px] text-white/40 hover:text-white hover:cursor-pointer" + @click="onSearchIconClick"> + <use href="#svg-search"/> </svg> - <svg @click="onPlayIconClick" - class="absolute top-[6px] right-[30px] w-[18px] h-[18px] text-white/40 hover:text-white hover:cursor-pointer" - xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" - stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> - <circle cx="12" cy="12" r="10"/> - <polygon points="10 8 16 12 10 16 10 8"/> + <svg class="absolute top-[6px] right-[30px] w-[18px] h-[18px] text-white/40 hover:text-white hover:cursor-pointer" + @click="onPlayIconClick"> + <use href="#svg-play"/> </svg> - <svg @click="onHelpIconClick" - class="absolute top-[6px] right-[6px] w-[18px] h-[18px] text-white/40 hover:text-white hover:cursor-pointer" - xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" - stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> - <circle cx="12" cy="12" r="10"/> - <path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/> - <line x1="12" y1="17" x2="12.01" y2="17"/> + <svg class="absolute top-[6px] right-[6px] w-[18px] h-[18px] text-white/40 hover:text-white hover:cursor-pointer" + @click="onHelpIconClick"> + <use href="#svg-help"/> </svg> <!-- Modals --> <transition name="fade"> |
