How to create clickable html elements like div-s on a picture in Laravel? - laravel

I am pretty new to Laravel and I need to make a project using that framework. In that project I need to display an image in a loaded view and on that image I need to draw/display html elements like div-s for example. These elements need to be drawn using (x,y) coordinates taken from a database and also must be clickable.
The whole purpose of the project is so that people could click on elements that are drawn on the image and they could "reserve" a place for themselves. For example, imagine a company's representative reserving a spot on the exhibition floor at a conference.
How should I do it? I am a bit lost, but was thinking about using JavaScript. Here is an example image with elements on it.

Related

Paging concept using scrollviewer in wp

I am new to wp7. I want to add three images to my page. But not on a single page. It should be on three pages. When i move the image, at that time, the image is changed and i am on the secong page keeping my header and footer fixed.
So how to add three image in one page?
Why do you want to use scroll-viewer?
1) Try using a pivot control without any pivot headers. Add your images to three different pivot items. In pivot the header and footer you specify will remain fixed, only the content will change.
2) Also you can create a single page. Add three images to a list. Bind it to your image control. On flick gesture, change the image URL hence changing the image being displayed but keeping every thing else constant.
I gave you two approaches, try using any one of them which suits you the best. For further information try studying pivots and flick gestures.

drag images onto a map

I need to implement a feature where images can be geotagged. I want to drag and drop images(one or more images can be selected from the list) onto the map. Then the selected images should be geo tagged automatically to the point where they are dropped.
Can someone give me an idea on how to work on this.
Thanks
Yes, you can do this with HTML and Javascript.
I would advice you to use the jquery libary.
What you do is render the map where you want to place an image(for this example new york city)
What you do is use jquery to make the image you want to drop of yourself at the statue of liberty 50% opacity and draggable.
Under the image you have an in the middle of the image as a "pointer" which is not opaque.
People drag the "dot" under the image to the desired location.
When it's released you take the offset x and y, calculate that to the relative time x and y to find the geolocation and then store everything via ajax.
That's kinda the basis you'll have to work on to accomplish this.
It's a fun project though, but a bit timeconsuming.

How to make objects snap to a position in html5 canvas?

I'm looking into making a jigsaw game using html5 canvas and JavaScript. I have the images(pieces) in place, and they are draggable, but I'd like the pieces to act like they are on a grid so that when you click and hold while dragging an image it can only be placed on certain tiles within the 3x3 grid.
A similar question was asked on Stack before but the only response pointed to a drupal module and I'm not using drupal. I found one more similar solution online that uses Asp.net but I'm hoping to solve this all on the front-end, and if I have to use some server-side code I only know PHP.
The renderGrid function for canvas it seems, just draws a grid, but doesn't make it functional for snapping objects to certain places.
Does anyone have clues on how to do this?
Use divide/floor down math when setting coordinates. E.g. to space x for each 24 pixels:
var gridx = Math.floor(x/24)*24;

Cocoa control to render a tile map

Is there any Cocoa control that is capable of drawing tile maps with multiple layers and multiple texture sources which can also intercept touches into single tiles? Having multiple layer support is not a real requirement but an optional feature (the views could still be stacked). Hardware acceleration is not needed at all.
So far I have toyed around with NSMatrix, IKImageBrowser and NSCollectionView but non of them felt like a good solution for the problem. Ideally I need an control similar to the one in Tiled.app. Is there anything, third party or built-in, or do I have to handcraft this control?
I fear that you will be hardly able to find a ready-to-use control for managing tile maps.
If I had to implement something like that on my own, I would consider using CATiledLayer, since this is the closest thing to a tile map control that I know of.
From CATiledLayer Reference:
CATiledLayer is a subclass of CALayer providing a way to asynchronously provide tiles of the layer's content, potentially cached at multiple levels of detail.
There is a nice sample by Bill Dudney (the author of "Core Animation for MacOS and the iPhone"). This sample could provide you a solid foundation for your own project, though it only displays one single PDF, allowing you to zoom in the area you clicked on (this requires rereading the tile at a different detail level).
Another interesting introduction can be found here. This is more step-by-step, so you might start with this.
Finally, on Cocoa is my Girlfriend there is a nice article, although it focuses on iOS, but you may find it anyway relevant.
Cocos2D supports building mac applications now
Article on cocos2d stating this: http://www.cocos2d-iphone.org/archives/1444
Aee here for how to do it: http://chris-fletcher.com/tag/cocos2d-os-x/
Aee here on how to use TMX tile maps with Cocos2D to build tile based maps: http://www.cocos2d-iphone.org/wiki/doku.php/prog_guide:tiled_maps
This means you can use the power of Cocos2d and you will have to write much less code to get to where you want with a tile based map.
If you don't want to use Cocos2D:
It seems you would have to code it yourself, but it shouldn't be too hard to do.
First you can create your .TMX file using the tile editor "Tiled.app" then you would need to parse the XML using a standard xml library for Cocoa.
To lay out the tiles use a UIView for the overall container and then create a tile class that holds your tile display information and responds to clicks the tile class should extend UIView. For the tile class allow the assigning of a click delegate and assign your ViewController as the click delegate for all tiles so you can handle clicks easily with the clicked tile being passed to you.
Loop through your xml data and create and position the tiles in the overall UIView by using the tiles width/height and your tilemaps rows/columns.
I think in about a day or 2 you could have the tile map being rendered and clickable using the standard TMX format which will allow you to edit your map in "Tiled.app"
The TMX standard is covered here: https://github.com/bjorn/tiled/wiki/TMX-Map-Format
route-me might fit the bill.

Could you recommend an image carousel?

I have a .NET 2.0 web project. I need a simple image carousel. What I would prefer is the main image on the top, and a scrolling bar with smaller images on the bottom. When the user hovers over or clicks the smaller image, it would populate the larger image space.
If you know of anything like this, even 3rd party paid controls, please recommend them.
jQuery is the way to go here is the google search result:
http://www.google.com/search?aq=0&oq=jquery+image+car&sourceid=chrome&ie=UTF-8&q=jquery+image+carousel

Resources