11 Commits

Author SHA1 Message Date
George
b92bf6fa32 i am awesome 2015-04-06 21:23:09 -04:00
Tommy Parnell
7cf711726b adjust doc 2015-03-28 15:03:50 -04:00
Tommy Parnell
fc8192ed5b more readme 2015-03-28 09:53:30 -04:00
Tommy Parnell
a4c63d1a1e link untapped profiles 2015-03-28 09:39:11 -04:00
Tommy Parnell
3454eb5f03 always copy out the css/js files 2015-03-28 09:29:30 -04:00
Tommy Parnell
ec8ad0f65f more readme 2015-03-28 09:12:59 -04:00
Tommy Parnell
0b09635aa7 fix docs 2015-03-28 09:11:27 -04:00
Tommy Parnell
4f46bc9129 hidden overflow the badges 2015-03-28 09:10:19 -04:00
Tommy Parnell
7b77eeacdc get all badges 2015-03-28 09:07:00 -04:00
Tommy Parnell
af9bd7ffc9 fix things 2015-03-28 08:34:27 -04:00
unknown
24ce3861b2 move content and symlink 2015-03-28 08:26:47 -04:00
16 changed files with 113 additions and 25 deletions

View File

@@ -7,6 +7,13 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UntappedWidgetGenerator", "
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UntappedWidgetGenerator.Web", "src\UntappedWidgetGenerator.Web\UntappedWidgetGenerator.Web.csproj", "{B4F9C525-5C56-440E-B4C2-972A33D7C8CD}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{AF0F0CDF-F957-4BB1-A30B-3357417FCB2B}"
ProjectSection(SolutionItems) = preProject
jquery.UntappedWidget.js = jquery.UntappedWidget.js
jquery.UntappedWidget.less = jquery.UntappedWidget.less
readme.md = readme.md
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU

View File

