# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
from django.contrib import admin
+from django.forms import ModelForm
+from django.forms.widgets import TextInput
from django.utils.translation import ugettext_lazy as _
from admin_ordering.admin import OrderableAdmin
from social.models import Cite, BannerGroup, Carousel, CarouselItem
+class CiteForm(ModelForm):
+ class Meta:
+ model = Cite
+ fields = '__all__'
+ widgets = {
+ 'background_color': TextInput(attrs={'type': 'color'}),
+ }
+
class CiteAdmin(admin.ModelAdmin):
+ form = CiteForm
list_display = ['nonempty_text', 'created_at', 'sticky', 'vip', 'small', 'has_image']
list_filter = ['group']
readonly_fields = ['created_at']
+ raw_id_fields = ['book']
fieldsets = (
- (None, {'fields': ('group', 'sticky', 'created_at')}),
- (_('Content'), {'fields': ('book', 'text', 'small', 'vip', 'link', 'video', 'picture', 'banner')}),
+ (None, {'fields': ('group', 'sticky', 'created_at', 'book')}),
+ (_('Content'), {'fields': ('link', 'vip', 'text', 'small')}),
+ (_('Media box'), {'fields': (
+ 'video',
+ 'picture', 'picture_alt',
+ 'picture_title', 'picture_author', 'picture_link',
+ 'picture_license', 'picture_license_link'
+
+ #'banner',
+ )}),
(
_('Background'),
{'fields': (
- 'image', 'image_shift', 'image_title', 'image_author',
- 'image_link', 'image_license', 'image_license_link')},
+ ('background_plain', 'background_color'),
+ 'image', 'image_shift',
+ 'banner',
+ 'image_title', 'image_author', 'image_link',
+ 'image_license', 'image_license_link'
+ )},
)
)
--- /dev/null
+# -*- coding: utf-8 -*-
+# Generated by Django 1.11.20 on 2019-07-15 12:05
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('social', '0008_auto_20190403_1510'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='cite',
+ name='background_color',
+ field=models.CharField(blank=True, max_length=32, verbose_name='background color'),
+ ),
+ migrations.AddField(
+ model_name='cite',
+ name='picture_alt',
+ field=models.CharField(blank=True, max_length=255, verbose_name='picture alternative text'),
+ ),
+ migrations.AddField(
+ model_name='cite',
+ name='picture_author',
+ field=models.CharField(blank=True, max_length=255, null=True, verbose_name='picture author'),
+ ),
+ migrations.AddField(
+ model_name='cite',
+ name='picture_license',
+ field=models.CharField(blank=True, max_length=255, null=True, verbose_name='picture license name'),
+ ),
+ migrations.AddField(
+ model_name='cite',
+ name='picture_license_link',
+ field=models.URLField(blank=True, null=True, verbose_name='picture license link'),
+ ),
+ migrations.AddField(
+ model_name='cite',
+ name='picture_link',
+ field=models.URLField(blank=True, null=True, verbose_name='picture link'),
+ ),
+ migrations.AddField(
+ model_name='cite',
+ name='picture_title',
+ field=models.CharField(blank=True, max_length=255, null=True, verbose_name='picture title'),
+ ),
+ ]
--- /dev/null
+# -*- coding: utf-8 -*-
+# Generated by Django 1.11.20 on 2019-07-15 12:12
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('social', '0009_auto_20190715_1405'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='cite',
+ name='background_plain',
+ field=models.BooleanField(default=False, verbose_name='plain background'),
+ ),
+ ]
from django.conf import settings
from django.core.exceptions import ValidationError
from django.core.urlresolvers import reverse
-from django.utils.translation import ugettext_lazy as _
+from django.utils.translation import ugettext_lazy as _, string_concat
from ssify import flush_ssi_includes
from catalogue.models import Book
vip = models.CharField(_('VIP'), max_length=128, null=True, blank=True)
link = models.URLField(_('link'))
video = models.URLField(_('video'), blank=True)
- picture = models.ImageField(_('picture'), blank=True)
+ picture = models.ImageField(_('picture'), blank=True,
+ help_text='Najlepsze wymiary: 975 x 315 z tekstem, 487 x 315 bez tekstu.')
+ picture_alt = models.CharField(_('picture alternative text'), max_length=255, blank=True)
+ picture_title = models.CharField(_('picture title'), max_length=255, null=True, blank=True)
+ picture_author = models.CharField(_('picture author'), max_length=255, blank=True, null=True)
+ picture_link = models.URLField(_('picture link'), blank=True, null=True)
+ picture_license = models.CharField(_('picture license name'), max_length=255, blank=True, null=True)
+ picture_license_link = models.URLField(_('picture license link'), blank=True, null=True)
sticky = models.BooleanField(_('sticky'), default=False, db_index=True,
help_text=_('Sticky cites will take precedense.'))
- banner = models.BooleanField(_('banner'), default=False, help_text=_('Adjust size to image, ignore the text'))
+ banner = models.BooleanField(_('banner'), default=False, help_text=string_concat(_('Adjust size to image, ignore the text'), '<br>(Przestarzałe; użyj funkcji "Obraz" w sekcji "Media box")'))
+ background_plain = models.BooleanField(_('plain background'), default=False)
+ background_color = models.CharField(_('background color'), max_length=32, blank=True)
image = models.ImageField(
_('image'), upload_to='social/cite', null=True, blank=True,
help_text=_('Best image is exactly 975px wide and weights under 100kB.'))
image_shift = models.IntegerField(
_('shift'), null=True, blank=True,
- help_text=_(u'Vertical shift, in percents. 0 means top, 100 is bottom. Default is 50%.'))
+ help_text=string_concat(_('Vertical shift, in percents. 0 means top, 100 is bottom. Default is 50%.'), '<br>(Przestarzałe; użyj obrazka o właściwych proporcjach;)'))
image_title = models.CharField(_('title'), max_length=255, null=True, blank=True)
image_author = models.CharField(_('author'), max_length=255, blank=True, null=True)
image_link = models.URLField(_('link'), blank=True, null=True)
verbose_name_plural = _('banners')
def __str__(self):
- return u"%s: %s…" % (self.vip, self.text[:60])
+ t = []
+ if self.text:
+ t.append(self.text[:60])
+ if self.book_id:
+ t.append('[ks.]'[:60])
+ t.append(self.link[:60])
+ if self.vip:
+ t.append('vip: ' + self.vip)
+ if self.picture:
+ t.append('[obr.]')
+ if self.video:
+ t.append('[vid.]')
+ return ', '.join(t)
def get_absolute_url(self):
"""This is used for testing."""
- return "%s?choose_cite=%d" % (reverse('main_page'), self.id)
+ return "%s?banner=%d" % (reverse('main_page'), self.id)
def has_box(self):
return self.video or self.picture
pieces.append('box')
if self.has_body():
pieces.append('text')
- if self.small:
- pieces.append('small')
return '-'.join(pieces)
{% spaceless %}
-{% load i18n %}
+<div class="cycle-slideshow carousel carousel-{{ carousel.slug }}"
+ data-cycle-slides="section"
+ data-cycle-pause-on-hover="true"
+ >
-<div class="carousel carousel-{{ carousel.slug }}">
- {% for item in carousel.carouselitem_set.all %}
- {% with banner=item.get_banner %}
- <!-- {{ banner.id }} -->
- {% if banner %}
- {% include 'social/cite_promo.html' with cite=banner main=True %}
- {% endif %}
- {% endwith %}
+ <div class="cycle-prev"></div>
+ <div class="cycle-next"></div>
+ <div class="cycle-pager"></div>
+
+ {% for banner in banners %}
+ {% if banner %}
+ {% include 'social/cite_promo.html' with cite=banner main=True %}
+ {% endif %}
{% endfor %}
</div>
{% load embed_video from social_tags %}
{% if main %}
- <section class="big-cite"{% if cite.image and not cite.banner %} style="background-image: url('{{ cite.image.url }}'); background-position: 50% {{ cite.image_shift|default_if_none:50 }}%;"{% endif %} {% if cite.banner %}class="banner"{% endif %}>
+ <section class="big-cite"{% if cite.image or cite.background_plain %}{% if not cite.banner %} style="{% if cite.image %}background-image: url('{{ cite.image.url }}'); background-position: 50% {{ cite.image_shift|default_if_none:50 }}%;{% else %}background-image: none; background-color: {{ cite.background_color|default:"#000000" }};{% endif %}"{% endif %}{% endif %} {% if cite.banner %}class="banner"{% endif %}>
{% endif %}
{% if cite %}
<a href="{{ cite.link }}" class="cite-{{ cite.layout }}">
{% if cite.banner %}
+ {# Obsolete #}
<img src="{{ cite.image.url }}" width="100%"/>
{% else %}
{% if cite.video %}
- {% embed_video cite.video %}
+ <div class="box-c">
+ {% embed_video cite.video %}
+ </div>
{% endif %}
{% if cite.picture %}
- <img src="{{ cite.picture.url }}">
+ <div class="box-c">
+ <img class="picture" src="{{ cite.picture.url }}" alt="{{ cite.picture_alt }}">
+ </div>
{% endif %}
+ <div class="{% if cite.small %}cite-text-small{% endif %}">
{% if cite.vip %}
<p class='vip mono'><span>{{ cite.vip }} {% trans "recommends" %}:</span></p>
{% endif %}
{% if cite.book %}
<p class="source mono"><span>{{ cite.book.pretty_title }}</span></p>
{% endif %}
+ </div>
{% endif %}
</a>
{% endif %}
from ssify import ssi_variable
from ssify.utils import ssi_vary_on_cookie
from social.utils import likes, get_or_choose_cite
-from ..models import Carousel
+from ..models import Carousel, Cite
register = template.Library()
return lazy(get_value, str)()
-@register.inclusion_tag('social/carousel.html')
-def carousel(slug):
+@register.inclusion_tag('social/carousel.html', takes_context=True)
+def carousel(context, slug):
# TODO: cache
try:
carousel = Carousel.objects.get(slug=slug)
except Carousel.DoesNotExist:
# TODO: add sanity check for install.
carousel = None
+ banners = [
+ item.get_banner()
+ for item in carousel.carouselitem_set.all()
+ ]
+
+ request = context['request']
+ if 'banner' in request.GET:
+ try:
+ banner_id = int(request.GET['banner'])
+ except (TypeError, ValueError):
+ pass
+ else:
+ try:
+ index = [b.pk for b in banners].index(banner_id)
+ except ValueError:
+ if request.user.is_staff:
+ # Staff is allowed to preview any banner.
+ try:
+ banners.insert(0, Cite.objects.get(pk=banner_id))
+ except Cite.DoesNotExist:
+ pass
+ else:
+ # Put selected banner to front.
+ banners = [banners[index]] + banners[:index] + banners[index+1:]
+
return {
- 'carousel': carousel
+ 'carousel': carousel,
+ 'banners': banners,
}
def get_or_choose_cite(request, book_id=None, tag_ids=None):
try:
assert request.user.is_staff
- assert 'choose_cite' in request.GET
- return Cite.objects.get(pk=request.GET['choose_cite'])
+ assert 'banner' in request.GET
+ return Cite.objects.get(pk=request.GET['banner'])
except (AssertionError, Cite.DoesNotExist):
return choose_cite(book_id, tag_ids)
(function($) {
$(function() {
- $('.sponsor-logos').cycle({timeout: 3000});
+ $('.sponsor-logos').cycle({slides: 'a', timeout: 3000});
});
})(jQuery);
'JAVASCRIPT': {
'base': {
'source_filenames': (
- 'js/contrib/jquery.cycle.min.js',
+ 'js/contrib/jquery.cycle2.min.js',
'js/contrib/jquery.jqmodal.js',
'js/contrib/jquery.form.js',
'js/contrib/jquery.paging.min.js',
+++ /dev/null
-/*!
- * jQuery Cycle Lite Plugin
- * http://malsup.com/jquery/cycle/lite/
- * Copyright (c) 2008 M. Alsup
- * Version: 1.0 (06/08/2008)
- * Dual licensed under the MIT and GPL licenses:
- * http://www.opensource.org/licenses/mit-license.php
- * http://www.gnu.org/licenses/gpl.html
- * Requires: jQuery v1.2.3 or later
- */
-(function(D){var A="Lite-1.0";D.fn.cycle=function(E){return this.each(function(){E=E||{};if(this.cycleTimeout){clearTimeout(this.cycleTimeout)}this.cycleTimeout=0;this.cyclePause=0;var I=D(this);var J=E.slideExpr?D(E.slideExpr,this):I.children();var G=J.get();if(G.length<2){if(window.console&&window.console.log){window.console.log("terminating; too few slides: "+G.length)}return }var H=D.extend({},D.fn.cycle.defaults,E||{},D.metadata?I.metadata():D.meta?I.data():{});H.before=H.before?[H.before]:[];H.after=H.after?[H.after]:[];H.after.unshift(function(){H.busy=0});var F=this.className;H.width=parseInt((F.match(/w:(\d+)/)||[])[1])||H.width;H.height=parseInt((F.match(/h:(\d+)/)||[])[1])||H.height;H.timeout=parseInt((F.match(/t:(\d+)/)||[])[1])||H.timeout;if(I.css("position")=="static"){I.css("position","relative")}if(H.width){I.width(H.width)}if(H.height&&H.height!="auto"){I.height(H.height)}var K=0;J.css({position:"absolute",top:0,left:0}).hide().each(function(M){D(this).css("z-index",G.length-M)});D(G[K]).css("opacity",1).show();if(D.browser.msie){G[K].style.removeAttribute("filter")}if(H.fit&&H.width){J.width(H.width)}if(H.fit&&H.height&&H.height!="auto"){J.height(H.height)}if(H.pause){I.hover(function(){this.cyclePause=1},function(){this.cyclePause=0})}D.fn.cycle.transitions.fade(I,J,H);J.each(function(){var M=D(this);this.cycleH=(H.fit&&H.height)?H.height:M.height();this.cycleW=(H.fit&&H.width)?H.width:M.width()});J.not(":eq("+K+")").css({opacity:0});if(H.cssFirst){D(J[K]).css(H.cssFirst)}if(H.timeout){if(H.speed.constructor==String){H.speed={slow:600,fast:200}[H.speed]||400}if(!H.sync){H.speed=H.speed/2}while((H.timeout-H.speed)<250){H.timeout+=H.speed}}H.speedIn=H.speed;H.speedOut=H.speed;H.slideCount=G.length;H.currSlide=K;H.nextSlide=1;var L=J[K];if(H.before.length){H.before[0].apply(L,[L,L,H,true])}if(H.after.length>1){H.after[1].apply(L,[L,L,H,true])}if(H.click&&!H.next){H.next=H.click}if(H.next){D(H.next).bind("click",function(){return C(G,H,H.rev?-1:1)})}if(H.prev){D(H.prev).bind("click",function(){return C(G,H,H.rev?1:-1)})}if(H.timeout){this.cycleTimeout=setTimeout(function(){B(G,H,0,!H.rev)},H.timeout+(H.delay||0))}})};function B(J,E,I,K){if(E.busy){return }var H=J[0].parentNode,M=J[E.currSlide],L=J[E.nextSlide];if(H.cycleTimeout===0&&!I){return }if(I||!H.cyclePause){if(E.before.length){D.each(E.before,function(N,O){O.apply(L,[M,L,E,K])})}var F=function(){if(D.browser.msie){this.style.removeAttribute("filter")}D.each(E.after,function(N,O){O.apply(L,[M,L,E,K])})};if(E.nextSlide!=E.currSlide){E.busy=1;D.fn.cycle.custom(M,L,E,F)}var G=(E.nextSlide+1)==J.length;E.nextSlide=G?0:E.nextSlide+1;E.currSlide=G?J.length-1:E.nextSlide-1}if(E.timeout){H.cycleTimeout=setTimeout(function(){B(J,E,0,!E.rev)},E.timeout)}}function C(E,F,I){var H=E[0].parentNode,G=H.cycleTimeout;if(G){clearTimeout(G);H.cycleTimeout=0}F.nextSlide=F.currSlide+I;if(F.nextSlide<0){F.nextSlide=E.length-1}else{if(F.nextSlide>=E.length){F.nextSlide=0}}B(E,F,1,I>=0);return false}D.fn.cycle.custom=function(K,H,I,E){var J=D(K),G=D(H);G.css({opacity:0});var F=function(){G.animate({opacity:1},I.speedIn,I.easeIn,E)};J.animate({opacity:0},I.speedOut,I.easeOut,function(){J.css({display:"none"});if(!I.sync){F()}});if(I.sync){F()}};D.fn.cycle.transitions={fade:function(F,G,E){G.not(":eq(0)").css("opacity",0);E.before.push(function(){D(this).show()})}};D.fn.cycle.ver=function(){return A};D.fn.cycle.defaults={timeout:4000,speed:1000,next:null,prev:null,before:null,after:null,height:"auto",sync:1,fit:0,pause:0,delay:0,slideExpr:null}})(jQuery);
\ No newline at end of file
--- /dev/null
+/*!
+* jQuery Cycle2; version: 2.1.6 build: 20141007
+* http://jquery.malsup.com/cycle2/
+* Copyright (c) 2014 M. Alsup; Dual licensed: MIT/GPL
+*/
+!function(a){"use strict";function b(a){return(a||"").toLowerCase()}var c="2.1.6";a.fn.cycle=function(c){var d;return 0!==this.length||a.isReady?this.each(function(){var d,e,f,g,h=a(this),i=a.fn.cycle.log;if(!h.data("cycle.opts")){(h.data("cycle-log")===!1||c&&c.log===!1||e&&e.log===!1)&&(i=a.noop),i("--c2 init--"),d=h.data();for(var j in d)d.hasOwnProperty(j)&&/^cycle[A-Z]+/.test(j)&&(g=d[j],f=j.match(/^cycle(.*)/)[1].replace(/^[A-Z]/,b),i(f+":",g,"("+typeof g+")"),d[f]=g);e=a.extend({},a.fn.cycle.defaults,d,c||{}),e.timeoutId=0,e.paused=e.paused||!1,e.container=h,e._maxZ=e.maxZ,e.API=a.extend({_container:h},a.fn.cycle.API),e.API.log=i,e.API.trigger=function(a,b){return e.container.trigger(a,b),e.API},h.data("cycle.opts",e),h.data("cycle.API",e.API),e.API.trigger("cycle-bootstrap",[e,e.API]),e.API.addInitialSlides(),e.API.preInitSlideshow(),e.slides.length&&e.API.initSlideshow()}}):(d={s:this.selector,c:this.context},a.fn.cycle.log("requeuing slideshow (dom not ready)"),a(function(){a(d.s,d.c).cycle(c)}),this)},a.fn.cycle.API={opts:function(){return this._container.data("cycle.opts")},addInitialSlides:function(){var b=this.opts(),c=b.slides;b.slideCount=0,b.slides=a(),c=c.jquery?c:b.container.find(c),b.random&&c.sort(function(){return Math.random()-.5}),b.API.add(c)},preInitSlideshow:function(){var b=this.opts();b.API.trigger("cycle-pre-initialize",[b]);var c=a.fn.cycle.transitions[b.fx];c&&a.isFunction(c.preInit)&&c.preInit(b),b._preInitialized=!0},postInitSlideshow:function(){var b=this.opts();b.API.trigger("cycle-post-initialize",[b]);var c=a.fn.cycle.transitions[b.fx];c&&a.isFunction(c.postInit)&&c.postInit(b)},initSlideshow:function(){var b,c=this.opts(),d=c.container;c.API.calcFirstSlide(),"static"==c.container.css("position")&&c.container.css("position","relative"),a(c.slides[c.currSlide]).css({opacity:1,display:"block",visibility:"visible"}),c.API.stackSlides(c.slides[c.currSlide],c.slides[c.nextSlide],!c.reverse),c.pauseOnHover&&(c.pauseOnHover!==!0&&(d=a(c.pauseOnHover)),d.hover(function(){c.API.pause(!0)},function(){c.API.resume(!0)})),c.timeout&&(b=c.API.getSlideOpts(c.currSlide),c.API.queueTransition(b,b.timeout+c.delay)),c._initialized=!0,c.API.updateView(!0),c.API.trigger("cycle-initialized",[c]),c.API.postInitSlideshow()},pause:function(b){var c=this.opts(),d=c.API.getSlideOpts(),e=c.hoverPaused||c.paused;b?c.hoverPaused=!0:c.paused=!0,e||(c.container.addClass("cycle-paused"),c.API.trigger("cycle-paused",[c]).log("cycle-paused"),d.timeout&&(clearTimeout(c.timeoutId),c.timeoutId=0,c._remainingTimeout-=a.now()-c._lastQueue,(c._remainingTimeout<0||isNaN(c._remainingTimeout))&&(c._remainingTimeout=void 0)))},resume:function(a){var b=this.opts(),c=!b.hoverPaused&&!b.paused;a?b.hoverPaused=!1:b.paused=!1,c||(b.container.removeClass("cycle-paused"),0===b.slides.filter(":animated").length&&b.API.queueTransition(b.API.getSlideOpts(),b._remainingTimeout),b.API.trigger("cycle-resumed",[b,b._remainingTimeout]).log("cycle-resumed"))},add:function(b,c){var d,e=this.opts(),f=e.slideCount,g=!1;"string"==a.type(b)&&(b=a.trim(b)),a(b).each(function(){var b,d=a(this);c?e.container.prepend(d):e.container.append(d),e.slideCount++,b=e.API.buildSlideOpts(d),e.slides=c?a(d).add(e.slides):e.slides.add(d),e.API.initSlide(b,d,--e._maxZ),d.data("cycle.opts",b),e.API.trigger("cycle-slide-added",[e,b,d])}),e.API.updateView(!0),g=e._preInitialized&&2>f&&e.slideCount>=1,g&&(e._initialized?e.timeout&&(d=e.slides.length,e.nextSlide=e.reverse?d-1:1,e.timeoutId||e.API.queueTransition(e)):e.API.initSlideshow())},calcFirstSlide:function(){var a,b=this.opts();a=parseInt(b.startingSlide||0,10),(a>=b.slides.length||0>a)&&(a=0),b.currSlide=a,b.reverse?(b.nextSlide=a-1,b.nextSlide<0&&(b.nextSlide=b.slides.length-1)):(b.nextSlide=a+1,b.nextSlide==b.slides.length&&(b.nextSlide=0))},calcNextSlide:function(){var a,b=this.opts();b.reverse?(a=b.nextSlide-1<0,b.nextSlide=a?b.slideCount-1:b.nextSlide-1,b.currSlide=a?0:b.nextSlide+1):(a=b.nextSlide+1==b.slides.length,b.nextSlide=a?0:b.nextSlide+1,b.currSlide=a?b.slides.length-1:b.nextSlide-1)},calcTx:function(b,c){var d,e=b;return e._tempFx?d=a.fn.cycle.transitions[e._tempFx]:c&&e.manualFx&&(d=a.fn.cycle.transitions[e.manualFx]),d||(d=a.fn.cycle.transitions[e.fx]),e._tempFx=null,this.opts()._tempFx=null,d||(d=a.fn.cycle.transitions.fade,e.API.log('Transition "'+e.fx+'" not found. Using fade.')),d},prepareTx:function(a,b){var c,d,e,f,g,h=this.opts();return h.slideCount<2?void(h.timeoutId=0):(!a||h.busy&&!h.manualTrump||(h.API.stopTransition(),h.busy=!1,clearTimeout(h.timeoutId),h.timeoutId=0),void(h.busy||(0!==h.timeoutId||a)&&(d=h.slides[h.currSlide],e=h.slides[h.nextSlide],f=h.API.getSlideOpts(h.nextSlide),g=h.API.calcTx(f,a),h._tx=g,a&&void 0!==f.manualSpeed&&(f.speed=f.manualSpeed),h.nextSlide!=h.currSlide&&(a||!h.paused&&!h.hoverPaused&&h.timeout)?(h.API.trigger("cycle-before",[f,d,e,b]),g.before&&g.before(f,d,e,b),c=function(){h.busy=!1,h.container.data("cycle.opts")&&(g.after&&g.after(f,d,e,b),h.API.trigger("cycle-after",[f,d,e,b]),h.API.queueTransition(f),h.API.updateView(!0))},h.busy=!0,g.transition?g.transition(f,d,e,b,c):h.API.doTransition(f,d,e,b,c),h.API.calcNextSlide(),h.API.updateView()):h.API.queueTransition(f))))},doTransition:function(b,c,d,e,f){var g=b,h=a(c),i=a(d),j=function(){i.animate(g.animIn||{opacity:1},g.speed,g.easeIn||g.easing,f)};i.css(g.cssBefore||{}),h.animate(g.animOut||{},g.speed,g.easeOut||g.easing,function(){h.css(g.cssAfter||{}),g.sync||j()}),g.sync&&j()},queueTransition:function(b,c){var d=this.opts(),e=void 0!==c?c:b.timeout;return 0===d.nextSlide&&0===--d.loop?(d.API.log("terminating; loop=0"),d.timeout=0,e?setTimeout(function(){d.API.trigger("cycle-finished",[d])},e):d.API.trigger("cycle-finished",[d]),void(d.nextSlide=d.currSlide)):void 0!==d.continueAuto&&(d.continueAuto===!1||a.isFunction(d.continueAuto)&&d.continueAuto()===!1)?(d.API.log("terminating automatic transitions"),d.timeout=0,void(d.timeoutId&&clearTimeout(d.timeoutId))):void(e&&(d._lastQueue=a.now(),void 0===c&&(d._remainingTimeout=b.timeout),d.paused||d.hoverPaused||(d.timeoutId=setTimeout(function(){d.API.prepareTx(!1,!d.reverse)},e))))},stopTransition:function(){var a=this.opts();a.slides.filter(":animated").length&&(a.slides.stop(!1,!0),a.API.trigger("cycle-transition-stopped",[a])),a._tx&&a._tx.stopTransition&&a._tx.stopTransition(a)},advanceSlide:function(a){var b=this.opts();return clearTimeout(b.timeoutId),b.timeoutId=0,b.nextSlide=b.currSlide+a,b.nextSlide<0?b.nextSlide=b.slides.length-1:b.nextSlide>=b.slides.length&&(b.nextSlide=0),b.API.prepareTx(!0,a>=0),!1},buildSlideOpts:function(c){var d,e,f=this.opts(),g=c.data()||{};for(var h in g)g.hasOwnProperty(h)&&/^cycle[A-Z]+/.test(h)&&(d=g[h],e=h.match(/^cycle(.*)/)[1].replace(/^[A-Z]/,b),f.API.log("["+(f.slideCount-1)+"]",e+":",d,"("+typeof d+")"),g[e]=d);g=a.extend({},a.fn.cycle.defaults,f,g),g.slideNum=f.slideCount;try{delete g.API,delete g.slideCount,delete g.currSlide,delete g.nextSlide,delete g.slides}catch(i){}return g},getSlideOpts:function(b){var c=this.opts();void 0===b&&(b=c.currSlide);var d=c.slides[b],e=a(d).data("cycle.opts");return a.extend({},c,e)},initSlide:function(b,c,d){var e=this.opts();c.css(b.slideCss||{}),d>0&&c.css("zIndex",d),isNaN(b.speed)&&(b.speed=a.fx.speeds[b.speed]||a.fx.speeds._default),b.sync||(b.speed=b.speed/2),c.addClass(e.slideClass)},updateView:function(a,b){var c=this.opts();if(c._initialized){var d=c.API.getSlideOpts(),e=c.slides[c.currSlide];!a&&b!==!0&&(c.API.trigger("cycle-update-view-before",[c,d,e]),c.updateView<0)||(c.slideActiveClass&&c.slides.removeClass(c.slideActiveClass).eq(c.currSlide).addClass(c.slideActiveClass),a&&c.hideNonActive&&c.slides.filter(":not(."+c.slideActiveClass+")").css("visibility","hidden"),0===c.updateView&&setTimeout(function(){c.API.trigger("cycle-update-view",[c,d,e,a])},d.speed/(c.sync?2:1)),0!==c.updateView&&c.API.trigger("cycle-update-view",[c,d,e,a]),a&&c.API.trigger("cycle-update-view-after",[c,d,e]))}},getComponent:function(b){var c=this.opts(),d=c[b];return"string"==typeof d?/^\s*[\>|\+|~]/.test(d)?c.container.find(d):a(d):d.jquery?d:a(d)},stackSlides:function(b,c,d){var e=this.opts();b||(b=e.slides[e.currSlide],c=e.slides[e.nextSlide],d=!e.reverse),a(b).css("zIndex",e.maxZ);var f,g=e.maxZ-2,h=e.slideCount;if(d){for(f=e.currSlide+1;h>f;f++)a(e.slides[f]).css("zIndex",g--);for(f=0;f<e.currSlide;f++)a(e.slides[f]).css("zIndex",g--)}else{for(f=e.currSlide-1;f>=0;f--)a(e.slides[f]).css("zIndex",g--);for(f=h-1;f>e.currSlide;f--)a(e.slides[f]).css("zIndex",g--)}a(c).css("zIndex",e.maxZ-1)},getSlideIndex:function(a){return this.opts().slides.index(a)}},a.fn.cycle.log=function(){window.console&&console.log&&console.log("[cycle2] "+Array.prototype.join.call(arguments," "))},a.fn.cycle.version=function(){return"Cycle2: "+c},a.fn.cycle.transitions={custom:{},none:{before:function(a,b,c,d){a.API.stackSlides(c,b,d),a.cssBefore={opacity:1,visibility:"visible",display:"block"}}},fade:{before:function(b,c,d,e){var f=b.API.getSlideOpts(b.nextSlide).slideCss||{};b.API.stackSlides(c,d,e),b.cssBefore=a.extend(f,{opacity:0,visibility:"visible",display:"block"}),b.animIn={opacity:1},b.animOut={opacity:0}}},fadeout:{before:function(b,c,d,e){var f=b.API.getSlideOpts(b.nextSlide).slideCss||{};b.API.stackSlides(c,d,e),b.cssBefore=a.extend(f,{opacity:1,visibility:"visible",display:"block"}),b.animOut={opacity:0}}},scrollHorz:{before:function(a,b,c,d){a.API.stackSlides(b,c,d);var e=a.container.css("overflow","hidden").width();a.cssBefore={left:d?e:-e,top:0,opacity:1,visibility:"visible",display:"block"},a.cssAfter={zIndex:a._maxZ-2,left:0},a.animIn={left:0},a.animOut={left:d?-e:e}}}},a.fn.cycle.defaults={allowWrap:!0,autoSelector:".cycle-slideshow[data-cycle-auto-init!=false]",delay:0,easing:null,fx:"fade",hideNonActive:!0,loop:0,manualFx:void 0,manualSpeed:void 0,manualTrump:!0,maxZ:100,pauseOnHover:!1,reverse:!1,slideActiveClass:"cycle-slide-active",slideClass:"cycle-slide",slideCss:{position:"absolute",top:0,left:0},slides:"> img",speed:500,startingSlide:0,sync:!0,timeout:4e3,updateView:0},a(document).ready(function(){a(a.fn.cycle.defaults.autoSelector).cycle()})}(jQuery),/*! Cycle2 autoheight plugin; Copyright (c) M.Alsup, 2012; version: 20130913 */
+function(a){"use strict";function b(b,d){var e,f,g,h=d.autoHeight;if("container"==h)f=a(d.slides[d.currSlide]).outerHeight(),d.container.height(f);else if(d._autoHeightRatio)d.container.height(d.container.width()/d._autoHeightRatio);else if("calc"===h||"number"==a.type(h)&&h>=0){if(g="calc"===h?c(b,d):h>=d.slides.length?0:h,g==d._sentinelIndex)return;d._sentinelIndex=g,d._sentinel&&d._sentinel.remove(),e=a(d.slides[g].cloneNode(!0)),e.removeAttr("id name rel").find("[id],[name],[rel]").removeAttr("id name rel"),e.css({position:"static",visibility:"hidden",display:"block"}).prependTo(d.container).addClass("cycle-sentinel cycle-slide").removeClass("cycle-slide-active"),e.find("*").css("visibility","hidden"),d._sentinel=e}}function c(b,c){var d=0,e=-1;return c.slides.each(function(b){var c=a(this).height();c>e&&(e=c,d=b)}),d}function d(b,c,d,e){var f=a(e).outerHeight();c.container.animate({height:f},c.autoHeightSpeed,c.autoHeightEasing)}function e(c,f){f._autoHeightOnResize&&(a(window).off("resize orientationchange",f._autoHeightOnResize),f._autoHeightOnResize=null),f.container.off("cycle-slide-added cycle-slide-removed",b),f.container.off("cycle-destroyed",e),f.container.off("cycle-before",d),f._sentinel&&(f._sentinel.remove(),f._sentinel=null)}a.extend(a.fn.cycle.defaults,{autoHeight:0,autoHeightSpeed:250,autoHeightEasing:null}),a(document).on("cycle-initialized",function(c,f){function g(){b(c,f)}var h,i=f.autoHeight,j=a.type(i),k=null;("string"===j||"number"===j)&&(f.container.on("cycle-slide-added cycle-slide-removed",b),f.container.on("cycle-destroyed",e),"container"==i?f.container.on("cycle-before",d):"string"===j&&/\d+\:\d+/.test(i)&&(h=i.match(/(\d+)\:(\d+)/),h=h[1]/h[2],f._autoHeightRatio=h),"number"!==j&&(f._autoHeightOnResize=function(){clearTimeout(k),k=setTimeout(g,50)},a(window).on("resize orientationchange",f._autoHeightOnResize)),setTimeout(g,30))})}(jQuery),/*! caption plugin for Cycle2; version: 20130306 */
+function(a){"use strict";a.extend(a.fn.cycle.defaults,{caption:"> .cycle-caption",captionTemplate:"{{slideNum}} / {{slideCount}}",overlay:"> .cycle-overlay",overlayTemplate:"<div>{{title}}</div><div>{{desc}}</div>",captionModule:"caption"}),a(document).on("cycle-update-view",function(b,c,d,e){if("caption"===c.captionModule){a.each(["caption","overlay"],function(){var a=this,b=d[a+"Template"],f=c.API.getComponent(a);f.length&&b?(f.html(c.API.tmpl(b,d,c,e)),f.show()):f.hide()})}}),a(document).on("cycle-destroyed",function(b,c){var d;a.each(["caption","overlay"],function(){var a=this,b=c[a+"Template"];c[a]&&b&&(d=c.API.getComponent("caption"),d.empty())})})}(jQuery),/*! command plugin for Cycle2; version: 20140415 */
+function(a){"use strict";var b=a.fn.cycle;a.fn.cycle=function(c){var d,e,f,g=a.makeArray(arguments);return"number"==a.type(c)?this.cycle("goto",c):"string"==a.type(c)?this.each(function(){var h;return d=c,f=a(this).data("cycle.opts"),void 0===f?void b.log('slideshow must be initialized before sending commands; "'+d+'" ignored'):(d="goto"==d?"jump":d,e=f.API[d],a.isFunction(e)?(h=a.makeArray(g),h.shift(),e.apply(f.API,h)):void b.log("unknown command: ",d))}):b.apply(this,arguments)},a.extend(a.fn.cycle,b),a.extend(b.API,{next:function(){var a=this.opts();if(!a.busy||a.manualTrump){var b=a.reverse?-1:1;a.allowWrap===!1&&a.currSlide+b>=a.slideCount||(a.API.advanceSlide(b),a.API.trigger("cycle-next",[a]).log("cycle-next"))}},prev:function(){var a=this.opts();if(!a.busy||a.manualTrump){var b=a.reverse?1:-1;a.allowWrap===!1&&a.currSlide+b<0||(a.API.advanceSlide(b),a.API.trigger("cycle-prev",[a]).log("cycle-prev"))}},destroy:function(){this.stop();var b=this.opts(),c=a.isFunction(a._data)?a._data:a.noop;clearTimeout(b.timeoutId),b.timeoutId=0,b.API.stop(),b.API.trigger("cycle-destroyed",[b]).log("cycle-destroyed"),b.container.removeData(),c(b.container[0],"parsedAttrs",!1),b.retainStylesOnDestroy||(b.container.removeAttr("style"),b.slides.removeAttr("style"),b.slides.removeClass(b.slideActiveClass)),b.slides.each(function(){var d=a(this);d.removeData(),d.removeClass(b.slideClass),c(this,"parsedAttrs",!1)})},jump:function(a,b){var c,d=this.opts();if(!d.busy||d.manualTrump){var e=parseInt(a,10);if(isNaN(e)||0>e||e>=d.slides.length)return void d.API.log("goto: invalid slide index: "+e);if(e==d.currSlide)return void d.API.log("goto: skipping, already on slide",e);d.nextSlide=e,clearTimeout(d.timeoutId),d.timeoutId=0,d.API.log("goto: ",e," (zero-index)"),c=d.currSlide<d.nextSlide,d._tempFx=b,d.API.prepareTx(!0,c)}},stop:function(){var b=this.opts(),c=b.container;clearTimeout(b.timeoutId),b.timeoutId=0,b.API.stopTransition(),b.pauseOnHover&&(b.pauseOnHover!==!0&&(c=a(b.pauseOnHover)),c.off("mouseenter mouseleave")),b.API.trigger("cycle-stopped",[b]).log("cycle-stopped")},reinit:function(){var a=this.opts();a.API.destroy(),a.container.cycle()},remove:function(b){for(var c,d,e=this.opts(),f=[],g=1,h=0;h<e.slides.length;h++)c=e.slides[h],h==b?d=c:(f.push(c),a(c).data("cycle.opts").slideNum=g,g++);d&&(e.slides=a(f),e.slideCount--,a(d).remove(),b==e.currSlide?e.API.advanceSlide(1):b<e.currSlide?e.currSlide--:e.currSlide++,e.API.trigger("cycle-slide-removed",[e,b,d]).log("cycle-slide-removed"),e.API.updateView())}}),a(document).on("click.cycle","[data-cycle-cmd]",function(b){b.preventDefault();var c=a(this),d=c.data("cycle-cmd"),e=c.data("cycle-context")||".cycle-slideshow";a(e).cycle(d,c.data("cycle-arg"))})}(jQuery),/*! hash plugin for Cycle2; version: 20130905 */
+function(a){"use strict";function b(b,c){var d;return b._hashFence?void(b._hashFence=!1):(d=window.location.hash.substring(1),void b.slides.each(function(e){if(a(this).data("cycle-hash")==d){if(c===!0)b.startingSlide=e;else{var f=b.currSlide<e;b.nextSlide=e,b.API.prepareTx(!0,f)}return!1}}))}a(document).on("cycle-pre-initialize",function(c,d){b(d,!0),d._onHashChange=function(){b(d,!1)},a(window).on("hashchange",d._onHashChange)}),a(document).on("cycle-update-view",function(a,b,c){c.hash&&"#"+c.hash!=window.location.hash&&(b._hashFence=!0,window.location.hash=c.hash)}),a(document).on("cycle-destroyed",function(b,c){c._onHashChange&&a(window).off("hashchange",c._onHashChange)})}(jQuery),/*! loader plugin for Cycle2; version: 20131121 */
+function(a){"use strict";a.extend(a.fn.cycle.defaults,{loader:!1}),a(document).on("cycle-bootstrap",function(b,c){function d(b,d){function f(b){var f;"wait"==c.loader?(h.push(b),0===j&&(h.sort(g),e.apply(c.API,[h,d]),c.container.removeClass("cycle-loading"))):(f=a(c.slides[c.currSlide]),e.apply(c.API,[b,d]),f.show(),c.container.removeClass("cycle-loading"))}function g(a,b){return a.data("index")-b.data("index")}var h=[];if("string"==a.type(b))b=a.trim(b);else if("array"===a.type(b))for(var i=0;i<b.length;i++)b[i]=a(b[i])[0];b=a(b);var j=b.length;j&&(b.css("visibility","hidden").appendTo("body").each(function(b){function g(){0===--i&&(--j,f(k))}var i=0,k=a(this),l=k.is("img")?k:k.find("img");return k.data("index",b),l=l.filter(":not(.cycle-loader-ignore)").filter(':not([src=""])'),l.length?(i=l.length,void l.each(function(){this.complete?g():a(this).load(function(){g()}).on("error",function(){0===--i&&(c.API.log("slide skipped; img not loaded:",this.src),0===--j&&"wait"==c.loader&&e.apply(c.API,[h,d]))})})):(--j,void h.push(k))}),j&&c.container.addClass("cycle-loading"))}var e;c.loader&&(e=c.API.add,c.API.add=d)})}(jQuery),/*! pager plugin for Cycle2; version: 20140415 */
+function(a){"use strict";function b(b,c,d){var e,f=b.API.getComponent("pager");f.each(function(){var f=a(this);if(c.pagerTemplate){var g=b.API.tmpl(c.pagerTemplate,c,b,d[0]);e=a(g).appendTo(f)}else e=f.children().eq(b.slideCount-1);e.on(b.pagerEvent,function(a){b.pagerEventBubble||a.preventDefault(),b.API.page(f,a.currentTarget)})})}function c(a,b){var c=this.opts();if(!c.busy||c.manualTrump){var d=a.children().index(b),e=d,f=c.currSlide<e;c.currSlide!=e&&(c.nextSlide=e,c._tempFx=c.pagerFx,c.API.prepareTx(!0,f),c.API.trigger("cycle-pager-activated",[c,a,b]))}}a.extend(a.fn.cycle.defaults,{pager:"> .cycle-pager",pagerActiveClass:"cycle-pager-active",pagerEvent:"click.cycle",pagerEventBubble:void 0,pagerTemplate:"<span>•</span>"}),a(document).on("cycle-bootstrap",function(a,c,d){d.buildPagerLink=b}),a(document).on("cycle-slide-added",function(a,b,d,e){b.pager&&(b.API.buildPagerLink(b,d,e),b.API.page=c)}),a(document).on("cycle-slide-removed",function(b,c,d){if(c.pager){var e=c.API.getComponent("pager");e.each(function(){var b=a(this);a(b.children()[d]).remove()})}}),a(document).on("cycle-update-view",function(b,c){var d;c.pager&&(d=c.API.getComponent("pager"),d.each(function(){a(this).children().removeClass(c.pagerActiveClass).eq(c.currSlide).addClass(c.pagerActiveClass)}))}),a(document).on("cycle-destroyed",function(a,b){var c=b.API.getComponent("pager");c&&(c.children().off(b.pagerEvent),b.pagerTemplate&&c.empty())})}(jQuery),/*! prevnext plugin for Cycle2; version: 20140408 */
+function(a){"use strict";a.extend(a.fn.cycle.defaults,{next:"> .cycle-next",nextEvent:"click.cycle",disabledClass:"disabled",prev:"> .cycle-prev",prevEvent:"click.cycle",swipe:!1}),a(document).on("cycle-initialized",function(a,b){if(b.API.getComponent("next").on(b.nextEvent,function(a){a.preventDefault(),b.API.next()}),b.API.getComponent("prev").on(b.prevEvent,function(a){a.preventDefault(),b.API.prev()}),b.swipe){var c=b.swipeVert?"swipeUp.cycle":"swipeLeft.cycle swipeleft.cycle",d=b.swipeVert?"swipeDown.cycle":"swipeRight.cycle swiperight.cycle";b.container.on(c,function(){b._tempFx=b.swipeFx,b.API.next()}),b.container.on(d,function(){b._tempFx=b.swipeFx,b.API.prev()})}}),a(document).on("cycle-update-view",function(a,b){if(!b.allowWrap){var c=b.disabledClass,d=b.API.getComponent("next"),e=b.API.getComponent("prev"),f=b._prevBoundry||0,g=void 0!==b._nextBoundry?b._nextBoundry:b.slideCount-1;b.currSlide==g?d.addClass(c).prop("disabled",!0):d.removeClass(c).prop("disabled",!1),b.currSlide===f?e.addClass(c).prop("disabled",!0):e.removeClass(c).prop("disabled",!1)}}),a(document).on("cycle-destroyed",function(a,b){b.API.getComponent("prev").off(b.nextEvent),b.API.getComponent("next").off(b.prevEvent),b.container.off("swipeleft.cycle swiperight.cycle swipeLeft.cycle swipeRight.cycle swipeUp.cycle swipeDown.cycle")})}(jQuery),/*! progressive loader plugin for Cycle2; version: 20130315 */
+function(a){"use strict";a.extend(a.fn.cycle.defaults,{progressive:!1}),a(document).on("cycle-pre-initialize",function(b,c){if(c.progressive){var d,e,f=c.API,g=f.next,h=f.prev,i=f.prepareTx,j=a.type(c.progressive);if("array"==j)d=c.progressive;else if(a.isFunction(c.progressive))d=c.progressive(c);else if("string"==j){if(e=a(c.progressive),d=a.trim(e.html()),!d)return;if(/^(\[)/.test(d))try{d=a.parseJSON(d)}catch(k){return void f.log("error parsing progressive slides",k)}else d=d.split(new RegExp(e.data("cycle-split")||"\n")),d[d.length-1]||d.pop()}i&&(f.prepareTx=function(a,b){var e,f;return a||0===d.length?void i.apply(c.API,[a,b]):void(b&&c.currSlide==c.slideCount-1?(f=d[0],d=d.slice(1),c.container.one("cycle-slide-added",function(a,b){setTimeout(function(){b.API.advanceSlide(1)},50)}),c.API.add(f)):b||0!==c.currSlide?i.apply(c.API,[a,b]):(e=d.length-1,f=d[e],d=d.slice(0,e),c.container.one("cycle-slide-added",function(a,b){setTimeout(function(){b.currSlide=1,b.API.advanceSlide(-1)},50)}),c.API.add(f,!0)))}),g&&(f.next=function(){var a=this.opts();if(d.length&&a.currSlide==a.slideCount-1){var b=d[0];d=d.slice(1),a.container.one("cycle-slide-added",function(a,b){g.apply(b.API),b.container.removeClass("cycle-loading")}),a.container.addClass("cycle-loading"),a.API.add(b)}else g.apply(a.API)}),h&&(f.prev=function(){var a=this.opts();if(d.length&&0===a.currSlide){var b=d.length-1,c=d[b];d=d.slice(0,b),a.container.one("cycle-slide-added",function(a,b){b.currSlide=1,b.API.advanceSlide(-1),b.container.removeClass("cycle-loading")}),a.container.addClass("cycle-loading"),a.API.add(c,!0)}else h.apply(a.API)})}})}(jQuery),/*! tmpl plugin for Cycle2; version: 20121227 */
+function(a){"use strict";a.extend(a.fn.cycle.defaults,{tmplRegex:"{{((.)?.*?)}}"}),a.extend(a.fn.cycle.API,{tmpl:function(b,c){var d=new RegExp(c.tmplRegex||a.fn.cycle.defaults.tmplRegex,"g"),e=a.makeArray(arguments);return e.shift(),b.replace(d,function(b,c){var d,f,g,h,i=c.split(".");for(d=0;d<e.length;d++)if(g=e[d]){if(i.length>1)for(h=g,f=0;f<i.length;f++)g=h,h=h[i[f]]||c;else h=g[c];if(a.isFunction(h))return h.apply(g,e);if(void 0!==h&&null!==h&&h!=c)return h}return c})}})}(jQuery);
.big-cite {
- height: 270px;
+ overflow: hidden;
+ height: (315 / 975) * 100vw;
+ width: 100%;
- .cite-box,.cite-text {
+ @media screen and (min-width: 62.5em) {
+ height: 315px;
+ width: 975px;
+ }
+
+ .cite-box,.cite-box-text,.cite-text {
display: block;
height: 100%;
position: relative;
}
}
-.cite-text, .cite-text-small {
+.box-c {
+ position: absolute;
+ text-align: center;
+ img.picture {
+ max-height: 100%;
+ max-width: 100%;
+ }
+}
+.cite-box {
+ .box-c {
+ top: 0;
+ left: 0;
+ bottom: 0;
+ right: 0;
+ }
+}
+
+.cite-box-text {
+ padding: 30/975*100vw 20/975*100vw 1/975*100vw (975 / 2 + 45)/975*100vw;
+ @media screen and (min-width: 62.5em) {
+ @include size(padding, 30px 20px 1px 975px / 2 + 45px);
+ }
+ .box-c {
+ /*top: 45/975*100vw;
+ left: 45/975*100vw;
+ bottom: 45/975*100vw;
+ width: (975 / 2 - 90)/975 * 100vw;
+ @media screen and (min-width: 62.5em) {
+ top: 45px;
+ left: 45px;
+ bottom: 45px;
+ width: 975px / 2 - 90px;
+ }*/
+ top:0;
+ left:0;
+ bottom:0;
+ width:50%;
+ }
+}
+
+.cite-text {
+ @include size(padding, 30px 20px 1px 80px);
+}
+
+.cite-box-text, .cite-text {
display: block;
color: black;
background: white;
- @include size(padding, 30px 20px 1px 80px);
.vip {
margin: 0;
color: white;
padding: 0;
margin: 0;
- background-size: 100%;
+ background-size: cover;
background-position: 50% 68%;
- background-repeat: repeat-y;
background-image: url(/static/img/backdrop/book-drawer2.jpg);
- @media screen and (min-width: 62.5em) {
- background-image: url(/static/img/backdrop/book-drawer2.jpg);
- }
-
&.banner {
background: none;
}
- .cite-text, .cite-text-small {
- @include size(padding, 46px 10px 48px 0);
+ .cite-box, .cite-box-text, .cite-text {
+ box-sizing: border-box;
+ //@include size(padding, 46px 10px 48px 0);
+ padding:
+ 46/975*100vw
+ 40/975*100vw
+ 48/975*100vw
+ 0;
+
background: none;
color: white;
- @media screen and (min-width: 30em) {
- @include size(padding-right, 40px);
+ @media screen and (min-width: 62.5em) {
+ padding: 46px 40px 48px 0;
}
.vip {
- @include size(margin-left, 10px);
- @include size(margin-top, 2.5px);
- @include size(margin-bottom, 5px);
- @include size(font-size, 11px);
-
- @media screen and (min-width: 16em) {
- padding-left: 10%;
- @include size(margin-left, -18px);
- }
+ padding-left: 10%;
+ margin:
+ 2.5/975*100vw
+ 0
+ 5/975*100vw
+ 10/975*100vw;
+
+ font-size: 11/975 * 100vw;
@media screen and (min-width: 62.5em) {
- float: left;
- padding-left: 0;
- @include size(margin-left, 16px);
- text-align: right;
- @include size(width, 147px);
+ margin: 2.5px 0 5px 10px;
+ font-size: 11px;
}
}
.cite-body {
- @include size(margin, .5px);
- @include size(font-size, 20px);
+ margin: .5 /975 * 100vw;
+ font-size: (30 / 975) * 100vw;
line-height: 1.16em;
- @media screen and (min-width: 30em) {
- @include size(font-size, 30px);
+ @media screen and (min-width: 62.5em) {
+ font-size: 30px;
+ margin: .5px;
}
}
.source {
- @include size(margin-top, 16px);
- @include size(margin-bottom, 16px);
- @include size(margin-right, 2px);
- @include size(font-size, 12px);
+ margin: 16/975*100vw 2/975*100vw 16/975*100vw 0;
+ font-size: 12/975*100vw;
+ @media screen and (min-width: 62.5em) {
+ margin: 16px 2px 16px 0;
+ font-size: 12px;
+ }
}
/* Make cite body and source slide to the left. */
.cite-body, .source {
- @include size(margin-left, 10px);
-
- @media screen and (min-width: 16em) {
- padding-left: 21.9%;
- @include size(margin-left, -38px);
- }
+ padding-left: 21.9%;
+ margin-left: -38/975*100vw;
@media screen and (min-width: 62.5em) {
- padding-left: 0;
- @include size(margin-left, 175px);
+ @include size(margin-left, -38px);
}
}
}
}
+
+ .cite-text {
+ .vip {
+ float: left;
+ padding-left: 0;
+ margin-left: 16/975*100vw;
+ text-align: right;
+ width: 147/975*100vw;
+ }
+ .cite-body, .source {
+ padding-left: 0;
+ margin-left: 175/975*100vw;
+ }
+
+ @media screen and (min-width: 62.5em) {
+ .vip {
+ @include size(margin-left, 16px);
+ @include size(width, 147px);
+ }
+ .cite-body, .source {
+ @include size(margin-left, 175px);
+ }
+
+ }
+ }
+
+
+ .cite-box-text {
+ padding-left: (975 / 2 + 45) /975 * 100vw;
+
+ @media screen and (min-width: 62.5em) {
+ padding-left: 975px / 2 + 45px;
+ }
+ }
+
/* a long cite displays smaller */
.cite-text-small .cite-body {
- @include size(font-size, 16px);
- @media screen and (min-width: 30em) {
+ //@include size(font-size, 16px);
+ font-size: (20/975) * 100vw;
+ @media screen and (min-width: 62.5em) {
@include size(font-size, 20px);
}
}
}
}
}
+
+
+.carousel {
+ position: relative;
+ width: 100%;
+ height: 315/975*100vw;
+ overflow: hidden;
+
+ @media screen and (min-width: 62.5em) {
+ width: 975px;
+ height: 315px;
+ }
+
+ .cycle-prev {
+ left: 0;
+ &::after {
+ content: "◀";
+ }
+ }
+ .cycle-next {
+ right: 0;
+ &::after {
+ content: "▶";
+ }
+ }
+
+ .cycle-prev, .cycle-next {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ width: 15%;
+ z-index: 1000;
+ background: black;
+ color: white;
+ opacity: 0;
+
+ &::after {
+ font-size: 100/975*100vw;
+ display: block;
+ line-height: 315/975*100vw;
+ text-align: center;
+
+ @media screen and (min-width: 62.5em) {
+ font-size: 100px;
+ line-height: 315px;
+ }
+ }
+ &:hover {
+ opacity: .33;
+ }
+ }
+}
-# -*- coding: utf-8 -*-
# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
ctx = {
'last_published': Book.objects.exclude(cover_thumb='').filter(parent=None).order_by('-created_at')[:6],
'theme_books': [],
- 'cite': get_or_choose_cite(request),
}
- # for category in ('author', 'epoch', 'genre', 'kind'):
- # try:
- # ctx[category] = Tag.objects.filter(category=category).order_by('?')[:1][0]
- # except IndexError:
- # pass
-
# FIXME: find this theme and books properly.
if Fragment.objects.exists():
while True: