Flickr Search Example: Nightly

Developer
Size
2,781 Kb
Views
60,720

How do I make an flickr search example: nightly?

Demo of loading images using the Flickr API with Ionic.. What is a flickr search example: nightly? How do you make a flickr search example: nightly? This script and codes were developed by Ionic on 03 July 2022, Sunday.

Flickr Search Example: Nightly Previews

Flickr Search Example: Nightly - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Flickr Search Example: Nightly</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <html ng-app="ionicApp">
<head> <meta charset="utf-8"> <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"> <title>Flickr</title> <link href="//code.ionicframework.com/nightly/css/ionic.css" rel="stylesheet"> <script src="//code.ionicframework.com/nightly/js/ionic.bundle.js"></script> <script src="//code.ionicframework.com/nightly/js/angular/angular-resource.js"></script>
</head>
<body ng-controller="FlickrCtrl"> <ion-header-bar class="bar-dark"> <h1 class="title">Flickr Search</h1> </ion-header-bar> <div id="search-bar"> <div class="item item-input-inset"> <label class="item-input-wrapper" id="search-input"> <i class="icon ion-search placeholder-icon"></i> <input type="text" placeholder="Search" ng-model="query" ng-change="search()"> </label> </div> </div> <ion-content id="content" push-search> <div id="photos" class="clearfix"> <div class="photo" ng-repeat="photo in photos.items"> <img ng-src="{{ photo.media.m }}"> </div> </div> </ion-content>
</body>
</html> <script src="js/index.js"></script>
</body>
</html>

Flickr Search Example: Nightly - Script Codes CSS Codes

#search-input { text-align: center;
}
#photos { margin: auto;
}
.photo { width: 100px; height: 100px; margin: 1px; float: left; overflow: hidden;
}
.photo img { min-width: 100%; min-height: 100%; max-width: 150%; max-height: 150%;
}
#search-bar { background: none; position: absolute; width: 100%; top: 44px; height: 40px; z-index: 3;
}
#search-bar .item { background: none; border: none;
}
#content { top: 44px; padding-top: 45px; padding-bottom: 20px;
}

Flickr Search Example: Nightly - Script Codes JS Codes

angular.module('ionicApp', ['ionic', 'ngResource'])
.factory('Flickr', function($resource, $q) { var photosPublic = $resource('http://api.flickr.com/services/feeds/photos_public.gne', { format: 'json', jsoncallback: 'JSON_CALLBACK' }, { 'load': { 'method': 'JSONP' } }); return { search: function(query) { var q = $q.defer(); photosPublic.load({ tags: query }, function(resp) { q.resolve(resp); }, function(err) { q.reject(err); }) return q.promise; } }
})
.controller('FlickrCtrl', function($scope, Flickr) { var doSearch = ionic.debounce(function(query) { Flickr.search(query).then(function(resp) { $scope.photos = resp; }); }, 500); $scope.search = function() { doSearch($scope.query); }
})
.directive('pushSearch', function() { return { restrict: 'A', link: function($scope, $element, $attr) { var amt, st, header; $element.bind('scroll', function(e) { if(!header) { header = document.getElementById('search-bar'); } st = e.detail.scrollTop; if(st < 0) { header.style.webkitTransform = 'translate3d(0, 0px, 0)'; } else { header.style.webkitTransform = 'translate3d(0, ' + -st + 'px, 0)'; } }); } }
})
.directive('photo', function($window) { return { restrict: 'C', link: function($scope, $element, $attr) { var size = ($window.outerWidth / 3) - 2; $element.css('width', size + 'px'); } }
});
Flickr Search Example: Nightly - Script Codes
Flickr Search Example: Nightly - Script Codes
Home Page Home
Developer Ionic
Username ionic
Uploaded July 03, 2022
Rating 4.5
Size 2,781 Kb
Views 60,720
Do you need developer help for Flickr Search Example: Nightly?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Ionic (ionic) Script Codes
Create amazing sales emails with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!