@@ -5,6 +5,18 @@
max-width: 1024px;
position: relative;
}
.profile a:link {
color: white;
}
.profile a:active {
color: white;
}
.profile a:hover {
color: white;
}
.profile a:visited {
color: white;
}
.profile .badges {
margin-right: 3px;
}
@@ -21,6 +33,7 @@
width: 100%;
background-color: rgba(0, 0, 0, 0.6);
height: 52px;
overflow: hidden;
}
.profile .user-info {
position: absolute;

View File

@@ -0,0 +1 @@
{"version":3,"sources":["jquery.UntappedWidget.less"],"names":[],"mappings":"AAOA;EACI,+BAAA;EACA,4BAAA;EACA,aAAA;EACA,iBAAA;EACA,kBAAA;;AALJ,QAMI,EAAC;EACG,YAAA;;AAPR,QASI,EAAC;EACG,YAAA;;AAVR,QAYI,EAAC;EACG,YAAA;;AAbR,QAeI,EAAC;EACG,YAAA;;AAhBR,QAkBI;EACI,iBAAA;;AAnBR,QAkBI,QAGI;EACI,WAAA;EACA,YAAA;EACA,mBAAA;;AAxBZ,QA4BI;EACI,kBAAA;EACA,SAAA;EACA,OAAA;EACA,QAAA;EACA,WAAA;EACA,oCAAA;EACA,YAAA;EACA,gBAAA;;AApCR,QAuCI;EACI,kBAAA;EACA,UAAA;EACA,YAAA;EACA,UAAA;;AA3CR,QAuCI,WAMI;EACI,qBAAA;EACA,mBAAA;;AA/CZ,QAuCI,WAWI;EACI,gBAAA;EACA,mBAAA;EACA,YAAA;EACA,aAAA;EACA,uBAAA;;AAvDZ,QAuCI,WAmBI;EACI,sBAAA;EACA,aAhEL,wCAgEK;EACA,YAAA;EACA,qBAAA","file":"jquery.UntappedWidget.css"}

View File

@@ -8,8 +8,8 @@
</div>\
</div>\
<div class=\"info\">\
<h1>"+ data.info + "</h1>\
<span class=\"username\">"+ data.username + "</span>\
<h1><a href=\"https://untappd.com/user/tparnell/" + data.username + "\">" + data.info + "</a></h1>\
<a class=\"username\" href=\"https://untappd.com/user/tparnell/" + data.username + "\">" + data.username + "</a>\
</div>\
</div>\
<div class=\"stats-bar\">\
@@ -20,14 +20,14 @@
}
var buildBadges = function (data) {
var buildBadges = function(data) {
var badges = "";
$.each(data.badges, function (index, value) {
$.each(data.badges, function(index, value) {
badges = badges + "<a href=\"" + value.linkUrl + "\" ><span><img src=\"" + value.imageUrl + "\" /></span></a>";
});
return badges;
}
};
$.fn.untappd = function (username) {
this.each(function () {

View File

@@ -1,4 +1,4 @@
@background-main: #FFCC00;
 @background-main: #FFCC00;
@background-social: rgba(0, 0, 0, 0.6);
@border: white;
@font: "ProximaNova", Helvetica Neue, Helvetica;
@@ -11,7 +11,18 @@
height: 240px;
max-width: 1024px;
position: relative;
a:link{
color: @fontColor
}
a:active{
color: @fontColor
}
a:hover{
color: @fontColor
}
a:visited{
color: @fontColor
}
.badges {
margin-right: 3px;
@@ -30,6 +41,7 @@
width: 100%;
background-color: rgba(0, 0, 0, 0.6);
height: 52px;
overflow: hidden;
}
.user-info {

1
jquery.UntappedWidget.min.css vendored Normal file
View File

@@ -0,0 +1 @@
.profile{background-position:center 0;background-repeat:no-repeat;height:240px;max-width:1024px;position:relative}.profile a:link{color:#fff}.profile a:active{color:#fff}.profile a:hover{color:#fff}.profile a:visited{color:#fff}.profile .badges{margin-right:3px}.profile .badges img{width:52px;height:52px;border-radius:27px}.profile .stats-bar{position:absolute;bottom:0;left:0;right:0;width:100%;background-color:rgba(0,0,0,.6);height:52px;overflow:hidden}.profile .user-info{position:absolute;left:20px;bottom:55px;z-index:2}.profile .user-info .user-avatar{display:inline-block;vertical-align:top}.profile .user-info .avatar-holder{overflow:hidden;border-radius:64px;width:124px;height:124px;border:4px solid #fff}.profile .user-info .info{padding:46px 0 0 16px;font-family:"ProximaNova",Helvetica Neue,Helvetica;color:#fff;display:inline-block}

2
jquery.UntappedWidget.min.js vendored Normal file
View File

@@ -0,0 +1,2 @@
(function(n){var t=function(n,t){return'<div class="profile" style="background-image: Url('+n.headerBackgroundUrl+')"><div class="user-info"> <div class="user-avatar"> <div class="avatar-holder"> <img src="'+n.avatarUrl+'" alt="User Avatar" /> <\/div> <\/div> <div class="info"> <h1><a href="https://untappd.com/user/tparnell/'+n.username+'">'+n.info+'<\/a><\/h1> <a class="username" href="https://untappd.com/user/tparnell/'+n.username+'">'+n.username+'<\/a> <\/div> <\/div> <div class="stats-bar"> <span class="badges">'+t+" <\/span> <\/div><\/div>"},i=function(t){var i="";return n.each(t.badges,function(n,t){i=i+'<a href="'+t.linkUrl+'" ><span><img src="'+t.imageUrl+'" /><\/span><\/a>'}),i};n.fn.untappd=function(r){this.each(function(){var u=this;n.get("http://untappdwidget.azurewebsites.net/"+r,function(r){n(u).html(t(r,i(r)))},"jsonp")})}})(jQuery);
//# sourceMappingURL=jquery.UntappedWidget.min.js.map

View File

@@ -0,0 +1,8 @@
{
"version":3,
"file":"jquery.UntappedWidget.min.js",
"lineCount":1,
"mappings":"CAAC,QAAS,CAACA,CAAD,CAAI,CAEV,IAAIC,EAAuB,QAAS,CAACC,CAAI,CAAEC,CAAP,CAAe,CAC/C,MAAO,oDAAwD,CAAED,CAAIE,oBAAqB,CAAE,8HAGxE,CAAEF,CAAIG,UAAW,CAAE,gJAIgB,CAAEH,CAAII,SAAU,CAAE,IAAM,CAAEJ,CAAIK,KAAM,CAAE,qFACxB,CAAEL,CAAII,SAAU,CAAE,IAAM,CAAEJ,CAAII,SAAU,CAAE,yFAIvF,CAAEH,CAAO,CAAE,oCAbY,EAoB/CK,EAAc,QAAQ,CAACN,CAAD,CAAO,CAC7B,IAAIC,EAAS,EAAE,CAKf,OAJAH,CAACS,KAAK,CAACP,CAAIC,OAAO,CAAE,QAAQ,CAACO,CAAK,CAAEC,CAAR,CAAe,CACvCR,CAAO,CAAEA,CAAO,CAAE,WAAa,CAAEQ,CAAKC,QAAS,CAAE,qBAAwB,CAAED,CAAKE,SAAU,CAAE,mBADrD,CAArC,CAEJ,CAEKV,CANsB,C,CASjCH,CAACc,GAAGC,QAAS,CAAEC,QAAS,CAACV,CAAD,CAAW,CAC/B,IAAIG,KAAK,CAAC,QAAS,CAAA,CAAG,CAClB,IAAIQ,EAAO,IAAI,CACfjB,CAACkB,IAAI,CAAC,yCAA0C,CAAEZ,CAAQ,CAAE,QAAQ,CAACJ,CAAD,CAAO,CAAEF,CAAC,CAACiB,CAAD,CAAME,KAAK,CAAClB,CAAoB,CAACC,CAAI,CAAEM,CAAW,CAACN,CAAD,CAAlB,CAArB,CAAd,CAAgE,CAAE,OAAxI,CAFa,CAAb,CADsB,CA/BzB,EAuCZ,CAACkB,MAAD,CAAQ",
"sources":["jquery.UntappedWidget.js"],
"names":["$","buildProfileTemplate","data","badges","headerBackgroundUrl","avatarUrl","username","info","buildBadges","each","index","value","linkUrl","imageUrl","fn","untappd","$.fn.untappd","that","get","html","jQuery"]
}

View File

@@ -1,7 +1,23 @@
[![Build status](https://ci.appveyor.com/api/projects/status/3pocqbscj75t4nif/branch/master?svg=true)](https://ci.appveyor.com/project/tparnell8/untappedwidget/branch/master)
This provides a simple embeddable widget for your [Untappd](https://untappd.com) profile. Server portions [hosted on azure](http://untappdwidget.azurewebsites.net/)
This provides a simple embeddable widget of your [Untappd](https://untappd.com) profile. You may view a demo of this [here](http://untappdwidget.azurewebsites.net/)
## How do I use this?
Simply add the css and js files at the root of this project to your website. Then call:
`$("#Target").untappd("YourUsername");`
We host the css at `http://untappdwidget.azurewebsites.net/Content/jquery.UntappedWidget.min.css`
We host the js at `http://untappdwidget.azurewebsites.net/Scripts/jquery.UntappedWidget.min.js`
## How do I contribute?
Submit pull requests
## Todo
* Make a build time minifier
* Push to Bower?
* Move the css/js into a cdn of some kind?
* Make this look better on a phone

View File

@@ -1 +0,0 @@
{"version":3,"sources":["jquery.UntappedWidget.less"],"names":[],"mappings":"AAOA;EACI,+BAAA;EACA,4BAAA;EACA,aAAA;EACA,iBAAA;EACA,kBAAA;;AALJ,QAOI;EACI,iBAAA;;AARR,QAOI,QAEI;EACI,WAAA;EACA,YAAA;EACA,mBAAA;;AAZZ,QAiBI;EACI,kBAAA;EACA,SAAA;EACA,OAAA;EACA,QAAA;EACA,WAAA;EACA,oCAAA;EACA,YAAA;;AAxBR,QA2BI;EACI,kBAAA;EACA,UAAA;EACA,YAAA;EACA,UAAA;;AA/BR,QA2BI,WAMI;EACI,qBAAA;EACA,mBAAA;;AAnCZ,QA2BI,WAWI;EACI,gBAAA;EACA,mBAAA;EACA,YAAA;EACA,aAAA;EACA,uBAAA;;AA3CZ,QA2BI,WAmBI;EACI,sBAAA;EACA,aApDL,wCAoDK;EACA,YAAA;EACA,qBAAA","file":"jquery.UntappedWidget.css"}

View File

@@ -1 +0,0 @@
.profile{background-position:center 0;background-repeat:no-repeat;height:240px;max-width:1024px;position:relative}.profile .badges{margin-right:3px}.profile .badges img{width:52px;height:52px;border-radius:27px}.profile .stats-bar{position:absolute;bottom:0;left:0;right:0;width:100%;background-color:rgba(0,0,0,.6);height:52px}.profile .user-info{position:absolute;left:20px;bottom:55px;z-index:2}.profile .user-info .user-avatar{display:inline-block;vertical-align:top}.profile .user-info .avatar-holder{overflow:hidden;border-radius:64px;width:124px;height:124px;border:4px solid #fff}.profile .user-info .info{padding:46px 0 0 16px;font-family:"ProximaNova",Helvetica Neue,Helvetica;color:#fff;display:inline-block}

View File

@@ -80,16 +80,26 @@
<Reference Include="System.Xml.Linq" />
</ItemGroup>
<ItemGroup>
<Content Include="..\..\jquery.UntappedWidget.css">
<Link>Content\jquery.UntappedWidget.css</Link>
<DependentUpon>jquery.UntappedWidget.less</DependentUpon>
</Content>
<Content Include="..\..\jquery.UntappedWidget.js">
<Link>Scripts\jquery.UntappedWidget.js</Link>
</Content>
<Content Include="..\..\jquery.UntappedWidget.min.css">
<Link>Content\jquery.UntappedWidget.min.css</Link>
<DependentUpon>jquery.UntappedWidget.css</DependentUpon>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="..\..\jquery.UntappedWidget.min.js">
<Link>Scripts\jquery.UntappedWidget.min.js</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Content\bootstrap-theme.css" />
<Content Include="Content\bootstrap-theme.min.css" />
<Content Include="Content\bootstrap.css" />
<Content Include="Content\bootstrap.min.css" />
<Content Include="Content\jquery.UntappedWidget.css">
<DependentUpon>jquery.UntappedWidget.less</DependentUpon>
</Content>
<Content Include="Content\jquery.UntappedWidget.min.css">
<DependentUpon>jquery.UntappedWidget.css</DependentUpon>
</Content>
<Content Include="Content\Site.css" />
<Content Include="fonts\glyphicons-halflings-regular.svg" />
<Content Include="fonts\glyphicons-halflings-regular.woff2" />
@@ -98,15 +108,25 @@
<Content Include="fonts\glyphicons-halflings-regular.eot" />
<Content Include="Content\bootstrap-theme.css.map" />
<Content Include="Content\bootstrap.css.map" />
<Content Include="Content\jquery.UntappedWidget.css.map">
<Content Include="..\..\jquery.UntappedWidget.less">
<Link>Content\jquery.UntappedWidget.less</Link>
</Content>
<Content Include="..\..\jquery.UntappedWidget.min.js.map">
<Link>Scripts\jquery.UntappedWidget.min.js.map</Link>
<DependentUpon>jquery.UntappedWidget.min.js</DependentUpon>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="..\..\jquery.UntappedWidget.css.map">
<Link>Content\jquery.UntappedWidget.css.map</Link>
<DependentUpon>jquery.UntappedWidget.css</DependentUpon>
</Content>
<None Include="Properties\PublishProfiles\f.pubxml" />
<None Include="Properties\PublishProfiles\untappdwidget.pubxml" />
<None Include="Scripts\jquery-1.9.1.intellisense.js" />
<Content Include="Scripts\bootstrap.js" />
<Content Include="Scripts\bootstrap.min.js" />
<Content Include="Scripts\jquery-1.9.1.js" />
<Content Include="Scripts\jquery-1.9.1.min.js" />
<Content Include="Scripts\jquery.UntappedWidget.js" />
<Content Include="Web.config" />
</ItemGroup>
<ItemGroup>
@@ -119,7 +139,6 @@
<Content Include="Views\Index\Index.cshtml" />
<Content Include="packages.config" />
<Content Include="Views\Index\Badge.cshtml" />
<Content Include="Content\jquery.UntappedWidget.less" />
<Content Include="Views\Shared\_Layout.cshtml" />
<Content Include="Scripts\jquery-1.9.1.min.map" />
<Content Include="Views\Index\Profile.cshtml" />
@@ -169,10 +188,14 @@ xcopy /s /y /R "$(SolutionDir)packages\Nancy.Viewengines.Razor.1.1\BuildProvider
xcopy /s /y /R "$(SolutionDir)packages\Nancy.Viewengines.Razor.1.1\lib\Net40\Nancy.ViewEngines.Razor.dll" "$(ProjectDir)bin\"
)</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<!--
<Target Name="BeforeBuild">
<ItemGroup>
<Content Include="..\..\jquery.UntappedWidget.js" />
</ItemGroup>
</Target>
To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="AfterBuild">
</Target>
-->

View File

@@ -2,6 +2,12 @@
@{
Layout = "Views/Shared/_Layout.cshtml";
}
<div class="row" style="margin-top: 10px">
<div class="well">
Simply embed your Untappd profile as a widget into your own website. See docs on <a href="https://github.com/tparnell8/UntappedWidget">Github</a>
</div>
</div>
<div id="target"></div>
@section styles{
<link rel="stylesheet" href="~/Content/jquery.UntappedWidget.min.css" />

View File

@@ -4,7 +4,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>@ViewBag.Title - My ASP.NET Application</title>
<title>Untappd Widget</title>
<link rel="stylesheet" href="~/Content/bootstrap.min.css" />
<link rel="stylesheet" href="~/Content/bootstrap-theme.min.css"/>
<link rel="stylesheet" href="~/Content/Site.css" />
@@ -19,6 +19,7 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/">Untappd Widget</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
@@ -28,10 +29,9 @@
</div>
<div class="container body-content">
<h1>Awesome</h1>
@RenderBody()
<footer>
<p>&copy; @DateTime.Now.Year - My ASP.NET Application</p>
</footer>
</div>

View File

@@ -38,7 +38,7 @@ namespace UntappedWidgetGenerator
dom[".profile_header"].Css("background-image").ToLower().TrimStart("url".ToCharArray()).TrimStart('(').TrimEnd(')').Trim('\''),
Info = dom[".info h1"].Text(),
Username = dom[".username"].Text(),
Badges = badges.OrderBy(a=>Guid.NewGuid()).Take(17).ToList()
Badges = badges.OrderBy(a=>Guid.NewGuid()).ToList()
};
}

1
tst.txt Normal file
View File

@@ -0,0 +1 @@
jkl;fdk