how to set icons in angular according to screen size? - angularjs

The graphic designer gave me for each icon he created different sizes.
How to make integrate them in angular html file ?
How to use the biggest icons for desktop, smaller for tablets and smallest for mobile ?

hide each icons when you don't want to show them
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" />
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
</head>
<body>
<div id="big-icon" class="hidden-sm hidden-xs hidden-md"></div>
<div id="small-icon" class="hidden-lg hidden-xs hidden-md"></div>
<div id="smallest-icon" class="hidden-lg hidden-sm hidden-md"></div>
</body>

Related

Bootstrap 5 hide col when device smaller than breakpoint size

In the following example, the navbar is correctly hidden when resizing the browser window. However, it is never hidden (always visible) when using the "Toogle device toolbar" in Chromium.
The problem doesn't seem to come from the devtools of chromium though because once deployed, displaying it on a mobile (google chrome or samsung internet browser) still shows the navbar.
What am I missing here ?
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.0.0-beta2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BmbxuPwQa2lc/FVzBcNJ7UAyJxM6wuqIj61tLrc4wSX0szH/Ev+nYRRuWlolflfl" crossorigin="anonymous">
</head>
<body>
<div class="container">
<div class="row justify-content-md-start justify-content-center">
<div class="col-2 d-none d-md-block" style="background-color: coral;">
navbar
</div>
<div class="col-12 col-sm-10 col-md-8" style="background-color: aqua;">
content
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap#5.0.0-beta2/dist/js/bootstrap.bundle.min.js" integrity="sha384-b5kHyXgcpbZJO/tY9Ul7kGkf1S0CWuKcCD38l8YkeH8z8QjE0GmW1gYU5S9FOnJ0" crossorigin="anonymous"></script>
</body>
</html>
You need to add the:
<meta name="viewport" content="width=device-width, initial-scale=1">
...line. Otherwise chrome will just scale (zoom) to fit.
See: https://getbootstrap.com/docs/5.0/getting-started/introduction/#starter-template

Lightbox 2 Navigation Symbols not appearing

Lightbox shows the enlarged image in a popup, but nothing else. No title and no navigation and closing symbols, no frame-creating animation behavior. I must use chrome's back arrow to return to the original image. I tested Lightbox in www.yurowcreates.com/Lville60. (To view, use the tab labeled "May 3rd" then click the picture in the upper left-hand corner.) I am also using Bootstrap. Could there be any conflicts? I have followed all installation instructions including providing paths to the navigation symbols and using the proper ordering of my HTML link tags and javascript script tags. (See below)
My HTML markup is as follows:
In the head section:
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-
beta.2/css/bootstrap.min.css" integrity="sha384-
PsH8R72JQ3SOdhVi3uxftmaW6Vc51MKb0q5P2rRUpPvrszuE4W1povHYgTpBfshb"
crossorigin="anonymous">
<link rel="stylesheet" href="Style.css" type="text/css">
<link rel="stylesheet" href="lightbox.css" type="text/css">
In the body section;
<div class="container">
<div class="row mb-3">
<div class="col">
<img class="mb-5 mb-sm-0" src="images/sandyandstu.jpg" width="300" height= "200">
</div>
...two other images in the same row go here...
</div>
,,,
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"
integrity="sha384-
KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN"
crossorigin="anonymous"></script>
... (ajax and bootstrap scripts)...
<script src="lightbox.js"></script>
</body>
Check that image paths are correct and modify lightbox.css accordingly to your file structure

AngularJS - Does Routing Harm SEO?

I am sure there are techniques to have a better SEO approach using AngularJS features, (https://prerender.io/js-seo/angularjs-seo-get-your-site-indexed-and-to-the-top-of-the-search-results/).
As an example, the source code of a project I am currently developing, returns the next:
<html lang="en" data-ng-app="ByTheWayApp" data-ng-controller="general">
<head>
<title>ByTheWay</title>
<base href="/" />
<meta charset="utf-8" />
<!-- Fonts -->
<link href="https://fonts.googleapis.com/css?family=Comfortaa:300,400,700|Courgette|Open+Sans:300,300i,400,400i,600,600i,700,700i,800,800i&subset=cyrillic,cyrillic-ext,greek,latin-ext" rel="stylesheet">
<link
rel="stylesheet"
type="text/css"
href="/assets/css/bytheway.css">
<link
rel="stylesheet"
type="text/css"
ng-href="{{ templateCSS }}">
</head>
<body>
<app>
<div class="loading">
<span>ByTheWay</span>
</div>
<div class="app-wrapper {{ displayClass }}" load >
<header class="header h-3 fixed">
<div class="inner-wrapper">
<div class="brand wpx-7">
<a href="/">
<h1 class="title"><span>ByTheWay</span></h1>
<h2 class="slogan"><span>chasing dreams worldwide</span></h2>
</a>
</div>
<nav class="nav w-auto text-right aw-const" id="nav">
home
sign in
<strong>sign up</strong>
</nav>
</div>
</header>
<div class="page" data-ng-controller="page" data-ng-view>
<!-- Here Go Every Page Templates using $routeProvider.when('',{}); -->
</div>
</div>
</app>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.8/angular.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.8/angular-route.js"></script>
<script type="text/javascript" src="/assets/js/bytheway.js"></script>
</body>
</html>
.
<div class="page"></div> would contain the Template .html file content, but it is not displayed when I check the source code, does the same happen when Google Spiders/Bots crawl my site ?
ps. I am not using yet meta tags, such description, tags, etc, because I am yet defining relevant content to be displayed.
Thank you and all the best

Not displaying correctly by full-width-header-menu-footer use angular-material

According to the official provided examples:
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>Full Width, Header, Menu, Footer</title>
<link rel="stylesheet" href="../bower_components/angular-material/angular-material.css">
</head>
<body layout="column" layout-fill>
<header>Header</header>
<div flex layout="row" layout-phone="column">
<aside flex-sm="33" flex-md="20">
Menu <br>[flex-sm="33"][flex-md="20"]
</aside>
<main flex>Main [flex]</main>
</div>
<footer>Footer</footer>
</body>
</html>
just use css as angular-material.css,but display wrong!
Make sure you are using the latest version as the docs only show the latest versions docs. So right now your probably seeing the docs for 0.6.0rc1 which has several beaking changes/renamings from 0.5.1 refer to the changelog for fixes.
If you want a full width header with a side menu and a footer here is the correct markup for 0.6.0rc1
<div layout="column" layout-fill>
<div layout="row">
<span>Your header</span>
</div>
<div layout="row" flex>
<div layout="column" flex="33">
Sidebar
</div>
<div flex="66">
Main content
</div>
</div>
<div layout="row">
The footer!
</div>
</div>
This is just a basic layout you would probably replace the header with md-tollbar and the sidemenu with md-sidenav. But this should help you along.
Also if you want to use 0.5.1 still just replace row with horizontal and column with vertical

Leave intact specific section of page when using Angular Snap

I'm using Angular Snap module but I can't make it only use a section of my page. For example I want yo leave header and footer intact when "snaping".
The follow example code describe my issue http://plnkr.co/edit/qOilojtXpCcBm99ynuzQ?p=preview
Code
<!DOCTYPE html>
<html ng-app="plunker">
<head>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="angular-snap.css" type="text/css" />
<script src="snap.js" type="text/javascript" charset="utf-8"></script>
<script data-require="angular.js#1.2.x" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.4/angular.min.js" data-semver="1.2.4"></script>
<script src="angular-snap.js" type="text/javascript" charset="utf-8"></script>
<script src="script.js"></script>
</head>
<body ng-controller="MainCtrl">
<!-- Header Image should here -->
<header>
<h1>Header</h1>
</header>
<!-- Menu Bar goes here -->
<div class="wrapper">
<div class="menu-holder">
<ul class="menu">
<li>item 1
</li>
<li class="active"><a class="test" href="#">This is the one</a>
<ul class="submenu">
<li>Submenu item 1
</li>
<li>Submenu item 2
</li>
</ul>
</li>
<li>menu item 3
</li>
<li>menu item 4
</li>
</ul>
</div>
<!-- menu-holder end -->
</div>
<!-- Both Snap-drawer and Snap-content should go below the Menu bar -->
<snap-drawer>
<button snap-toggle>Another Toggle Button</button>
</snap-drawer>
<snap-content snap-options="{tapToClose:false}">
<button snap-toggle>Toggle</button>
</snap-content>
</body>
</html>
Thanks
Plugin creator gives me answer for this on https://github.com/jtrussell/angular-snap.js/issues/75
I copy answer here for Archive purpose:
It's doable, here's an example with a fixed footer from a previous
thread, Snap still applies to the whole page we're just showing
content over it:
http://plnkr.co/edit/Vdz0AZ3tnlfErERmjcrY?p=preview
You can change it to a fixed header by updating the nav element like
so:
<nav class="navbar navbar-default navbar-fixed-top" role="navigation" style="background:red">
<div class="container">
Bottom container stuff!
</div>
</nav>
Just fair warning there are some issues with using fixed position
elements, just something to keep in mind.
The snap-content directive should expand to fill it's container, so
you may also be able to get something working by wrapping that element
in a non-static positioned element. Here's a rough demo.

Resources