[Client] Improve usability
This commit is contained in:
		
							parent
							
								
									2614771a7c
								
							
						
					
					
						commit
						ae6293cb6b
					
				
					 2 changed files with 4 additions and 20 deletions
				
			
		| 
						 | 
					@ -7,8 +7,6 @@
 | 
				
			||||||
</div>
 | 
					</div>
 | 
				
			||||||
<a class="lcjomzwbohoelkxsnuqjiaccdbdfiazy" v-else
 | 
					<a class="lcjomzwbohoelkxsnuqjiaccdbdfiazy" v-else
 | 
				
			||||||
	:href="image.url"
 | 
						:href="image.url"
 | 
				
			||||||
	@mousemove="onMousemove"
 | 
					 | 
				
			||||||
	@mouseleave="onMouseleave"
 | 
					 | 
				
			||||||
	@click.prevent="onClick"
 | 
						@click.prevent="onClick"
 | 
				
			||||||
	:style="style"
 | 
						:style="style"
 | 
				
			||||||
	:title="image.name"
 | 
						:title="image.name"
 | 
				
			||||||
| 
						 | 
					@ -45,20 +43,6 @@ export default Vue.extend({
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	methods: {
 | 
						methods: {
 | 
				
			||||||
		onMousemove(e) {
 | 
					 | 
				
			||||||
			const rect = this.$el.getBoundingClientRect();
 | 
					 | 
				
			||||||
			const mouseX = e.clientX - rect.left;
 | 
					 | 
				
			||||||
			const mouseY = e.clientY - rect.top;
 | 
					 | 
				
			||||||
			const xp = mouseX / this.$el.offsetWidth * 100;
 | 
					 | 
				
			||||||
			const yp = mouseY / this.$el.offsetHeight * 100;
 | 
					 | 
				
			||||||
			this.$el.style.backgroundPosition = `${xp}% ${yp}%`;
 | 
					 | 
				
			||||||
			this.$el.style.backgroundImage = `url("${this.image.url}")`;
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		onMouseleave() {
 | 
					 | 
				
			||||||
			this.$el.style.backgroundPosition = '';
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		onClick() {
 | 
							onClick() {
 | 
				
			||||||
			this.$root.new(ImageViewer, {
 | 
								this.$root.new(ImageViewer, {
 | 
				
			||||||
				image: this.image
 | 
									image: this.image
 | 
				
			||||||
| 
						 | 
					@ -76,9 +60,8 @@ export default Vue.extend({
 | 
				
			||||||
	width 100%
 | 
						width 100%
 | 
				
			||||||
	height 100%
 | 
						height 100%
 | 
				
			||||||
	background-position center
 | 
						background-position center
 | 
				
			||||||
 | 
						background-size contain
 | 
				
			||||||
	&:not(:hover)
 | 
						background-repeat no-repeat
 | 
				
			||||||
		background-size cover
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
.ldwbgwstjsdgcjruamauqdrffetqudry
 | 
					.ldwbgwstjsdgcjruamauqdrffetqudry
 | 
				
			||||||
	display flex
 | 
						display flex
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -62,7 +62,8 @@ export default Vue.extend({
 | 
				
			||||||
	width 100%
 | 
						width 100%
 | 
				
			||||||
	height 100%
 | 
						height 100%
 | 
				
			||||||
	background-position center
 | 
						background-position center
 | 
				
			||||||
	background-size cover
 | 
						background-size contain
 | 
				
			||||||
 | 
						background-repeat no-repeat
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.qjewsnkgzzxlxtzncydssfbgjibiehcy
 | 
					.qjewsnkgzzxlxtzncydssfbgjibiehcy
 | 
				
			||||||
	display flex
 | 
						display flex
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue