UPD: Remove profile list icon

This commit is contained in:
Robert Kossessa
2024-02-01 17:30:07 +01:00
parent 9e6f0ffa29
commit 3412cda566
4 changed files with 31 additions and 24 deletions

View File

@@ -2,7 +2,7 @@
<div class="aspect-[800/1100]"> <div class="aspect-[800/1100]">
<div <div
class="bg-contain bg-top bg-no-repeat h-full w-full relative" class="bg-contain bg-top bg-no-repeat h-full w-full relative"
:style="{backgroundImage: `linear-gradient(to bottom, black, rgba(0,0,0,0.2) 10%), url(${RenderNano})`}"> :style="{backgroundImage: `linear-gradient(to bottom, black, rgba(0,0,0,0.2) 10%, rgba(0,0,0,0.2) 95%, black), url(${RenderNano})`}">
<div class="flex px-4 pt-5 pb-3 items-baseline font-heading text-lg"> <div class="flex px-4 pt-5 pb-3 items-baseline font-heading text-lg">
{{ $t('preview.title') }} {{ $t('preview.title') }}
</div> </div>

View File

@@ -7,18 +7,10 @@
class="flex-1 flex h-full text-left whitespace-nowrap overflow-hidden" class="flex-1 flex h-full text-left whitespace-nowrap overflow-hidden"
:class="{'bg-zinc-200' : selected}" :class="{'bg-zinc-200' : selected}"
@submit.prevent="profile.name = nameInput; editing=false"> @submit.prevent="profile.name = nameInput; editing=false">
<span class="ml-4 mr-1 h-full w-4 flex items-center">
<component
:is="draggable && hover ? GripHorizontal : FileDigit"
:class="{'text-zinc-600': selected,
'text-muted-foreground': !selected}"
class="w-4 h-4 mb-0.5"
/>
</span>
<input <input
ref="profileNameInput" v-model="nameInput" ref="profileNameInput" v-model="nameInput"
onfocus="this.select()" :placeholder="$t('profiles.name_placeholder')" onfocus="this.select()" :placeholder="$t('profiles.name_placeholder')"
class="flex-1 pl-1 h-full bg-transparent focus-visible:ring-0 focus-visible:outline-none" class="flex-1 pl-10 h-full bg-transparent focus-visible:ring-0 focus-visible:outline-none"
:class="{'font-semibold bg-zinc-200 hover:bg-zinc-100 text-black' : selected, :class="{'font-semibold bg-zinc-200 hover:bg-zinc-100 text-black' : selected,
'hover:bg-zinc-900 bg-opacity-50 text-white': !selected}" 'hover:bg-zinc-900 bg-opacity-50 text-white': !selected}"
@blur="onNameInputBlur"> @blur="onNameInputBlur">
@@ -37,11 +29,13 @@
'hover:bg-zinc-900 bg-opacity-50 text-white': !selected}" 'hover:bg-zinc-900 bg-opacity-50 text-white': !selected}"
class="flex-1 h-full text-left whitespace-nowrap overflow-hidden text-ellipsis pr-4" class="flex-1 h-full text-left whitespace-nowrap overflow-hidden text-ellipsis pr-4"
@click="!editing && $emit('select') && $refs.profileTitle.scramble()"> @click="!editing && $emit('select') && $refs.profileTitle.scramble()">
<component <span class="ml-4 w-4 mr-2" :class="{'ml-8': !draggable}">
:is="draggable && hover ? GripHorizontal : FileDigit" <GripHorizontal
v-if="draggable"
:class="{'text-zinc-600': selected, :class="{'text-zinc-600': selected,
'text-muted-foreground': !selected}" 'text-muted-foreground': !selected}"
class="ml-4 mr-2 mb-0.5 h-4 w-4 inline-block" /> class="mb-0.5 h-4 w-4 inline-block" />
</span>
<ScrambleText <ScrambleText
ref="profileTitle" ref="profileTitle"
:class="{'text-black': selected, 'text-zinc-100': !selected}" :class="{'text-black': selected, 'text-zinc-100': !selected}"
@@ -49,7 +43,7 @@
<span <span
v-if="showId" v-if="showId"
class="text-xs text-zinc-600" class="text-xs text-zinc-600"
:class="{'hidden': hover}"> uID:{{ profile.id }}</span> :class="{'hidden': hover}"> UID:{{ profile.id }}</span>
</button> </button>
<template v-if="!confirmDelete"> <template v-if="!confirmDelete">
<button <button
@@ -99,7 +93,7 @@
</div> </div>
</template> </template>
<script setup> <script setup>
import { Check, Copy, FileDigit, PenLine, Trash2, X, GripHorizontal } from 'lucide-vue-next' import { Check, Copy, PenLine, Trash2, X, GripHorizontal } from 'lucide-vue-next'
import ScrambleText from '@/components/effects/ScrambleText.vue' import ScrambleText from '@/components/effects/ScrambleText.vue'
import { nextTick, ref } from 'vue' import { nextTick, ref } from 'vue'

View File

@@ -2,18 +2,21 @@
<div> <div>
<div> <div>
<div <div
class="w-full p-4 flex items-center"> class="w-full p-4 flex items-center justify-between">
<div>
<h1 class="text-lg"> <h1 class="text-lg">
{{ $t(`profiles.title`) }}<span class="text-sm text-zinc-600"> ({{ store.profiles.length }}/{{ maxProfiles {{ $t(`profiles.title`) }}<span class="text-sm text-zinc-600"> ({{ store.profiles.length }}/{{ maxProfiles
}})</span> }})</span>
</h1> </h1>
</div> <button
class="bg-zinc-200 text-black hover:bg-zinc-100 rounded-full aspect-square w-8 flex justify-center items-center"
@click="store.addProfile">
<Plus class="h-4" />
</button>
</div> </div>
<Separator /> <Separator />
</div> </div>
<div> <div>
<div class="flex w-full h-12 items-center"> <div v-if="showFilter" class="flex w-full h-12 items-center">
<label for="filter" class="flex h-full items-center cursor-text"> <label for="filter" class="flex h-full items-center cursor-text">
<Search class="ml-4 mr-2 mb-0.5 h-4 w-4 shrink-0 opacity-50 float-left" /> <Search class="ml-4 mr-2 mb-0.5 h-4 w-4 shrink-0 opacity-50 float-left" />
</label> </label>
@@ -71,6 +74,13 @@ import ScrambleText from '@/components/effects/ScrambleText.vue'
import { useStore } from '@/store.js' import { useStore } from '@/store.js'
import ProfileButton from '@/components/profile/ProfileButton.vue' import ProfileButton from '@/components/profile/ProfileButton.vue'
defineProps({
showFilter: {
type: Boolean,
default: false,
},
})
const maxProfiles = 32 const maxProfiles = 32
const store = useStore() const store = useStore()

View File

@@ -41,6 +41,9 @@ export const useStore = defineStore('main', {
this.selectedProfileId = id this.selectedProfileId = id
return true return true
}, },
addProfile() {
console.log('addProfile is not implemented')
},
duplicateProfile(id) { duplicateProfile(id) {
const originalProfile = this.profiles.find(p => p.id === id) const originalProfile = this.profiles.find(p => p.id === id)
const newProfile = JSON.parse(JSON.stringify(originalProfile)) const newProfile = JSON.parse(JSON.stringify(originalProfile))