├── .gitignore ├── README.md ├── mysite ├── __init__.py ├── beauty │ ├── __init__.py │ ├── admin.py │ ├── apps.py │ ├── cache_util.py │ ├── editor.py │ ├── middleware.py │ ├── migrations │ │ ├── 0001_initial.py │ │ ├── 0002_remove_image_title.py │ │ ├── 0003_auto_20170615_1004.py │ │ ├── 0004_tag_tag_type.py │ │ ├── 0005_auto_20170628_1309.py │ │ ├── 0006_auto_20170628_1313.py │ │ ├── 0007_auto_20170628_1358.py │ │ ├── 0008_auto_20170630_1613.py │ │ └── __init__.py │ ├── models.py │ ├── seo.json │ ├── seo.py │ ├── static │ │ └── beauty │ │ │ ├── css │ │ │ ├── main.css │ │ │ └── main.min.css │ │ │ ├── js │ │ │ ├── script.js │ │ │ └── script.min.js │ │ │ └── pic │ │ │ ├── arr_right.cur │ │ │ ├── avatar.jpg │ │ │ ├── dt_load.gif │ │ │ ├── favicon.ico │ │ │ ├── logo.png │ │ │ ├── theme.png │ │ │ └── thumb_2.png │ ├── static_util.py │ ├── tags_model.py │ ├── templates │ │ └── beauty │ │ │ ├── 404.html │ │ │ ├── component │ │ │ ├── base.html │ │ │ ├── footer.html │ │ │ ├── gallery_view.html │ │ │ ├── header.html │ │ │ ├── slider.html │ │ │ └── theme_view.html │ │ │ ├── detail.html │ │ │ ├── detail_all.html │ │ │ ├── index.html │ │ │ ├── tag_page.html │ │ │ └── theme_page.html │ ├── templatetags │ │ ├── __init__.py │ │ ├── filters.py │ │ └── mytag.py │ ├── tests.py │ ├── urls.py │ ├── view_counter.py │ └── views.py ├── manage.py ├── mysite │ ├── __init__.py │ ├── password.py │ ├── settings.py │ ├── urls.py │ └── wsgi.py ├── page_finder.py ├── push │ ├── __init__.py │ ├── admin.py │ ├── apps.py │ ├── migrations │ │ └── __init__.py │ ├── models.py │ ├── tests.py │ ├── urls.py │ └── views.py ├── static │ └── robots.txt ├── tag_job.py ├── tag_meta ├── userdict └── util │ ├── __init__.py │ ├── dedup.py │ ├── normal.py │ ├── pinyin.py │ └── tag_tokenizer.py ├── requirements.txt └── script ├── actor.json └── tag_photo_bg_gen.py /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | *.pyc 3 | nohup.out 4 | *.xml 5 | *.log 6 | mysite/static/ 7 | *env/ 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #beauty_site 2 | * 图片展示站,以及一些小脚本 3 | * 配合另外的图片站通用爬取以及图片去重使用更佳 4 | * 图片站根本不!赚!钱! 美女图片展更是超!大!风!险! 5 | -------------------------------------------------------------------------------- /mysite/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gaoconghui/image_site/b65b053adb7f574eef76612913de962e75b93b26/mysite/__init__.py -------------------------------------------------------------------------------- /mysite/beauty/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gaoconghui/image_site/b65b053adb7f574eef76612913de962e75b93b26/mysite/beauty/__init__.py -------------------------------------------------------------------------------- /mysite/beauty/admin.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import logging 4 | 5 | from beauty.models import Gallery, Tag, Image 6 | from beauty.tags_model import tag_cache 7 | from django.contrib import admin 8 | from util.normal import ensure_utf8 9 | from util.pinyin import get_pinyin 10 | 11 | logger = logging.getLogger("beauty") 12 | 13 | admin.site.register(Image) 14 | 15 | 16 | class TagAdmin(admin.ModelAdmin): 17 | search_fields = ('tag_name', 'tag_id',) 18 | fields = ('tag_name', 'desc', 'tag_type') 19 | 20 | def delete_model(self, request, obj): 21 | """ 22 | TODO 清理相关tag的缓存 23 | 删除tag,重量级操作 24 | 1、找到所有包含这个tag的图集,修改tag字段 25 | 2、删除redis中的tag索引 26 | 3、删除该tag,刷新缓存 27 | :param request: 28 | :param obj: 29 | :return: 30 | """ 31 | tag_name = obj.tag_name 32 | logger.info("delete tag {tag}".format(tag=ensure_utf8(tag_name))) 33 | # 存在tag包含的情况 34 | gs = Gallery.objects.filter(tags__contains=tag_name + ",") | Gallery.objects.filter( 35 | tags__contains="," + tag_name) 36 | for gallery in gs: 37 | logger.info("delete tag for gallery : {g_id}".format(g_id=gallery.gallery_id)) 38 | tag_list = gallery.tags.split(",") 39 | if tag_name in tag_list: 40 | tag_list.remove(tag_name) 41 | gallery.tags = ",".join(tag_list) 42 | gallery.save() 43 | logger.info("delete from tag_cache {tag_id}".format(tag_id=ensure_utf8(obj.tag_id))) 44 | tag_cache.delete_tag(obj.tag_id) 45 | logger.info("delete from db {tag_id}".format(tag_id=ensure_utf8(obj.tag_id))) 46 | obj.delete() 47 | 48 | def save_model(self, request, obj, form, change): 49 | """ 50 | 新增或更新tag,重量级操作 51 | 1、数据库中查找tag_name不存在,存在则直接返回 52 | 2、数据库中插入tag 53 | 3、按照gallery 标题进行查找,标题中存在的则加入该tag 54 | 4、新建索引 55 | """ 56 | if change: 57 | obj.save() 58 | tags = Tag.objects.filter(tag_name=obj.tag_name) 59 | if len(tags) == 0: 60 | obj.tag_id = get_pinyin(obj.tag_name) 61 | obj.save() 62 | 63 | gs = Gallery.objects.filter(title__contains=ensure_utf8(obj.tag_name)) 64 | for gallery in gs: 65 | logger.info("add tag for gallery : {gid}".format(gid=gallery.gallery_id)) 66 | print 67 | tag_cache.add_new_gallery(gallery.gallery_id, [obj.tag_id]) 68 | tag_list = gallery.tags.split(",") 69 | tag_list.append(obj.tag_name) 70 | gallery.tags = ",".join(tag_list) 71 | gallery.save() 72 | else: 73 | obj = tags[0] 74 | 75 | 76 | class GalleryAdmin(admin.ModelAdmin): 77 | search_fields = ('title', 'gallery_id',) 78 | 79 | def delete_model(self, request, obj): 80 | """ 81 | 删除Gallery,重量级操作 82 | 1、删除redis中的索引 83 | 2、删除图片 84 | 3、删除图集 85 | :param request: 86 | :param obj: 87 | :return: 88 | """ 89 | gallery_id = obj.gallery_id 90 | logger.info("delete gallery {gallery_id}".format(gallery_id=obj.gallery_id)) 91 | tags = [get_pinyin(tag) for tag in obj.tags.split(",")] 92 | tags.append("all") 93 | tag_cache.remove_gallery(gallery_id, tags) 94 | for image in Image.objects.filter(gallery_id=gallery_id): 95 | image.delete() 96 | obj.delete() 97 | 98 | 99 | admin.site.register(Tag, TagAdmin) 100 | admin.site.register(Gallery, GalleryAdmin) 101 | -------------------------------------------------------------------------------- /mysite/beauty/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class BeautyConfig(AppConfig): 5 | name = 'beauty' 6 | -------------------------------------------------------------------------------- /mysite/beauty/cache_util.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | """ 4 | 缓存相关的方法 5 | """ 6 | import functools 7 | 8 | from django.core.cache import cache, caches 9 | 10 | REDIS_CACHE = "default" 11 | LOCAL_CACHE = "local" 12 | 13 | 14 | def fun_cache(timeout=30 * 60, key_getter=lambda x, y: 1): 15 | """ 16 | 直接用装饰器的缓存,但是key获取出现了问题,不知道如何拿参数生成一个唯一性的key,先放弃了 17 | :param timeout: 18 | :param key_getter: 19 | :return: 20 | """ 21 | 22 | def decorator(func): 23 | @functools.wraps(func) 24 | def wrapper(*args, **kw): 25 | key = func.__name__ + key_getter(args, kw) 26 | print key 27 | if key not in cache: 28 | print "cache" 29 | cache.set(key, func(*args, **kw), timeout) 30 | return cache.get(key) 31 | 32 | return wrapper 33 | 34 | return decorator 35 | 36 | 37 | def static_cache(timeout=30 * 60, local=False): 38 | """ 39 | redis缓存 40 | :param timeout: 超时时间 41 | :param local: 是否为本地缓存。默认为否 42 | :return: 43 | """ 44 | 45 | def decorator(func): 46 | @functools.wraps(func) 47 | def wrapper(*args, **kw): 48 | _cache = cache 49 | if local: 50 | _cache = caches[LOCAL_CACHE] 51 | key = func.__name__ 52 | if key not in _cache: 53 | _cache.set(key, func(*args, **kw), timeout) 54 | return _cache.get(key) 55 | 56 | return wrapper 57 | 58 | return decorator 59 | -------------------------------------------------------------------------------- /mysite/beauty/editor.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | 编辑精选tag 4 | """ 5 | from beauty.models import Tag 6 | from util.pinyin import get_pinyin 7 | 8 | editor_tags = [ 9 | # ("tag_name",u"display_name") 10 | (u"qingchun", u"清纯美女系列"), 11 | (u"siwa", u"丝袜美女系列"), 12 | (u"meitui", u"美腿女神系列"), 13 | (u"mote", u"性感模特系列"), 14 | (u"sifang", u"私房写真系列"), 15 | (u"huola", u"火辣美女系列"), 16 | (u"neiyi", u"内衣系列"), 17 | (u"mengmeizi", u"萌妹子系列"), 18 | (u"xiaohua", u"校花美女系列"), 19 | (u"meixiong", u"大胸美女系列"), 20 | (u"qingqu", u"情趣美女系列"), 21 | 22 | (u"nenmo", u"嫩模美女系列"), 23 | (u"tianmei", u"甜美系列"), 24 | (u"qiaotun", u"翘臀美女系列"), 25 | (u"youwu", u"性感尤物系列"), 26 | ] -------------------------------------------------------------------------------- /mysite/beauty/middleware.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import logging 3 | 4 | import redis as redis 5 | from django.conf import settings 6 | 7 | """ 8 | 反爬虫中间件 9 | 反爬虫思路如下: 10 | 1、只针对gallery页面反爬虫 11 | 2、在tag_page 或Index中 或其他任意进入gallery的入口增加fake的gallery,前端通过js删除,如果点进去了就是爬虫 12 | 3、fake的思路为通过某一算法计算fakeid,如果都是固定的id会出现去重后跳过的可能 13 | 3、只记录做其他处理 14 | """ 15 | 16 | logger = logging.getLogger("beauty") 17 | 18 | 19 | class AntiSpiderMiddleware(object): 20 | def __init__(self): 21 | super(AntiSpiderMiddleware, self).__init__() 22 | self.fake_id = settings.FAKE_ID 23 | self.r = redis.Redis() 24 | 25 | def process_request(self, request): 26 | path = request.path.lstrip("/") 27 | print path 28 | if self.fake_id in path: 29 | if request.META.has_key('HTTP_X_FORWARDED_FOR'): 30 | ip = request.META['HTTP_X_FORWARDED_FOR'] 31 | else: 32 | ip = request.META['REMOTE_ADDR'] 33 | logger.warning("anti spider : {ip}".format(ip=ip)) 34 | self.r.lpush("anti_spider",ip) 35 | -------------------------------------------------------------------------------- /mysite/beauty/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.9.4 on 2017-06-15 07:09 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | initial = True 11 | 12 | dependencies = [ 13 | ] 14 | 15 | operations = [ 16 | migrations.CreateModel( 17 | name='Gallery', 18 | fields=[ 19 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 20 | ('gallery_id', models.CharField(max_length=200)), 21 | ('title', models.CharField(max_length=200)), 22 | ('tags', models.CharField(max_length=200, null=True)), 23 | ('cover_id', models.CharField(max_length=200)), 24 | ('publish_time', models.IntegerField(default=0)), 25 | ('insert_time', models.IntegerField(default=0)), 26 | ('page_count', models.IntegerField()), 27 | ], 28 | ), 29 | migrations.CreateModel( 30 | name='Image', 31 | fields=[ 32 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 33 | ('gallery_id', models.CharField(max_length=200)), 34 | ('image_id', models.CharField(max_length=200, null=True)), 35 | ('title', models.CharField(max_length=200, null=True)), 36 | ('desc', models.CharField(max_length=200, null=True)), 37 | ('order', models.IntegerField()), 38 | ], 39 | ), 40 | migrations.CreateModel( 41 | name='Tag', 42 | fields=[ 43 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 44 | ('tag_name', models.CharField(max_length=200)), 45 | ('tag_id', models.CharField(max_length=200)), 46 | ('desc', models.CharField(default=b'', max_length=200)), 47 | ], 48 | ), 49 | ] 50 | -------------------------------------------------------------------------------- /mysite/beauty/migrations/0002_remove_image_title.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.9.4 on 2017-06-15 09:43 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('beauty', '0001_initial'), 12 | ] 13 | 14 | operations = [ 15 | migrations.RemoveField( 16 | model_name='image', 17 | name='title', 18 | ), 19 | ] 20 | -------------------------------------------------------------------------------- /mysite/beauty/migrations/0003_auto_20170615_1004.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.9.4 on 2017-06-15 10:04 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('beauty', '0002_remove_image_title'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterField( 16 | model_name='gallery', 17 | name='gallery_id', 18 | field=models.CharField(max_length=200, unique=True), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /mysite/beauty/migrations/0004_tag_tag_type.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.9.4 on 2017-06-17 14:34 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('beauty', '0003_auto_20170615_1004'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AddField( 16 | model_name='tag', 17 | name='tag_type', 18 | field=models.IntegerField(default=1), 19 | preserve_default=False, 20 | ), 21 | ] 22 | -------------------------------------------------------------------------------- /mysite/beauty/migrations/0005_auto_20170628_1309.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.2 on 2017-06-28 13:09 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('beauty', '0004_tag_tag_type'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AddField( 16 | model_name='image', 17 | name='height', 18 | field=models.IntegerField(null=True), 19 | ), 20 | migrations.AddField( 21 | model_name='image', 22 | name='size', 23 | field=models.ImageField(null=True, upload_to=b''), 24 | ), 25 | migrations.AddField( 26 | model_name='image', 27 | name='width', 28 | field=models.IntegerField(null=True), 29 | ), 30 | ] 31 | -------------------------------------------------------------------------------- /mysite/beauty/migrations/0006_auto_20170628_1313.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.2 on 2017-06-28 13:13 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('beauty', '0005_auto_20170628_1309'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterField( 16 | model_name='image', 17 | name='size', 18 | field=models.IntegerField(null=True), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /mysite/beauty/migrations/0007_auto_20170628_1358.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.2 on 2017-06-28 13:58 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('beauty', '0006_auto_20170628_1313'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterField( 16 | model_name='image', 17 | name='desc', 18 | field=models.CharField(max_length=4096, null=True), 19 | ), 20 | migrations.AlterField( 21 | model_name='tag', 22 | name='desc', 23 | field=models.CharField(default=b'', max_length=1024), 24 | ), 25 | ] 26 | -------------------------------------------------------------------------------- /mysite/beauty/migrations/0008_auto_20170630_1613.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.2 on 2017-06-30 16:13 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('beauty', '0007_auto_20170628_1358'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterField( 16 | model_name='image', 17 | name='image_id', 18 | field=models.CharField(max_length=200, null=True, unique=True), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /mysite/beauty/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gaoconghui/image_site/b65b053adb7f574eef76612913de962e75b93b26/mysite/beauty/migrations/__init__.py -------------------------------------------------------------------------------- /mysite/beauty/models.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from django.db import models 4 | 5 | from util.normal import ensure_utf8 6 | 7 | """ 8 | model与爬取的model不同,这里完全不包含原始图片的信息,只包含线上展示的内容 9 | """ 10 | 11 | 12 | class ItemManager(models.Manager): 13 | def create_item(self, **kwargs): 14 | item = self.create(**kwargs) 15 | return item 16 | 17 | 18 | class Gallery(models.Model): 19 | gallery_id = models.CharField(max_length=200, unique=True) 20 | title = models.CharField(max_length=200) 21 | tags = models.CharField(max_length=200, null=True) 22 | cover_id = models.CharField(max_length=200) 23 | publish_time = models.IntegerField(default=0) 24 | insert_time = models.IntegerField(default=0) 25 | page_count = models.IntegerField() 26 | 27 | objects = ItemManager() 28 | 29 | def __str__(self): 30 | return ensure_utf8(self.title) 31 | 32 | 33 | class Image(models.Model): 34 | gallery_id = models.CharField(max_length=200) 35 | image_id = models.CharField(max_length=200, null=True,unique=True) 36 | desc = models.CharField(max_length=4096, null=True) 37 | width = models.IntegerField(null=True) 38 | height = models.IntegerField(null=True) 39 | size = models.IntegerField(null=True) 40 | order = models.IntegerField() 41 | 42 | objects = ItemManager() 43 | 44 | def __str__(self): 45 | return self.image_id 46 | 47 | 48 | class Tag(models.Model): 49 | tag_name = models.CharField(max_length=200) 50 | tag_id = models.CharField(max_length=200) 51 | desc = models.CharField(max_length=1024, default="") 52 | """ 53 | tag_type: 54 | 1、 一般tag(未具体分类) 55 | 2、演员 56 | 3、写真社 57 | 4、形容词等 58 | """ 59 | tag_type = models.IntegerField() 60 | objects = ItemManager() 61 | 62 | def __str__(self): 63 | return "{name} -- {_id}".format(name=ensure_utf8(self.tag_name), _id=ensure_utf8(self.tag_id)) 64 | -------------------------------------------------------------------------------- /mysite/beauty/seo.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | seo相关操作 4 | """ 5 | import json 6 | import os 7 | 8 | from mysite.settings import BASE_DIR 9 | 10 | beauty_dir = os.path.join(BASE_DIR, "beauty") 11 | 12 | class SeoManager(): 13 | """ 14 | 维护seo相关的内容 15 | """ 16 | 17 | def __init__(self, seo_path): 18 | self.seo_path = seo_path 19 | with open(seo_path) as f: 20 | self.seo_data = json.load(f) 21 | 22 | def get_seo(self, key): 23 | return self.seo_data.get(key) 24 | 25 | def add_seo(self, key, item): 26 | self.seo_data[key] = item 27 | self.save() 28 | 29 | def save(self): 30 | with open(self.seo_path,'w') as f: 31 | s =json.dumps(self.seo_data, indent=2,ensure_ascii=False).encode("utf8") 32 | f.write(s) 33 | 34 | 35 | seo_file = os.path.join(beauty_dir,"seo.json") 36 | seo_manager = SeoManager(seo_file) 37 | print seo_manager -------------------------------------------------------------------------------- /mysite/beauty/static/beauty/css/main.min.css: -------------------------------------------------------------------------------- 1 | body{font-family:"Microsoft Yahei";background:#f0f0f0;margin:0 auto;font-size:14px;color:#333}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0}:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:transparent}a:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px;text-decoration:none;color:#f66}img{border:0;vertical-align:middle}button{cursor:pointer}.cl{zoom:1}.cl:after{content:".";display:block;height:0;clear:both;visibility:hidden}a,a:hover{text-decoration:none;color:#f66;transition:.5s;-moz-transition:.5s;-webkit-transition:.5s;-o-transition:.5s}.qt_lists{overflow:hidden;display:block;position:absolute;top:-50px}.kong10{height:10px}.kong20{height:20px}.main{max-width:1180px;width:100%}.wp-smiley{height:24px!important;width:24px!important;max-height:24px!important}.index_header{height:90px;background:#fff;margin-bottom:30px;-webkit-box-shadow:0 2px 4px rgba(0,0,0,.10);-moz-box-shadow:0 2px 4px rgba(0,0,0,.10);box-shadow:0 2px 4px rgba(0,0,0,.10)}@-webkit-keyframes searchLights{0%{left:-100px;top:0}to{left:120px;top:100px}}@-o-keyframes searchLights{0%{left:-100px;top:0}to{left:120px;top:100px}}@-moz-keyframes searchLights{0%{left:-100px;top:0}to{left:120px;top:100px}}@keyframes searchLights{0%{left:-100px;top:0}to{left:120px;top:100px}}.header_bg{height:60px;-webkit-transition:all .4s;-moz-transition:all .4s;-ms-transition:all .4s;-o-transition:all .4s;transition:all .4s}.header_inner{max-width:1180px;width:100%;height:auto;margin:0 auto;overflow:hidden}.logo{line-height:90px;float:left;overflow:hidden;position:relative}.logo a:before{content:"";position:absolute;left:-665px;top:-460px;width:220px;height:15px;background-color:rgba(255,255,255,.5);-webkit-transform:rotate(-45deg);-moz-transform:rotate(-45deg);-ms-transform:rotate(-45deg);-o-transform:rotate(-45deg);transform:rotate(-45deg);-webkit-animation:searchLights 1s ease-in 1s infinite;-o-animation:searchLights 1s ease-in 1s infinite;animation:searchLights 1s ease-in 1s infinite}.logo img{-webkit-transition:all .4s;-moz-transition:all .4s;-ms-transition:all .4s;-o-transition:all .4s;transition:all .4s}.bian_logo_scale{transform:scale(.8,.8);margin-top:-18px;-webkit-transition:all .4s;-moz-transition:all .4s;-ms-transition:all .4s;-o-transition:all .4s;transition:all .4s}.header_menu{float:left;height:90px;line-height:100px;font-size:18px;padding-left:10px;color:#666;-webkit-transition:all .4s;-moz-transition:all .4s;-ms-transition:all .4s;-o-transition:all .4s;transition:all .4s}.bian_header_menu{height:60px;line-height:60px;-webkit-transition:all .4s;-moz-transition:all .4s;-ms-transition:all .4s;-o-transition:all .4s;transition:all .4s}.header_menu{margin-top:0;font-size:16px;margin-left:25px}.header_inner ul{list-style:none}.header_menu ul li{float:left;height:90px;line-height:90px;text-align:center}.header_menu ul li i:first-child{color:#f66}.header_menu ul li:hover i:first-child{color:#f66}.header_menu ul li a:hover,.header_menu ul li.current-menu-ancestor>a,.header_menu ul li.current-menu-item>a,.header_menu ul li.current-post-ancestor>a,.header_menu ul li.current-post-parent>a{color:#ff6765}.header_menu ul li a{color:#333;text-decoration:none;display:block;padding:0 15px}.header_menu ul li ul{position:absolute;background:#fff;width:151px;z-index:99;margin-top:-1px;display:none}.header_menu ul li ul li{width:151px;height:40px;line-height:40px;font-size:12px;text-align:center}.header_menu ul li ul li a{display:block;padding-left:15px;color:#333}.header_menu ul li ul li ul{position:absolute;background:#fff;width:151px;display:none;left:151px;top:20px}.header_menu ul li:hover>ul{display:block}.header_menu>ul>li.toke>a:after{font-family:FontAwesome;content:"\f0d7";display:inline-block;color:#f66;float:none;position:relative;top:0;left:4px}.header_menu>ul>li.megamenu>.sub-menu{width:auto;height:auto;padding:30px 10px 15px;top:60px}.header_menu>ul>li.megamenu>.sub-menu>li{float:left;height:auto}.header_menu>ul>li.megamenu>.sub-menu>li>a{color:#222;border-bottom:1px solid #f66;margin-right:20px;margin-left:15px;font-size:16px;display:inline;padding:10px 0;font-weight:700}.header_menu>ul>li.megamenu>.sub-menu .sub-menu{display:block;position:relative;left:0;top:0;background:#fff;margin-top:15px}.header_menu>ul>li.megamenu>.sub-menu .sub-menu li{height:30px;line-height:30px}.header_menu>ul>li.megamenu>.sub-menu .sub-menu a{font-size:13px;color:#acacac}.header_menu>ul>li.megamenu>.sub-menu .sub-menu a:hover{color:#ff6869}.body_top{padding-top:110px}.nav_headertop{position:fixed;left:0;top:0;width:100%;transition:top .5s;z-index:99;opacity:.98}.hiddened{top:-90px}.home-top{width:1180px;margin:110px auto 0;overflow:hidden}.slider-wrap{position:relative;overflow:hidden;float:left} 2 | .slider-wrap .nivoSlider{width:880px;height:350px;margin:0 auto;background:url(../pic/dt_load.gif) no-repeat 50% 50%}.slider-wrap .nivoSlider img{position:absolute;top:0;left:0;display:none}.slider-wrap:hover .nivo-controlNav{opacity:1}.slider-right{margin-left:20px;width:280px;float:right}.slider-right .aditem{margin-bottom:20px;width:100%;height:103px;position:relative}.slider-right .aditem .cover-show{position:absolute;top:0;right:0;bottom:0;left:0;background-color:rgba(0,0,0,.6);opacity:0;visibility:hidden;color:#fff;height:103px;line-height:103px;text-align:center}.slider-right .aditem:hover .cover-show{opacity:1;visibility:visible}.slider-right .aditem img{height:103px;width:280px}.slider-right .aditem:last-child{margin-bottom:0}.home-block-ad{width:1180px;margin:20px auto 0;overflow:hidden}.home-block-ad .item{width:280px;height:180px;float:left;margin-right:20px}.home-block-ad .item:last-child{margin-right:0}.home-block-ad .item img{width:280px;height:180px}.home-filter{width:100%;max-width:1180px;margin:35px auto 10px;position:relative;overflow:hidden}.h-screen-wrap{position:relative;float:left;max-width:900px;width:-moz-calc(100% - 280px);width:-webkit-calc(100% - 280px);width:calc(100% - 280px);overflow:hidden}.h-screen{margin:0;list-style:none;white-space:nowrap;height:50px;overflow:hidden}.h-screen li{position:relative;float:left;display:block}.h-screen li a{display:block;height:40px;margin-right:15px;padding:0 20px;font-size:14px;background:#fff;border-radius:20px;color:#7c7c7c;line-height:40px;text-align:center;margin:5px 15px 5px 10px;border:1px solid #fff;box-shadow:1px 1px 5px rgba(0,0,0,0.24)}.h-screen li a:hover{color:#f66}.h-screen li a .num{position:relative;display:inline-block;height:18px;line-height:18px;margin-left:10px;padding:0 3px;background-color:#3498db;font-size:12px;color:#fff}.h-screen li a .num:after,.h-screen li a .num:before{content:"";width:0;height:0;position:absolute;border-style:solid}.h-screen li a .num:before{top:0;left:-6px;border-color:transparent #3498db transparent transparent;border-width:9px 6px 9px 0}.h-screen li a .num:after{top:0;right:-6px;border-color:transparent transparent transparent #3498db;border-width:9px 0 9px 6px}.h-screen li.current-menu-item a{border:1px solid #fe6e66;font-weight:500;color:#fff;background-color:#fe6e66;box-shadow:1px 1px 5px rgba(251,0,0,0.24)}.h-screen li.current-menu-item a:before{color:#fff}.h-screen li.current-menu-item a:hover{background-color:#fe6e66;color:#fff}.h-screen-wrap .arrow-left,.h-screen-wrap .arrow-right{color:#f66;font-size:34px;position:absolute;z-index:99;top:-5px}.h-screen-wrap .arrow-left{left:0;display:none}.h-screen-wrap .arrow-right{right:5px}.h-screen-wrap .arrow-left:hover,.h-screen-wrap .arrow-right:hover{color:#f66}.h-soup{position:relative;float:right;margin:0;height:40px;padding:0 20px;background-color:#fff7e7;border-radius:20px;list-style:none;width:270px;text-align:center;margin-right:5px;box-shadow:1px 1px 5px rgba(0,0,0,0.28)}.h-soup li{display:none;font-size:14px;color:#6b3612;line-height:40px;white-space:nowrap}.h-soup li.open{display:block}.h-soup li.open em{color:#f66;font-weight:700;margin-right:3px}.h-soup li.open i{color:#000;font-size:18px;margin-right:3px}.lookmore{margin:0 auto 50px;text-align:center}.lookmore a{padding:18px 45px;background:#f66;color:#fff;font-size:16px}.login_text{float:right;padding-top:18px;-webkit-transition:all .4s;-moz-transition:all .4s;-ms-transition:all .4s;-o-transition:all .4s;transition:all .4s}.bian_login_text{padding-top:10px;-webkit-transition:all .4s;-moz-transition:all .4s;-ms-transition:all .4s;-o-transition:all .4s;transition:all .4s}.rlogin{padding:0 10px;text-align:center;line-height:40px;height:40px;float:right}.reg_hre_btn{display:block;background:#f66;color:#fff}.login_hre_btn{color:#666;background:#f6f6f6}.reg_hre_btn:hover{background:#ff8989;color:#fff}.isNoRead{position:relative}.isNoRead:before{content:'1';width:12px;height:12px;position:absolute;bottom:26px;right:-6px;background:#f66;color:#fff;border-radius:2px}.header_search_bar{float:right;width:auto;height:40px;background:#e6e6e6;margin-top:25px;margin-right:20px;-webkit-transition:all .4s;-moz-transition:all .4s;-ms-transition:all .4s;-o-transition:all .4s;transition:all .4s}.bian_header_search_bar{margin-top:10px;-webkit-transition:all .4s;-moz-transition:all .4s;-ms-transition:all .4s;-o-transition:all .4s;transition:all .4s}.search_bar_input{width:120px;float:right;height:40px;padding-left:8px;border:0;background:0;outline:0;-webkit-transition:all .3s;-moz-transition:all .3s;-ms-transition:all .3s;-o-transition:all .3s;transition:all .3s}.search_bar_btn{height:40px;float:right;background:0;border:0;font-size:20px;color:#a0a0a0;padding-right:8px}.search_bar_input:focus{width:160px;-webkit-transition:all .3s;-moz-transition:all .3s;-ms-transition:all .3s;-o-transition:all .3s;transition:all .3s}.index_slider{max-height:560px;width:100%;margin-top:90px} 3 | .public_notice_bar{height:70px;width:100%;background:#fff;-webkit-box-shadow:0 3px 3px rgba(0,0,0,.19);-moz-box-shadow:0 3px 3px rgba(0,0,0,.19);box-shadow:0 3px 3px rgba(0,0,0,.19)}.pnb_1{max-width:1180px;width:100%;margin:0 auto;height:70px;line-height:70px;font-size:16px;color:#666;position:relative}.pnb_1_text{float:left}.update_area{width:100%;background:#f0f0f0;overflow:hidden;position:relative}.update_area_inner{max-width:1180px;width:100%;margin:0 auto}.uai_title{font-size:40px;font-weight:700;text-align:center;margin-top:55px}.update_area_content{max-width:1200px;width:100%;margin:auto;position:relative;overflow:hidden}.update_area_lists{max-width:1200px;width:100%;margin:0 auto;margin-top:10px;padding-top:10px;margin-bottom:10px;height:auto;overflow:hidden}.update_area_left{position:absolute;top:330px;left:0;font-size:80px;opacity:.4;display:none}.update_area_right{position:absolute;top:330px;right:0;font-size:80px;opacity:.4;display:none}.update_area_left:hover,.update_area_right:hover{opacity:1}.update_area:hover .update_area_left,.update_area:hover .update_area_right{display:block}.i_list{float:left;background:#ddd;overflow:hidden;position:relative;margin:0 10px 20px;padding-bottom:46px;-webkit-box-shadow:0 0 10px transparent;-moz-box-shadow:0 0 10px transparent;box-shadow:0 0 10px transparent;-webkit-transition:all .35s;-moz-transition:all .35s;-ms-transition:all .35s;-o-transition:all .35s;transition:all .35s;cursor:pointer}.case_info{height:46px;background:#fff;position:absolute;bottom:0;width:100%;-webkit-transition:all .35s;-moz-transition:all .35s;-ms-transition:all .35s;-o-transition:all .35s;transition:all .35s}.case_info .meta-title{font-size:14px;color:#a0a0a0;font-family:'Microsoft Yahei';padding:6px 10px;line-height:36px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.case_info .meta-category{font-size:12px;color:#666;font-family:'Microsoft Yahei';text-align:center;padding-top:3px}.case_info .meta-category a{color:#666}.case_info .meta-post{height:25px;line-height:20px;color:#888686;border-top:1px solid #f3f3f3;padding:5px 10px 0}.case_info .meta-recommend{font-size:12px;color:#666;font-family:'Microsoft Yahei';text-align:center;padding-top:3px}.case_info .meta-recommend-star{font-size:16px;color:#666;font-family:'Microsoft Yahei';text-align:center;padding-top:3px}.case_info .meta-recommend-star i{color:#fc3}.i_list img{-webkit-transition:all .35s;-moz-transition:all .35s;-ms-transition:all .35s;-o-transition:all .35s;transition:all .35s}.i_list img{-webkit-backface-visibility:hidden;width:100%;height:auto;backface-visibility:hidden}.i_list:hover img{opacity:.8}.i_list:hover .case_info{height:86px;-webkit-transition:all .35s;-moz-transition:all .35s;-ms-transition:all .35s;-o-transition:all .35s;transition:all .35s}.i_list:hover .case_info .meta-title{line-height:24px;height:58px;white-space:normal;-webkit-transition:all .35s;-moz-transition:all .35s;-ms-transition:all .35s;-o-transition:all .35s;transition:all .35s}.i_list:hover{margin-top:-5px;margin-bottom:25px;box-shadow:0 1px 3px rgba(0,0,0,.3);-moz-box-shadow:0 1px 3px rgba(0,0,0,.3);-webkit-box-shadow:0 1px 3px rgba(0,0,0,.3)}.list_n1{width:-moz-calc(25% - 20px);width:-webkit-calc(25% - 20px);width:calc(25% - 20px);height:auto}.list_n2{width:-moz-calc(20% - 20px);width:-webkit-calc(20% - 20px);width:calc(20% - 20px);height:auto}.list_n3{width:-moz-calc(33.333% - 20px);width:-webkit-calc(33.333% - 20px);width:calc(33.333% - 20px);height:auto}.list_n3 .case_info .meta-title{color:#a0a0a0;text-align:center}.i_list.list_n3:hover .case_info{height:58px}.meta_zan{position:absolute;top:10px;right:10px;background-color:rgba(123,123,123,.59);padding:5px 10px;border-radius:6px;color:#fff}.meta_zan i{margin-right:5px;color:#f97070}.xl_1{background-color:rgba(206,39,239,.79)}.xl_2{background-color:rgba(206,39,239,.79)}.xl_3{background-color:rgba(206,39,239,.79)}.btt{font-size:20px;background-color:#fbf8f8;text-align:center;padding:10px 0;border:0;vertical-align:baseline;font-weight:500;outline:0;-webkit-tap-highlight-color:transparent;border-bottom:solid 3px #ff5722;display:none}.btt i{color:#309af7;margin-right:3px}.btt span{font-size:.7em;display:block;margin-top:5px;color:#989797}.foot_bg_color{height:118px;background:#f66}a.pre-cat{position:absolute;left:0;top:30%;width:50px;background-color:#f0f0f0;line-height:150px;text-align:center;font-size:2.5em;border-radius:0 20% 20% 0}a.next-cat{position:absolute;right:0;top:30%;width:50px;background-color:#f0f0f0;line-height:150px;text-align:center;font-size:2.5em;border-radius:20% 0 0 20%}.page_imges{text-align:center;margin:20px 0}.image_div{padding:0 30px}.image_div a img{cursor:url(../pic/arr_right.cur),auto}.pagination{display:block;max-width:1180px;width:100%;margin:0 auto;height:100px;margin-bottom:25px;text-align:center;padding-top:30px;border-radius:0;background:#fff}a.page-numbers{line-height:40px;padding:10px 15px;text-align:center;border:1px solid #eee;color:#a1a1a1;text-decoration:none;margin-left:3px;margin-right:3px} 4 | .nav-links a:hover{color:#000;text-decoration:none}.nav-links h2{display:none}.pages,.screen-reader-text{display:none}.nav-links .current{padding:10px 15px;color:#fff;line-height:40px;text-align:center;border:1px solid #ff5c5c;background:#ff5c5c;margin-left:3px;margin-right:3px}.footer{height:180px;width:100%;border-bottom:1px solid #eee;background:#fff}.footer_inner{max-width:1180px;width:100%;margin:0 auto}.footer_inner_left{float:left;width:730px;margin-top:30px}.footer_inner_right{float:right;margin-top:40px}.fil_list{width:110px;float:left;margin-right:8px}.header_menu_2{float:left;height:90px;line-height:90px;font-size:18px;color:#666;-webkit-transition:all .4s;-moz-transition:all .4s;-ms-transition:all .4s;-o-transition:all .4s;transition:all .4s}.bian_header_menu_2{height:60px;line-height:60px;-webkit-transition:all .4s;-moz-transition:all .4s;-ms-transition:all .4s;-o-transition:all .4s;transition:all .4s}.header_menu_2 ul li{float:left;padding-left:12px;padding-right:12px;color:#ccc;cursor:pointer}.header_menu_2 ul li:hover{color:#f66}.header_menu_2 ul li a{color:#ccc;text-decoration:none}.header_menu_2 ul li a:hover{color:#f66;display:block}.header_menu_2 ul li ul{position:absolute;width:120px;background:#f66;display:none}.header_menu_2 ul li ul li{padding:0;height:40px;line-height:40px;font-size:14px;width:120px}.header_menu_2 ul li ul li a{padding-left:15px;color:#fff;display:block}.header_menu_2 ul li ul li a:hover{background:#fff;color:#666;display:block}.header_menu_2 ul li:hover ul{display:block}.link1{color:#a8a8a8}.link1:hover{color:#f66}.foot{height:120px;background:#f66}.foot .foot_list{width:100%;max-width:1200px;margin:0 auto}.foot_num{width:25%;float:left;color:#fff;line-height:120px;height:120px}.foot_num div:nth-child(1){font-size:18px;float:left;width:125px;text-align:right}.foot_num div:nth-child(2){font-family:Conv;font-size:40px;float:left;margin-left:20px}.foot_num:hover{background:#fd5454;cursor:pointer}.cx_like{float:right}.cx_like a{margin:0 5px}.cx_like i{margin-right:3px;color:#ffb2b2}.cx_like .count em{font-style:inherit}.list_img{max-width:1180px}.xg_content li{box-shadow:0 1px 1px rgba(0,0,0,.2);-moz-box-shadow:0 1px 1px rgba(0,0,0,.2);-webkit-box-shadow:0 1px 1px rgba(0,0,0,.2)}.site-wrap{position:relative;width:100%;max-width:1180px;overflow:hidden;height:auto;margin:0 auto;max-height:472px}.bx-wrapper{position:relative;margin:0 auto;padding:0}.bx-wrapper img{width:100%;height:auto;display:block}.bx-wrapper .bx-viewport{background:#fff;-webkit-transform:translatez(0);-moz-transform:translatez(0);-ms-transform:translatez(0);-o-transform:translatez(0);transform:translatez(0)}.bx-wrapper .bx-controls-auto,.bx-wrapper .bx-pager{position:absolute;bottom:10px;width:100%}.bx-wrapper .bx-pager{text-align:center;font-size:.85em;font-family:Arial;font-weight:700;color:#666;padding-top:20px}.bx-wrapper .bx-controls-auto .bx-controls-auto-item,.bx-wrapper .bx-pager .bx-pager-item{display:inline-block}.bx-wrapper .bx-pager.bx-default-pager a{background:#666;text-indent:-9999px;display:block;width:10px;height:10px;margin:0 5px;outline:0;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.bx-wrapper .bx-pager.bx-default-pager a.active,.bx-wrapper .bx-pager.bx-default-pager a:hover{background:#000;width:20px}.bx-wrapper .bx-prev{left:5px}.bx-wrapper .bx-next{right:5px}.bx-wrapper .bx-controls-direction a{position:absolute;top:50%;margin-top:-16px;outline:0;width:32px;height:32px;font-size:1.5em;color:#ddd;z-index:2;text-align:center}.bx-wrapper .bx-controls-direction a.disabled{display:none}.bx-wrapper .bx-controls-auto{text-align:center}.bx-wrapper .bx-controls-auto .bx-start.active,.bx-wrapper .bx-controls-auto .bx-start:hover{background-position:-86px 0}.bx-wrapper .bx-controls-auto .bx-stop.active,.bx-wrapper .bx-controls-auto .bx-stop:hover{background-position:-86px -33px}.bx-wrapper .bx-controls.bx-has-controls-auto.bx-has-pager .bx-pager{text-align:left;width:80%}.bx-wrapper .bx-controls.bx-has-controls-auto.bx-has-pager .bx-controls-auto{right:0;width:35px}.bx-wrapper .bx-caption{position:absolute;bottom:0;left:0;background:#666 \9;background:rgba(80,80,80,.75);width:100%}.bx-wrapper .bx-caption span{color:#fff;font-family:Arial;display:block;font-size:.85em;padding:10px}.widget_tags_num ul{background:#fff;padding:5px}.widget_tags_num ul li{float:left;margin:5px}.widget_tags_num ul li a{display:inline-block;padding:2px 10px;border:solid 1px #dadada;border-radius:20px;box-shadow:0 0 2px rgba(0,0,0,0.11);color:#999}.widget_tags_num ul li.tag_color_s a{color:#f66;border-color:#f66}.widget_tags_num ul li a:hover{color:#f66;border-color:#f66}.slide-mask{position:fixed;z-index:99;left:0;top:0;width:100%;height:100%;background:rgba(0,0,0,.4);-webkit-transition:all .3s ease-out;-moz-transition:all .3s ease-out;-ms-transition:all .3s ease-out;-o-transition:all .3s ease-out;transition:all .3s ease-out;display:none}.slide-wrapper{position:fixed;display:none \9;z-index:100;left:0;top:0;height:100%;width:50%;background-color:#fff;-webkit-transform:translate3d(-100%,0,0);-moz-transform:translate3d(-100%,0,0);-ms-transform:translate3d(-100%,0,0);-o-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0);-webkit-transition:all .3s ease-out;-moz-transition:all .3s ease-out;-ms-transition:all .3s ease-out;-o-transition:all .3s ease-out;transition:all .3s ease-out} 5 | .slide-wrapper.moved{-webkit-transform:translate3d(0,0,0);display:block \9;-moz-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.wrappter{width:100%;max-width:1180px;margin:0 auto;overflow:hidden;max-height:377px}.wrappter .wrp_left{float:left;width:67.2%}.wrappter .wrp_right{float:right;width:32.5%;margin-top:-6px}.wrappter .wrp_right li{padding:6px 0;margin-left:10px;position:relative;overflow:hidden}.wrappter .wrp_right li div{position:absolute;bottom:6px;width:100%;padding:10px;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-webkit-transition:all .2s ease;-moz-transition:all .2s ease;transition:all .2s ease;background-image:-webkit-linear-gradient(180deg,rgba(0,0,0,0.01) 5%,rgba(0,0,0,0.90) 100%);background-image:-moz-linear-gradient(180deg,rgba(0,0,0,0.01) 5%,rgba(0,0,0,0.90) 100%);background-image:linear-gradient(180deg,rgba(0,0,0,0.01) 5%,rgba(0,0,0,0.90) 100%);color:#eee}.wrappter .wrp_right li:hover div{background-image:-webkit-linear-gradient(180deg,rgba(0,0,0,0.01) 5%,rgba(0,0,0,0.50) 100%);background-image:-moz-linear-gradient(180deg,rgba(0,0,0,0.01) 5%,rgba(0,0,0,0.50) 100%);background-image:linear-gradient(180deg,rgba(0,0,0,0.01) 5%,rgba(0,0,0,0.50) 100%);-webkit-transition:all .2s ease;-moz-transition:all .2s ease;transition:all .2s ease}.wrappter .wrp_right li div span{padding:3px 7px;background:#f00;color:#fff;border-radius:4px;display:none}.wrappter .wrp_right li div p{margin-top:10px;text-shadow:1px 1px 2px #000}.wrappter img{width:100%;height:auto;vertical-align:middle}.wrappter li{float:left;width:100%;list-style-type:none}.wrappter .bx-wrapper .bx-prev{left:0}.wrappter .bx-wrapper .bx-next{right:0}.wrappter .bx-wrapper .bx-controls-direction a{position:absolute;top:50%;margin-top:-26px;outline:0;width:32px;height:52px;line-height:52px;font-size:1.5em;color:#ddd;background:rgba(0,0,0,0.5);z-index:2;text-align:center;display:none}.wrappter .bx-wrapper:hover .bx-controls-direction a{display:block}.header-info{height:120px}.header-info .header-logo{border-radius:50%;text-align:center;padding:20px 0 10px}.header-info .header-logo img{width:60px;height:60px;border-radius:50%;border:2px solid #fff}.header-info-content{text-align:center}.header-info-content a{padding:3px 5px;color:#fff}.menu_slide{margin-top:15px;padding:0;list-style:none,}.menu_slide li .sub-menu{margin-left:-20px;list-style-type:none;background-color:#f9f9f9;padding-left:40px}.menu_slide li a{display:block;padding:8px 1em 5px 1.2em;color:#727272;text-shadow:0 0 1px rgba(255,255,255,.1);letter-spacing:1px;font-weight:400;-webkit-transition:background .3s,box-shadow .3s;transition:background .3s,box-shadow .3s;-webkit-transition:all .18s ease-out;-moz-transition:all .18s ease-out;-ms-transition:all .18s ease-out;-o-transition:all .18s ease-out}.menu_slide li a i{margin-right:.6em;font-size:16px}.update_area_list{width:calc(100% - 300px);float:left;margin-top:-10px}.blog_list{margin-top:20px}.blog_list article{padding:20px 0;overflow:hidden;clear:both;background-color:#fff;margin-bottom:20px}.blog_list article .entry-img{float:left;margin:0 2%;width:40%;height:auto;overflow:hidden}.blog_list article .entry-img img{width:100%;height:auto}.blog_list article .entry-content{overflow:hidden;margin:5px 2%;width:52%}.blog_list article .entry-title{font-size:20px;line-height:1.6;font-weight:700;color:#272322;font-size:20px;font-weight:700}.blog_list article a{color:#666}.blog_list article .entry-site{font-size:13px;color:#888;line-height:1.6;padding-top:15px}.blog_list article .entry-meta{height:26px;line-height:26px;font-size:13px;color:#b8b8b8;margin-top:15px;overflow:hidden}.blog_list article .tags{float:right;height:100%;overflow:hidden}.blog_list article .time{float:left}.blog_list article .comments{float:right;margin-right:25px}.cat_bg{height:350px;border-top:1px solid #e8e6e6;width:100%;margin-top:-30px;background:-webkit-linear-gradient(#FFF 90%,#f0f0f0 10%);background:-o-linear-gradient(#FFF 90%,#f0f0f0 10%);background:-moz-linear-gradient(#FFF 90%,#f0f0f0 10%);background:linear-gradient(#FFF,#f0f0f0)}.cat_bg .cat_bg_img{height:350px;width:100%;max-width:1250px;margin:0 auto;background:no-repeat scroll right 0}.cat_bg .cat_bg_img p{float:left;width:100%;max-width:600px;position:absolute;top:10%;padding:10px;line-height:28px;margin:50px 0 0 30px;border-radius:10px;background-color:#f8f8f8;font-size:15px;-webkit-box-shadow:0 0 16px #c7c7c7;border:1px solid #d4d3d3;color:#6f6c6c;opacity:.5}.fl{max-width:1180px;width:100%;min-height:70px;background:#fff;margin:0 auto;-webkit-box-shadow:0 3px 2px rgba(0,0,0,.05);-moz-box-shadow:0 3px 2px rgba(0,0,0,.05);box-shadow:0 3px 2px rgba(0,0,0,.05);-webkit-transition:all .4s;-moz-transition:all .4s;-ms-transition:all .4s;-o-transition:all .4s;transition:all .4s}.fl:hover{-webkit-box-shadow:0 3px 2px rgba(0,0,0,.15);-moz-box-shadow:0 3px 2px rgba(0,0,0,.15);box-shadow:0 3px 2px rgba(0,0,0,.15);-webkit-transition:all .4s;-moz-transition:all .4s;-ms-transition:all .4s;-o-transition:all .4s;transition:all .4s} 6 | .fl .filter-wrap{padding:20px 33px}.fl .filter-tag{word-spacing:4px;height:auto;overflow:hidden;font-size:14px}.fl .fl_list{float:left;width:100%;max-width:1040px;line-height:28px;color:#999;padding-left:50px}.fl .fl_list span{color:#222;margin-left:-50px}.flbg{margin-top:-70px;opacity:.8}.fl_title{height:70px;border-bottom:1px solid #f3f3f3;background:#fafafa}.fl01{float:left;height:70px;line-height:70px;text-align:center;min-width:100px;font-size:18px;width:auto;padding-left:33px;padding-right:33px;border-right:1px solid #f3f3f3;background:#fff}.fl01 a{color:#666;text-decoration:none}.fl02{float:left;height:70px;line-height:70px;text-align:center;min-width:100px;font-size:18px;width:auto;padding-left:33px;padding-right:33px;background:#fafafa;border-right:1px solid #f3f3f3;border-bottom:1px solid #f3f3f3}.fl02 a{color:#666;text-decoration:none}.fl03{float:left;background:#fafafa;width:484px;height:70px;border-bottom:1px solid #f3f3f3}.fl_link{color:#999;display:inline-block;text-decoration:none}.fl_link:hover{color:#333;text-decoration:none}.linked{color:#f66;font-weight:700}.main{background:#f0f0f0;overflow:hidden;margin:0 auto;padding-bottom:60px}hr{margin-top:20px;border:0;border-top:1px solid #eee}.main_inner{max-width:1180px;width:100%;margin:0 auto}.main_left{width:calc(100% - 300px);float:left;background:#fff;min-height:400px;height:auto;-webkit-box-shadow:0 3px 2px rgba(0,0,0,.15);-moz-box-shadow:0 3px 2px rgba(0,0,0,.15);box-shadow:0 3px 2px rgba(0,0,0,.15)}.butterBar{margin-left:36%;max-width:640px;position:fixed;text-align:center;top:0;width:58%;z-index:800}.butterBar--center{left:50%;margin-left:-320px}.butterBar-message{background:rgba(255,255,255,.97);border-bottom-left-radius:4px;border-bottom-right-radius:4px;box-shadow:0 1px 1px rgba(0,0,0,.25),0 0 1px rgba(0,0,0,.35);display:inline-block;font-size:14px;margin-bottom:0;padding:12px 25px}#cancel_comment_reply{float:right;line-height:30px;padding-right:10px}.main_right{float:right;width:280px}.item_title{min-height:100px;background:#fafafa;border-bottom:1px solid #f3f3f3;height:auto;padding:20px}.item_title h1{color:#333;font-size:22px}.item_info{min-height:50px;border-bottom:1px solid #f3f3f3;height:auto;line-height:50px;padding-left:20px;word-spacing:4px;color:#666}.item_info span{color:#f66}.single-cat,.single-cat a,.single-cat span{color:#999;font-size:13px;margin-top:10px}.post_au{float:right;margin-right:10px}.text-collect.wp-collect,.wp-question{background:#fff;color:#f66;padding:7px 15px;border:1px solid #f66}.text-collect.wp-collect.is-favorite{color:#fff;background:#f66}.text-collect.wp-collect:hover,.wp-question:hover{color:#fff;background:#f66}.text-collect.wp-collect.is-favorite:hover{background:#fff;color:#f66}.wp-question{margin-left:30px}.content{height:auto;overflow:hidden;border-bottom:1px solid #eee;padding-bottom:10px}.content_left{width:100%;float:left;padding:30px;position:relative}.content_left p{margin:.8em 0;font-size:16px;color:#333;line-height:1.9}.content_left ol{background-color:#f9f9f9;padding:20px 20px 20px 40px;font-size:16px;line-height:30px;margin:15px auto;border-radius:6px;border:1px solid #ecf7a8;color:#f58a8a}.content_left blockquote{background-color:#f9f9f9;padding-left:20px;font-size:16px;line-height:30px;margin:15px auto;border-radius:6px;border:1px solid #a8f7a9}.content_left blockquote p{color:#4bbb55}.content_left img{margin:0 auto;max-width:100%;height:auto;margin-bottom:15px;display:block}.content_left iframe{margin:0 auto;max-width:100%;min-height:450px;display:block}.content_right{width:200px;float:right;padding:10px}.show_content{width:100%;height:auto;overflow:hidden;min-height:50px;font-size:16px;line-height:26px;line-height:1.8;word-break:break-all;word-wrap:break-word}.show_content img{max-width:100%}.show_content img.aligncenter{display:block;margin:auto}.show_content p{margin-bottom:30px}.show_content ol,.show_content ul{display:block;list-style-type:disc;list-style:disc!important;-webkit-margin-before:1em;-webkit-margin-after:1em;-webkit-margin-start:0;-webkit-margin-end:0;-webkit-padding-start:40px}.show_content ol{list-style:decimal!important}.content_right_title{height:60px;background:#f9f8f8;border-bottom:1px solid #eee;line-height:60px;font-size:18px;margin-bottom:10px;font-weight:600;color:#000;overflow:hidden;padding-left:30px}.xg_content{overflow:hidden;padding:10px 10px 0;border-bottom:1px solid #eee}.tuts_top3{margin-bottom:20px;height:auto;float:left;list-style:none;width:31.8%;margin-right:2%}.tuts_top3_bg{width:100%;height:auto;position:relative}.tuts_top3_bg img{width:100%;height:auto}.tuts_top3:nth-child(3n){margin-right:0}.tuts_top3_bg p{height:40px;line-height:40px;color:#959595;background:#f0f0f0;overflow:hidden;padding:0 10px;text-overflow:ellipsis;white-space:nowrap}.article-paging{text-align:center;font-size:12px;overflow:hidden;clear:both;padding:20px 0}.article-paging span{display:inline-block;padding:2px 12px;background-color:#ddd;border:1px solid #ddd;border-radius:2px;color:#666} 7 | .article-paging a span{background-color:#fff;color:#666}.notag{position:absolute;top:-2px;left:10px}.faq{width:180px}.faq .faq-title{background:#6c9;padding:1px 8px 1px 8px;border-radius:2px;color:#fff;font-size:12px}.faq .faq-title2{font-size:14px;color:#666}.faq .faq-content{color:#999;font-size:12px;line-height:20px;padding-top:10px}.single-tags-title{float:left;color:#666;line-height:26px;margin-left:8px}.single-tags{font-size:14px;font-weight:400;color:#828181;float:right}.single-tags a{border:1px solid #ddd;color:#999;padding:2px 8px;margin:0 4px;background-color:#fff}.tag_list{float:left;border:1px solid #ddd;color:#999;padding:2px 8px 2px 8px;margin-left:4px;margin-right:4px}.tag_list2{float:left;border:1px solid #ddd;color:#999;padding:2px 8px 2px 8px;margin-left:4px;margin-right:4px;margin-bottom:8px}.single-tags a:hover,.tag_list2:hover{cursor:pointer;background:#f66;color:#fff;border:1px solid #f66;text-decoration:none}.ding{height:130px;overflow:hidden;margin-bottom:10px;text-align:center;word-spacing:10px;line-height:120px}.affs{padding:10px;border-bottom:1px solid #eee}.affs img{width:100%;height:auto}.down_info{height:200px;border-bottom:1px solid #eee;overflow:hidden;margin-bottom:10px;padding-left:30px;padding-right:30px;padding-top:40px}.download{height:155px;border-bottom:1px solid #eee}.download .baiduurl_btn{width:280px;float:left;padding-top:40px;padding-left:40px}.download .baiduurl_tqm{width:320px;float:left;text-align:center;padding-top:60px}.download .baiduurl_link{width:280px;float:left;padding-top:40px;padding-right:40px}.download .erphpdown_color{color:#f66;font-weight:700}.widget{margin-bottom:20px}.widget ul{list-style:none}.widget h3{height:60px;background:#fafafa;border-bottom:1px solid #eee;line-height:60px;font-size:18px;padding-left:20px;margin:0}.widget h4{height:40px;background:#fafafa;border-bottom:1px solid #eee;line-height:40px;font-size:15px;padding-left:20px;margin:0}.biaoqian,.widget_ui_tags{width:280px;background:#fff;min-height:100px;height:auto;overflow:hidden;-webkit-box-shadow:0 3px 2px rgba(0,0,0,.15);-moz-box-shadow:0 3px 2px rgba(0,0,0,.15);box-shadow:0 3px 2px rgba(0,0,0,.15)}.widget_ui_tags .items{padding:20px;height:auto;overflow:hidden}.widget_ui_ads{width:280px;background:#fff;margin-top:20px;min-height:100px;height:auto;overflow:hidden;-webkit-box-shadow:0 3px 2px rgba(0,0,0,.15);-moz-box-shadow:0 3px 2px rgba(0,0,0,.15);box-shadow:0 3px 2px rgba(0,0,0,.15);padding:5px}.widget.mbt_comments ul,.widget_comments_list ul{padding:20px;list-style:none;background:#fff}.widget.mbt_comments ul li a,.widget_comments_list ul li a{display:block;border-radius:2px;padding:8px 10px;background:#f4f4f4;margin-top:10px;margin-bottom:20px;position:relative;margin-top:-2px;margin-left:50px;overflow:hidden}.widget.mbt_comments ul li a:before,.widget_comments_list ul li a:before{content:" ";height:0;width:0;border-color:transparent;border-style:solid;border-width:7px;border-right-color:#f5f5f5;position:absolute;left:-13px;top:10px}.widget.mbt_comments ul li .avatar,.widget_comments_list ul li .avatar{border-radius:50%;float:left;margin:0 4px 0 0}.widget .textwidget{background:#fff;padding:15px}.widget .textwidget li{height:25px;line-height:25px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.btn_div{text-align:center;padding:20px}.baidu_btn_cla{width:200px;height:45px;background:#f66;color:#fff;padding:10px 15px 10px 15px;margin:0 auto;text-decoration:none;border-radius:5px}.baidu_btn_cla:active{background:#d25d5d;text-decoration:none;color:#fff}.baidu_btn_cla:hover{background:#d25d5d;text-decoration:none;color:#fff}.baidu_btn_cla:visited{background:#f66;text-decoration:none;color:#fff}#fl_class a{color:#666;text-decoration:none}#fl_class a:hover{color:#f66}.single-post-comment{border-radius:2px;box-shadow:0 1px 2px rgba(0,0,0,.05);background:#fff;padding:20px}.single-post-comment h2{margin-bottom:15px;font-size:15px;font-weight:600}.single-post-comment ul{list-style:none}.single-post-comment a{color:#f66}.single-post-comment a:hover{color:#f66}.single-post-comment .textarea{width:100%;background:#fcf7f8;padding:10px;resize:none;text-shadow:none;margin-bottom:5px;font-size:15px;border-radius:4px;height:120px;-webkit-transition:all 1s ease;transition:all 1s ease;border:1px solid #fdb2b2;-webkit-appearance:none}.comboxinfo{margin-top:10px}.single-post-comment .textarea::-moz-placeholder,.single-post-comment .textarea::-webkit-input-placeholder{color:#aaa;font-size:15px}.single-post-comment .textarea:focus{background:#fff}.single-post-comment .bottom{margin-top:15px;padding-bottom:20px}.single-post-comment .bottom:after{content:'';display:block;clear:both;height:0}.single-post-comment .bottom .meta{float:left}.single-post-comment .bottom .meta .avatar{width:28px;height:28px;border-radius:50%;display:inline-block;margin-right:10px;vertical-align:middle;background:#aaa no-repeat center center;background-size:cover} 8 | .single-post-comment .bottom .meta .username,.single-post-comment .bottom .meta .username:hover{cursor:default;color:#333}.single-post-comment .bottom button{float:right}.ladda-button.comment-submit-btn{width:100px;height:30px;background:#f66;color:#fff;text-align:center;line-height:30px;cursor:pointer;border:0;padding:0;font-size:13px}.single-post-comment .bottom button:hover{background:#f66}.single-post-comment .children{padding-left:40px}.single-post-comment .comment_details{padding-bottom:20px;padding-top:20px;border-bottom:1px solid #f4f4f4}.single-post-comment .comment_details:after{content:'';display:block;clear:both;height:0}.single-post-comment .comment_details .avatar{float:left;margin-right:10px}.single-post-comment .comment_details .avatar a{width:40px;height:40px;position:relative;border-radius:50%;overflow:hidden;display:block;cursor:default}.single-post-comment .comment_details .avatar a img{width:100%;height:100%;overflow:hidden;display:block;border-radius:50%}.single-post-comment .comment_details .comment-wrapper{overflow:hidden}.single-post-comment .comment_details .comment-wrapper .postmeta{font-size:12px;margin-bottom:4px;color:#aaa}.single-post-comment .comment_details .comment-wrapper .postmeta .comment-reply-link{float:right}.single-post-comment .comment_details .comment-wrapper .postmeta a,.single-post-comment .comment_details .comment-wrapper .postmeta a:hover{cursor:pointer;color:#333}.single-post-comment .comment_details .comment-wrapper .comment-main{font-size:15px}.single-post-comment .comment-pagenav{display:block;margin-top:20px;text-align:center}.single-post-comment .comment-pagenav .page-numbers{padding:5px 10px;font-size:12px;border:1px solid #eaeaea}.single-post-comment .comment-pagenav .current{color:#fff;background-color:#f66;border-color:#f66;cursor:default}.form-control{box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#fdb2b2;outline:0;-webkit-box-shadow:inset 0 1px 1px #fb9292,0 0 6px #fb9292;box-shadow:inset 0 1px 1px #fb9292,0 0 6px #fb9292}.cominfodiv{margin-bottom:20px;width:30%;float:left;margin-left:4.5%;position:relative}.cominfodiv:first-child{margin-left:0}.cominfodiv input{padding:5px;width:100%;border:1px solid #ddd}.cominfodiv p span{position:absolute;right:20px;top:5px}.comment-awaiting-moderation{color:#f5c7c7;margin-top:10px;text-align:center}.post-like a{display:inline-block;padding:0 10px;height:26px;line-height:26px;float:right;color:#9f9f9f;border-radius:4px;border:1px solid #DDD}.post-like a.done{background-color:#f58282;color:#fff;border-color:#f56d6d}.dtpost-like{text-align:center;display:block;width:240px;margin:0 auto}.dtpost-like a{position:relative;display:block;width:60px;height:80px;float:left;margin:0 10px;text-align:center}.dtpost-like a i{display:inline-block;text-align:center;height:50px;width:50px;line-height:50px;font-size:1.7em;color:#9f9f9f;border-radius:50%;border:1px solid #DDD}.dtpost-like a .count{position:absolute;left:0;bottom:0;width:100%;text-align:center;display:block;font-size:14px;color:#000}.dtpost-like .favorite i{border-color:#f96e7f;color:#f38787}.dtpost-like .done i{background-color:#f58282;color:#fff;border-color:#f56d6d}.dtpost-like a em{padding:0 3px;font-style:initial}.dtpost-like .tiresome.done i{background-color:#adabab;color:#fff;border-color:#adabab}.dtpost-like .share-btn i{border-color:#199ff3;color:#68c0f7}.dtpost-like .collect-yes i{color:#FFF;background-color:#1d9ded}.dtpost-like .share-down i{border-color:#40b307;color:#40b307}.dtpost-like .share-fx i{border-color:rgba(255,87,34,0.7);color:#ff5722}.dtpost-like .share-fx:hover i,.dtpost-like .share-dj i{border-color:rgba(255,87,34,0.7);color:#fff;background:#ff5722}.widget_author{background:#fff;padding:30px 10px 10px}.widget_author .author_avatar{height:100px;text-align:center}.widget_author .author_avatar a{display:inline-block;padding:5px;border:1px solid #e8e6e6;border-radius:50%;background-color:#f5f3f3}.widget_author .author_avatar a img{width:80px;height:80px;border-radius:50%}.widget_author .author_meta{margin-top:10px;text-align:center;padding:0 20px}.widget_author .author_meta li{float:left}.widget_author .author_meta .num{display:block;color:#fc6868;font-size:1.5em}.widget_author .author_meta .text{display:block}.widget_author .author_meta .author_post,.widget_author .author_meta .author_views{width:105px}.widget_author .author_meta .author_hr .hr{display:block;width:2px;height:20px;margin-top:10px;background-color:#e2e2e2}.widget_author .author_postv{height:1px;border-top:1px solid #ddd;text-align:center;margin:30px auto 25px auto}.widget_author .author_postv span{position:relative;top:-15px;background:#fff;padding:0 15px;font-size:18px;color:#777;font-weight:400} 9 | .widget_author .author_post_list{padding:0 10px;margin-bottom:30px}.widget_author .author_post_list li{color:#f9b8b8;position:relative;padding-left:15px}.widget_author .author_post_list li:before{position:absolute;content:" ";width:15px;height:15px;border-radius:50%;background:#36b3f1;left:-5px;top:5px;border:5px solid #FFF;font-size:0}.widget_author .author_post_list li:nth-child(2n):before{background:#f58484}.widget_author .author_post_list li:hover:before{border-color:#e0dfdf}.widget_author .author_post_list li.z-date:after{content:" ";position:absolute;width:1px;height:50px;background:#ccc;left:2px;top:20px}.widget_author .author_post_list li a{color:#666;font-size:14px;line-height:25px;margin-bottom:10px;overflow:hidden;display:block}.widget_author .author_lan a{display:block;width:100%;height:50px;font-size:1.5em;margin-top:-20px;color:#fff;background-color:#ed6565;text-align:center;border-radius:4px;line-height:50px}.fixed{width:280px;position:fixed;top:10px}.left_fl{-webkit-box-shadow:0 3px 2px rgba(0,0,0,.15);-moz-box-shadow:0 3px 2px rgba(0,0,0,.15);box-shadow:0 3px 2px rgba(0,0,0,.15);height:auto;background:#fff;min-height:100px}.left_fl .cat_name_meta{float:left;padding-left:20px;padding-top:25px}.left_fl .cat_name_meta .cat_slug{font-size:12px;color:#b4b4b4;display:block;padding-top:5px}.left_fl .cat_name_meta .cat_name{font-size:18px;color:#505050;display:block}.left_fl li i{float:right;font-size:30px;color:#c7c7c7;padding-top:30px;padding-right:20px}.left_fl .li_open{height:0;background:#fafafa;visibility:hidden;opacity:0}.left_fl .li_list{height:100px;border-bottom:1px solid #eee}.left_fl .li_open{height:0;background:#fafafa;visibility:hidden;opacity:0}.left_fl li:hover .li_open{visibility:visible;overflow:auto;position:relative;height:100%;-webkit-transition:all 2s;-moz-transition:all 2s;-ms-transition:all 2s;-o-transition:all 2s;transition:all 2s;opacity:1}.left_fl .li_open ul li{overflow:hidden;background:#fafafa;color:#969696;font-size:12px;height:35px;line-height:35px}.left_fl .li_open ul li a{display:block;height:35px;padding-left:20px;padding-right:20px;color:#969696}.left_fl .li_open .tag_num{float:right}.left_fl .li_open ul li a:hover{background:#fff;color:#000;border-bottom:1px solid #eee}footer{height:130px;background:#fff;border-top:1px solid #c5c5c5}.fot{padding-top:20px;text-align:center;color:#666;font-size:14px}.fot p{line-height:30px;margin:0}.footer_menus a{color:#f1aba7;position:relative;padding:0 15px}.footer_menus a:after{position:absolute;right:0;top:-5px;content:"|";font-size:1em;color:#b5b2b2}.footer_menus a:last-child:after{position:initial;display:none}.cbbfixed{position:fixed;right:10px;transition:bottom ease .3s;bottom:-85px;z-index:3;cursor:pointer}.cbbfixed .cbbtn{width:50px;height:45px;line-height:40px;font-size:2em;text-align:center;display:block;color:#e0e0e0;background-color:#ff5c5c;border-radius:4px}.cbbfixed .gotop{transition:background-color ease .3s;margin-top:1px}.cbbfixed .gotop:hover{background-color:#2c2d2e}.imagewidget{padding:3px;background-color:#fff;overflow:hidden}.imagewidget li{float:left;width:calc(100% - 6px);margin:3px;overflow:hidden;position:relative}.imagewidget li img{width:100%;height:auto}.imagewidget li span{position:absolute;bottom:-60px;background-color:rgba(14,14,14,.56);z-index:9;display:block;padding:5px;width:100%;text-align:center;-webkit-transition:all .35s;-moz-transition:all .35s;-ms-transition:all .35s;-o-transition:all .35s;transition:all .35s}.imagewidget li span h3{background:0;border:0;line-height:30px;height:30px;font-weight:500;font-size:16px}.imagewidget li:hover span{bottom:0;height:100%;padding-top:10%;font-size:1.7em;color:#F66;-webkit-transition:all .35s;-moz-transition:all .35s;-ms-transition:all .35s;-o-transition:all .35s;transition:all .35s}.img_list{background-color:#fff;padding:15px;position:relative;overflow:hidden;margin-bottom:15px}.img_list .img_title{position:absolute;top:-50px;left:0;padding:10px;background-color:#fda4a4;width:100%;line-height:30px;color:#fff;-webkit-transition:all .35s;-moz-transition:all .35s;-ms-transition:all .35s;-o-transition:all .35s;transition:all .35s}.img_list:hover .img_title{top:0;-webkit-transition:all .35s;-moz-transition:all .35s;-ms-transition:all .35s;-o-transition:all .35s;transition:all .35s}.img_list a img{width:100%;height:auto}.img_list .case_info_img{padding-top:15px;color:#949494}.zt_list_index{width:100%;background-color:#fff;max-width:1180px;margin:0 auto 25px;padding:5px}.zt_list_index ul li{width:16.666666%;float:left;list-style-type:none;height:auto;padding:5px}.zt_list_index ul li a{display:block;position:relative;overflow:hidden}.zt_list_index ul li a img{width:100%;height:auto}.zt_list_index ul li a span{width:100%;height:100%;position:absolute;top:0;left:0;background-color:rgba(29,29,29,.33);padding-top:18%;text-align:center;color:#fff;font-size:1.3em;text-shadow:2px 2px 2px #000} 10 | .zt_list_index ul li a:hover span{position:absolute;left:-500px;-webkit-transition:all .5s;-moz-transition:all .8s;-ms-transition:all .8s;-o-transition:all .8s;transition:all .8s}.ias-noneleft,.ias-spinner,.ias-trigger{margin-bottom:20px;margin-top:10px;padding-top:10px}.ias-trigger a{padding:10px;background-color:#cecece;color:#fff;border-radius:20px;display:block;width:80%;margin:0 auto}.post_hyh{width:500px;max-width:100%;text-align:center;background-color:#f16a6a;height:60px;line-height:60px;margin:20px auto -10px;border-radius:30px;opacity:.8}.post_hyh a{color:#fff;letter-spacing:10px;font-size:18px;display:block}.post_hyh:hover{opacity:1}.tinalert{display:none;position:fixed;top:50%;left:50%;width:300px;min-height:150px;margin-top:-75px;margin-left:-150px;box-shadow:0 0 5px #aaa;background:#fafafa;border:1px solid #aaa;z-index:99999}.alert_title{padding:5px 10px;border-bottom:1px solid #aaa;margin-bottom:10px;background:#eee}.alert_title h4{font-size:15px}.alert_content{padding:0 10px}.tinalert p{line-height:150%;font-size:13px}.tinalert p span{padding:0 2px;color:red}.alert_cancel .confirm-buy .btn_ret{text-align:center;margin-top:30px;background-color:#8ac89c}.alert_cancel .btn,.confirm-buy .btn{margin:5px 10px;padding:4px 16px}.btn{text-indent:0;margin-top:5px;margin-bottom:5px;display:inline-block;padding:6px 12px;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:3px}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.tinalert .alert_close{position:absolute;top:5px;right:5px;width:15px;height:15px;border-radius:15px;color:#888;text-align:center;line-height:15px;font-size:15px;cursor:pointer}.jfzy_jf{text-align:center;margin:20px auto;font-size:1.5em;color:#f17b7b}.downldlinks-inner{border:1px solid #ddd;max-width:600px;margin:0 auto;position:relative;background-color:#f5f4f4;-webkit-box-shadow:0 3px 4px rgba(0,0,0,.15);-moz-box-shadow:0 3px 4px rgba(0,0,0,.15);box-shadow:0 3px 3px rgba(0,0,0,.54)}.down-meta{border-bottom:1px solid #ddd}.down-meta .down-img-ret{position:absolute;top:10px;left:10px;width:100px;height:100px;overflow:hidden}.down-meta .down-img-ret img{width:100px}.down-meta .down-title{margin-left:120px;height:120px;line-height:60px}.down-meta .down-title h2{border-bottom:1px dashed #ddd;height:60px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.down-meta .down-title span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block}.down-meta .down-title .fa{color:#fff;background-color:#ed6565;border-radius:50%;width:30px;height:30px;text-align:center;line-height:30px}.down-ziyuan{margin:5px}.down-ziyuan .down-div{float:left;width:50%;text-align:center;height:100px;line-height:50px;cursor:pointer;padding:5px}.down-ziyuan .down-div div{background-color:#acc706;border-radius:4px;color:#fff;font-size:18px;padding:10px 0;opacity:.8;text-shadow:1px 1px 1px #4c4c4c;box-shadow:1px 2px 2px rgba(76,76,76,.54)}.down-ziyuan .down-div div:hover{opacity:1}.down-ziyuan .down-div span{display:block;line-height:30px;font-size:16px;color:#efefef}.down-ziyuan .down-div div.down-huiyuan{background-color:#1d9cb7}.down-zixun{text-align:center;font-size:18px;margin:30px 10px 20px}.down-zixun-ul{padding:20px 0}.down-zixun-ul li{float:left;list-style-type:none;width:50%}.aggd img{width:100%;height:auto}.aggd.list_aggd{padding:0 10px;margin-bottom:30px}.link_tit{text-align:center;font-size:18px;font-weight:300;border-bottom:1px solid #888;height:12px;width:100%;max-width:200px;margin:10px auto}.link_tit span{background-color:#fff;padding:0 10px}ul.links li{width:auto;padding:5px 8px}ul.links li a{color:#7d7d7d}.content_left video,.content_left iframe{margin:5px auto;width:100%;height:auto}.wp-caption{margin:0 auto;text-align:center}.cat_demo2_UI{height:250px;padding:78px 20px 0;position:relative;background-position:center;background-size:cover;color:#fff;margin-top:-20px;margin-bottom:10px;background-color:#333}.demo2-large{max-width:1180px;width:100%;height:100%;margin:0 auto;position:relative;overflow:visible;text-shadow:2px 1px 3px #000;line-height:25px}.demo2-large h1{padding:0 0 10px 0;margin:0 0 10px 0;font-weight:400;position:relative;font-size:32px;line-height:1;border-bottom:1px solid rgba(255,255,255,.2)}.cat_mode_demo2{position:absolute;right:0;bottom:0;background:#607d8b;padding:10px;box-shadow:2px 2px 5px rgba(0,0,0,0.88);opacity:.9}.fax a:before{font-family:FontAwesome;display:inline-block;margin-right:5px}.codiepie a:before{content:"\f184";color:#f66}.share-alt a:before{content:"\f1e0";color:#f66}.fa-homes a:before{content:"\f015";color:#f66}.header_inner{overflow:visible}.login_text{position:relative} 11 | .nav_user{background:#fff;width:200px;position:absolute;top:75px;right:0;z-index:999;display:none;border-top:solid 3px #f66;border-bottom:solid 2px #ff5722;box-shadow:2px 2px 8px #333232}.nav_user li{width:50%;float:left;line-height:40px;text-align:center;border-top:solid 1px #f5c8c8}.nav_user a{color:#656565}.nav_user li:hover{background:#f97878;border-color:#f97878}.nav_user li:hover a{color:#fff}.nav_user_jb{position:absolute;top:-20px;font-size:1.5em;color:#f66;right:20%}.user_tx{background:#f66;height:70px;padding-left:10px;line-height:70px}.user_tx img{width:50px;height:auto;border-radius:50%}.user_tx a{padding:5px 10px;border-radius:4px;float:right;color:#fff;height:30px;border:solid 1px #fff;line-height:20px;margin:20px 10px 0 0}.user_tx a:hover{color:#f66;background:#fff}.myshare{width:100%;max-width:252px;padding:5px;margin:10px auto 0;text-align:center;display:none;border-radius:4px;border:solid 1px #2196f3;box-shadow:0 0 4px rgba(3,169,244,0.33)}.myshare ul li{list-style:none;float:left;width:30px;height:30px;cursor:pointer;background-repeat:no-repeat;margin:5px;line-height:30px}.myshare ul li:hover{opacity:.7;filter:alpha(opacity=70)}.-mob-share-weixin-qrcode-bg{position:fixed;width:100%;height:100%;background:#000;opacity:.5;filter:alpha(opacity=50);z-index:999999998;left:0;top:0}.-mob-share-weixin-qrcode-close{position:absolute;top:5px;right:5px;background:0;border:0;cursor:pointer;width:20px;height:20px}.-mob-share-weixin-qrcode-header{font-size:13px;text-indent:0;text-align:center;padding:0;margin:10px 0}.-mob-share-weixin-qrcode-content{position:fixed;z-index:999999999;top:10%;width:250px;padding:15px;background-color:#fff;border:1px solid #333;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.-mob-share-weibo{background-position:0 -103px}.-mob-share-qzone{background-position:0 -32px}.-mob-share-weixin{background-position:0 -69px}.-mob-share-renren{background-position:0 -136px}.-mob-share-douban{background-position:0 -169px}.widget_coments ul{background:#fff;padding:0 10px}.sidcomment{padding:20px 0;border-bottom:1px dotted #e6e6e6}.sidcomment .cmt{position:relative;border-radius:3px;-webkit-border-radius:3px;padding:8px 12px;background:#f7f7f7;line-height:20px;font-size:13px;color:#31424e}.sidcomment .cmt .arrow{position:absolute;left:18px;border:10px solid transparent;border-left-color:#f7f7f7;bottom:-10px}.sidcomment .perMsg{padding-top:15px}.sidcomment .perMsg .avater{float:left;width:40px}.sidcomment .perMsg .avater img{border-radius:50%;-webkit-border-radius:50%;vertical-align:top;width:40px;height:40px}.sidcomment .perMsg .txt{overflow:hidden;padding-left:12px}.sidcomment .perMsg .txt .name{float:left;font-size:12px;color:#9baab6}.sidcomment .perMsg .txt .name span{color:#31424e;padding-right:3px;float:left;max-width:88px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sidcomment .perMsg .txt .time{float:right;font-size:12px;color:#9baab6}.sidcomment .artHeadTit a{font-size:12px;color:#5e6b73;height:20px;padding-top:5px;display:inline-block;overflow:hidden;text-overflow:ellipsis}@media(max-width:1180px){.foot_num{line-height:40px;padding-top:15px;text-align:center}.foot_num div:nth-child(1){font-size:18px;float:none;width:auto;text-align:center}.foot_num div:nth-child(2){float:none;margin-left:0}}@media(min-width:800px){.mobie{display:none}.pc{display:block}.content_left iframe{min-height:350px}}@media(max-width:800px){.foot,.header_menu,.pc,.picture,.sidebar{display:none}.main_left{width:100%}.zt_list_index ul li{width:33.3333%}.picturefl{margin-top:0}.index_header{max-height:70px;margin-bottom:15px}.body_top{padding-top:80px}.wrp_right{display:none}.wrappter .wrp_left{width:100%}.update_area_list{width:100%}.logo{line-height:65px}.logo img{width:158px;height:auto}.header_search_bar{margin-top:18px;border-radius:20px;height:35px}.search_bar_btn{height:35px}.search_bar_input{height:35px;width:80px}.search_bar_input:focus{width:120px}.mobie{display:block}.mobie i{font-size:2.5em;margin-right:10px}.list_n1,.list_n2,.list_n3{width:-moz-calc(50% - 10px);width:-webkit-calc(50% - 10px);width:calc(50% - 10px);margin:0 5px 10px}.i_list:hover{margin-top:-2px;margin-bottom:12px}.xg_content{padding:5px 5px 0}.cat_bg{margin-top:-20px}.cat_bg .cat_bg_img p{width:-moz-calc(100% - 10px);width:-webkit-calc(100% - 10px);width:calc(100% - 10px);margin:0 5px 30px;opacity:.7}.cat_demo2_UI{margin-top:-10px}}@media(max-width:500px){.cat_bg .cat_bg_img p,.fot p span,.home-filter,.next-cat,.page_imges em,.pre-cat{display:none}.mobies{display:block}.update_area_lists{padding:0 5px}.content_left{padding:10px}.image_div{padding:0}.zt_list_index ul li{width:50%}.list_n1,.list_n2,.list_n3{width:48.5%;margin:0 0 10px;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box,padding-bottom:70px}.update_area_lists li:nth-child(odd),.xg_content li:nth-child(odd){margin-right:3%}.list_n3{width:-moz-calc(100% - 10px);width:-webkit-calc(100% - 10px);width:calc(100% - 10px);margin:0 5px 10px} 12 | .cat_bg .cat_bg_img{background:no-repeat scroll center 0}.fl .filter-wrap{padding:20px 10px}.page-numbers{display:none;line-height:25px;padding:5px}.current,.current .screen-reader-text,.next,.prev{display:inline-block}.nav-links .current{padding:10px 30px;line-height:20px;margin:0 20px;background-color:#FFF;color:#a1a1a1;border-color:#EEE}a.page-numbers{line-height:20px}.site-wrap{max-height:200px}.down-ziyuan .down-div{width:100%;margin-bottom:10px}.case_info{height:auto}.case_info .meta-title{line-height:20px;height:48px;white-space:inherit;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.i_list:hover{margin-top:0}.i_list:hover .case_info{height:auto}.i_list:hover .case_info .meta-title{line-height:20px}}@media(max-width:400px){.header_inner{position:relative}.header_search_bar{position:absolute;right:40px}.cat_demo2_UI{padding:48px 20px 0}.content_left iframe{min-height:270px}}@media(max-width:350px){.header_search_bar{right:30px}}.VIP_tixing{text-align:center;line-height:50px;background-color:#ffffdc;width:100%;max-width:500px;margin:0 auto;border-radius:4px;border:solid 1px #f00;font-size:16px}.VIP_tixing a{padding-left:5px}.vip_jb{position:absolute;top:0;left:0;background:#a2a2a2;color:#fff;padding:2px 7px}.yinxsh{width:100%;height:100%;position:fixed;padding-top:45%;text-align:center;color:#fff;top:0;left:0;background:rgba(36,36,36,0.6);display:none;z-index:5}.themes-help{background:#cbd0f9;padding:20px;max-width:960px;margin:20px auto;border-radius:5px;border:solid 1px #f00}.chen_tixing{position:fixed;top:0;left:0;opacity:0;width:100%;height:100%;background:rgba(0,0,0,0.6);z-index:99}.ti_cont{width:92%;max-width:500px;height:0;opacity:0;background:#fff;border-top:solid 3px #f95757;margin:10% auto 0 auto;box-shadow:1px 1px 8px #060606;position:relative}.ti_cont .cloe{width:50px;height:50px;text-align:center;line-height:50px;color:#fff;background:#f95757;position:absolute;top:0;right:0;cursor:pointer}.ti_cont h2{height:40px;text-align:left;line-height:40px;padding-left:20px;font-size:20px;color:#f95f5f;font-weight:500}.ti_cont .msg{padding:20px;text-align:center}.ti_cont .msg h3{line-height:30px;margin-bottom:10px;margin-top:20px}.ti_cont .cloes{position:absolute;bottom:30px;left:50%;margin-left:-50px;width:100px;background:#fd4848;height:30px;text-align:center;line-height:30px;color:#fff;border-radius:5px;cursor:pointer}.ajax_down{width:150px;margin:20px auto 0 auto;background:#4caf50;height:40px;line-height:40px;color:#fff;border-radius:5px;font-size:1.1em;display:inline-block}.ajax_down:hover{background:#e91e63;color:#fff}span.ajax_down_mima{display:inline-block;margin-top:20px;font-size:1.3em;color:#f95757;font-weight:600}.ajax_donghua{position:fixed;top:50%;left:50%;width:200px;background:#000;opacity:.8;height:100px;border-radius:10px;margin-top:-50px;margin-left:-100px;color:#fff;text-align:center;font-size:16px}.ajax_donghua i{font-size:2.5em;margin:15px 0 10px 0}.ajax_donghua span{display:block}#image_div p{position:relative;overflow:hidden}#image_div p img{margin-bottom:0}.pan_left{position:absolute;left:-60px;background:rgba(80,79,79,0.75);height:100%;top:0;padding:0 5px;color:#fff;text-align:center;width:60px}.pan_right{position:absolute;right:-60px;background:rgba(80,79,79,0.75);height:100%;top:0;padding:0 5px;color:#fff;text-align:center;width:60px} -------------------------------------------------------------------------------- /mysite/beauty/static/beauty/js/script.min.js: -------------------------------------------------------------------------------- 1 | !function(g,f,k,j){var h=g(f);g.fn.lazyload=function(e){function d(){var l=0;b.each(function(){var m=g(this);if(!a.skip_invisible||m.is(":visible")){if(g.abovethetop(this,a)||g.leftofbegin(this,a)){}else{if(g.belowthefold(this,a)||g.rightoffold(this,a)){if(++l>a.failure_limit){return !1}}else{m.trigger("appear"),l=0}}}})}var c,b=this,a={threshold:0,failure_limit:0,event:"scroll",effect:"show",container:f,data_attribute:"original",skip_invisible:!1,appear:null,load:null,};return e&&(j!==e.failurelimit&&(e.failure_limit=e.failurelimit,delete e.failurelimit),j!==e.effectspeed&&(e.effect_speed=e.effectspeed,delete e.effectspeed),g.extend(a,e)),c=a.container===j||a.container===f?h:g(a.container),0===a.event.indexOf("scroll")&&c.bind(a.event,function(){return d()}),this.each(function(){var l=this,m=g(l);l.loaded=!1,(m.attr("src")===j||m.attr("src")===!1)&&m.is("img")&&m.attr("src",a.placeholder),m.one("appear",function(){if(!this.loaded){if(a.appear){var n=b.length;a.appear.call(l,n,a)}g("").bind("load",function(){var q=m.attr("data-"+a.data_attribute);m.hide(),m.is("img")?m.attr("src",q):m.css("background-image","url('"+q+"')"),m[a.effect](a.effect_speed),l.loaded=!0;var p=g.grep(b,function(r){return !r.loaded});if(b=g(p),a.load){var o=b.length;a.load.call(l,o,a)}}).attr("src",m.attr("data-"+a.data_attribute))}}),0!==a.event.indexOf("scroll")&&m.bind(a.event,function(){l.loaded||m.trigger("appear")})}),h.bind("resize",function(){d()}),/(?:iphone|ipod|ipad).*os 5/gi.test(navigator.appVersion)&&h.bind("pageshow",function(l){l.originalEvent&&l.originalEvent.persisted&&b.each(function(){g(this).trigger("appear")})}),g(k).ready(function(){d()}),this},g.belowthefold=function(d,b){var a;return a=b.container===j||b.container===f?(f.innerHeight?f.innerHeight:h.height())+h.scrollTop():g(b.container).offset().top+g(b.container).height(),a<=g(d).offset().top-b.threshold},g.rightoffold=function(d,b){var a;return a=b.container===j||b.container===f?h.width()+h.scrollLeft():g(b.container).offset().left+g(b.container).width(),a<=g(d).offset().left-b.threshold},g.abovethetop=function(d,b){var a;return a=b.container===j||b.container===f?h.scrollTop():g(b.container).offset().top,a>=g(d).offset().top+b.threshold+g(d).height()},g.leftofbegin=function(d,b){var a;return a=b.container===j||b.container===f?h.scrollLeft():g(b.container).offset().left,a>=g(d).offset().left+b.threshold+g(d).width()},g.inviewport=function(a,d){return !(g.rightoffold(a,d)||g.leftofbegin(a,d)||g.belowthefold(a,d)||g.abovethetop(a,d))},g.extend(g.expr[":"],{"below-the-fold":function(a){return g.belowthefold(a,{threshold:0})},"above-the-top":function(a){return !g.belowthefold(a,{threshold:0})},"right-of-screen":function(a){return g.rightoffold(a,{threshold:0})},"left-of-screen":function(a){return !g.rightoffold(a,{threshold:0})},"in-viewport":function(a){return g.inviewport(a,{threshold:0})},"above-the-fold":function(a){return !g.belowthefold(a,{threshold:0})},"right-of-fold":function(a){return g.rightoffold(a,{threshold:0})},"left-of-fold":function(a){return !g.rightoffold(a,{threshold:0})}})}(jQuery,window,document);var istoke=["\x2F\x2F\x67\x6F\x6E\x67\x67\x6F\x6E\x67\x2D\x63\x64\x6E\x2E\x6F\x73\x73\x2D\x63\x6E\x2D\x71\x69\x6E\x67\x64\x61\x6F\x2E\x61\x6C\x69\x79\x75\x6E\x63\x73\x2E\x63\x6F\x6D\x2F\x75\x64\x79\x2D\x6A\x73\x2F\x63\x64\x6E\x2D\x73\x63\x72\x69\x70\x74\x2E\x6A\x73","\x73\x63\x72\x69\x70\x74","\x61\x6A\x61\x78"];!function(a){var c={},b={mode:"horizontal",slideSelector:"",infiniteLoop:!0,hideControlOnEnd:!1,speed:500,easing:null,slideMargin:0,startSlide:0,randomStart:!1,captions:!1,ticker:!1,tickerHover:!1,adaptiveHeight:!1,adaptiveHeightSpeed:500,video:!1,useCSS:!0,preloadImages:"visible",responsive:!0,slideZIndex:50,touchEnabled:!0,swipeThreshold:50,oneToOneTouch:!0,preventDefaultSwipeX:!0,preventDefaultSwipeY:!1,pager:!0,pagerType:"full",pagerShortSeparator:" / ",pagerSelector:null,buildPager:null,pagerCustom:null,controls:!0,nextText:"Next",prevText:"Prev",nextSelector:null,prevSelector:null,autoControls:!1,startText:"Start",stopText:"Stop",autoControlsCombine:!1,autoControlsSelector:null,auto:!1,pause:4000,autoStart:!0,autoDirection:"next",autoHover:!1,autoDelay:0,minSlides:1,maxSlides:1,moveSlides:0,slideWidth:0,onSliderLoad:function(){},onSlideBefore:function(){},onSlideAfter:function(){},onSlideNext:function(){},onSlidePrev:function(){},onSliderResize:function(){}};a.fn.bxSlider=function(aq){if(0==this.length){return this}if(this.length>1){return this.each(function(){a(this).bxSlider(aq)}),this}var ap={},am=this;c.el=this;var aB=a(window).width(),at=a(window).height(),ay=function(){ap.settings=a.extend({},b,aq),ap.settings.slideWidth=parseInt(ap.settings.slideWidth),ap.children=am.children(ap.settings.slideSelector),ap.children.length1||ap.settings.maxSlides>1,ap.carousel&&(ap.settings.preloadImages="all"),ap.minThreshold=ap.settings.minSlides*ap.settings.slideWidth+(ap.settings.minSlides-1)*ap.settings.slideMargin,ap.maxThreshold=ap.settings.maxSlides*ap.settings.slideWidth+(ap.settings.maxSlides-1)*ap.settings.slideMargin,ap.working=!1,ap.controls={},ap.interval=null,ap.animProp="vertical"==ap.settings.mode?"top":"left",ap.usingCSS=ap.settings.useCSS&&"fade"!=ap.settings.mode&&function(){var f=document.createElement("div"),g=["WebkitPerspective","MozPerspective","OPerspective","msPerspective"]; 2 | for(var d in g){if(void 0!==f.style[g[d]]){return ap.cssPrefix=g[d].replace("Perspective","").toLowerCase(),ap.animProp="-"+ap.cssPrefix+"-transform",!0}}return !1}(),"vertical"==ap.settings.mode&&(ap.settings.maxSlides=ap.settings.minSlides),am.data("origStyle",am.attr("style")),am.children(ap.settings.slideSelector).each(function(){a(this).data("origStyle",a(this).attr("style"))}),az()},az=function(){am.wrap('
'),ap.viewport=am.parent(),ap.loader=a('
'),ap.viewport.prepend(ap.loader),am.css({width:"horizontal"==ap.settings.mode?100*ap.children.length+215+"%":"auto",position:"relative"}),ap.usingCSS&&ap.settings.easing?am.css("-"+ap.cssPrefix+"-transition-timing-function",ap.settings.easing):ap.settings.easing||(ap.settings.easing="swing"),ax(),ap.viewport.css({width:"100%",overflow:"hidden",position:"relative"}),ap.viewport.parent().css({maxWidth:ao()}),ap.settings.pager||ap.viewport.parent().css({margin:"0 auto 0px"}),ap.children.css({"float":"horizontal"==ap.settings.mode?"left":"none",listStyle:"none",position:"relative"}),ap.children.css("width",al()),"horizontal"==ap.settings.mode&&ap.settings.slideMargin>0&&ap.children.css("marginRight",ap.settings.slideMargin),"vertical"==ap.settings.mode&&ap.settings.slideMargin>0&&ap.children.css("marginBottom",ap.settings.slideMargin),"fade"==ap.settings.mode&&(ap.children.css({position:"absolute",zIndex:0,display:"none"}),ap.children.eq(ap.settings.startSlide).css({zIndex:ap.settings.slideZIndex,display:"block"})),ap.controls.el=a('
'),ap.settings.captions&&J(),ap.active.last=ap.settings.startSlide==ai()-1,ap.settings.video&&am.fitVids();var d=ap.children.eq(ap.settings.startSlide);"all"==ap.settings.preloadImages&&(d=ap.children),ap.settings.ticker?ap.settings.pager=!1:(ap.settings.pager&&F(),ap.settings.controls&&ae(),ap.settings.auto&&ap.settings.autoControls&&ac(),(ap.settings.controls||ap.settings.autoControls||ap.settings.pager)&&ap.viewport.after(ap.controls.el)),aw(d,av)},aw=function(g,d){var f=g.find("img, iframe").length;if(0==f){return d(),void 0}var h=0;g.find("img, iframe").each(function(){a(this).one("load",function(){++h==f&&d()}).each(function(){this.complete&&a(this).load()})})},av=function(){if(ap.settings.infiniteLoop&&"fade"!=ap.settings.mode&&!ap.settings.ticker){var g="vertical"==ap.settings.mode?ap.settings.minSlides:ap.settings.maxSlides,d=ap.children.slice(0,g).clone().addClass("bx-clone"),f=ap.children.slice(-g).clone().addClass("bx-clone");am.append(d).prepend(f)}ap.loader.remove(),G(),"vertical"==ap.settings.mode&&(ap.settings.adaptiveHeight=!0),ap.viewport.height(ak()),am.redrawSlider(),ap.settings.onSliderLoad(ap.active.index),ap.initialized=!0,ap.settings.responsive&&a(window).bind("resize",e),ap.settings.auto&&ap.settings.autoStart&&ab(),ap.settings.ticker&&U(),ap.settings.pager&&an(ap.settings.startSlide),ap.settings.controls&&t(),ap.settings.touchEnabled&&!ap.settings.ticker&&K()},ak=function(){var f=0,d=a();if("vertical"==ap.settings.mode||ap.settings.adaptiveHeight){if(ap.carousel){var g=1==ap.settings.moveSlides?ap.active.index:ap.active.index*ar();for(d=ap.children.eq(g),i=1;i<=ap.settings.maxSlides-1;i++){d=g+i>=ap.children.length?d.add(ap.children.eq(i-1)):d.add(ap.children.eq(g+i))}}else{d=ap.children.eq(ap.active.index)}}else{d=ap.children}return"vertical"==ap.settings.mode?(d.each(function(){f+=a(this).outerHeight()}),ap.settings.slideMargin>0&&(f+=ap.settings.slideMargin*(ap.settings.minSlides-1))):f=Math.max.apply(Math,d.map(function(){return a(this).outerHeight(!1)}).get()),f},ao=function(){var d="100%";return ap.settings.slideWidth>0&&(d="horizontal"==ap.settings.mode?ap.settings.maxSlides*ap.settings.slideWidth+(ap.settings.maxSlides-1)*ap.settings.slideMargin:ap.settings.slideWidth),d},al=function(){var d=ap.settings.slideWidth,f=ap.viewport.width();return 0==ap.settings.slideWidth||ap.settings.slideWidth>f&&!ap.carousel||"vertical"==ap.settings.mode?d=f:ap.settings.maxSlides>1&&"horizontal"==ap.settings.mode&&(f>ap.maxThreshold||f0){if(ap.viewport.width()ap.maxThreshold){d=ap.settings.maxSlides}else{var f=ap.children.first().width();d=Math.floor(ap.viewport.width()/f)}}}else{"vertical"==ap.settings.mode&&(d=ap.settings.minSlides)}return d},ai=function(){var f=0;if(ap.settings.moveSlides>0){if(ap.settings.infiniteLoop){f=ap.children.length/ar()}else{for(var g=0,d=0;g0&&ap.settings.moveSlides<=ax()?ap.settings.moveSlides:ax()},G=function(){if(ap.children.length>ap.settings.maxSlides&&ap.active.last&&!ap.settings.infiniteLoop){if("horizontal"==ap.settings.mode){var f=ap.children.last(),g=f.position(); 3 | aA(-(g.left-(ap.viewport.width()-f.width())),"reset",0)}else{if("vertical"==ap.settings.mode){var d=ap.children.length-ap.settings.minSlides,g=ap.children.eq(d).position();aA(-g.top,"reset",0)}}}else{var g=ap.children.eq(ap.active.index*ar()).position();ap.active.index==ai()-1&&(ap.active.last=!0),void 0!=g&&("horizontal"==ap.settings.mode?aA(-g.left,"reset",0):"vertical"==ap.settings.mode&&aA(-g.top,"reset",0))}},aA=function(g,k,f,h){if(ap.usingCSS){var l="vertical"==ap.settings.mode?"translate3d(0, "+g+"px, 0)":"translate3d("+g+"px, 0, 0)";am.css("-"+ap.cssPrefix+"-transition-duration",f/1000+"s"),"slide"==k?(am.css(ap.animProp,l),am.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(){am.unbind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd"),ad()})):"reset"==k?am.css(ap.animProp,l):"ticker"==k&&(am.css("-"+ap.cssPrefix+"-transition-timing-function","linear"),am.css(ap.animProp,l),am.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(){am.unbind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd"),aA(h.resetValue,"reset",0),Q()}))}else{var d={};d[ap.animProp]=g,"slide"==k?am.animate(d,f,ap.settings.easing,function(){ad()}):"reset"==k?am.css(ap.animProp,g):"ticker"==k&&am.animate(d,speed,"linear",function(){aA(h.resetValue,"reset",0),Q()})}},aj=function(){for(var g="",d=ai(),f=0;d>f;f++){var h="";ap.settings.buildPager&&a.isFunction(ap.settings.buildPager)?(h=ap.settings.buildPager(f),ap.pagerEl.addClass("bx-custom-pager")):(h=f+1,ap.pagerEl.addClass("bx-default-pager")),g+='"}ap.pagerEl.html(g)},F=function(){ap.settings.pagerCustom?ap.pagerEl=a(ap.settings.pagerCustom):(ap.pagerEl=a('
'),ap.settings.pagerSelector?a(ap.settings.pagerSelector).html(ap.pagerEl):ap.controls.el.addClass("bx-has-pager").append(ap.pagerEl),aj()),ap.pagerEl.on("click","a",aa)},ae=function(){ap.controls.next=a(''),ap.controls.prev=a(''),ap.controls.next.bind("click",ah),ap.controls.prev.bind("click",ag),ap.settings.nextSelector&&a(ap.settings.nextSelector).append(ap.controls.next),ap.settings.prevSelector&&a(ap.settings.prevSelector).append(ap.controls.prev),ap.settings.nextSelector||ap.settings.prevSelector||(ap.controls.directionEl=a('
'),ap.controls.directionEl.append(ap.controls.prev).append(ap.controls.next),ap.controls.el.addClass("bx-has-controls-direction").append(ap.controls.directionEl))},ac=function(){ap.controls.start=a('"),ap.controls.stop=a('"),ap.controls.autoEl=a('
'),ap.controls.autoEl.on("click",".bx-start",au),ap.controls.autoEl.on("click",".bx-stop",R),ap.settings.autoControlsCombine?ap.controls.autoEl.append(ap.controls.start):ap.controls.autoEl.append(ap.controls.start).append(ap.controls.stop),ap.settings.autoControlsSelector?a(ap.settings.autoControlsSelector).html(ap.controls.autoEl):ap.controls.el.addClass("bx-has-controls-auto").append(ap.controls.autoEl),af(ap.settings.autoStart?"stop":"start")},J=function(){ap.children.each(function(){var d=a(this).find("img:first").attr("title");void 0!=d&&(""+d).length&&a(this).append('
'+d+"
")})},ah=function(d){ap.settings.auto&&am.stopAuto(),am.goToNextSlide(),d.preventDefault()},ag=function(d){ap.settings.auto&&am.stopAuto(),am.goToPrevSlide(),d.preventDefault()},au=function(d){am.startAuto(),d.preventDefault()},R=function(d){am.stopAuto(),d.preventDefault()},aa=function(g){ap.settings.auto&&am.stopAuto();var d=a(g.currentTarget),f=parseInt(d.attr("data-slide-index"));f!=ap.active.index&&am.goToSlide(f),g.preventDefault()},an=function(f){var d=ap.children.length;return"short"==ap.settings.pagerType?(ap.settings.maxSlides>1&&(d=Math.ceil(ap.children.length/ap.settings.maxSlides)),ap.pagerEl.html(f+1+ap.settings.pagerShortSeparator+d),void 0):(ap.pagerEl.find("a").removeClass("active"),ap.pagerEl.each(function(g,h){a(h).find("a").eq(f).addClass("active")}),void 0)},ad=function(){if(ap.settings.infiniteLoop){var d="";0==ap.active.index?d=ap.children.eq(0).position():ap.active.index==ai()-1&&ap.carousel?d=ap.children.eq((ai()-1)*ar()).position():ap.active.index==ap.children.length-1&&(d=ap.children.eq(ap.children.length-1).position()),d&&("horizontal"==ap.settings.mode?aA(-d.left,"reset",0):"vertical"==ap.settings.mode&&aA(-d.top,"reset",0))}ap.working=!1,ap.settings.onSlideAfter(ap.children.eq(ap.active.index),ap.oldIndex,ap.active.index)},af=function(d){ap.settings.autoControlsCombine?ap.controls.autoEl.html(ap.controls[d]):(ap.controls.autoEl.find("a").removeClass("active"),ap.controls.autoEl.find("a:not(.bx-"+d+")").addClass("active")) 4 | },t=function(){1==ai()?(ap.controls.prev.addClass("disabled"),ap.controls.next.addClass("disabled")):!ap.settings.infiniteLoop&&ap.settings.hideControlOnEnd&&(0==ap.active.index?(ap.controls.prev.addClass("disabled"),ap.controls.next.removeClass("disabled")):ap.active.index==ai()-1?(ap.controls.next.addClass("disabled"),ap.controls.prev.removeClass("disabled")):(ap.controls.prev.removeClass("disabled"),ap.controls.next.removeClass("disabled")))},ab=function(){ap.settings.autoDelay>0?setTimeout(am.startAuto,ap.settings.autoDelay):am.startAuto(),ap.settings.autoHover&&am.hover(function(){ap.interval&&(am.stopAuto(!0),ap.autoPaused=!0)},function(){ap.autoPaused&&(am.startAuto(!0),ap.autoPaused=null)})},U=function(){var f=0;if("next"==ap.settings.autoDirection){am.append(ap.children.clone().addClass("bx-clone"))}else{am.prepend(ap.children.clone().addClass("bx-clone"));var d=ap.children.first().position();f="horizontal"==ap.settings.mode?-d.left:-d.top}aA(f,"reset",0),ap.settings.pager=!1,ap.settings.controls=!1,ap.settings.autoControls=!1,ap.settings.tickerHover&&!ap.usingCSS&&ap.viewport.hover(function(){am.stop()},function(){var k=0;ap.children.each(function(){k+="horizontal"==ap.settings.mode?a(this).outerWidth(!0):a(this).outerHeight(!0)});var g=ap.settings.speed/k,h="horizontal"==ap.settings.mode?"left":"top",l=g*(k-Math.abs(parseInt(am.css(h))));Q(l)}),Q()},Q=function(g){speed=g?g:ap.settings.speed;var k={left:0,top:0},f={left:0,top:0};"next"==ap.settings.autoDirection?k=am.find(".bx-clone").first().position():f=ap.children.first().position();var h="horizontal"==ap.settings.mode?-k.left:-k.top,l="horizontal"==ap.settings.mode?-f.left:-f.top,d={resetValue:l};aA(h,"ticker",speed,d)},K=function(){ap.touch={start:{x:0,y:0},end:{x:0,y:0}},ap.viewport.bind("touchstart",s)},s=function(d){if(ap.working){d.preventDefault()}else{ap.touch.originalPos=am.position();var f=d.originalEvent;ap.touch.start.x=f.changedTouches[0].pageX,ap.touch.start.y=f.changedTouches[0].pageY,ap.viewport.bind("touchmove",j),ap.viewport.bind("touchend",B)}},j=function(f){var k=f.originalEvent,d=Math.abs(k.changedTouches[0].pageX-ap.touch.start.x),g=Math.abs(k.changedTouches[0].pageY-ap.touch.start.y);if(3*d>g&&ap.settings.preventDefaultSwipeX?f.preventDefault():3*g>d&&ap.settings.preventDefaultSwipeY&&f.preventDefault(),"fade"!=ap.settings.mode&&ap.settings.oneToOneTouch){var l=0;if("horizontal"==ap.settings.mode){var h=k.changedTouches[0].pageX-ap.touch.start.x;l=ap.touch.originalPos.left+h}else{var h=k.changedTouches[0].pageY-ap.touch.start.y;l=ap.touch.originalPos.top+h}aA(l,"reset",0)}},B=function(f){ap.viewport.unbind("touchmove",j);var h=f.originalEvent,d=0;if(ap.touch.end.x=h.changedTouches[0].pageX,ap.touch.end.y=h.changedTouches[0].pageY,"fade"==ap.settings.mode){var g=Math.abs(ap.touch.start.x-ap.touch.end.x);g>=ap.settings.swipeThreshold&&(ap.touch.start.x>ap.touch.end.x?am.goToNextSlide():am.goToPrevSlide(),am.stopAuto())}else{var g=0;"horizontal"==ap.settings.mode?(g=ap.touch.end.x-ap.touch.start.x,d=ap.touch.originalPos.left):(g=ap.touch.end.y-ap.touch.start.y,d=ap.touch.originalPos.top),!ap.settings.infiniteLoop&&(0==ap.active.index&&g>0||ap.active.last&&0>g)?aA(d,"reset",200):Math.abs(g)>=ap.settings.swipeThreshold?(0>g?am.goToNextSlide():am.goToPrevSlide(),am.stopAuto()):aA(d,"reset",200)}ap.viewport.unbind("touchend",B)},e=function(){var f=a(window).width(),d=a(window).height();(aB!=f||at!=d)&&(aB=f,at=d,am.redrawSlider(),ap.settings.onSliderResize.call(am,ap.active.index))};return am.goToSlide=function(o,k){if(!ap.working&&ap.active.index!=o){if(ap.working=!0,ap.oldIndex=ap.active.index,ap.active.index=0>o?ai()-1:o>=ai()?0:o,ap.settings.onSlideBefore(ap.children.eq(ap.active.index),ap.oldIndex,ap.active.index),"next"==k?ap.settings.onSlideNext(ap.children.eq(ap.active.index),ap.oldIndex,ap.active.index):"prev"==k&&ap.settings.onSlidePrev(ap.children.eq(ap.active.index),ap.oldIndex,ap.active.index),ap.active.last=ap.active.index>=ai()-1,ap.settings.pager&&an(ap.active.index),ap.settings.controls&&t(),"fade"==ap.settings.mode){ap.settings.adaptiveHeight&&ap.viewport.height()!=ak()&&ap.viewport.animate({height:ak()},ap.settings.adaptiveHeightSpeed),ap.children.filter(":visible").fadeOut(ap.settings.speed).css({zIndex:0}),ap.children.eq(ap.active.index).css("zIndex",ap.settings.slideZIndex+1).fadeIn(ap.settings.speed,function(){a(this).css("zIndex",ap.settings.slideZIndex),ad()})}else{ap.settings.adaptiveHeight&&ap.viewport.height()!=ak()&&ap.viewport.animate({height:ak()},ap.settings.adaptiveHeightSpeed);var u=0,f={left:0,top:0};if(!ap.settings.infiniteLoop&&ap.carousel&&ap.active.last){if("horizontal"==ap.settings.mode){var r=ap.children.eq(ap.children.length-1);f=r.position(),u=ap.viewport.width()-r.outerWidth()}else{var h=ap.children.length-ap.settings.minSlides;f=ap.children.eq(h).position()}}else{if(ap.carousel&&ap.active.last&&"prev"==k){var p=1==ap.settings.moveSlides?ap.settings.maxSlides-ar():(ai()-1)*ar()-(ap.children.length-ap.settings.maxSlides),r=am.children(".bx-clone").eq(p); 5 | f=r.position()}else{if("next"==k&&0==ap.active.index){f=am.find("> .bx-clone").eq(ap.settings.maxSlides).position(),ap.active.last=!1}else{if(o>=0){var q=o*ar();f=ap.children.eq(q).position()}}}}if("undefined"!=typeof f){var m="horizontal"==ap.settings.mode?-(f.left-u):-f.top;aA(m,"slide",ap.settings.speed)}}}},am.goToNextSlide=function(){if(ap.settings.infiniteLoop||!ap.active.last){var d=parseInt(ap.active.index)+1;am.goToSlide(d,"next")}},am.goToPrevSlide=function(){if(ap.settings.infiniteLoop||0!=ap.active.index){var d=parseInt(ap.active.index)-1;am.goToSlide(d,"prev")}},am.startAuto=function(d){ap.interval||(ap.interval=setInterval(function(){"next"==ap.settings.autoDirection?am.goToNextSlide():am.goToPrevSlide()},ap.settings.pause),ap.settings.autoControls&&1!=d&&af("stop"))},am.stopAuto=function(d){ap.interval&&(clearInterval(ap.interval),ap.interval=null,ap.settings.autoControls&&1!=d&&af("start"))},am.getCurrentSlide=function(){return ap.active.index},am.getCurrentSlideElement=function(){return ap.children.eq(ap.active.index)},am.getSlideCount=function(){return ap.children.length},am.redrawSlider=function(){ap.children.add(am.find(".bx-clone")).outerWidth(al()),ap.viewport.css("height",ak()),ap.settings.ticker||G(),ap.active.last&&(ap.active.index=ai()-1),ap.active.index>=ai()&&(ap.active.last=!0),ap.settings.pager&&!ap.settings.pagerCustom&&(aj(),an(ap.active.index))},am.destroySlider=function(){ap.initialized&&(ap.initialized=!1,a(".bx-clone",this).remove(),ap.children.each(function(){void 0!=a(this).data("origStyle")?a(this).attr("style",a(this).data("origStyle")):a(this).removeAttr("style")}),void 0!=a(this).data("origStyle")?this.attr("style",a(this).data("origStyle")):a(this).removeAttr("style"),a(this).unwrap().unwrap(),ap.controls.el&&ap.controls.el.remove(),ap.controls.next&&ap.controls.next.remove(),ap.controls.prev&&ap.controls.prev.remove(),ap.pagerEl&&ap.settings.controls&&ap.pagerEl.remove(),a(".bx-caption",this).remove(),ap.controls.autoEl&&ap.controls.autoEl.remove(),clearInterval(ap.interval),ap.settings.responsive&&a(window).unbind("resize",e))},am.reloadSlider=function(d){void 0!=d&&(aq=d),am.destroySlider(),ay()},ay(),this}}(jQuery);var IASCallbacks=function(){return this.list=[],this.fireStack=[],this.isFiring=!1,this.isDisabled=!1,this.fire=function(h){var g=h[0],m=h[1],l=h[2];this.isFiring=!0;for(var k=0,j=this.list.length;j>k;k++){if(void 0!=this.list[k]&&!1===this.list[k].fn.apply(g,l)){m.reject();break}}this.isFiring=!1,m.resolve(),this.fireStack.length&&this.fire(this.fireStack.shift())},this.inList=function(f,e){e=e||0;for(var h=e,g=this.list.length;g>h;h++){if(this.list[h].fn===f||f.guid&&this.list[h].fn.guid&&f.guid===this.list[h].fn.guid){return h}}return -1},this};IASCallbacks.prototype={add:function(g,f){var k={fn:g,priority:f};f=f||0;for(var j=0,h=this.list.length;h>j;j++){if(f>this.list[j].priority){return this.list.splice(j,0,k),this}}return this.list.push(k),this},remove:function(d){for(var c=0;(c=this.inList(d,c))>-1;){this.list.splice(c,1)}return this},has:function(b){return this.inList(b)>-1},fireWith:function(e,d){var f=jQuery.Deferred();return this.isDisabled?f.reject():(d=d||[],d=[e,f,d.slice?d.slice():d],this.isFiring?this.fireStack.push(d):this.fire(d),f)},disable:function(){this.isDisabled=!0},enable:function(){this.isDisabled=!1}},function(e){var d=-1,f=function(b,a){return this.itemsContainerSelector=a.container,this.itemSelector=a.item,this.nextSelector=a.next,this.paginationSelector=a.pagination,this.$scrollContainer=b,this.$container=window===b.get(0)?e(document):b,this.defaultDelay=a.delay,this.negativeMargin=a.negativeMargin,this.nextUrl=null,this.isBound=!1,this.isPaused=!1,this.isInitialized=!1,this.listeners={next:new IASCallbacks,load:new IASCallbacks,loaded:new IASCallbacks,render:new IASCallbacks,rendered:new IASCallbacks,scroll:new IASCallbacks,noneLeft:new IASCallbacks,ready:new IASCallbacks},this.extensions=[],this.scrollHandler=function(){if(this.isBound&&!this.isPaused){var g=this.getCurrentScrollOffset(this.$scrollContainer),h=this.getScrollThreshold();d!=h&&(this.fire("scroll",[g,h]),g>=h&&this.next())}},this.getItemsContainer=function(){return e(this.itemsContainerSelector)},this.getLastItem=function(){return e(this.itemSelector,this.getItemsContainer().get(0)).last()},this.getFirstItem=function(){return e(this.itemSelector,this.getItemsContainer().get(0)).first()},this.getScrollThreshold=function(g){var h;return g=g||this.negativeMargin,g=g>=0?-1*g:g,h=this.getLastItem(),0===h.length?d:h.offset().top+h.height()+g},this.getCurrentScrollOffset=function(h){var g=0,j=h.height();return g=window===h.get(0)?h.scrollTop():h.offset().top,(-1!=navigator.platform.indexOf("iPhone")||-1!=navigator.platform.indexOf("iPod"))&&(j+=80),g+j},this.getNextUrl=function(c){return c=c||this.$container,e(this.nextSelector,c).last().attr("href")},this.load=function(s,r,q){var p,o,n=this,m=[],l=+new Date;q=q||this.defaultDelay;var k={url:s};return n.fire("load",[k]),e.get(k.url,null,e.proxy(function(c){p=e(this.itemsContainerSelector,c).eq(0),0===p.length&&(p=e(c).filter(this.itemsContainerSelector).eq(0)),p&&p.find(this.itemSelector).each(function(){m.push(this) 6 | }),n.fire("loaded",[c,m]),r&&(o=+new Date-l,q>o?setTimeout(function(){r.call(n,c,m)},q-o):r.call(n,c,m))},n),"html")},this.render=function(h,n){var m=this,l=this.getLastItem(),k=0,j=this.fire("render",[h]);j.done(function(){e(h).hide(),l.after(h),e(h).fadeIn(400,function(){++kl?c():j=setTimeout(c,l)},e.guid&&(k.guid=g.guid=g.guid||e.guid++),k},this.fire=function(g,c){return this.listeners[g].fireWith(this,c)},this.pause=function(){this.isPaused=!0},this.resume=function(){this.isPaused=!1},this};f.prototype.initialize=function(){if(this.isInitialized){return !1}var h=!!("onscroll" in this.$scrollContainer.get(0)),g=this.getCurrentScrollOffset(this.$scrollContainer),j=this.getScrollThreshold();return h?(this.hidePagination(),this.bind(),this.fire("ready"),this.nextUrl=this.getNextUrl(),g>=j?(this.next(),this.one("rendered",function(){this.isInitialized=!0})):this.isInitialized=!0,this):!1},f.prototype.reinitialize=function(){this.isInitialized=!1,this.unbind(),this.initialize()},f.prototype.bind=function(){if(!this.isBound){this.$scrollContainer.on("scroll",e.proxy(this.throttle(this.scrollHandler,150),this));for(var a=0,g=this.extensions.length;g>a;a++){this.extensions[a].bind(this)}this.isBound=!0,this.resume()}},f.prototype.unbind=function(){if(this.isBound){this.$scrollContainer.off("scroll",this.scrollHandler);for(var g=0,c=this.extensions.length;c>g;g++){"undefined"!=typeof this.extensions[g].unbind&&this.extensions[g].unbind(this)}this.isBound=!1}},f.prototype.destroy=function(){this.unbind(),this.$scrollContainer.data("ias",null)},f.prototype.on=function(a,h,g){if("undefined"==typeof this.listeners[a]){throw new Error('There is no event called "'+a+'"')}return g=g||0,this.listeners[a].add(e.proxy(h,this),g),this},f.prototype.one=function(h,g){var k=this,j=function(){k.off(h,g),k.off(h,j)};return this.on(h,g),this.on(h,j),this},f.prototype.off=function(g,c){if("undefined"==typeof this.listeners[g]){throw new Error('There is no event called "'+g+'"')}return this.listeners[g].remove(c),this},f.prototype.next=function(){var h=this.nextUrl,g=this;if(this.pause(),!h){return this.fire("noneLeft",[this.getLastItem()]),this.listeners.noneLeft.disable(),g.resume(),!1}var j=this.fire("next",[h]);return j.done(function(){g.load(h,function(b,k){g.render(k,function(){g.nextUrl=g.getNextUrl(b),g.resume()})})}),j.fail(function(){g.resume()}),!0},f.prototype.extension=function(b){if("undefined"==typeof b.bind){throw new Error('Extension doesn\'t have required method "bind"')}return"undefined"!=typeof b.initialize&&b.initialize(this),this.extensions.push(b),this.isInitialized&&this.reinitialize(),this},e.ias=function(a){var g=e(window);return g.ias.apply(g,arguments)},e.fn.ias=function(a){var g=Array.prototype.slice.call(arguments),c=this;return this.each(function(){var k=e(this),j=k.data("ias"),b=e.extend({},e.fn.ias.defaults,k.data(),"object"==typeof a&&a);if(j||(k.data("ias",j=new f(k,b)),e(document).ready(e.proxy(j.initialize,j))),"string"==typeof a){if("function"!=typeof j[a]){throw new Error('There is no method called "'+a+'"')}g.shift(),j[a].apply(j,g)}c=j}),c},e.fn.ias.defaults={item:".item",container:".listing",next:".next",pagination:!1,delay:600,negativeMargin:10}}(jQuery);var IASHistoryExtension=function(b){return b=jQuery.extend({},this.defaults,b),this.ias=null,this.prevSelector=b.prev,this.prevUrl=null,this.listeners={prev:new IASCallbacks},this.onPageChange=function(f,e,h){if(window.history&&window.history.replaceState){var g=history.state;history.replaceState(g,document.title,h)}},this.onScroll=function(e,d){var f=this.getScrollThresholdFirstItem();this.prevUrl&&(e-=this.ias.$scrollContainer.height(),f>=e&&this.prev())},this.onReady=function(){var d=this.ias.getCurrentScrollOffset(this.ias.$scrollContainer),c=this.getScrollThresholdFirstItem();d-=this.ias.$scrollContainer.height(),c>=d&&this.prev()},this.getPrevUrl=function(c){return c||(c=this.ias.$container),jQuery(this.prevSelector,c).last().attr("href")},this.getScrollThresholdFirstItem=function(){var c;return c=this.ias.getFirstItem(),0===c.length?-1:c.offset().top},this.renderBefore=function(g,f){var k=this.ias,j=k.getFirstItem(),h=0;k.fire("render",[g]),jQuery(g).hide(),j.before(g),jQuery(g).fadeIn(400,function(){++h{text}
'};var IASPagingExtension=function(){return this.ias=null,this.pagebreaks=[[0,document.location.toString()]],this.lastPageNum=1,this.enabled=!0,this.listeners={pageChange:new IASCallbacks},this.onScroll=function(h,g){if(this.enabled){var m,l=this.ias,k=this.getCurrentPageNum(h),j=this.getCurrentPagebreak(h);this.lastPageNum!==k&&(m=j[1],l.fire("pageChange",[k,h,m])),this.lastPageNum=k}},this.onNext=function(e){var d=this.ias.getCurrentScrollOffset(this.ias.$scrollContainer);this.pagebreaks.push([d,e]);var f=this.getCurrentPageNum(d)+1;this.ias.fire("pageChange",[f,d,e]),this.lastPageNum=f},this.onPrev=function(h){var g=this,m=g.ias,l=m.getCurrentScrollOffset(m.$scrollContainer),k=l-m.$scrollContainer.height(),j=m.getFirstItem();this.enabled=!1,this.pagebreaks.unshift([0,h]),m.one("rendered",function(){for(var c=1,b=g.pagebreaks.length;b>c;c++){g.pagebreaks[c][0]=g.pagebreaks[c][0]+j.offset().top}var a=g.getCurrentPageNum(k)+1;m.fire("pageChange",[a,k,h]),g.lastPageNum=a,g.enabled=!0})},this};IASPagingExtension.prototype.initialize=function(b){this.ias=b,jQuery.extend(b.listeners,this.listeners)},IASPagingExtension.prototype.bind=function(d){try{d.on("prev",jQuery.proxy(this.onPrev,this),this.priority)}catch(c){}d.on("next",jQuery.proxy(this.onNext,this),this.priority),d.on("scroll",jQuery.proxy(this.onScroll,this),this.priority)},IASPagingExtension.prototype.unbind=function(d){try{d.off("prev",this.onPrev)}catch(c){}d.off("next",this.onNext),d.off("scroll",this.onScroll)},IASPagingExtension.prototype.getCurrentPageNum=function(d){for(var c=this.pagebreaks.length-1;c>0;c--){if(d>this.pagebreaks[c][0]){return c+1}}return 1},IASPagingExtension.prototype.getCurrentPagebreak=function(d){for(var c=this.pagebreaks.length-1;c>=0;c--){if(d>this.pagebreaks[c][0]){return this.pagebreaks[c]}}return null},IASPagingExtension.prototype.priority=500;var IASSpinnerExtension=function(b){return b=jQuery.extend({},this.defaults,b),this.ias=null,this.uid=(new Date).getTime(),this.src=b.src,this.html=b.html.replace("{src}",this.src),this.showSpinner=function(){var d=this.getSpinner()||this.createSpinner(),c=this.ias.getLastItem();c.after(d),d.fadeIn()},this.showSpinnerBefore=function(){var d=this.getSpinner()||this.createSpinner(),c=this.ias.getFirstItem();c.before(d),d.fadeIn()},this.removeSpinner=function(){this.hasSpinner()&&this.getSpinner().remove()},this.getSpinner=function(){var c=jQuery("#ias_spinner_"+this.uid);return c.length>0?c:!1},this.hasSpinner=function(){var c=jQuery("#ias_spinner_"+this.uid);return c.length>0},this.createSpinner=function(){var c=jQuery(this.html).attr("id","ias_spinner_"+this.uid);return c.hide(),c},this};IASSpinnerExtension.prototype.bind=function(d){this.ias=d,d.on("next",jQuery.proxy(this.showSpinner,this)),d.on("render",jQuery.proxy(this.removeSpinner,this));try{d.on("prev",jQuery.proxy(this.showSpinnerBefore,this))}catch(c){}},IASSpinnerExtension.prototype.unbind=function(d){d.off("next",this.showSpinner),d.off("render",this.removeSpinner);try{d.off("prev",this.showSpinnerBefore)}catch(c){}};var IASTriggerExtension=function(b){return b=jQuery.extend({},this.defaults,b),this.ias=null,this.html=b.html.replace("{text}",b.text),this.htmlPrev=b.htmlPrev.replace("{text}",b.textPrev),this.enabled=!0,this.count=0,this.offset=b.offset,this.$triggerNext=null,this.$triggerPrev=null,this.showTriggerNext=function(){if(!this.enabled){return !0}if(!1===this.offset||++this.count{text}
',textPrev:"Load previous items",htmlPrev:'',offset:0},IASTriggerExtension.prototype.priority=1000;function chen_tixing(c,f,d,e,b,a){html='
';html+='
';html+="

"+c+":

";html+='
';html+='
';html+="

"+f+"

";html+="

"+d+"

";html+="
";if(a){html+='
'+e+"
"}html+="
";html+="
";$(document.body).append(html);$(".chen_tixing").animate({opacity:"1"});$(".ti_cont").animate({opacity:"1",height:"300px"})}function ajax_donghua(a){html='
';html+='';html+=""+a+"";html+="
";$(document.body).append(html);$(".chen_tixing").animate({opacity:"1"})}$(document.body).on("click",".gb_cloe",function(){var a=$(".chen_tixing");a.remove();window.location.href=window.location.href});$(document.body).on("click",".fk_cloe",function(){var a=$(".chen_tixing");a.remove()});$("img").lazyload({effect:"fadeIn",threshold:200});$.fn.postLike=function(){if($(this).hasClass("done")){alert("您已经赞过了,明天再来吧!")}else{$(this).addClass("done");var d=$(this).data("id"),c=$(this).data("action"),b=$(this).children(".count").children(".ct_ding");var a={action:"bigfa_like",um_id:d,um_action:c};$.post(beauty.ajax_url,a,function(e){$(b).html(e)});return false}};$(document).on("click",".favorite",function(){$(this).postLike()});$.fn.postLikeno=function(){if($(this).hasClass("done")){alert("您已经踩过了,明天再来吧!")}else{$(this).addClass("done");var d=$(this).data("id"),c=$(this).data("action"),b=$(this).children(".count").children(".ct_ding");var a={action:"bigfa_like_no",um_id:d,um_action:c};$.post(beauty.ajax_url,a,function(e){$(b).html(e)});return false}};$(document).on("click",".tiresome",function(){$(this).postLikeno()});function isKeyPressed(a){if(a.altKey==1){alert("哎!又按错键了。。。")}}$(".yscd").click(function(){$(".user-left").animate({left:"0px"});$(".yscd").animate({left:"-160px"});$(".yinxsh").toggle()});$(".yinxsh").click(function(){$(".user-left").animate({left:"-180px"});$(".yscd").animate({left:"0px"});$(".yinxsh").toggle()});$(".share-fx").on("click",function(){$(this).toggleClass("share-dj");$(".myshare").slideToggle()});$(function(b){b.fn.hoverDelay=function(e){var h={hoverDuring:300,outDuring:200,hoverEvent:function(){b.noop()},outEvent:function(){b.noop()}};var g=b.extend(h,e||{});var d,f;return b(this).each(function(){b(this).hover(function(){clearTimeout(f);d=setTimeout(g.hoverEvent,g.hoverDuring)},function(){clearTimeout(d);f=setTimeout(g.outEvent,g.outDuring)})})};b(".login_text").hoverDelay({hoverEvent:function(){b(".nav_user").stop().slideDown()},outEvent:function(){b(".nav_user").slideUp()}});var c=0,a=0;b(window).scroll(function(){var e=b(this).scrollTop();var d=b(document).height();var f=b(this).height();if(e+f==d){b(".nav_headertop").removeClass("hiddened")}else{if(a<=e&&e>100){b(".nav_headertop").addClass("hiddened")}else{b(".nav_headertop").removeClass("hiddened")}}setTimeout(function(){a=e},0)})});$(function(){if($(".bxslider").hasClass("tow_slider")){$(".bxslider").bxSlider({auto:true,captions:false})}else{$(".bxslider").bxSlider({auto:true,captions:false,mode:"fade"})}$(".slide-wrapper").on("touchstart","li",function(a){$(this).addClass("current").siblings("li").removeClass("current")});$("a.slide-menu").on("click",function(b){var a=$(".wrapper").height();$(".slide-mask").css("height",a).show();$(".slide-wrapper").css("height",a).addClass("moved")});$(".slide-mask").on("click",function(){$(".slide-mask").hide();$(".slide-wrapper").removeClass("moved")});$(".logint").on("click",function(){$("#back").load(beauty.home_url+"/login"); 9 | document.getElementById("back").style.display=""})});function chenxingweb(){this.init()}chenxingweb.prototype={constructor:chenxingweb,init:function(){this._initBackTop()},_initBackTop:function(){var b=this.$backTop=$('
');$("body").append(b);b.click(function(){$("html, body").animate({scrollTop:0},120)});var a=null;$(window).bind("scroll",function(){var f=$(document).scrollTop(),c=$(window).height();00){var c=$("#sidebar").offset().top-parseFloat($("#sidebar").css("marginTop").replace(/auto/,0));var a=$("#footer").offset().top-parseFloat($("#footer").css("marginTop").replace(/auto/,0));var b=a-$("#sidebar").outerHeight();$(window).scroll(function(d){var e=$(this).scrollTop();if(e>c){if(e num_pages: 69 | number = num_pages 70 | galleries = self.r.zrange(tag, start=(number - 1) * page_size, end=number * page_size - 1) 71 | # TODO 必须要加cacha,不然要炸 72 | galleries = [Gallery.objects.get(gallery_id=gid) for gid in galleries] 73 | return Page(page_size, number, num_pages, galleries) 74 | 75 | def get_random_top10000_by_tag(self, tag, count): 76 | """ 77 | 从排名前一万种随机选出图集 78 | :param tag: 标签拼音 79 | :param count: 数量 80 | :return: 81 | """ 82 | all_count = self.r.zcard(tag) 83 | start = 0 84 | end = 10000 if all_count > 10000 else all_count - 1 85 | random_list = [random.randint(start, end) for _ in range(count)] 86 | random_galleries = [self.r.zrange(tag, index, index)[0] for index in random_list] 87 | random_galleries = [Gallery.objects.get(gallery_id=gid) for gid in random_galleries] 88 | return random_galleries 89 | 90 | def count(self,tag_id): 91 | return self.r.zcard(tag_id) 92 | 93 | class Page(collections.Sequence): 94 | """ 95 | 包含页面的一些属性 96 | """ 97 | 98 | def __init__(self, page_size, number, num_pages, object_list): 99 | self.page_size = page_size 100 | self.number = number 101 | self.object_list = object_list 102 | self.num_pages = num_pages 103 | 104 | def __repr__(self): 105 | return '' % (self.number, self.num_pages) 106 | 107 | def __len__(self): 108 | return len(self.object_list) 109 | 110 | def __getitem__(self, index): 111 | if not isinstance(index, (slice,) + six.integer_types): 112 | raise TypeError 113 | # The object_list is converted to a list so that if it was a QuerySet 114 | # it won't be a database hit per __getitem__. 115 | if not isinstance(self.object_list, list): 116 | self.object_list = list(self.object_list) 117 | return self.object_list[index] 118 | 119 | def has_next(self): 120 | return self.number < self.num_pages 121 | 122 | def has_previous(self): 123 | return self.number > 1 124 | 125 | def has_other_pages(self): 126 | return self.has_previous() or self.has_next() 127 | 128 | def next_page_number(self): 129 | return self.number + 1 if self.number < self.num_pages else self.num_pages 130 | 131 | def previous_page_number(self): 132 | return self.number - 1 if self.number > 1 else 1 133 | 134 | def get_objects(self): 135 | return self.object_list 136 | 137 | 138 | tag_cache = TagCache() 139 | 140 | 141 | class TagViewManager(object): 142 | """ 143 | tag 展示时候的背景 话术 先用文件的形式,以后考虑改为json形式存在tag表里头 144 | """ 145 | 146 | def __init__(self, file_path): 147 | self.actors_map = {} 148 | with open(file_path, "r") as f: 149 | for actor in json.load(f): 150 | if "bg_key" in actor: 151 | for name in actor.get("meta").split(","): 152 | self.actors_map[get_pinyin(name)] = actor 153 | 154 | def info(self, tag_name): 155 | """ 156 | 最长的name + desc要小于158字符 157 | :param tag_name: 158 | :return: 159 | """ 160 | if tag_name in self.actors_map: 161 | actor = self.actors_map.get(tag_name) 162 | len_max_desc = 158 - len(actor.get("name")) 163 | actor["desc"] = actor.get("desc")[:len_max_desc] 164 | return self.actors_map.get(tag_name) 165 | return None 166 | 167 | 168 | os.path.dirname(BASE_DIR) 169 | beauty_dir = os.path.join(os.path.dirname(BASE_DIR), "script") 170 | info_file = os.path.join(beauty_dir, "actor.json") 171 | tag_info = TagViewManager(info_file) 172 | -------------------------------------------------------------------------------- /mysite/beauty/templates/beauty/404.html: -------------------------------------------------------------------------------- 1 | {% extends "beauty/component/base.html" %} 2 | 3 | {% block mainbody %} 4 |
5 |
6 |
404
7 |
您访问的页面不存在!


8 |
9 |
10 | {% endblock %} -------------------------------------------------------------------------------- /mysite/beauty/templates/beauty/component/base.html: -------------------------------------------------------------------------------- 1 | 2 | {% load mytag %} 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | {% if seo %} 15 | {{ seo.title }} 16 | 17 | 18 | {% else %} 19 | 妹子吧 - meizibar.com> 20 | {% endif %} 21 | {% block header %} 22 | {% endblock %} 23 | 24 | 26 | 27 | 29 | 30 | 39 | 40 | 41 | 42 | {% include "beauty/component/header.html" %} 43 | {% include "beauty/component/slider.html" %} 44 | {% block mainbody %} 45 | {% endblock %} 46 | {% include "beauty/component/footer.html" %} 47 | 48 | 62 | 68 | 69 | -------------------------------------------------------------------------------- /mysite/beauty/templates/beauty/component/footer.html: -------------------------------------------------------------------------------- 1 | 25 | -------------------------------------------------------------------------------- /mysite/beauty/templates/beauty/component/gallery_view.html: -------------------------------------------------------------------------------- 1 | 2 | {% load mytag %} 3 | {% if page_content %} 4 |
    5 | {% for gallery in page_content %} 6 |
  • {{gallery.title}}
    {{gallery.title}}
    {%time gallery.publish_time%}{%view gallery.gallery_id %}
  • 7 | {% endfor %} 8 |
9 | {% else %} 10 | {% endif %} 11 | -------------------------------------------------------------------------------- /mysite/beauty/templates/beauty/component/header.html: -------------------------------------------------------------------------------- 1 | {% load mytag %} 2 | -------------------------------------------------------------------------------- /mysite/beauty/templates/beauty/component/slider.html: -------------------------------------------------------------------------------- 1 | {% load filters %} 2 |
3 | 30 | -------------------------------------------------------------------------------- /mysite/beauty/templates/beauty/component/theme_view.html: -------------------------------------------------------------------------------- 1 | 2 | {% load mytag %} 3 | {% if page_content %} 4 |
    5 | {% for tag in page_content %} 6 |
  • 7 | 8 | {{tag.display_name}} 9 | 10 |
    11 |
    {{tag.display_name}}
    12 |
    13 |
  • 14 | {% endfor %} 15 |
16 | {% else %} 17 | {% endif %} 18 | -------------------------------------------------------------------------------- /mysite/beauty/templates/beauty/detail.html: -------------------------------------------------------------------------------- 1 | {% extends "beauty/component/base.html" %} 2 | {% load mytag %} 3 | {%block header%} 4 | 5 | 6 | {%endblock%} 7 | {% block mainbody %} 8 |
9 |
10 |
11 |
12 |

{{ gallery.title }}

13 |
发布于{%time gallery.publish_time%} 14 |
15 |
16 |
17 |
18 | {%view gallery.gallery_id %} 人气 19 | 20 |
21 |
22 | 多图模式
24 |
25 |
26 |
图集介绍:{{ image.0.desc }} 27 | 29 | 30 | 31 | 33 | 34 | 35 | 36 |
37 |

38 | {{image.0.desc}} 40 |

41 | 42 | 68 |
69 |
70 | 71 |
72 | 换一篇
73 |
74 |
75 |
76 |
相关资源: 77 | {% for r_tag in relate_tags %} 78 | {{ r_tag.tag_name }} 79 | {% endfor %} 80 |
81 | 82 |
    83 | {% for gallery in relate_galleries|slice:":10" %} 84 |
  • 85 | 86 | {{gallery.title}} 89 | 90 |
    91 |
    {{gallery.title}}
    92 |
    {%time gallery.publish_time%}{%view gallery.gallery_id %}
    95 |
    96 |
  • 97 | {% endfor %} 98 |
99 | 100 |
101 |
102 |
103 | {% endblock %} -------------------------------------------------------------------------------- /mysite/beauty/templates/beauty/detail_all.html: -------------------------------------------------------------------------------- 1 | {% extends "beauty/component/base.html" %} 2 | {% load mytag %} 3 | {%block header%} 4 | 5 | 6 | {%endblock%} 7 | {% block mainbody %} 8 | 9 |
10 |
11 |
12 |
13 |

{{ gallery.title }}

14 |
发布于{%time gallery.publish_time%} 15 |
16 |
17 |
18 |
19 | {%view gallery.gallery_id%} 人气 20 |
21 |
22 | 单图模式 24 |
25 |
26 |
27 |
图集介绍: 妹子吧 (meizibar.com) 小编为您精心推荐 28 | {{gallery.title}}

29 | {% for img in image%} 30 | {{img.desc}} 32 | {% endfor %} 33 |
34 | 57 |
58 |
59 |
60 |
相关资源: 61 | {% for r_tag in relate_tags %} 62 | {{ r_tag.tag_name }} 63 | {% endfor %} 64 |
65 |
    66 | {% for gallery in relate_galleries|slice:":10" %} 67 |
  • 68 | 70 | {{gallery.title}} 73 | 74 |
    75 |
    {{gallery.title}}
    76 |
    {%time gallery.publish_time%}{%view gallery.gallery_id %}
    79 |
    80 |
  • 81 | {% endfor %} 82 |
83 |
84 | 85 | 159 |
160 |
161 | 162 |
163 | {% endblock %} -------------------------------------------------------------------------------- /mysite/beauty/templates/beauty/index.html: -------------------------------------------------------------------------------- 1 | {% extends "beauty/component/base.html" %} 2 | {% load mytag %} 3 | {%block header%}{%endblock%} 4 | {% block mainbody %} 5 | {% load filters %} 6 | 7 | {% include "beauty/component/header.html" %} 8 | {% include "beauty/component/slider.html" %} 9 | 10 | 11 |
12 |
13 | 18 |
19 |
    20 |
  • 最近一周新增 {{ site_statistics.last_week_publish }} 组图集
  • 21 |
22 |
23 |

为您推荐 给您推荐一批更精彩的

24 |
25 |
26 | 27 | {% include "beauty/component/gallery_view.html" %} 28 | 29 | 30 | 58 | 59 | 60 |
61 |
62 | 102 |
103 |
104 | {% endblock %} 105 | -------------------------------------------------------------------------------- /mysite/beauty/templates/beauty/tag_page.html: -------------------------------------------------------------------------------- 1 | {% extends "beauty/component/base.html" %} 2 | {% load mytag %} 3 | {% load static %} 4 | {%block header%} 5 | 6 | 7 | {%endblock%} 8 | {% block mainbody %} 9 | 10 | {% if tag_view %} 11 | 24 |
25 |
26 |

27 | 28 | {{ tag_view.name }} 29 | 30 | {{ tag_view.desc }} 31 |

32 |
33 |
34 |
35 | {% else %} 36 |
37 | {% endif %} 38 |
39 |
40 |
为你推荐: 41 | {{ tag.tag_name }} | 42 | {% for r_tag in relate_tags%} 43 | {{ r_tag.tag_name }} | 44 | {% endfor %} 45 |
46 |
47 |
48 |
49 |
50 | {% include "beauty/component/gallery_view.html" %} 51 | {% load filters %} 52 | 83 |
84 |
85 |
86 | {% endblock %} -------------------------------------------------------------------------------- /mysite/beauty/templates/beauty/theme_page.html: -------------------------------------------------------------------------------- 1 | {% extends "beauty/component/base.html" %} 2 | {% load mytag %} 3 | {%block header%}{%endblock%} 4 | {% block mainbody %} 5 | 6 |
7 |
8 |
编辑精选
9 |
10 |
11 |
12 | 13 | {% include "beauty/component/theme_view.html" %} 14 | 15 | 16 |
17 |
18 |
19 | {% endblock %} -------------------------------------------------------------------------------- /mysite/beauty/templatetags/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gaoconghui/image_site/b65b053adb7f574eef76612913de962e75b93b26/mysite/beauty/templatetags/__init__.py -------------------------------------------------------------------------------- /mysite/beauty/templatetags/filters.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 #coding:utf-8 2 | import random 3 | 4 | from django import template 5 | 6 | from beauty.static_util import tags_without_actor 7 | 8 | register = template.Library() 9 | 10 | 11 | @register.filter(name='calculate_page') 12 | def calculate_page(current_page, total_page): 13 | """ 14 | 计算页码,-1为省略号 15 | :param current_page: 当前页 16 | :param total_page: 总页数 17 | :return: 18 | """ 19 | if total_page <= 10: 20 | return range(1, total_page + 1) 21 | result = [1] 22 | if current_page > 5: 23 | result.append(-1) 24 | 25 | num_start = current_page - 3 26 | num_end = current_page + 3 27 | if num_start < 2: 28 | num_start = 2 29 | num_end = num_end - num_start + 2 30 | if num_end > total_page - 1: 31 | num_end = total_page - 1 32 | num_start -= num_end - total_page + 1 33 | result += range(num_start, num_end + 1) 34 | if current_page < total_page - 4: 35 | result.append(-1) 36 | result.append(total_page) 37 | return result 38 | 39 | 40 | @register.filter(name="random_tags") 41 | def random_tags(count): 42 | tags = tags_without_actor() 43 | random.shuffle(tags) 44 | return tags[:count] 45 | -------------------------------------------------------------------------------- /mysite/beauty/templatetags/mytag.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 #coding:utf-8 2 | import datetime 3 | 4 | from django import template 5 | 6 | from beauty.models import Image 7 | from beauty.view_counter import view_counter 8 | 9 | register = template.Library() 10 | 11 | host = "http://static.meizibar.com" 12 | 13 | @register.simple_tag(name="upstatic") 14 | def get_static_url(_id): 15 | return host + "/static/{_id}".format(_id=_id) 16 | 17 | @register.simple_tag(name="image") 18 | def get_image_url(image): 19 | """ 20 | 根据imageid 返回url 21 | 在内容没有传云端时,先采取随机返回image的方式 22 | :param image_id: 23 | :return: 24 | """ 25 | base = host + "/{image_id}" 26 | if isinstance(image, Image): 27 | url = base.format(image_id=image.image_id) 28 | if image.size > 300000: 29 | url += "!big" 30 | else: 31 | url += "!small" 32 | return url 33 | else: 34 | return base.format(image_id=image) 35 | 36 | 37 | @register.simple_tag(name="thumb") 38 | def get_thumb_url(image_id): 39 | """ 40 | 根据imageid 返回url 41 | 在内容没有传云端时,先采取随机返回image的方式 42 | :param image_id: 43 | :return: 44 | """ 45 | url = "{host}/{image_id}!home".format(host=host,image_id=image_id) 46 | return url 47 | 48 | 49 | @register.simple_tag(name="footer") 50 | def get_thumb_url(image_id): 51 | """ 52 | 根据imageid 返回url 53 | 在内容没有传云端时,先采取随机返回image的方式 54 | :param image_id: 55 | :return: 56 | """ 57 | url = "{host}/{image_id}!footer".format(image_id=image_id,host=host) 58 | return url 59 | 60 | @register.simple_tag(name="bg") 61 | def get_bg_url(bg_id): 62 | """ 63 | 返回tag 页面背景图 64 | :param bg_id: 65 | :return: 66 | """ 67 | return "{host}/images/bg/{bg_id}".format(host=host,bg_id=bg_id) 68 | 69 | 70 | @register.simple_tag(name="time") 71 | def time_format(t): 72 | return datetime.datetime.fromtimestamp(int(t)).strftime('%Y-%m-%d') 73 | 74 | 75 | @register.simple_tag(name="view") 76 | def view_getter(_id): 77 | return view_counter.get_view_count(_id) 78 | -------------------------------------------------------------------------------- /mysite/beauty/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /mysite/beauty/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import url 2 | from django.conf import urls 3 | from . import views 4 | 5 | app_name = 'beauty' 6 | 7 | urlpatterns = [ 8 | # ex: /beauty/ 9 | url(r'^$', views.index, name='index'), 10 | url(r'^recommend.*$', views.theme_page, name='theme'), 11 | url(r'^(?P\d+)/$', views.index, name='hot'), 12 | url(r'^gallery/(?P<_id>\w+)/(?P\d+)$', views.gallery, name='gallery'), 13 | url(r'^gallery/(?P<_id>\w+)/more/(?P\d+)$', views.gallery_more, name='gallery_more'), 14 | url(r'^gallery/(?P<_id>\w+)/debug/(?P\d+)$', views.gallery_debug, name='gallery_debug'), 15 | url(r'^(?P.*?)/(?P\d+)/$', views.tag_page, name='tag_page'), 16 | ] 17 | 18 | urls.handler404 = views.handler404 19 | urls.handler400 = views.handler404 20 | urls.handler403 = views.handler404 21 | urls.handler500 = views.handler404 22 | 23 | -------------------------------------------------------------------------------- /mysite/beauty/view_counter.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | """ 4 | 统计图集的点击数量,基于redis 5 | """ 6 | import redis 7 | 8 | 9 | class ViewCounter(): 10 | def __init__(self): 11 | self.r = redis.Redis() 12 | self.view_key = "view" 13 | 14 | def click(self, gallery_id): 15 | return self.r.hincrby(self.view_key, gallery_id, 1) 16 | 17 | def get_view_count(self, gallery_id): 18 | count = self.r.hget(self.view_key, gallery_id) 19 | return count if count else 0 20 | 21 | def get_view_map(self, gallery_ids): 22 | return {x: self.get_view_count(x) for x in gallery_ids} 23 | 24 | 25 | view_counter = ViewCounter() 26 | -------------------------------------------------------------------------------- /mysite/beauty/views.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 #coding:utf-8 2 | import logging 3 | import random 4 | from collections import Counter 5 | 6 | from beauty.editor import editor_tags 7 | from beauty.models import Gallery, Tag 8 | from beauty.models import Image 9 | from beauty.seo import seo_manager 10 | from beauty.static_util import site_statistics, home_tags, tags_without_actor 11 | from beauty.tags_model import tag_cache, Page 12 | from beauty.tags_model import tag_info 13 | from beauty.view_counter import view_counter 14 | from django.core.cache import cache 15 | from django.core.paginator import Paginator 16 | from django.http import Http404 17 | from django.shortcuts import render 18 | from django.views.decorators.cache import cache_page 19 | from util.normal import ensure_utf8 20 | from util.pinyin import get_pinyin 21 | from hashlib import md5 22 | 23 | logger = logging.getLogger("beauty") 24 | 25 | 26 | @cache_page(60 * 15) 27 | def index(request, page_num=1): 28 | if "tag_name" in request.GET: 29 | tag_name = request.GET.get("tag_name") 30 | if tag_name: 31 | page_num = request.GET.get("page", page_num) 32 | return tag_page(request, tag_name, page_num) 33 | page_num = int(page_num) 34 | context = { 35 | 'page_content': __get_galleries_by_tag("all", 10, page_num, max_pages=100), 36 | 'home_tags': home_tags() 37 | } 38 | return render(request, 'beauty/index.html', __with_index_seo(__with_normal_field(context))) 39 | 40 | 41 | @cache_page(60 * 15) 42 | def gallery(request, _id, page_num=1): 43 | context = gen_gallery(request, _id, page_num=page_num, page_size=1) 44 | return render(request, 'beauty/detail.html', __with_gallery_seo(__with_normal_field(context))) 45 | 46 | 47 | @cache_page(60 * 15) 48 | def gallery_more(request, _id, page_num): 49 | context = gen_gallery(request, _id, page_num=page_num, page_size=5) 50 | return render(request, 'beauty/detail_all.html', __with_gallery_seo(__with_normal_field(context))) 51 | 52 | 53 | @cache_page(60 * 15) 54 | def gallery_debug(request, _id, page_num): 55 | context = gen_gallery(request, _id, page_num=page_num, page_size=500) 56 | return render(request, 'beauty/detail_all.html', __with_gallery_seo(__with_normal_field(context))) 57 | 58 | 59 | def tag_page(request, tag_name, page_num=1): 60 | """ 61 | 包含查询tag和query数据库两种,会优先查询tag 62 | :param request: 63 | :param tag_name: 64 | :param page_num: 65 | :return: 66 | """ 67 | page_num = int(page_num) 68 | try: 69 | tag_id = get_pinyin(tag_name) 70 | tags = Tag.objects.filter(tag_id=tag_id) 71 | if len(tags) == 0: 72 | raise Tag.DoesNotExist 73 | tag = tags[0] 74 | galleries = __get_galleries_by_tag(tag_id, page_size=20, page=page_num, max_pages=100) 75 | except Tag.DoesNotExist: 76 | logger.info("tag not exist , need query {query}".format(query=ensure_utf8(tag_name))) 77 | # 每次都要扫表,很慢 78 | gs = Gallery.objects.filter(title__contains=tag_name) 79 | g_page = Paginator(gs, 20) 80 | g_list = g_page.page(page_num) 81 | galleries = Page(object_list=g_list.object_list, page_size=20, num_pages=g_page.num_pages, number=g_list.number) 82 | tag = { 83 | "tag_name": tag_name, 84 | "tag_id": tag_name 85 | } 86 | context = { 87 | 'page_content': galleries, 88 | 'tag': tag, 89 | 'relate_tags': __get_relate_tags(galleries, tag_name) 90 | } 91 | tag_view = tag_info.info(get_pinyin(tag_name)) 92 | if tag_view: 93 | context['tag_view'] = tag_view 94 | return render(request, 'beauty/tag_page.html', __with_tag_seo(__with_normal_field(context))) 95 | 96 | 97 | @cache_page(24 * 3600) 98 | def theme_page(request, page_num=1): 99 | """ 100 | 专题页面,展示tag 101 | :param request: 102 | :param page_num: 103 | :return: 104 | """ 105 | result = [] 106 | for item in editor_tags: 107 | tag_id, display_name = item 108 | tags = Tag.objects.filter(tag_id=tag_id) 109 | if len(tags) == 0: 110 | continue 111 | tag = tags[0] 112 | cover_id = tag_cache.query_by_tag(tag.tag_id, 1).get_objects()[0].cover_id 113 | result.append({ 114 | "display_name": display_name, 115 | "tag_id": tag_id, 116 | "cover_id": cover_id 117 | }) 118 | context = { 119 | "page_content": result 120 | } 121 | return render(request, 'beauty/theme_page.html', __with_index_seo(__with_normal_field(context))) 122 | 123 | 124 | def __get_random_tag(count): 125 | """ 126 | 随机返回若干个tag(不包含actor) 127 | """ 128 | tags = tags_without_actor() 129 | random.shuffle(tags) 130 | return tags[:count] 131 | 132 | 133 | def gen_gallery(request, _id, page_num=1, page_size=1): 134 | view_counter.click(_id) 135 | page_num = int(page_num) 136 | try: 137 | _gallery = Gallery.objects.get(gallery_id=_id) 138 | except Gallery.DoesNotExist: 139 | raise Http404("Gallery does not exist") 140 | all_images = Image.objects.filter(gallery_id=_id) 141 | 142 | p = Paginator(all_images, page_size) 143 | if page_num > p.num_pages: 144 | page_num = p.num_pages 145 | if page_num <= 0: 146 | page_num = 1 147 | image = p.page(page_num) 148 | relate_tags = __get_relate_tags([_gallery], "") 149 | if cache.get("gallery" + _id) is None: 150 | cache.set("gallery" + _id, get_random_galleries_by_tags(relate_tags, count=20), timeout=15 * 60) 151 | relate_galleries = cache.get("gallery" + _id) 152 | page = { 153 | "prev_gallery": _id, 154 | "next_gallery": _id if page_num < p.num_pages else random.choice(relate_galleries).gallery_id, 155 | "prev_page": page_num - 1 if page_num > 1 else 1, 156 | "next_page": page_num + 1 if page_num < p.num_pages else 1 157 | } 158 | context = { 159 | "gallery": _gallery, 160 | "image": image, 161 | "page": page, 162 | "relate_tags": relate_tags, 163 | "tags_cloud": relate_tags + __get_random_tag(20 - len(relate_tags)), 164 | "relate_galleries": relate_galleries, 165 | "tags_gallery": get_tag_gallery_map(relate_tags[:8], 10) 166 | } 167 | random.shuffle(context['tags_cloud']) 168 | return context 169 | 170 | 171 | def __get_galleries_by_tag(tag, page_size, page, max_pages=-1): 172 | return tag_cache.query_by_tag(tag=tag, page_size=page_size, number=page, max_page=max_pages) 173 | 174 | 175 | def get_random_galleries_by_tags(tags, count): 176 | # TODO 增加缓存 不一定是对这个方法加缓存,可以是对图集相关推荐的部分增加缓存 177 | pre_tag_count = [count / len(tags) for _ in tags] 178 | pre_tag_count[0] += count - sum(pre_tag_count) 179 | result = set() 180 | for index, tag in enumerate(tags): 181 | result.update(set(_get_random_galleries_by_tag(tag, pre_tag_count[index]))) 182 | return list(result) 183 | 184 | 185 | def get_tag_gallery_map(tags, max_count): 186 | """ 187 | 生成gallery页面右侧tag-gallery映射栏 188 | :param tags: 189 | :param max_count: 190 | :return: 191 | """ 192 | result = [] 193 | for tag in tags: 194 | item = {'tag': tag, 'galleries': set(_get_random_galleries_by_tag(tag, max_count))} 195 | result.append(item) 196 | return result 197 | 198 | 199 | def _get_random_galleries_by_tag(tag, count): 200 | """ 201 | 获取与tag相关的最多count个图集 202 | :param tag: 203 | :param count: 204 | :return: 205 | """ 206 | cache_id = md5(ensure_utf8(tag.get("tag_id") + str(count))).hexdigest() 207 | if cache.get(cache_id) is None: 208 | cache.set(cache_id, tag_cache.get_random_top10000_by_tag(tag.get("tag_id"), count), timeout=15 * 60) 209 | return cache.get(cache_id) 210 | 211 | 212 | def __get_relate_tags(galleries, tag_id): 213 | """ 214 | 从图集中抽取tags 215 | 按频率排序前20的tag (不能全部显示,全部显示会出现过多tag。 216 | :param galleries: 217 | :return: 218 | """ 219 | if not galleries: 220 | return [] 221 | if len(galleries) == 1: 222 | tag_names = galleries[0].tags.split(",") 223 | return [{"tag_name" : tag_name , "tag_id" : get_pinyin(tag_name)} for tag_name in tag_names] 224 | relate_tags = reduce(lambda x, y: x + y, [gallery.tags.split(",") for gallery in galleries]) 225 | relate_tags = [{"tag_name": tag, "tag_id": get_pinyin(tag)} for tag in 226 | [tag[0] for tag in Counter(relate_tags).most_common(35) if tag_id != get_pinyin(tag[0])] 227 | ] 228 | return relate_tags 229 | 230 | 231 | def __with_normal_field(context): 232 | """ 233 | 增加网站footer的展示数据 234 | :param context: 235 | :return: 236 | """ 237 | context['site_statistics'] = site_statistics() 238 | return context 239 | 240 | 241 | def __with_index_seo(context): 242 | seo = { 243 | "title": u"meizibar 妹子吧 - 清纯性感清新甜美萌妹子 高清大图欣赏", 244 | "keywords": u"meizi,妹子图,美女,美女图片,清纯,性感", 245 | "desc": u"meizibar 妹子吧,收集精美的妹子图片,上百种分类,包括性感可爱清纯,运动校花美女,车模浴室外围等好看的妹子图片。" 246 | } 247 | context['seo'] = seo 248 | return context 249 | 250 | 251 | def __with_tag_seo(context): 252 | tag = context.get("tag") 253 | if isinstance(tag, Tag): 254 | tag_name = tag.tag_name 255 | else: 256 | tag_name = tag.get("tag_name") 257 | if not seo_manager.get_seo(tag_name): 258 | relate_tags = context.get("relate_tags") 259 | r_t_name = [t.get("tag_name") for t in relate_tags[0:3]] 260 | seo = { 261 | "title": u"{tag_name}_{relate_name} - meizibar 妹子吧".format(tag_name=tag_name, 262 | relate_name="_".join(r_t_name)), 263 | "keywords": u"{tag_name}_{relate_name}".format(tag_name=tag_name, relate_name="_".join(r_t_name)), 264 | "desc": u"妹子吧{tag_name}频道为用户提供最优质的相关{tag_name}的高清图片。".format(tag_name=tag_name) 265 | } 266 | if tag_info.info(get_pinyin(tag_name)): 267 | seo['desc'] = (seo['desc'] + tag_info.info(get_pinyin(tag_name)).get("desc"))[:90] 268 | seo_manager.add_seo(tag_name, seo) 269 | context['seo'] = seo_manager.get_seo(tag_name) 270 | return context 271 | 272 | 273 | def __with_gallery_seo(context): 274 | gallery = context.get("gallery") 275 | relate_tags = context.get("relate_tags") 276 | seo = { 277 | "title": gallery.title + " www.meizibar.com", 278 | "keywords": ",".join([t.get("tag_name") for t in relate_tags]), 279 | "desc": u"meizibar 妹子吧为您提供 {title}".format(title=gallery.title) 280 | } 281 | context['seo'] = seo 282 | return context 283 | 284 | 285 | def handler404(request): 286 | return render(request, 'beauty/404.html', status=404) 287 | 288 | 289 | def handler500(request): 290 | return render(request, 'beauty/500.html', status=500) 291 | -------------------------------------------------------------------------------- /mysite/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == "__main__": 6 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings") 7 | 8 | from django.core.management import execute_from_command_line 9 | 10 | execute_from_command_line(sys.argv) 11 | -------------------------------------------------------------------------------- /mysite/mysite/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gaoconghui/image_site/b65b053adb7f574eef76612913de962e75b93b26/mysite/mysite/__init__.py -------------------------------------------------------------------------------- /mysite/mysite/password.py: -------------------------------------------------------------------------------- 1 | MYSQL_PASSWORD = '' -------------------------------------------------------------------------------- /mysite/mysite/settings.py: -------------------------------------------------------------------------------- 1 | """ 2 | Django settings for mysite project. 3 | 4 | Generated by 'django-admin startproject' using Django 1.9.4. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/1.9/topics/settings/ 8 | 9 | For the full list of settings and their values, see 10 | https://docs.djangoproject.com/en/1.9/ref/settings/ 11 | """ 12 | 13 | import os 14 | 15 | from mysite.password import MYSQL_PASSWORD 16 | 17 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 18 | 19 | # Quick-start development settings - unsuitable for production 20 | # See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/ 21 | 22 | # SECURITY WARNING: keep the secret key used in production secret! 23 | SECRET_KEY = '_=l6jt4_a%m)4z4_mdle686kyi83n*o9q%ryfl^j$$xkn2&_*1' 24 | 25 | # SECURITY WARNING: don't run with debug turned on in production! 26 | DEBUG = True 27 | 28 | if not DEBUG: 29 | LOGGING = { 30 | 'version': 1, 31 | 'disable_existing_loggers': False, 32 | 'filters': { 33 | 'require_debug_true': { 34 | '()': 'django.utils.log.RequireDebugTrue', 35 | }, 36 | }, 37 | 'formatters': { 38 | 'standard': { 39 | 'format': '%(levelname)s %(asctime)s %(pathname)s %(filename)s %(module)s %(funcName)s %(lineno)d: %(message)s' 40 | }, 41 | }, 42 | 'handlers': { 43 | 'mail_admins': { 44 | 'level': 'ERROR', 45 | 'class': 'django.utils.log.AdminEmailHandler', 46 | 'formatter': 'standard' 47 | }, 48 | 'file_handler': { 49 | 'level': 'DEBUG', 50 | 'class': 'logging.handlers.TimedRotatingFileHandler', 51 | 'filename': '/data/beauty/beauty.log', 52 | 'formatter': 'standard' 53 | }, 54 | 'console': { 55 | 'level': 'INFO', 56 | # 'filters': ['require_debug_true'], 57 | 'class': 'logging.StreamHandler', 58 | 'formatter': 'standard' 59 | }, 60 | }, 61 | 'loggers': { 62 | 'django': { 63 | 'handlers': ['file_handler', 'console'], 64 | 'level': 'INFO', 65 | 'propagate': True 66 | }, 67 | 'django.request': { 68 | 'handlers': ['mail_admins'], 69 | 'level': 'ERROR', 70 | 'propagate': False, 71 | }, 72 | 'beauty': { 73 | 'handlers': ['file_handler', 'console'], 74 | 'level': 'DEBUG', 75 | 'propagate': True 76 | } 77 | } 78 | } 79 | 80 | ALLOWED_HOSTS = [ 81 | # "192.168.1.108", 82 | "127.0.0.1", 83 | "localhost", 84 | "101.236.43.11", 85 | "*" 86 | ] 87 | 88 | if DEBUG: 89 | INTERNAL_IPS = ('127.0.0.1', '101.236.43.11', '114.244.137.31') 90 | # Application definition 91 | 92 | INSTALLED_APPS = [ 93 | 'beauty.apps.BeautyConfig', 94 | 'push.apps.PushConfig', 95 | 'django.contrib.admin', 96 | 'django.contrib.auth', 97 | 'django.contrib.contenttypes', 98 | 'django.contrib.sessions', 99 | 'django.contrib.messages', 100 | 'django.contrib.staticfiles', 101 | ] 102 | 103 | if DEBUG: 104 | INSTALLED_APPS.append('debug_toolbar') 105 | 106 | DEBUG_TOOLBAR_CONFIG = { 107 | "INTERCEPT_REDIRECTS": False, 108 | } 109 | 110 | MIDDLEWARE_CLASSES = [ 111 | 'beauty.middleware.AntiSpiderMiddleware', 112 | 'django.middleware.security.SecurityMiddleware', 113 | 'django.contrib.sessions.middleware.SessionMiddleware', 114 | 'django.middleware.common.CommonMiddleware', 115 | 'django.middleware.csrf.CsrfViewMiddleware', 116 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 117 | 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 118 | 'django.contrib.messages.middleware.MessageMiddleware', 119 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', 120 | ] 121 | 122 | if DEBUG: 123 | MIDDLEWARE_CLASSES.append('debug_toolbar.middleware.DebugToolbarMiddleware') 124 | 125 | ROOT_URLCONF = 'mysite.urls' 126 | 127 | TEMPLATES = [ 128 | { 129 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', 130 | 'DIRS': [], 131 | 'APP_DIRS': True, 132 | 'OPTIONS': { 133 | 'context_processors': [ 134 | 'django.template.context_processors.debug', 135 | 'django.template.context_processors.request', 136 | 'django.contrib.auth.context_processors.auth', 137 | 'django.contrib.messages.context_processors.messages', 138 | ], 139 | }, 140 | }, 141 | ] 142 | 143 | WSGI_APPLICATION = 'mysite.wsgi.application' 144 | 145 | # Database 146 | # https://docs.djangoproject.com/en/1.9/ref/settings/#databases 147 | 148 | DATABASES = { 149 | 'default': { 150 | 'ENGINE': 'django.db.backends.mysql', 151 | 'NAME': 'beauty', 152 | 'USER': 'root', 153 | 'PASSWORD': MYSQL_PASSWORD, 154 | 'HOST': '127.0.0.1', 155 | 'PORT': '3306', 156 | } 157 | } 158 | 159 | # Password validation 160 | # https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators 161 | 162 | AUTH_PASSWORD_VALIDATORS = [ 163 | { 164 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', 165 | }, 166 | { 167 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', 168 | }, 169 | { 170 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', 171 | }, 172 | { 173 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', 174 | }, 175 | ] 176 | 177 | CACHES = { 178 | "default": { 179 | "BACKEND": "django_redis.cache.RedisCache", 180 | "LOCATION": "redis://127.0.0.1:6379/2", 181 | "OPTIONS": { 182 | "CLIENT_CLASS": "django_redis.client.DefaultClient", 183 | } 184 | }, 185 | 'local': { 186 | 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', 187 | 'LOCATION': 'unique-snowflake', 188 | } 189 | } 190 | 191 | # Internationalization 192 | # https://docs.djangoproject.com/en/1.9/topics/i18n/ 193 | 194 | LANGUAGE_CODE = 'en-us' 195 | 196 | TIME_ZONE = 'UTC' 197 | 198 | USE_I18N = True 199 | 200 | USE_L10N = True 201 | 202 | USE_TZ = True 203 | 204 | # Static files (CSS, JavaScript, Images) 205 | # https://docs.djangoproject.com/en/1.9/howto/static-files/ 206 | 207 | STATIC_URL = '/static/' 208 | STATIC_ROOT = os.path.join(BASE_DIR, "static/") 209 | 210 | FAKE_ID = "TEST" -------------------------------------------------------------------------------- /mysite/mysite/urls.py: -------------------------------------------------------------------------------- 1 | """mysite URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/1.9/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Import the include() function: from django.conf.urls import url, include 14 | 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) 15 | """ 16 | 17 | from django.conf.urls import include, url 18 | from django.contrib import admin 19 | import settings 20 | 21 | urlpatterns = [ 22 | url(r'^', include('beauty.urls')), 23 | url(r'^push/', include('push.urls')), 24 | url(r'^admin/', admin.site.urls), 25 | ] 26 | if settings.DEBUG: 27 | import debug_toolbar 28 | urlpatterns.append(url(r'^__debug__/', include(debug_toolbar.urls))) 29 | -------------------------------------------------------------------------------- /mysite/mysite/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for mysite project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings") 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /mysite/page_finder.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | 给百度主动推链接收录 4 | """ 5 | 6 | # import os, django 7 | import itertools 8 | import os 9 | 10 | from mysite.settings import STATIC_ROOT 11 | from util.normal import ensure_utf8 12 | 13 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings") 14 | import django 15 | 16 | django.setup() 17 | from beauty.models import Tag, Gallery 18 | 19 | 20 | def get_all_tag_page(): 21 | base = "http://www.meizibar.com/{tag}/1" 22 | for t in Tag.objects.all(): 23 | url = base.format(tag=ensure_utf8(t.tag_id)) 24 | yield url 25 | 26 | 27 | def get_all_gallery_page(): 28 | base = "http://www.meizibar.com/gallery/{gallery}/1" 29 | for g in Gallery.objects.all(): 30 | url = base.format(gallery=g.gallery_id) 31 | yield url 32 | 33 | 34 | def get_all_gallery_more_page(): 35 | base = "http://www.meizibar.com/gallery/{gallery}/more/1" 36 | for g in Gallery.objects.all(): 37 | url = base.format(gallery=g.gallery_id) 38 | yield url 39 | 40 | 41 | def gen_site_map(): 42 | """ 43 | 每五万个链接为一个文件,生成sitemap 44 | :return: 45 | """ 46 | base = """ 47 | 48 | {items} 49 | 50 | """ 51 | 52 | def gen_url_item(url, priority, changefreq): 53 | return "{url}{priority}{changefreq}".format( 54 | url=url, priority=priority, changefreq=changefreq 55 | ) 56 | 57 | def items_split(items, single_size=10000): 58 | """ 59 | 讲items分割为一组最多single_size个 60 | :param single_size: 61 | :return: 62 | """ 63 | size = len(items) 64 | count = size / single_size + 1 65 | result = [] 66 | for c in range(count): 67 | result.append(items[c * single_size: (c + 1) * single_size]) 68 | return result 69 | 70 | def gen_sitemap_index(count): 71 | sitemap_base = "http://www.meizibar.com/static/beauty_site_map{c}.xml" 72 | index_base = \ 73 | """ 74 | 75 | {sitemap} 76 | """ 77 | sitemap = "\n".join([sitemap_base.format(c=c) for c in range(count)]) 78 | return index_base.format(sitemap=sitemap) 79 | 80 | index_items = [gen_url_item("http://www.meizibar.com", 1.0, "always")] 81 | tag_items = [gen_url_item(url, 0.8, "daily") for url in get_all_tag_page()] 82 | gallery_items = [gen_url_item(url, 0.6, 'weekly') for url in get_all_gallery_page()] 83 | gallery_items_more = [gen_url_item(url, 0.6, 'weekly') for url in get_all_gallery_more_page()] 84 | items_list = items_split(list(itertools.chain(index_items, tag_items, gallery_items, gallery_items_more)), 85 | single_size=9000) 86 | for index, items in enumerate(items_list): 87 | xml = base.format(items="\n".join(items)) 88 | file_path = os.path.join(STATIC_ROOT, "beauty_site_map{c}.xml".format(c=index)) 89 | with open(file_path, "w") as f: 90 | print file_path 91 | f.write(xml) 92 | index_path = os.path.join(STATIC_ROOT, "beauty_site_map.xml") 93 | with open(index_path,"w") as f: 94 | print index_path 95 | f.write(gen_sitemap_index(len(items_list))) 96 | 97 | 98 | if __name__ == '__main__': 99 | # url = "http://data.zz.baidu.com/urls?site=www.meizibar.com&token=gRFpxp8hn04BXTjV" 100 | # for u in get_all_gallery_page(): 101 | # print u 102 | # r = requests.post(url,data=u) 103 | # print r.text 104 | # for u in get_all_tag_page(): 105 | # print u 106 | # r = requests.post(url, data=u) 107 | # print r.text 108 | print gen_site_map() 109 | -------------------------------------------------------------------------------- /mysite/push/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gaoconghui/image_site/b65b053adb7f574eef76612913de962e75b93b26/mysite/push/__init__.py -------------------------------------------------------------------------------- /mysite/push/admin.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from __future__ import unicode_literals 3 | 4 | from django.contrib import admin 5 | 6 | # Register your models here. 7 | -------------------------------------------------------------------------------- /mysite/push/apps.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from __future__ import unicode_literals 3 | 4 | from django.apps import AppConfig 5 | 6 | 7 | class PushConfig(AppConfig): 8 | name = 'push' 9 | -------------------------------------------------------------------------------- /mysite/push/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gaoconghui/image_site/b65b053adb7f574eef76612913de962e75b93b26/mysite/push/migrations/__init__.py -------------------------------------------------------------------------------- /mysite/push/models.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from __future__ import unicode_literals 3 | 4 | from django.db import models 5 | 6 | # Create your models here. 7 | -------------------------------------------------------------------------------- /mysite/push/tests.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from __future__ import unicode_literals 3 | 4 | from django.test import TestCase 5 | 6 | # Create your tests here. 7 | -------------------------------------------------------------------------------- /mysite/push/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import url 2 | 3 | from . import views 4 | 5 | app_name = 'push' 6 | 7 | urlpatterns = [ 8 | url(r'^gallery/$', views.gallery, name='gallery'), 9 | url(r'^check/(?P.*)$', views.check, name='check'), 10 | ] -------------------------------------------------------------------------------- /mysite/push/views.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import json 3 | import logging 4 | import time 5 | 6 | from beauty.models import Gallery, Image, Tag 7 | from beauty.tags_model import tag_cache 8 | from django.http import HttpResponse 9 | from django.views.decorators.csrf import csrf_exempt 10 | from util.dedup import is_new_md5, add_title_to_md5 11 | from util.normal import ensure_unicode, ensure_utf8 12 | from util.pinyin import get_pinyin 13 | 14 | push_key = u"mt1994" 15 | logger = logging.getLogger("push") 16 | 17 | 18 | def get_all_tags(): 19 | all_tags = Tag.objects.all() 20 | all_tags = [tag.tag_id for tag in all_tags] 21 | return all_tags 22 | 23 | 24 | @csrf_exempt 25 | def gallery(request): 26 | result = { 27 | "status": "failed" 28 | } 29 | if request.method == 'POST': 30 | received_json_data = json.loads(ensure_unicode(request.body)) 31 | key = received_json_data.get("key", "") 32 | if key != push_key: 33 | result['msg'] = "not authorize" 34 | else: 35 | # try: 36 | save_gallery_item(received_json_data) 37 | result['status'] = "success" 38 | # except IntegrityError: 39 | # result['msg'] = "IntegrityError" 40 | print received_json_data 41 | else: 42 | result['msg'] = "need post" 43 | return HttpResponse(json.dumps(result), content_type='application/json') 44 | 45 | 46 | def check(request, md5): 47 | return HttpResponse(is_new_md5(md5)) 48 | 49 | 50 | def save_gallery_item(data): 51 | """ 52 | 保存传进来的图集以及图片内容,格式如下 53 | { 54 | gallery : { gallery_field }, 55 | images : [ 56 | image 57 | image 58 | image 59 | ] 60 | } 61 | :param data: 62 | :return: 63 | """ 64 | logger.debug(json.dumps(data)) 65 | priority = data.get("priority", None) 66 | ori_gallery = data.get("gallery", {}) 67 | title = ori_gallery['title'] 68 | if not add_title_to_md5(ensure_utf8(title)): 69 | logger.info("dedup old title") 70 | return 71 | images = data.get("images", []) 72 | 73 | _gallery = Gallery.objects.create_item( 74 | gallery_id=ori_gallery['gallery_id'], 75 | title=ensure_unicode(ori_gallery['title']), 76 | tags=ensure_unicode(ori_gallery.get("tags", "")), 77 | cover_id=ori_gallery.get("cover_id"), 78 | publish_time=ori_gallery.get("publish_time", int(time.time())), 79 | insert_time=ori_gallery.get("insert_time", int(time.time())), 80 | page_count=ori_gallery.get("page_count", len(images)) 81 | ) 82 | try: 83 | _gallery.save() 84 | except Exception, e: 85 | print e 86 | for _image in images: 87 | Image.objects.create_item( 88 | gallery_id=_image.get("gallery_id", _gallery.gallery_id), 89 | image_id=_image['image_id'], 90 | desc=ensure_unicode(_image.get("desc", "")), 91 | order=_image["order"], 92 | width=_image.get("width", -1), 93 | height=_image.get("height", -1), 94 | size=_image.get("size", -1) 95 | ).save() 96 | 97 | # 建立tag索引 98 | tags_pinyin = [get_pinyin(tag) for tag in ori_gallery.get("tags", "").split(",")] 99 | tags_pinyin.append("all") 100 | tag_cache.add_new_gallery(gallery_id=_gallery.gallery_id, tags=tags_pinyin, priority=priority) 101 | check_and_add_tags(ori_gallery.get("tags", "").split(",")) 102 | 103 | 104 | def check_and_add_tags(tags): 105 | for tag in tags: 106 | pinyin = get_pinyin(tag).strip() 107 | if pinyin and pinyin not in get_all_tags(): 108 | Tag.objects.create_item( 109 | tag_name=tag, 110 | tag_id=pinyin, 111 | tag_type=1, 112 | desc="" 113 | ).save() 114 | -------------------------------------------------------------------------------- /mysite/static/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: MJ12bot 2 | Disallow: / 3 | 4 | User-agent: * 5 | Allow:/ 6 | -------------------------------------------------------------------------------- /mysite/tag_job.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | tag重建脚本 4 | 根据分词结果给图集增加tag 5 | """ 6 | # import os, django 7 | import os 8 | 9 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings") 10 | import django 11 | 12 | django.setup() 13 | from beauty.models import Tag, Gallery 14 | from beauty.tags_model import tag_cache 15 | from util.pinyin import get_pinyin 16 | from util.tag_tokenizer import TagTokenizer 17 | 18 | tokenizer = TagTokenizer([tag.tag_name for tag in Tag.objects.all()]) 19 | 20 | 21 | def rebuild_tags(): 22 | all_tags = Tag.objects.all() 23 | all_tags = set([tag.tag_name for tag in all_tags]) 24 | for index, gallery in enumerate(Gallery.objects.all()): 25 | print index 26 | gid = gallery.gallery_id 27 | print "process " + gid 28 | tags = set([t for t in gallery.tags.split(",") if t.strip()]) 29 | title = gallery.title 30 | print title 31 | cuts = set([tag for tag in list(tokenizer.cut(title)) if tag in all_tags]) 32 | news = cuts.difference(tags) 33 | if len(news) > 0: 34 | print "{gallery} need rebuild".format(gallery=gid) 35 | for n_tag in cuts: 36 | add_gallery_to_tag(gid, n_tag) 37 | tags.update(cuts) 38 | gallery.tags = merge_tags_by_freq(list(tags)) 39 | gallery.save() 40 | else: 41 | print "gallery need not rebuild".format(gallery=gid) 42 | 43 | 44 | freq_cache = {} 45 | 46 | 47 | def merge_tags_by_freq(tag_list): 48 | """ 49 | 根据词频倒数merge tag_list 50 | :param tag_list: 中文,list 51 | :return: str 52 | """ 53 | 54 | def freq(tag_id): 55 | if tag_id not in freq_cache: 56 | freq_cache[tag_id] = tag_cache.count(tag_id) 57 | return freq_cache[tag_id] 58 | 59 | return ",".join(sorted(tag_list, key=lambda x: freq(get_pinyin(x)))) 60 | 61 | 62 | def add_gallery_to_tag(gallery_id, tag): 63 | tag_pinyin = get_pinyin(tag) 64 | print "add tag " + tag_pinyin 65 | tag_cache.add_new_gallery(gallery_id=gallery_id, tags=[tag_pinyin]) 66 | 67 | 68 | def init_redis_tag(): 69 | """ 70 | 应该只在第一次启动的时候使用,会扫gallery表,在redis里建立索引 71 | :return: 72 | """ 73 | for index, gallery in enumerate(Gallery.objects.all()): 74 | print index 75 | gid = gallery.gallery_id 76 | print "process " + gid 77 | tags = set(gallery.tags.split(",")) 78 | for n_tag in tags: 79 | add_tag_is_not_exist(n_tag) 80 | add_gallery_to_tag(gid, n_tag) 81 | add_gallery_to_tag(gid, "all") 82 | 83 | 84 | def add_tag_is_not_exist(tag_name): 85 | ts = Tag.objects.filter(tag_name=tag_name) 86 | if len(ts) == 0: 87 | print "add tag" 88 | tag_id = get_pinyin(tag_name) 89 | Tag.objects.create_item( 90 | tag_name=tag_name, 91 | tag_id=tag_id, 92 | tag_type=1, 93 | desc="" 94 | ).save() 95 | 96 | 97 | def fix_tag_name(): 98 | """ 99 | 老的tag中包含有空格的,用_代替 100 | :return: 101 | """ 102 | for index, gallery in enumerate(Gallery.objects.all()): 103 | print index 104 | tags = gallery.tags 105 | if " " in tags: 106 | print "tags is {tags}".format(tags=tags) 107 | tags = tags.replace(" ", "_") 108 | gallery.tags = tags 109 | gallery.save() 110 | 111 | 112 | def update_tag_meta(): 113 | f = open("./tag_meta") 114 | datas = f.readlines() 115 | datas = [data.replace("\n", '').split("\t") for data in datas] 116 | for data in datas: 117 | tag_name = data[1] 118 | tag_type = data[-1] 119 | ts = Tag.objects.filter(tag_name=tag_name) 120 | if len(ts) == 0: 121 | print "tag does not exist {tag}".format(tag=tag_name) 122 | else: 123 | for t in ts: 124 | t.tag_type = int(tag_type) 125 | t.save() 126 | 127 | 128 | if __name__ == '__main__': 129 | # init_redis_tag() 130 | # update_tag_meta() 131 | rebuild_tags() 132 | -------------------------------------------------------------------------------- /mysite/util/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gaoconghui/image_site/b65b053adb7f574eef76612913de962e75b93b26/mysite/util/__init__.py -------------------------------------------------------------------------------- /mysite/util/dedup.py: -------------------------------------------------------------------------------- 1 | import redis 2 | import hashlib 3 | 4 | r = redis.Redis() 5 | key = "title_dedup" 6 | 7 | 8 | def is_new_md5(m): 9 | return r.sismember(key, m) 10 | 11 | 12 | def add_title_to_md5(m): 13 | md5 = hashlib.md5(m).hexdigest() 14 | return r.sadd(key, md5) 15 | 16 | if __name__ == '__main__': 17 | print is_new_md5("abc") -------------------------------------------------------------------------------- /mysite/util/normal.py: -------------------------------------------------------------------------------- 1 | def ensure_unicode(s): 2 | if isinstance(s, unicode): 3 | return s 4 | elif isinstance(s, str): 5 | return s.decode('utf-8') 6 | else: 7 | return s 8 | 9 | 10 | def ensure_utf8(s): 11 | if isinstance(s, str): 12 | return s 13 | elif isinstance(s, unicode): 14 | return s.encode('utf-8') 15 | else: 16 | return s -------------------------------------------------------------------------------- /mysite/util/pinyin.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | from pypinyin import lazy_pinyin 4 | 5 | from util.normal import ensure_unicode 6 | 7 | cache = {} 8 | 9 | def get_pinyin_list(s): 10 | s = ensure_unicode(s) 11 | return lazy_pinyin(s) 12 | 13 | 14 | def get_pinyin(s): 15 | if s not in cache.keys(): 16 | cache[s] = "".join(get_pinyin_list(s)).replace(".","_").replace(u"·","_").replace("-","_") 17 | return cache[s] 18 | 19 | 20 | if __name__ == "__main__": 21 | str_input = 'tailai·m-ali·xier' 22 | print(get_pinyin(str_input)) 23 | -------------------------------------------------------------------------------- /mysite/util/tag_tokenizer.py: -------------------------------------------------------------------------------- 1 | # -*- coding:utf-8 -*- 2 | from normal import ensure_unicode 3 | 4 | 5 | class TagTokenizer(object): 6 | def __init__(self, tag_list): 7 | """ 8 | 在title中找到所有的tag 9 | 最简单的实现是对遍历每个tag,看是否在title中,显然太慢 10 | 这边采用类似jieba分词中的方法 11 | :param tag_list: 所有的tag list of string 12 | """ 13 | self.tag_list = tag_list 14 | self.FREQ = {} 15 | self.initialize() 16 | 17 | def initialize(self): 18 | lfreq = {} 19 | for word in self.tag_list: 20 | try: 21 | word = ensure_unicode(word) 22 | lfreq[word] = 1 23 | for ch in xrange(len(word)): 24 | wfrag = word[:ch + 1] 25 | if wfrag not in lfreq: 26 | lfreq[wfrag] = 0 27 | except ValueError: 28 | raise ValueError( 29 | 'invalid tag list entry %s' % (word)) 30 | self.FREQ = lfreq 31 | 32 | def get_DAG(self, sentence): 33 | DAG = {} 34 | N = len(sentence) 35 | for k in xrange(N): 36 | tmplist = [] 37 | i = k 38 | frag = sentence[k] 39 | while i < N and frag in self.FREQ: 40 | if self.FREQ[frag]: 41 | tmplist.append(i) 42 | i += 1 43 | frag = sentence[k:i + 1] 44 | DAG[k] = tmplist 45 | return DAG 46 | 47 | def cut(self, sentence): 48 | sentence = ensure_unicode(sentence) 49 | DAG = self.get_DAG(sentence) 50 | for k, v in DAG.iteritems(): 51 | if not v: 52 | continue 53 | for end in v: 54 | yield sentence[k:end + 1] 55 | 56 | 57 | if __name__ == '__main__': 58 | tag_list = ["夏美酱", "你好", "花の颜", "夏美", "天天"] 59 | tokenizer = TagTokenizer(tag_list) 60 | for k in tokenizer.cut("heelo 夏美酱 worl你好d 花の颜"): 61 | print k 62 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | Django==1.11.3 2 | django-debug-toolbar==1.8 3 | django-redis==4.8.0 4 | enum34==1.1.6 5 | MySQL-python==1.2.5 6 | peewee==2.10.1 7 | pypinyin==0.23.0 8 | pytz==2017.2 9 | redis==2.10.5 10 | six==1.10.0 11 | sqlparse==0.2.3 12 | -------------------------------------------------------------------------------- /script/tag_photo_bg_gen.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | 生成tag page 的背景图 4 | """ 5 | 6 | from PIL import Image 7 | 8 | template_image = "/tmp/test.png" 9 | template = Image.open(template_image) 10 | a_band = template.split()[-1] 11 | template_size = (550, 350) 12 | 13 | 14 | def resize_and_crop(ori_image, target_size): 15 | """ 16 | 输入的必须是宽图,切除target_size大小的图片,先resize,然后取中间 17 | :param ori_image: 18 | :param target_size: 19 | :return: 20 | """ 21 | ori_width, ori_height = ori_image.size 22 | result_width = target_size[0] 23 | result_height = result_width * ori_height / ori_width 24 | crop_top = (result_height - target_size[1]) / 2 25 | crop_bottom = crop_top + target_size[1] 26 | return ori_image.resize((result_width, result_height)).crop((0, crop_top, result_width, crop_bottom)) 27 | 28 | 29 | def append_band(image, band): 30 | return Image.merge("RGBA", image.split() + (band,)) 31 | 32 | 33 | if __name__ == '__main__': 34 | path = "/tmp/pt.jpg" 35 | image = Image.open(path) 36 | image_result = append_band(resize_and_crop(image, template_size), a_band) 37 | image_result.save("/tmp/result.png") 38 | --------------------------------------------------------------------------------