Finger-dragging a background layer that is many times wider than the view, with snapping enabled only on the end of the image - html

Apologies if this has been answered before, I didn't see anything that matched it perfectly. I've found a ton of resources for sliders that snap to the edge of the current frame, but not my requirements below.
What is the best way to build a simple webpage that has the following:
A top layer, that fills the entire screen, with a 'hole' showing a background layer.
The background layer must be draggable/swipeable horizontally.
The background layer is many time wider than the viewport, so I don't want any snapping until the edges of the image are reached.
I made a little gif mockup to try to show what I'm on about.
Thanks for any help!

Related

Trouble with WPBakery, putting one image above the other

I have WPBakery installed on my wordpress website, and I have tried to have two images in a single widget in a row divided into 5 columns, the two images being in a single column.
One of the images however is a sort of a custom stylized picture frame for the other image. I managed to partially solve the issue by applying a margin of "-140%" on the top margin. Unfortunately I can't get the image to stretch out to fit the frame, also when changing the viewport to be smaller (mobile sized for example), the frame scales proportionally as it should, while the image it self shrinks.
Can anyone help me out on making the image scale proportionally with the image, and also making sure it stretches to the size of the frame?
Note: The images might not be the same resolution as the frame, but i need the image to be stretched to those dimensions.
Here is how it looks on a 1080p monitor, notice how its not stretched to the frame
When it is shrunk to a mobile viewport
In my professional opinion of over 13 years of web development in a business setting, my answer to you is use ONE image. Have a .PSD project for these. Have your image frame as one layer, and use your normal images in another layer on top. When you want to create one of these images, open up the .PSD project, highlight the image to be replaced, and import the new. You may have to crop the new to be the dimensions of the last one and play with the centering x and y. Then, save your new image at full size. It will scale down because it is ONE image, not one image with a hacktastic image background.

Google Slides Select Shape And Zoom to it

I am trying to use the functionality of Google Slides to create a complicated diagram of a complicated process. Basically, I have tiny rectangles (shapes) within larger rectangles within even larger rectangles, all on top of a huge rectangle that occupies my entire viewport with the maximum zoom out (Ctrl-Alt-Minus pressed many times). Rectangles have some small font text in them and there are also a bunch of connectors going from one rectangle to another.
It's a big mess.
When I want to see the details of a small rectangle, I use the provided Ctrl-Alt-Plus shortcut to zoom in as far as it lets me. However, it's incredibly cumbersome, because it will only zoom in to whatever is in the very center of the screen. So, I need to constantly adjust my view port to place what I want into the center of the screen.
What I want is to write a script (if such functionality is in fact provided - hence the question) where I could click on a specific rectangle and it would immediately zoom to this rectangle, placing it in the middle of my screen, it occupying about 50% of the screen space.
I looked through Google Slides API reference and found absolutely nothing related to zoom. Am I searching incorrectly, or is it simply not there?

spread background pattern over two divs css

I'm currently designing a site and I'm trying to use a patterned background over two s... The issue is that everytime the window is resized, or a different resolution is used to my development one, the patterns don't align. Been looking for solutions everywhere... can't find anything. Here's a screenshot of what I mean:
http://img801.imageshack.us/img801/1056/33l3.jpg
I know you can set the background position, but that doesn't help, because when you resize the window again, because the main section and the rectangle on the top are different divs, the background moves again. Is this possible to fix? Or do I need to consider something else entirely?

How to properly clear all images that were "blitted" onscreen using pygame?

I was wondering how does pygame.blit manages the images blitted on screen. When I blit an multiple images on the screen, I see that each image is stacked on top the previous one.
How do I clear all these images? Wouldn't(somehow) there be a big problem when there are LOTS of images stacking on top of each other on the screen? Currently, I'm just blitting a white bg or custom bg on the whole screen to "clear" the screen. So far no problems or anything since the app I am working on is very small.
When you blit an image to a surface, it basicly draws it on the surface. The location of the blitting or the object blitted is not saved and cannot be changed. It's like if you were painting the images onto a canvas. The new ones would go over the old ones and there would be no way to get rid of one image if it were colliding with another image.
The most common approach to solving this is to just completly clear the screen using surface.fill(), and redraw the images each frame.
To answer your question about if there woudl be problems when there are lots of images, no. The window will only be saved as each individual pixel being a certain color, much like a regular picture you would take a camera, so no matter how many objects you blit, the game will always take the same amount of time.
There are multiple approaches:
Clean the whole background, as you are doing.
If the computer keeps up with the fps, perhaps it's better to leave it like this.
Clean only the areas where you blitted objects (see pygame.sprite.RenderUpdates)
In your case, if you have many stacked objects, perhaps it's better to write your own solution, trying to find the union between colliding rectangles, to avoid reblitting the same background over and over.

same image shows different color on top and bottom of the page

i ran across something i have never seen before. the page has a top div and a footer div. both with an image as background. mirrored the image as well via photoshop.
now the weird thing is, it shows a different color. see http://www.hp-consultants.nl
when i tilt my screen towards me the colors become the same. even in photoshop i notice the difference. does anyone know what is wrong?
ive tried using regular CSS colors instead of a background image, to no effect. even the same image shows a difference
thanks!
There's nothing wrong with your page. Using Photohop's colour picker confirms that the colours are both indeed exactly the same.
The effect probably happens because you're sitting in front of a TFT monitor, whose display is sensitive to the angle you look at it from.
Some useful background information:
LCD Test: Viewing angle
Wikipedia on TFT LCDs:
TN displays suffer from limited viewing angles, especially in the vertical direction. Colors will shift when viewed off-perpendicular. In the vertical direction, colors will shift so much that they will invert past a certain angle.
The colours are exactly the same a quick check with any image editor will tell you that. TFT Monitors can do strange things to colours depending on the viewing angle.
Also our eyes and brains are really not as good at determining colour as we think. Have you ever seen this optical illusion.
The Squares Labeled A & B are the same colour
may be is the orientation of the led, that brights differently. have you tried to get the browser windows to the bottom of the screen so you see the header where the footer is.
Try this:
open 2 browser instances
resize the window of each to view only the header or the footer (one for each)
place the footer window at the top and the header window at the top
switch window places
in my case I see the bottom one always more clear.
Hope this helps you