AngularJS2.0 Tile Homepage Animation To New Page - animation

I am starting on a new website project using AngularJS 2.0.
However, I have a particular idea which I have no idea how to work out.
The website would work as follows: (I have put a link down here with multiple images that I hope can illustrate my idea).
Homepage with 20 rectangles, all having a different background color and some text and maybe a picture inside of it.
When clicking on one of the rectangles, the background of that tile will animate to a new page. The color of the header of that "new" page would be the color of the background of the tile. I think this should be done using the routing module right?
Link
How can I achieve this? Should I be using like 20 different components on the home screen which I somehow animate to a new page using routing or should I do something else?
I am kinda new to AngularJS but I'd love to learn more, would be great if anyone could help me out with this.
Thanks in advance

Related

Making clickable areas on a 3D model in Three js

I'm creating a webpage for a new beer brand for gamers.
So far, I've created a spinning beer can in Three js. I found a GLTF model, made a texture, added lighting and reflections - all the simple basics - using Drei and Fiber.
What I would love to achieve right now, is to use the beer can as navigation for the page. So if you mouse over the logo on the face of the can, the logo should change color to indicate you can click it, and if you click it, something happens (let's say a modal opens). You can then spin the can around and click different parts of it (some text, an icon, the barcode, etc) to get different content.
I'm not sure how I would achieve this or approach this. I've had a couple of different thoughts:
Map up clickable areas on the model somehow. This didn't seem possible.
Make all the different clickable parts separate objects in the model. This seems like a ton of work, and I'd have to spend a lot of time learning Blender. The can model is pretty simple (used a free one from sketchfab.com for now).
Map up html-elements onto the can using css3drenderer. But I didn't find a way to bend it onto the can well, and it didn't seem like I could use the model for that.
Use many textures with alphas on top of each other on the can and somehow look for transparency on click for each layer. Didn't find any way to do this.
Any ideas on what techniques to use to achieve this? I've done game dev in Unity, but I'm new to Three js and WebGL, so it's really hard to know where to start searching.
The common approach is to use raycasting to detect interaction with a model.
What you're really looking for is a hyperlink. Although you can't manually apply a hyperlink to three.js, you can use THREE.Raycaster() as a loophole.
Once you determine that the model was clicked on, you just do the following to redirect the user:
window.location.href = 'https://example.com/'
That should do it~
EDIT:
Here is an example, based on my reply to your comment:
if(intersects.length > 0){
if(intersects[0] == model.children[2]){ //Second child
window.location.href = 'https://example.com/'
}
}

Stretch Cover Image to Browser, Lift When Scrolled

So, the new Exposure site is wonderful and got me wondering how they've achieved something like this. Basically, it's a cover image that's stretched to the browser window (even if you resize), what's lovely about is that only when you scroll do you get to see the content below.
I guess you could use something like backstretch.js for the dynamically-resized image. How are they achieving the rest, though?
I've set up a pen here: http://codepen.io/realph/pen/luwdJ
Which seems to do the job, but the content is being covered when you scroll rather than falling below the cover image.
Any idea what I'm doing wrong, or any tips for achieving something like this?
Thanks in advance!
I think this is what your looking for and css can do the whole thing
http://codepen.io/anon/pen/rajDJ
Just add this rule to your images or image class
img {
width: 100%;
}
What exposure is doing there is creating onclick modal window that contains the image but you can do that with js or jquery or there are many jquery plugins that do that.
Also to get the nice grid structure you can use a grid template. Here is one to get you started http://960.gs/

How to zoom in on K2 item module images

This is the website I am working on > http://legendofindia.com/
I have been stuck on the "What's New" of the page because the client wants the images displayed to have a mouse over effect that zooms in the picture.
kicker: when the picture zooms in the container box shouldn't move. and it has to be full css
Been trying a lot of approach editing the css files and been researching also but to no avail. I hope you guys can help me because my deadline is pretty close and this is the last thing I need to finish.
Thanks
may be you can do like this jsfiddle.net/27Syr/5/
taken from Creating a Zoom Effect on an image on hover using CSS?

three js clickable cube texture

I am new on the JavaScript and HTML. I am on learning process. I successfully made a cube and textured it. I also want to add different html link to open pages in "iframe".
I used the example of http://mrdoob.github.com/three.js/examples/canvas_geometry_cube.html
This is what I did http://olcaysahin.com/pages/cube.html
If anyone knows any tutorial or similar approach to make each face clickable, appreciated.
Thanks
Have a look at http://mrdoob.github.com/three.js/examples/canvas_interactive_cubes.html.
The from variable intersects, you can determine which face was clicked on from either the faceIndex or the face normal.

UI Like Youtube in Android (Tablet)

I've spent 2 hours looking for a solution. I need to make a design
like the Youtube UI (Tablet UI) where it shows a vertical scroll, but
in each row there are 4 videos (landscape view). I've tried to do
something similar, but i couldn't =(
Is there any place where i can get the source code of the youtube
application for Tablet? Or maybe some resource to solve this? :(
BTW, my try was designing UI with scrollView, LinearLayout and my_item.xml, i tried to inflate my_item.xml adding programmatically into the linearlayout (horizontal orientation), but it doesn't work in the way that i want. I need something like a linearlayout but with horizontal and vertical orientation at the same time (something like a div).
I was thinking to use a ListView and a custom adapter (with my_item.xml), but i'm not sure if this can be the best solution.
Thxs
You should create seperate resources for each layout.
For example if the user is in Portrait mode you would have the correct layout in.
layout-port: layout for portrait orientation
layout-land: layout for landscape orientation
Read more on providing alternative resources here
Also i would recommend to read more on Handling runtime changes
This will help you with recognizing when the user changes orientation. You could actually use this guide and when the user flips the devices orientation you could then change the layout. Keep in mind hard coding this can be dangerous though. I would recommend using the layout folders.
Good luck!
Finally i solve my problem.
It works with a linearLayout(vertical) and adding linearlayout(horizontal) for each row. And obviously managing my scrollview.
BTW, i still think android should have a layout like a "div".
Thxs all

Resources