From e5652e9cd560ccda249819857c207643820b075f Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 8 Nov 2016 11:46:00 -0500 Subject: le gap --- StoneIsland/config.xml | 2 +- .../ios/Stone Island.xcodeproj/project.pbxproj | 1 + .../UserInterfaceState.xcuserstate | Bin 11016 -> 56917 bytes .../ios/Stone Island/Stone Island-Info.plist | 419 +++++++++++---------- StoneIsland/platforms/ios/Stone Island/config.xml | 31 +- StoneIsland/platforms/ios/www/css/nav.css | 4 + StoneIsland/platforms/ios/www/css/products.css | 4 +- StoneIsland/platforms/ios/www/index.html | 2 +- .../platforms/ios/www/js/lib/blogs/BlogView.js | 4 +- .../platforms/ios/www/js/lib/blogs/HubView.js | 157 +++++--- .../ios/www/js/lib/products/CollectionView.js | 6 +- .../ios/www/js/lib/products/ProductView.js | 8 +- StoneIsland/www/index.html | 2 +- 13 files changed, 343 insertions(+), 297 deletions(-) (limited to 'StoneIsland') diff --git a/StoneIsland/config.xml b/StoneIsland/config.xml index 0cc5863a..c21885e7 100755 --- a/StoneIsland/config.xml +++ b/StoneIsland/config.xml @@ -1,5 +1,5 @@ - + Stone Island Stone Island diff --git a/StoneIsland/platforms/ios/Stone Island.xcodeproj/project.pbxproj b/StoneIsland/platforms/ios/Stone Island.xcodeproj/project.pbxproj index a9addbce..803a62a5 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcodeproj/project.pbxproj +++ b/StoneIsland/platforms/ios/Stone Island.xcodeproj/project.pbxproj @@ -581,6 +581,7 @@ GCC_VERSION = ""; INFOPLIST_FILE = "Stone Island/Stone Island-Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 7.1; + ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( "-weak_framework", CoreFoundation, diff --git a/StoneIsland/platforms/ios/Stone Island.xcodeproj/project.xcworkspace/xcuserdata/jules.xcuserdatad/UserInterfaceState.xcuserstate b/StoneIsland/platforms/ios/Stone Island.xcodeproj/project.xcworkspace/xcuserdata/jules.xcuserdatad/UserInterfaceState.xcuserstate index 0499c07f..d4c956dc 100644 Binary files a/StoneIsland/platforms/ios/Stone Island.xcodeproj/project.xcworkspace/xcuserdata/jules.xcuserdatad/UserInterfaceState.xcuserstate and b/StoneIsland/platforms/ios/Stone Island.xcodeproj/project.xcworkspace/xcuserdata/jules.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/StoneIsland/platforms/ios/Stone Island/Stone Island-Info.plist b/StoneIsland/platforms/ios/Stone Island/Stone Island-Info.plist index 94a706f5..a8e57f0b 100755 --- a/StoneIsland/platforms/ios/Stone Island/Stone Island-Info.plist +++ b/StoneIsland/platforms/ios/Stone Island/Stone Island-Info.plist @@ -1,212 +1,213 @@ - - CFBundleDevelopmentRegion - English - CFBundleDisplayName - ${PRODUCT_NAME} - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIconFile - icon.png - CFBundleIcons - - CFBundlePrimaryIcon - - CFBundleIconFiles - - icon-40 - icon-small - icon-60 - icon.png - icon@2x - icon-72 - icon-72@2x - - UIPrerenderedIcon - - - - CFBundleIcons~ipad - - CFBundlePrimaryIcon - - CFBundleIconFiles - - icon-small - icon-40 - icon-50 - icon-76 - icon-60 - icon - icon@2x - icon-72 - icon-72@2x - - UIPrerenderedIcon - - - - CFBundleIdentifier - us.okfoc.stoneisland - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - APPL - CFBundleShortVersionString - 0.5.6 - CFBundleSignature - ???? - CFBundleURLTypes - - - CFBundleURLSchemes - - stoneisland - - - - CFBundleVersion - 0.5.6 - LSApplicationQueriesSchemes - - youtube - - LSRequiresIPhoneOS - - NSAppTransportSecurity - - NSAllowsArbitraryLoads - - - NSLocationWhenInUseUsageDescription - - NSMainNibFile~ipad - - UIBackgroundModes - - remote-notification - - UIInterfaceOrientation - - UIInterfaceOrientationPortrait - - UILaunchImages - - - UILaunchImageMinimumOSVersion - 8.0 - UILaunchImageName - Default - UILaunchImageOrientation - Portrait - UILaunchImageSize - {320, 480} - - - UILaunchImageMinimumOSVersion - 8.0 - UILaunchImageName - Default - UILaunchImageOrientation - Landscape - UILaunchImageSize - {320, 480} - - - UILaunchImageMinimumOSVersion - 8.0 - UILaunchImageName - Default-568h - UILaunchImageOrientation - Portrait - UILaunchImageSize - {320, 568} - - - UILaunchImageMinimumOSVersion - 8.0 - UILaunchImageName - Default-568h - UILaunchImageOrientation - Landscape - UILaunchImageSize - {320, 568} - - - UILaunchImageMinimumOSVersion - 8.0 - UILaunchImageName - Default-667h - UILaunchImageOrientation - Portrait - UILaunchImageSize - {375, 667} - - - UILaunchImageMinimumOSVersion - 8.0 - UILaunchImageName - Default-667h - UILaunchImageOrientation - Landscape - UILaunchImageSize - {375, 667} - - - UILaunchImageMinimumOSVersion - 8.0 - UILaunchImageName - Default-736h - UILaunchImageOrientation - Portrait - UILaunchImageSize - {414, 736} - - - UILaunchImageMinimumOSVersion - 8.0 - UILaunchImageName - Default-Landscape-736h - UILaunchImageOrientation - Landscape - UILaunchImageSize - {414, 736} - - - UILaunchImageMinimumOSVersion - 8.0 - UILaunchImageName - Default-Portrait - UILaunchImageOrientation - Portrait - UILaunchImageSize - {768, 1024} - - - UILaunchImageMinimumOSVersion - 8.0 - UILaunchImageName - Default-Landscape - UILaunchImageOrientation - Landscape - UILaunchImageSize - {768, 1024} - - - UIRequiresFullScreen - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - - - + + CFBundleDevelopmentRegion + English + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + icon.png + CFBundleIcons + + CFBundlePrimaryIcon + + CFBundleIconFiles + + icon-40 + icon-small + icon-60 + icon.png + icon@2x + icon-72 + icon-72@2x + + UIPrerenderedIcon + + + + CFBundleIcons~ipad + + CFBundlePrimaryIcon + + CFBundleIconFiles + + icon-small + icon-40 + icon-50 + icon-76 + icon-60 + icon + icon@2x + icon-72 + icon-72@2x + + UIPrerenderedIcon + + + + CFBundleIdentifier + us.okfoc.stoneisland + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 0.6.1 + CFBundleSignature + ???? + CFBundleURLTypes + + + CFBundleURLSchemes + + stoneisland + + + + CFBundleVersion + 0.6.1 + LSApplicationQueriesSchemes + + youtube + + LSRequiresIPhoneOS + + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + + NSLocationWhenInUseUsageDescription + + NSMainNibFile~ipad + + UIBackgroundModes + + remote-notification + + UIInterfaceOrientation + + UIInterfaceOrientationPortrait + + UILaunchImages + + + UILaunchImageMinimumOSVersion + 8.0 + UILaunchImageName + Default + UILaunchImageOrientation + Portrait + UILaunchImageSize + {320, 480} + + + UILaunchImageMinimumOSVersion + 8.0 + UILaunchImageName + Default + UILaunchImageOrientation + Landscape + UILaunchImageSize + {320, 480} + + + UILaunchImageMinimumOSVersion + 8.0 + UILaunchImageName + Default-568h + UILaunchImageOrientation + Portrait + UILaunchImageSize + {320, 568} + + + UILaunchImageMinimumOSVersion + 8.0 + UILaunchImageName + Default-568h + UILaunchImageOrientation + Landscape + UILaunchImageSize + {320, 568} + + + UILaunchImageMinimumOSVersion + 8.0 + UILaunchImageName + Default-667h + UILaunchImageOrientation + Portrait + UILaunchImageSize + {375, 667} + + + UILaunchImageMinimumOSVersion + 8.0 + UILaunchImageName + Default-667h + UILaunchImageOrientation + Landscape + UILaunchImageSize + {375, 667} + + + UILaunchImageMinimumOSVersion + 8.0 + UILaunchImageName + Default-736h + UILaunchImageOrientation + Portrait + UILaunchImageSize + {414, 736} + + + UILaunchImageMinimumOSVersion + 8.0 + UILaunchImageName + Default-Landscape-736h + UILaunchImageOrientation + Landscape + UILaunchImageSize + {414, 736} + + + UILaunchImageMinimumOSVersion + 8.0 + UILaunchImageName + Default-Portrait + UILaunchImageOrientation + Portrait + UILaunchImageSize + {768, 1024} + + + UILaunchImageMinimumOSVersion + 8.0 + UILaunchImageName + Default-Landscape + UILaunchImageOrientation + Landscape + UILaunchImageSize + {768, 1024} + + + UIRequiresFullScreen + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + + + \ No newline at end of file diff --git a/StoneIsland/platforms/ios/Stone Island/config.xml b/StoneIsland/platforms/ios/Stone Island/config.xml index 3f2ba682..4b1803b1 100755 --- a/StoneIsland/platforms/ios/Stone Island/config.xml +++ b/StoneIsland/platforms/ios/Stone Island/config.xml @@ -1,16 +1,5 @@ - - - - - - - - - - - - + @@ -49,9 +38,6 @@ - - - Stone Island Stone Island @@ -67,11 +53,20 @@ - + + + - - + + + + + + + + + diff --git a/StoneIsland/platforms/ios/www/css/nav.css b/StoneIsland/platforms/ios/www/css/nav.css index c84b5b30..30f1af18 100755 --- a/StoneIsland/platforms/ios/www/css/nav.css +++ b/StoneIsland/platforms/ios/www/css/nav.css @@ -412,6 +412,10 @@ padding-bottom:0px; width: 100%; overflow: hidden; } +#collection.single { + height: -webkit-calc(100% - 43px); + height: calc(100% - 43px); +} #story, #hub, #archive, .page, #closed { /* these things do not have a footer */ height: -webkit-calc(100% - 43px); diff --git a/StoneIsland/platforms/ios/www/css/products.css b/StoneIsland/platforms/ios/www/css/products.css index 52fe05ee..85e9f3b5 100755 --- a/StoneIsland/platforms/ios/www/css/products.css +++ b/StoneIsland/platforms/ios/www/css/products.css @@ -16,10 +16,10 @@ background: rgba(245,245,245,1.0); } -#collection .single .item { +#collection.single .item { max-width: 98vw; } -#collection .single .item img { +#collection.single .item img { width: 98vw; height: 126vw; } diff --git a/StoneIsland/platforms/ios/www/index.html b/StoneIsland/platforms/ios/www/index.html index 0d6cd6c6..768e3140 100755 --- a/StoneIsland/platforms/ios/www/index.html +++ b/StoneIsland/platforms/ios/www/index.html @@ -12,7 +12,7 @@ --> - + diff --git a/StoneIsland/platforms/ios/www/js/lib/blogs/BlogView.js b/StoneIsland/platforms/ios/www/js/lib/blogs/BlogView.js index 06e051cb..b7c80520 100755 --- a/StoneIsland/platforms/ios/www/js/lib/blogs/BlogView.js +++ b/StoneIsland/platforms/ios/www/js/lib/blogs/BlogView.js @@ -9,8 +9,8 @@ var BlogView = View.extend({ fetch: function(fn){ $.ajax({ method: "GET", -// url: sdk.env == 'test' ? '/db.json' : "http://stone.sup.land/db.json", - url: "http://stone.sup.land/db.json", +// url: sdk.env == 'test' ? '/db.json' : "https://stone.sup.land/db.json", + url: "https://stone.sup.land/db.json", success: function(data){ this.success(data) fn && fn() diff --git a/StoneIsland/platforms/ios/www/js/lib/blogs/HubView.js b/StoneIsland/platforms/ios/www/js/lib/blogs/HubView.js index e73e49a7..dd88839c 100755 --- a/StoneIsland/platforms/ios/www/js/lib/blogs/HubView.js +++ b/StoneIsland/platforms/ios/www/js/lib/blogs/HubView.js @@ -15,6 +15,7 @@ var HubView = ScrollableView.extend({ this.$content = this.$(".content") this.$loader = this.$(".loader") this.scroller = new IScroll('#hub', app.iscroll_options) + HubLoader.init(this) }, show: function(){ @@ -36,72 +37,80 @@ var HubView = ScrollableView.extend({ }).sort(function(a,b){ return a[0] > b[0] ? -1 : a[0] == b[0] ? 0 : 1 }).map(function(pair){ - console.log(pair[1]) + // console.log(pair[1]) return pair[1] }) this.$loader.hide() this.$content.empty() this.galleries = {} + HubLoader.add(this.data) + + this.deferScrollToTop() + }, + + append: function(row){ // id date subtitle body link store image[uri caption] - this.data.forEach(function(row){ - // console.log(row) - console.log(moment(row.date)) - var t = this.template.replace(/{{id}}/g, row.id) - .replace(/{{date}}/, moment(row.date).format("MM.DD.YYYY")) - .replace(/{{title}}/, row.title) - .replace(/{{subtitle}}/, row.subtitle) - .replace(/{{link}}/, row.link) - .replace(/{{body}}/, row.body.replace(/\n/g, "
")) - var $t = $(t) - if (row.store != "true") { - $t.find(".store").remove() - } - this.$content.append($t) - - if (row.image.length > 1) { - // image gallery - var $gallery = $(".gallery-" + row.id) - row.image.forEach(function(img){ - var el = document.createElement("div") - el.style.backgroundImage = "url(" + img.uri + ")" - el.className = "item" - $gallery.append(el) - }) - this.galleries[row.id] = new Flickity( ".gallery-" + row.id, { - selector: '.item', - cellAlign: 'center', - autoPlay: false, - freeScroll: false, - wrapAround: true, - imagesLoaded: true, - prevNextButtons: false, - pageDots: false, - contain: true, - draggable: true, - }) - } - else { - // single image + // console.log(row) + console.log(moment(row.date)) + var t = this.template.replace(/{{id}}/g, row.id) + .replace(/{{date}}/, moment(row.date).format("MM.DD.YYYY")) + .replace(/{{title}}/, row.title) + .replace(/{{subtitle}}/, row.subtitle) + .replace(/{{link}}/, row.link) + .replace(/{{body}}/, row.body.replace(/\n/g, "
")) + var $t = $(t) + if (row.store != "true") { + $t.find(".store").remove() + } + this.$content.append($t) + + if (row.image && row.image.length > 1) { + // image gallery + var $gallery = $(".gallery-" + row.id) + row.image.forEach(function(img){ var el = document.createElement("div") - el.style.backgroundImage = "url(" + row.image[0].uri + ")" + el.style.backgroundImage = "url(" + img.uri + ")" el.className = "item" - $(".gallery-" + row.id).append(el) - $(".gallery-" + row.id).data("row", row) - - // video, append play button - if (row.link.match(/youtube|youtu.be|vimeo/)) { - var play = document.createElement("div") - play.className = "play" - $(".gallery-" + row.id).append(play) - $(".gallery-" + row.id).addClass("gallery-video-post") - } - $t.find(".gallery-left").remove() - $t.find(".gallery-right").remove() + $gallery.append(el) + }) + this.galleries[row.id] = new Flickity( ".gallery-" + row.id, { + selector: '.item', + cellAlign: 'center', + autoPlay: false, + freeScroll: false, + wrapAround: true, + imagesLoaded: true, + prevNextButtons: false, + pageDots: false, + contain: true, + draggable: true, + }) + } + else { + // single image + var el = document.createElement("div") + if (row.image && row.image.length) { + el.style.backgroundImage = "url(" + row.image[0].uri + ")" } + el.className = "item" + $(".gallery-" + row.id).append(el) + $(".gallery-" + row.id).data("row", row) - }.bind(this)) - - this.deferScrollToTop() + // video, append play button + if (row.link.match(/youtube|youtu.be|vimeo/)) { + var play = document.createElement("div") + play.className = "play" + $(".gallery-" + row.id).append(play) + $(".gallery-" + row.id).addClass("gallery-video-post") + if (! row.image) { + var url = row.link + var ytid = (url.match(/v=([-_a-zA-Z0-9]{11})/i) || url.match(/youtu.be\/([-_a-zA-Z0-9]{11})/i) || url.match(/embed\/([-_a-zA-Z0-9]{11})/i))[1].split('&')[0]; + e.style.backgroundImage = "url(https://i.ytimg.com/vi/" + ytid + "/maxresdefault.jpg" + } + } + $t.find(".gallery-left").remove() + $t.find(".gallery-right").remove() + } }, store_link: function(){ @@ -127,4 +136,38 @@ var HubView = ScrollableView.extend({ window.plugins.socialsharing.share(title, null, null, "http://deeplink.me/www.stoneisland.com/hub" ) }, -}) \ No newline at end of file +}) + +var HubLoader = (function(){ + var queue, view, item, loader + var HubLoader = {} + var loader + HubLoader.init = function(v){ + view = v + } + HubLoader.add = function(items){ + queue = items + this.load() + } + HubLoader.load = function(){ + item = queue.shift() + if (! item) return + if (item.image && item.image.length) { + loader = new Loader (HubLoader.build) + images = item.image.map(function(img){ + return img.uri.replace("http:","https:") + }).filter(function(img){ + return img.uri + }) + loader.preloadImages(images) + } + else { + HubLoader.build() + } + } + HubLoader.build = function(){ + view.append(item) + setTimeout(HubLoader.load, 20) + } + return HubLoader +})() \ No newline at end of file diff --git a/StoneIsland/platforms/ios/www/js/lib/products/CollectionView.js b/StoneIsland/platforms/ios/www/js/lib/products/CollectionView.js index 3fd4a757..06146bad 100755 --- a/StoneIsland/platforms/ios/www/js/lib/products/CollectionView.js +++ b/StoneIsland/platforms/ios/www/js/lib/products/CollectionView.js @@ -33,7 +33,7 @@ var CollectionView = ScrollableView.extend({ if (sdk.env !== "test" && app.closed.storeIsClosed) { return app.closed.show() } - if (this.data && this.data.SearchResponseFull.Results.Items.length == 1) { + if (this.data && this.data.SearchResponseFull.Results.Items.length < 4) { app.footer.hide() } else { @@ -91,8 +91,8 @@ var CollectionView = ScrollableView.extend({ this.$content.empty() // DefaultCode10 // data.SearchResponseFull.Results.Items.length = 1 - var is_single_product = (data.SearchResponseFull.Results.Items.length == 1) - this.$content.toggleClass("single", is_single_product) + var is_single_product = (data.SearchResponseFull.Results.Items.length < 4) + this.$el.toggleClass("single", is_single_product) if (is_single_product) { console.log("IS SINGLE PRODUCT") diff --git a/StoneIsland/platforms/ios/www/js/lib/products/ProductView.js b/StoneIsland/platforms/ios/www/js/lib/products/ProductView.js index 72ff9da3..a97cba23 100755 --- a/StoneIsland/platforms/ios/www/js/lib/products/ProductView.js +++ b/StoneIsland/platforms/ios/www/js/lib/products/ProductView.js @@ -113,14 +113,12 @@ var ProductView = ScrollableView.extend({ var descriptions = this.get_descriptions(details) - this.gallery.populate( data['Code8'], details['Item']['ImageTypes'] ) - var name_partz = data['ModelNames'].split(' ') var num = name_partz.shift() var title = name_partz.join(' ') var type = title_case( data['MicroCategory'] ) var price = "$" + data['DiscountedPrice'] + ".00" - var body = descriptions['EditorialDescription'].replace(/
/g, "

") + var body = descriptions['EditorialDescription'].replace(/
/g, "

").replace(/(
)+$/, "") var default_color_id = this.populate_selectors(data, details) @@ -128,15 +126,19 @@ var ProductView = ScrollableView.extend({ this.$style.css("opacity", 0) this.$color.html("NOT AVAILABLE") this.$size.hide() + this.gallery.populate( data['Code8'], details['Item']['ImageTypes'] ) } else { this.$style.css("opacity", 1) + var color = this.colors[default_color_id] var color_label = color.label var sizes = this.find_sizes_for_color(default_color_id) var size = sizes[0] var size_label = this.sizes[size].label + this.gallery.populate( color.code, details['Item']['ImageTypes'] ) + this.color = color this.size = size diff --git a/StoneIsland/www/index.html b/StoneIsland/www/index.html index 0d6cd6c6..768e3140 100755 --- a/StoneIsland/www/index.html +++ b/StoneIsland/www/index.html @@ -12,7 +12,7 @@ --> - + -- cgit v1.2.3-70-g09d2