Fixes some pages, links, presentation,

restores some routes.

* p8-av4.s.jpg:
* star-939235_1280.s.jpg:
* star-939235_1280.xxs.jpg: a smaller background

* Makefile: restores the server reload after rsync call

* style.css: adds animation

* AdminController.cs: Fixes the call to Notify

* Global.asax.cs: restores a dropped route

* App.master: Drops script references to jQuery-ui and Prettify from
the master page. They are heavy.

* parallax.js: specifies the capture to false at calling the event
  listener registration

* UserPost.aspx: Fixes this page

* Index.aspx: adds the `panel` class to embed those default home page
  links

* Web.csproj: dropping the imported parallax.js script

* animated-overlay.gif: may be used in a futur work :-)
vnext
Paul Schneider 9 years ago
parent 4c12fed2d0
commit 6106c6cdda
16 changed files with 184 additions and 485 deletions

@ -1,3 +1,7 @@
2015-10-24 Paul Schneider <paul@pschneider.fr>
* Makefile: restores the server reload after rsync call
2015-10-09 Paul Schneider <paul@pschneider.fr>
* Makefile: reloads config after each rsync call

@ -38,6 +38,7 @@ rsync_% : DESTDIR = $(DESTDIR_$@)
rsync_% : deploy
echo "!Deploying to $(HOST)!"
$(RSYNCCMD) dist/web/$(CONFIG)/ root@$(HOST):$(DESTDIR)
ssh root@$(HOST) "service apache2 reload"
build:
xbuild /p:Configuration=$(CONFIG) /t:Build Yavsc.sln

