Skip to content

Commit

Permalink
added RWD
Browse files Browse the repository at this point in the history
  • Loading branch information
cutme committed Jan 31, 2016
1 parent 4c82017 commit 87e0793
Show file tree
Hide file tree
Showing 26 changed files with 1,014 additions and 1,639 deletions.
1,506 changes: 1 addition & 1,505 deletions app/css/main.css
100644 → 100755

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion app/js/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ head.js('http://code.jquery.com/jquery-1.11.1.min.js', function() {
}
})
.js('https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.js')
.js('/js/min/main-min.js');
.js('/js/main.js');
//.js('/js/main.js')


Expand Down
159 changes: 158 additions & 1 deletion app/js/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
function debouncer( func , timeout ) {
var timeoutID , timeout = timeout || 200;
return function () {
var scope = this , args = arguments;
clearTimeout( timeoutID );
timeoutID = setTimeout( function () {
func.apply( scope , Array.prototype.slice.call( args ) );
} , timeout );
}
}

jQuery(function($) {
var Layout = {

goTop: function() {
var $viewport = $('html, body');

Expand Down Expand Up @@ -33,6 +45,149 @@ jQuery(function($) {
}
};

var Nav = {
mobileNav: function() {
var b = $('body'),
h = $('#header').height(),
mm = $('#main-menu'),
windowpos,
ww = $(window).width();
console.log(ww);

function fixNav() {
windowpos = $(window).scrollTop();

if (ww <= 640) {
if (windowpos >= h) {
b.addClass("fixed");
} else {
b.removeClass("fixed");
}
}

$(window).on('scroll', function() {
windowpos = $(window).scrollTop();
ww = $(window).width();

if (ww <= 640) {
if (windowpos >= h) {
b.addClass("fixed");

} else {
b.removeClass("fixed");
}
}
});
}

function showHide() {
var e = $('.nav-trigger');

e.on('click', function(e) {
e.preventDefault();

mm.toggleClass('opened');
});

$(window).on('resize', function() {
ww = $(window).width();

if (ww > 640) {
mm.removeClass('opened');
}
});
}

fixNav();
showHide();
},

init: function() {
Nav.mobileNav();
}
}

var Rwd = {

forumTitle: function(ww) {
if ($('.content-list.forum').length > 0) {

var e = $('.content-list.forum'),
long_name = $('h3', e).attr('data-long');
short_name = $('h3', e).attr('data-short');

if (ww <= 480) {
$('h3', e).html(short_name);
} else {
$('h3', e).html(long_name);
}
}
},

loginButton: function(ww) {
if ( $('#top-bar').hasClass('not-logged')) {
var e = $('.btn.login');

if ($('.btn.login').length > 0) {
if (ww < 1024) {
e.detach();
$('#header').append(e);

} else {
e.detach();
$('#top-bar .welcome').after(e);
}
}
}
},

mainMenu: function(ww) {
var e = $('#main-menu');

if (ww < 1024) {
e.detach();
$('#header').after(e);

} else {
e.detach();
$('#header').append(e);
}
},

highlightsVideo: function(ww) {
if (('#highlights .video').length > 0) {
var e = $('#highlights .video');

if (ww <= 1024) {
e.detach();
$('.content-list.jobs').after(e);

} else {
e.detach();
$('#highlights .highlights').after(e);
}
}
},

init: function() {
var ww = $(window).width();

Rwd.forumTitle(ww);
Rwd.highlightsVideo(ww);
Rwd.loginButton(ww);
Rwd.mainMenu(ww);

$(window).resize( debouncer( function(e) {
ww = $(window).width();

Rwd.forumTitle(ww);
Rwd.highlightsVideo(ww);
Rwd.loginButton(ww);
Rwd.mainMenu(ww);
}));
}
};

var Slider = {

topicSlider: function() {
Expand Down Expand Up @@ -98,7 +253,7 @@ jQuery(function($) {
highlightsSlider: function() {

var el = $('#highlights .slider');

el.show().royalSlider({
addActiveClass: true,
autoPlay: {
Expand Down Expand Up @@ -137,7 +292,9 @@ jQuery(function($) {
$(document).ready(function () {

Layout.init();
Nav.init();
Slider.init();
Rwd.init();

// js is on
$('html').removeClass('no-js');
Expand Down
1 change: 0 additions & 1 deletion app/js/min/init-min.js

This file was deleted.

1 change: 0 additions & 1 deletion app/js/min/main-min.js

This file was deleted.

14 changes: 9 additions & 5 deletions app/partials/highlights.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
<p>Set without brought abundantly. You'll behold. Night, moveth which fruit without saw to was rule. <a href="#" class="more">Read more...</a></p>

</article>

<img src="assets/news-slide.jpg" alt="" width="755" height="395" />

<a href="#">
<img src="assets/news-slide.jpg" alt="" width="755" height="395" />
</a>
</li>

<li>
Expand All @@ -27,7 +29,9 @@

</article>

<img src="assets/news-slide.jpg" alt="" width="755" height="395" />
<a href="#">
<img src="assets/news-slide.jpg" alt="" width="755" height="395" />
</a>
</li>
</ul>

Expand All @@ -37,15 +41,15 @@
</li>

<li class="item">
<img src="assets/highlight-2.jpg" alt="highlight-2" width="356" height="394" />
<img src="assets/highlight-3.jpg" alt="highlight-3" width="368" height="394" />
</li>

<li class="item">
<img src="assets/highlight-3.jpg" alt="highlight-3" width="368" height="394" />
</li>

<li class="item">
<img src="assets/highlight-4.jpg" alt="highlight-4" width="356" height="394" />
<img src="assets/highlight-3.jpg" alt="highlight-3" width="368" height="394" />
</li>
</ul>

Expand Down
2 changes: 1 addition & 1 deletion app/partials/javascript.mustache
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<script src="/js/head.core.min.js" data-headjs-load="/js/min/init-min.js" type="text/javascript"></script>
<script src="/js/head.core.min.js" data-headjs-load="/js/init.js" type="text/javascript"></script>
2 changes: 1 addition & 1 deletion app/partials/top-bar.mustache
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div id="top-bar" class="not-logged">
<div class="container">
<p class="text ">Witaj, Nieznajomy. <span class="gray-nobel">Obecnie jesteś niezalogowany.</span></p>
<p class="text welcome">Witaj, Nieznajomy. <span class="gray-nobel">Obecnie jesteś niezalogowany.</span></p>

<a class="btn login">Zaloguj się</a>

Expand Down
42 changes: 35 additions & 7 deletions app/sass/blocks/_additions.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
.additions {
float: right;
width: 740px;
margin-bottom: 50px;
width: 640px;
margin: 0 auto 50px auto;

@media screen and ( min-width: $tablet_landscape + 1 + px ) {
float: right;
width: grid(740, 760);
}

@media screen and ( max-width: $smartphone_landscape + px ) {
width: 100%;
padding: 0 20px;
}

h4 {
margin-bottom: 15px;
Expand All @@ -14,10 +23,19 @@
}
color: white;
}

.about {
float: left;
width: 340px;
width: grid(340, 740);
margin-bottom: 30px;

@media
screen and ( min-width: $tablet_landscape + 1 + px ) and ( max-width: $ultrabook + px ),
screen and ( max-width: $smartphone_landscape + px ) {

float: none;
width: 100%;
}

p {
@include antialias;
Expand All @@ -26,7 +44,7 @@
font-size: em(12);
color: $gray-silver;
}

a {
color: white;

Expand All @@ -38,9 +56,18 @@

.language {
float: right;
width: 360px;
width: grid(360, 740);
text-align: center;

@media
screen and ( min-width: $tablet_landscape + 1 + px ) and ( max-width: $ultrabook + px ),
screen and ( max-width: $smartphone_landscape + px ) {

float: none;
width: 100%;
text-align: left;
}

h4 {
margin-bottom: 30px;
}
Expand All @@ -65,6 +92,7 @@
padding: 10px;
background-color: rgba(black, .1);
border-bottom: 1px solid rgba(white, .1);
text-align: center;
}

.lang {
Expand Down

0 comments on commit 87e0793

Please sign in to comment.