@ -51,6 +51,7 @@ input, textarea, checkbox {
.blogbanner { float: left; top:0; }
.subtitle { font-size:small; font-style: italic; }
header {
transition: margin 2s, padding 2s, background 2s;
padding: 0;
margin: 0;
padding-top: 201px;
@ -59,11 +60,13 @@ header {
background: url("/images/star-939235_1280.jpg") 0 0 no-repeat fixed;
}
header h1, header a {
transition:padding 2s;
background-color: rgba(0,0,0,.5);
margin:0; padding:1em;
}
nav {
transition: margin 2s, padding 2s, background 2s;
margin: 2em;
padding: 2em;
display: block;
@ -73,6 +76,7 @@ nav {
}
main {
transition: margin 2s, padding 2s, background 2s;
margin: 2em;
padding: 2em;
display: block;
@ -81,6 +85,7 @@ main {
}
footer {
transition: margin 2s, padding 2s, background 2s;
background: url("/images/helix-nebula-1400x1400.s.jpg") 50% 90% repeat fixed ;
margin: 0;
margin-top: 2em;
@ -156,7 +161,9 @@ textarea.fullwidth { min-height:10em; }
display:inline;
bottom:0;
}
.panel { display:inline-block; }
.panel {
display:inline-block;
}
.panel,.bshpanel, aside {
background-color: rgba(20,20,20,.8);
@ -197,9 +204,6 @@ content: ")";
font-family: 'Arial', cursive;
padding: 1em;
}
a:visited {
color: #E0E0E0;
}
label {
font-size: medium;
}
@ -269,10 +273,14 @@ input, select, textarea {
font-family: 'Arial', cursive;
}
.actionlink:hover, fa:hover, .menuitem:hover, a:hover {
a:hover {
background-color:rgba(30,0,124,0.9);
border: solid green 1px;
}
a:active {
background-color:rgba(124,0,32,0.9);
}
input:hover, textarea:hover {
color: white;
background-color:rgba(64,64,64,0.8);
@ -323,10 +331,11 @@ input, select, textarea {
@media all and (max-width: 640px) {
header {
padding-bottom:1em;
background: url("/images/star-939235_1280.s.jpg") 0 0 no-repeat fixed;
}
#avatar {
margin:.5em;
margin:.5em;
}
header h1, header a , .actionlink, .menuitem, a { padding:.5em;}
@ -339,6 +348,7 @@ header h1, header a , .actionlink, .menuitem, a { padding:.5em;}
main {
margin: 1em;
padding: 1em;
background: url("/images/p8-av4.s.jpg") 50% 20em no-repeat fixed ;
}
footer {
background: url("/images/helix-nebula-1400x1400.s.jpg") 50% 90% repeat fixed ;

@ -1,3 +1,31 @@
2015-10-24 Paul Schneider <paul@pschneider.fr>
* p8-av4.s.jpg:
* star-939235_1280.s.jpg:
* star-939235_1280.xxs.jpg: a smaller background
* style.css: adds animation
* AdminController.cs: Fixes the call to Notify
* Global.asax.cs: restores a dropped route
* App.master: Drops script references to jQuery-ui and
Prettify from
the master page. They are heavy.
* parallax.js: specifies the capture to false at calling the
event listener registration
* UserPost.aspx: Fixes this page
* Index.aspx: adds the `panel` class to embed those default
home page links
* Web.csproj: dropping the imported parallax.js script
* animated-overlay.gif: may be used in a futur work :-)
2015-10-23 Paul Schneider <paul@pschneider.fr>
* AdminController.cs: Notification when Admin group is created

@ -27,7 +27,7 @@ namespace Yavsc.Controllers
{
if (!Roles.RoleExists (adminRoleName)) {
Roles.CreateRole (adminRoleName);
YavscHelpers.Notify (adminRoleName + " " + LocalizedText.role_created);
YavscHelpers.Notify (ViewData, adminRoleName + " " + LocalizedText.role_created);
}
return View ();

@ -75,6 +75,12 @@ namespace Yavsc
new { controller = "Blogs", action = "Index",
postid=UrlParameter.Optional }
);
routes.MapRoute (
"BackCompat",
"{controller}/{action}/{user}/{title}",
new { controller = "Home", action = "Index", user = UrlParameter.Optional, title = UrlParameter.Optional }
);
routes.MapRoute (
"Default",
"{controller}/{action}/{id}",

@ -15,9 +15,9 @@
<link rel="stylesheet" href="<%=Url.Content("~/App_Themes/doxy.css")%>" />
<link rel="icon" type="image/png" href="/favicon.png?v=3" />
<script src="<%=Url.Content("~/Scripts/jquery-2.1.4.min.js")%>"></script>
<script src="<%=Url.Content("~/Scripts/jquery-ui-1.11.4.js")%>"></script>
<script src="<%=Url.Content("~/Scripts/parralax.js")%>"></script>
<script src="<%=Url.Content("~/Scripts/Prettify/run_prettify.js")%>"></script>
<!--<script src="<%=Url.Content("~/Scripts/jquery-ui-1.11.4.min.js")%>"></script>-->
<script src="<%=Url.Content("~/Scripts/parallax.js")%>"></script>
<!--<script src="<%=Url.Content("~/Scripts/Prettify/run_prettify.js")%>"></script>-->
<script type="text/javascript">
var apiBaseUrl = '<%=Url.Content(Yavsc.WebApiConfig.UrlPrefixRelative)%>';
</script>
@ -29,9 +29,9 @@ var apiBaseUrl = '<%=Url.Content(Yavsc.WebApiConfig.UrlPrefixRelative)%>';
<body>
<header data-type="background" data-speed="8" >
<asp:ContentPlaceHolder ID="overHeaderOne" runat="server">
<h1><a href="<%= Url.Content("~/") %>">
<h1><a href="<%= Url.RouteUrl("Default") %>">
<%=ViewState["orgtitle"]%></a>
- <a href="<%= Url.RouteUrl("Default", new {controller="Home" }) %>"><%= YavscHelpers.SiteName %></a>
- <a href="<%= Url.RouteUrl("Default", new {controller = "Home" , action = "Index" }) %>"><%= YavscHelpers.SiteName %></a>
</h1>
</asp:ContentPlaceHolder>
<asp:ContentPlaceHolder ID="header" runat="server"></asp:ContentPlaceHolder>
@ -56,17 +56,17 @@ Yavsc.notice('<%=note%>');
<img src="<%=Url.AvatarUrl(HttpContext.Current.User.Identity.Name)%>" alt="vos billets" class="iconsmall" />
<span class="hint">Vos billets</span>
</a>
<a href="<%= Url.RouteUrl("Default", new { controller = "Account", action = "Profile", id = HttpContext.Current.User.Identity.Name} ) %>" accesskey="P" class="menuitem">
<i class="fa fa-user"><%= HttpContext.Current.User.Identity.Name %>
<span class="hint"> &Eacute;dition de votre profile </span></i>
<a href="<%= Url.RouteUrl("Default", new { controller = "Account", action = "Profile", id = HttpContext.Current.User.Identity.Name} ) %>" accesskey="P" class="menuitem fa fa-user">
<%= HttpContext.Current.User.Identity.Name %>
<span class="hint"> &Eacute;dition de votre profile </span>
</a>
<a href="/Blogs/Post" accesskey="P" class="menuitem">
<i class="fa fa-pencil"><u>P</u>oster
<span class="hint">&Eacute;dition d'un nouveau billet </span></i>
<a href="/Blogs/Post" accesskey="P" class="menuitem fa fa-pencil">
<u>P</u>oster
<span class="hint">&Eacute;dition d'un nouveau billet </span>
</a>
<a href="<%= Url.RouteUrl("Default", new { controller = "Account", action = "Logout", returnUrl=Request.Url.PathAndQuery}) %>" accesskey = "C" class="menuitem">
<i class="fa fa-sign-out"><%=Html.Translate("Logout")%></i></a>
<a href="<%= Url.RouteUrl("Default", new { controller = "Account", action = "Logout", returnUrl=Request.Url.PathAndQuery}) %>" accesskey = "C" class="menuitem fa fa-sign-out">
<%=Html.Translate("Logout")%></a>
<% } %>
</nav>
<main data-type="background" data-speed="10" data-emheight="10" data-posx="0" data-posy="22" >
@ -87,11 +87,6 @@ Yavsc.notice('<%=note%>');
<a class="thanks" href="<%=link.Url%>"><%= link.Text %></a>
<% }} %>
<%= Html.ActionLink("Formulaire de contact","Contact","Home") %>
<script src="https://apis.google.com/js/platform.js" defer>
{lang: 'fr'}
</script>
<div id="gspacer" class="control"><div class="g-plusone" data-annotation="inline" data-width="170"></div>
</div>
</footer><div class="modal"></div>
</body>
</html>

@ -1,358 +1,94 @@
/*!
* parallax.js v1.3.1 (http://pixelcog.github.io/parallax.js/)
* @copyright 2015 PixelCog, Inc.
* @license MIT (https://github.com/pixelcog/parallax.js/blob/master/LICENSE)
*/
;(function ( $, window, document, undefined ) {
// Polyfill for requestAnimationFrame
// via: https://gist.github.com/paulirish/1579671
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame'];
window.cancelAnimationFrame = window[vendors[x]+'CancelAnimationFrame']
|| window[vendors[x]+'CancelRequestAnimationFrame'];
}
if (!window.requestAnimationFrame)
window.requestAnimationFrame = function(callback) {
var currTime = new Date().getTime();
var timeToCall = Math.max(0, 16 - (currTime - lastTime));
var id = window.setTimeout(function() { callback(currTime + timeToCall); },
timeToCall);
lastTime = currTime + timeToCall;
return id;
};
if (!window.cancelAnimationFrame)
window.cancelAnimationFrame = function(id) {
clearTimeout(id);
};
}());
// Parallax Constructor
function Parallax(element, options) {
var self = this;
if (typeof options == 'object') {
delete options.refresh;
delete options.render;
$.extend(this, options);
}
this.$element = $(element);
if (!this.imageSrc && this.$element.is('img')) {
this.imageSrc = this.$element.attr('src');
}
var positions = (this.position + '').toLowerCase().match(/\S+/g) || [];
if (positions.length < 1) {
positions.push('center');
}
if (positions.length == 1) {
positions.push(positions[0]);
}
if (positions[0] == 'top' || positions[0] == 'bottom' || positions[1] == 'left' || positions[1] == 'right') {
positions = [positions[1], positions[0]];
}
if (this.positionX != undefined) positions[0] = this.positionX.toLowerCase();
if (this.positionY != undefined) positions[1] = this.positionY.toLowerCase();
self.positionX = positions[0];
self.positionY = positions[1];
if (this.positionX != 'left' && this.positionX != 'right') {
if (isNaN(parseInt(this.positionX))) {
this.positionX = 'center';
} else {
this.positionX = parseInt(this.positionX);
}
}
if (this.positionY != 'top' && this.positionY != 'bottom') {
if (isNaN(parseInt(this.positionY))) {
this.positionY = 'center';
} else {
this.positionY = parseInt(this.positionY);
}
}
this.position =
this.positionX + (isNaN(this.positionX)? '' : 'px') + ' ' +
this.positionY + (isNaN(this.positionY)? '' : 'px');
if (navigator.userAgent.match(/(iPod|iPhone|iPad)/)) {
if (this.iosFix && !this.$element.is('img')) {
this.$element.css({
backgroundImage: 'url(' + this.imageSrc + ')',
backgroundSize: 'cover',
backgroundPosition: this.position
});
}
return this;
}
if (navigator.userAgent.match(/(Android)/)) {
if (this.androidFix && !this.$element.is('img')) {
this.$element.css({
backgroundImage: 'url(' + this.imageSrc + ')',
backgroundSize: 'cover',
backgroundPosition: this.position
});
}
return this;
}
this.$mirror = $('<div />').prependTo('body');
this.$slider = $('<img />').prependTo(this.$mirror);
this.$mirror.addClass('parallax-mirror').css({
visibility: 'hidden',
zIndex: this.zIndex,
position: 'fixed',
top: 0,
left: 0,
overflow: 'hidden'
});
this.$slider.addClass('parallax-slider').one('load', function() {
if (!self.naturalHeight || !self.naturalWidth) {
self.naturalHeight = this.naturalHeight || this.height || 1;
self.naturalWidth = this.naturalWidth || this.width || 1;
}
self.aspectRatio = self.naturalWidth / self.naturalHeight;
Parallax.isSetup || Parallax.setup();
Parallax.sliders.push(self);
Parallax.isFresh = false;
Parallax.requestRender();
});
this.$slider[0].src = this.imageSrc;
if (this.naturalHeight && this.naturalWidth || this.$slider[0].complete) {
this.$slider.trigger('load');
}
};
// Parallax Instance Methods
$.extend(Parallax.prototype, {
speed: 0.2,
bleed: 0,
zIndex: -100,
iosFix: true,
androidFix: true,
position: 'center',
overScrollFix: false,
refresh: function() {
this.boxWidth = this.$element.outerWidth();
this.boxHeight = this.$element.outerHeight() + this.bleed * 2;
this.boxOffsetTop = this.$element.offset().top - this.bleed;
this.boxOffsetLeft = this.$element.offset().left;
this.boxOffsetBottom = this.boxOffsetTop + this.boxHeight;
var winHeight = Parallax.winHeight;
var docHeight = Parallax.docHeight;
var maxOffset = Math.min(this.boxOffsetTop, docHeight - winHeight);
var minOffset = Math.max(this.boxOffsetTop + this.boxHeight - winHeight, 0);
var imageHeightMin = this.boxHeight + (maxOffset - minOffset) * (1 - this.speed) | 0;
var imageOffsetMin = (this.boxOffsetTop - maxOffset) * (1 - this.speed) | 0;
if (imageHeightMin * this.aspectRatio >= this.boxWidth) {
this.imageWidth = imageHeightMin * this.aspectRatio | 0;
this.imageHeight = imageHeightMin;
this.offsetBaseTop = imageOffsetMin;
var margin = this.imageWidth - this.boxWidth;
if (this.positionX == 'left') {
this.offsetLeft = 0;
} else if (this.positionX == 'right') {
this.offsetLeft = - margin;
} else if (!isNaN(this.positionX)) {
this.offsetLeft = Math.max(this.positionX, - margin);
} else {
this.offsetLeft = - margin / 2 | 0;
}
} else {
this.imageWidth = this.boxWidth;
this.imageHeight = this.boxWidth / this.aspectRatio | 0;
this.offsetLeft = 0;
var margin = this.imageHeight - imageHeightMin;
if (this.positionY == 'top') {
this.offsetBaseTop = imageOffsetMin;
} else if (this.positionY == 'bottom') {
this.offsetBaseTop = imageOffsetMin - margin;
} else if (!isNaN(this.positionY)) {
this.offsetBaseTop = imageOffsetMin + Math.max(this.positionY, - margin);
} else {
this.offsetBaseTop = imageOffsetMin - margin / 2 | 0;
}
}
},
render: function() {
var scrollTop = Parallax.scrollTop;
var scrollLeft = Parallax.scrollLeft;
var overScroll = this.overScrollFix ? Parallax.overScroll : 0;
var scrollBottom = scrollTop + Parallax.winHeight;
if (this.boxOffsetBottom > scrollTop && this.boxOffsetTop < scrollBottom) {
this.visibility = 'visible';
} else {
this.visibility = 'hidden';
}
this.mirrorTop = this.boxOffsetTop - scrollTop;
this.mirrorLeft = this.boxOffsetLeft - scrollLeft;
this.offsetTop = this.offsetBaseTop - this.mirrorTop * (1 - this.speed);
this.$mirror.css({
transform: 'translate3d(0px, 0px, 0px)',
visibility: this.visibility,
top: this.mirrorTop - overScroll,
left: this.mirrorLeft,
height: this.boxHeight,
width: this.boxWidth
});
this.$slider.css({
transform: 'translate3d(0px, 0px, 0px)',
position: 'absolute',
top: this.offsetTop,
left: this.offsetLeft,
height: this.imageHeight,
width: this.imageWidth,
maxWidth: 'none'
});
}
});
// Parallax Static Methods
$.extend(Parallax, {
scrollTop: 0,
scrollLeft: 0,
winHeight: 0,
winWidth: 0,
docHeight: 1 << 30,
docWidth: 1 << 30,
sliders: [],
isReady: false,
isFresh: false,
isBusy: false,
setup: function() {
if (this.isReady) return;
var $doc = $(document), $win = $(window);
$win.on('scroll.px.parallax load.px.parallax', function() {
var scrollTopMax = Parallax.docHeight - Parallax.winHeight;
var scrollLeftMax = Parallax.docWidth - Parallax.winWidth;
Parallax.scrollTop = Math.max(0, Math.min(scrollTopMax, $win.scrollTop()));
Parallax.scrollLeft = Math.max(0, Math.min(scrollLeftMax, $win.scrollLeft()));
Parallax.overScroll = Math.max($win.scrollTop() - scrollTopMax, Math.min($win.scrollTop(), 0));
Parallax.requestRender();
})
.on('resize.px.parallax load.px.parallax', function() {
Parallax.winHeight = $win.height();
Parallax.winWidth = $win.width();
Parallax.docHeight = $doc.height();
Parallax.docWidth = $doc.width();
Parallax.isFresh = false;
Parallax.requestRender();
});
this.isReady = true;
},
configure: function(options) {
if (typeof options == 'object') {
delete options.refresh;
delete options.render;
$.extend(this.prototype, options);
}
},
refresh: function() {
$.each(this.sliders, function(){ this.refresh() });
this.isFresh = true;
},
render: function() {
this.isFresh || this.refresh();
$.each(this.sliders, function(){ this.render() });
},
requestRender: function() {
var self = this;
if (!this.isBusy) {
this.isBusy = true;
window.requestAnimationFrame(function() {
self.render();
self.isBusy = false;
});
}
}
});
// Parallax Plugin Definition
function Plugin(option) {
return this.each(function () {
var $this = $(this);
var options = typeof option == 'object' && option;
if (this == window || this == document || $this.is('body')) {
Parallax.configure(options);
}
else if (!$this.data('px.parallax')) {
options = $.extend({}, $this.data(), options);
$this.data('px.parallax', new Parallax(this, options));
}
if (typeof option == 'string') {
Parallax[option]();
}
})
};
var old = $.fn.parallax;
$.fn.parallax = Plugin;
$.fn.parallax.Constructor = Parallax;
// Parallax No Conflict
$.fn.parallax.noConflict = function () {
$.fn.parallax = old;
return this;
};
// Parallax Data-API
$(document).on('ready.px.parallax.data-api', function () {
$('[data-parallax="scroll"]').parallax();
});
}(jQuery, window, document));
//
// parralax.js
//
// Author:
// Paul Schneider <paul@pschneider.fr>
//
// Copyright (c) 2015 GNU GPL
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
$(document).ready(function(){
var $window = $(window);
var onPos = function (bgobj,dx,dy) {
x=$window.scrollLeft()+dx;
y=$window.scrollTop()+dy;
var speed = bgobj.data('speed');
var xPos = bgobj.attr('orgbgpx') - Math.round( x / speed);
var yPos = bgobj.attr('orgbgpy') - Math.round( y / speed);
// Put together our final background position
var coords = '' + xPos + bgobj.attr('orgbgpxu') + yPos + bgobj.attr('orgbgpyu');
// Move the background
bgobj.css({ backgroundPosition: coords });
};
var tiltLR=0;
var titleFB=0;
$('[data-type="background"]').each(function(){
var $bgobj = $(this); // assigning the object
// get the initial background position, assumes a "X% Yem" ?
var orgpos = $bgobj.css('backgroundPosition');
var bgpos = orgpos.split(" ");
var bgposx = bgpos[0];
var bgposy = bgpos[1];
if (/%$/.test(bgposx)){
bgposx = bgposx.substr(0,bgposx.length-1);
$bgobj.attr('orgbgpxu','% ');
}
else if (/em$/.test(bgposx)){
bgposx = bgposx.substr(0,bgposx.length-2);
$bgobj.attr('orgbgpxu','em ');
}
else if (/px$/.test(bgposx)){
bgposx = bgposx.substr(0,bgposx.length-2);
$bgobj.attr('orgbgpxu','px ');
}
else { $bgobj.attr('orgbgpxu','px '); }
if (/%$/.test(bgposy)){
bgposy = bgposy.substr(0,bgposy.length-1);
$bgobj.attr('orgbgpyu','% ');
}
else if (/em$/.test(bgposy)){
bgposy = bgposy.substr(0,bgposy.length-2);
$bgobj.attr('orgbgpyu','em ');
}
else if (/px$/.test(bgposy)){
bgposy = bgposy.substr(0,bgposy.length-2);
$bgobj.attr('orgbgpyu','px ');
}
else { $bgobj.attr('orgbgpyu','px '); }
$bgobj.attr('orgbgpx',parseInt(bgposx));
$bgobj.attr('orgbgpy',parseInt(bgposy));
$(window).scroll(function() {
onPos($bgobj,tiltLR,titleFB);
});
if (window.DeviceOrientationEvent) {
window.addEventListener('deviceorientation', function(event) {
tiltLR = event.gamma;
titleFB = event.beta;
onPos($bgobj,tiltLR,titleFB);
},false);
$(window).mousemove(function(e) {
tiltLR = e.pageX;
titleFB = e.pageY;
onPos($bgobj,tiltLR,titleFB);
});
}
});
});

@ -1,99 +0,0 @@
//
// parralax.js
//
// Author:
// Paul Schneider <paul@pschneider.fr>
//
// Copyright (c) 2015 GNU GPL
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
$(document).ready(function(){
var $window = $(window);
var onPos = function (bgobj,dx,dy) {
x=$window.scrollLeft()+dx;
y=$window.scrollTop()+dy;
var speed = bgobj.data('speed');
var xPos = bgobj.attr('orgbgpx') - Math.round( x / speed);
var yPos = bgobj.attr('orgbgpy') - Math.round( y / speed);
// Put together our final background position
var coords = '' + xPos + bgobj.attr('orgbgpxu') + yPos + bgobj.attr('orgbgpyu');
// Move the background
bgobj.css({ backgroundPosition: coords });
};
var tiltLR=0;
var titleFB=0;
$('[data-type="background"]').each(function(){
var $bgobj = $(this); // assigning the object
// get the initial background position, assumes a "X% Yem" ?
var orgpos = $bgobj.css('backgroundPosition');
var bgpos = orgpos.split(" ");
var bgposx = bgpos[0];
var bgposy = bgpos[1];
if (/%$/.test(bgposx)){
bgposx = bgposx.substr(0,bgposx.length-1);
$bgobj.attr('orgbgpxu','% ');
}
else if (/em$/.test(bgposx)){
bgposx = bgposx.substr(0,bgposx.length-2);
$bgobj.attr('orgbgpxu','em ');
}
else if (/px$/.test(bgposx)){
bgposx = bgposx.substr(0,bgposx.length-2);
$bgobj.attr('orgbgpxu','px ');
}
else { $bgobj.attr('orgbgpxu','px '); }
if (/%$/.test(bgposy)){
bgposy = bgposy.substr(0,bgposy.length-1);
$bgobj.attr('orgbgpyu','% ');
}
else if (/em$/.test(bgposy)){
bgposy = bgposy.substr(0,bgposy.length-2);
$bgobj.attr('orgbgpyu','em ');
}
else if (/px$/.test(bgposy)){
bgposy = bgposy.substr(0,bgposy.length-2);
$bgobj.attr('orgbgpyu','px ');
}
else { $bgobj.attr('orgbgpyu','px '); }
$bgobj.attr('orgbgpx',parseInt(bgposx));
$bgobj.attr('orgbgpy',parseInt(bgposy));
$(window).scroll(function() {
onPos($bgobj,tiltLR,titleFB);
});
if (window.DeviceOrientationEvent) {
// Create an event listener
window.addEventListener('deviceorientation', function(event) {
tiltLR = event.gamma;
titleFB = event.beta;
console.log("DeviceOrientationEvent");
onPos($bgobj,tiltLR,titleFB);
});
$(window).mousemove(function(e) {
tiltLR = e.pageX;
titleFB = e.pageY;
onPos($bgobj,tiltLR,titleFB);
});
}
});
});

@ -10,7 +10,7 @@
</a>
<% } %>
<h1 class="blogtitle">
<a href="<%= Url.Action("UserPost", new{user=Model.Author, title = Model.Title}) %>">
<a href="<%= Url.RouteUrl("BlogByTitle", new{ user=Model.Author, title = Model.Title}) %>">
<%=Model.Title%>
</a>
- <%= Html.ActionLink((string)ViewData ["BlogTitle"] ,"UserPosts",new{user=Model.Author}, null) %>

@ -6,7 +6,7 @@
</asp:Content>
<asp:Content ContentPlaceHolderID="MASContent" ID="MASContentContent" runat="server">
<div>
<div class="panel">
<%= Html.ActionLink("Les articles", "Index", "Blogs", null, new { @class="actionlink" }) %>
<%= Html.ActionLink("Contact", "Contact", "Home", null, new { @class="actionlink" }) %>
<%= Html.ActionLink("Credits", "Credits", "Home", null, new { @class="actionlink" }) %>

@ -142,6 +142,7 @@
<Folder Include="fonts\" />
<Folder Include="lib\" />
<Folder Include="App_Data\" />
<Folder Include="App_Themes\images\" />
</ItemGroup>
<ItemGroup>
<Compile Include="Controllers\HomeController.cs" />
@ -398,7 +399,6 @@
<Content Include="images\helix-nebula-1400x1400.xxs.jpg" />
<Content Include="images\star-939235_1280.xxs.jpg" />
<Content Include="images\p8-av4.xxs.jpg" />
<Content Include="Scripts\parralax.js" />
<Content Include="Views\Blogs\Title.aspx" />
<Content Include="Views\Blogs\PostActions.ascx" />
<Content Include="Scripts\yavsc.tags.js" />
@ -443,6 +443,24 @@
<Content Include="App_Themes\sunburst.css" />
<Content Include="App_Themes\prettify.css" />
<Content Include="images\FhHRx.gif" />
<Content Include="images\animated-overlay.gif" />
<Content Include="App_Themes\images\ui-bg_flat_30_cccccc_40x100.png" />
<Content Include="App_Themes\images\ui-bg_flat_50_5c5c5c_40x100.png" />
<Content Include="App_Themes\images\ui-bg_glass_20_555555_1x400.png" />
<Content Include="App_Themes\images\ui-bg_glass_40_0078a3_1x400.png" />
<Content Include="App_Themes\images\ui-bg_glass_40_ffc73d_1x400.png" />
<Content Include="App_Themes\images\ui-bg_gloss-wave_25_333333_500x100.png" />
<Content Include="App_Themes\images\ui-bg_highlight-soft_80_eeeeee_1x100.png" />
<Content Include="App_Themes\images\ui-bg_inset-soft_25_000000_1x100.png" />
<Content Include="App_Themes\images\ui-bg_inset-soft_30_f58400_1x100.png" />
<Content Include="App_Themes\images\ui-icons_222222_256x240.png" />
<Content Include="App_Themes\images\ui-icons_4b8e0b_256x240.png" />
<Content Include="App_Themes\images\ui-icons_a83300_256x240.png" />
<Content Include="App_Themes\images\ui-icons_cccccc_256x240.png" />
<Content Include="App_Themes\images\ui-icons_ffffff_256x240.png" />
<Content Include="Scripts\parallax.js" />
<Content Include="images\p8-av4.s.jpg" />
<Content Include="images\star-939235_1280.s.jpg" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

Loading…