爱意满满的作品展示区。
coraline

个人网站, http://lorem.in

  •  
  •   coraline · Jun 21, 2014 · 11251 views
    This topic created in 4533 days ago, the information mentioned may be changed or developed.
    之前弄了个基于grunt的前端开发,上线框架 Wframe https://github.com/LoeiFy/WFrame

    为了弄个例子出来,就顺势做一个网站出来, http://lorem.in

    网站是挂在Github上,可能奇怪的有点慢。

    同时对pc跟手机做了适配,体验都不错,鼠标键盘都可以操作 swipe, tap, scroll or keyboard to navigator

    兼容性的话都明白的,我没那么多心思去兼容,但是高级点的浏览器都没有问题,可能有一些bug,以后在修复了
    Supplement 1  ·  Jun 21, 2014
    Supplement 2  ·  Jul 2, 2014
    更新一个版本:

    1.添加fav ico 可以在Safari添加到主屏幕,像一个app的样子

    2.添加svg动画,支持Retina Display

    3.功能函数都分离出来,模块更清晰

    4.界面细微调整

    已知bug:

    1.手机设备点击不了作品链接,这个暂时没想到办法

    2.浏览器前进后退有点问题,这个是没有处理好history api 逻辑要变一下
    54 replies  •  2015-09-17 22:50:48 +08:00
    pagecho
    pagecho
    Jun 21, 2014
    1
    最后的那个模糊效果好厉害啊!有教程么?
    JoyNeop
    JoyNeop
    Jun 21, 2014
    2
    卧槽这域名屌炸了
    Livid
    Livid
    MOD
    PRO
    Jun 21, 2014
    3
    Server not found.
    wzxjohn
    wzxjohn
    Jun 21, 2014
    4
    @JoyNeop 域名怎么了?
    wzxjohn
    wzxjohn
    Jun 21, 2014
    5
    git上国内访问慢很正常啊。。。没啥好奇怪的=。=
    coraline
    coraline
    OP
    Jun 21, 2014
    6
    @pagecho

    canvas 重新画一张图 模拟

    @Livid 是在Github上的,用dnspod做解析,访问不了我也不明白为什么
    Geeker
    Geeker
    Jun 21, 2014
    7
    我手抖按了下 Tab 键 。。
    paloalto
    paloalto
    Jun 21, 2014❤️1
    8
    @pagecho lz 用的是 canvas 实现模糊。

    var CanvasImage = function(a, b) {
    this.element = a,
    this.image = b,
    this.element.width = this.image.width,
    this.element.height = this.image.height,
    this.context = this.element.getContext("2d"),
    this.context.drawImage(this.image, 0, 0)
    };

    CanvasImage.prototype.blur = function(a) {
    this.context.globalAlpha = .5;
    for (var b = -a; a >= b; b += 2) for (var c = -a; a >= c; c += 2) this.context.drawImage(this.element, c, b), c >= 0 && b >= 0 && this.context.drawImage(this.element, -(c - 1), -(b - 1));
    this.context.globalAlpha = 1
    },
    paloalto
    paloalto
    Jun 21, 2014❤️1
    9
    @pagecho 嫌麻烦的话,可以试试这个:

    https://github.com/jakiestfu/Blur.js

    blur.js is a jQuery plugin that produces psuedo-transparent blurred elements over other elements.
    mortal
    mortal
    Jun 21, 2014
    10
    牛啊。。。
    pagecho
    pagecho
    Jun 21, 2014
    11
    @paloalto 成功了。。。好屌!!!
    guoqiao
    guoqiao
    Jun 21, 2014 via iPhone❤️1
    12
    能不能把错别字改下,强迫症的表示难受…
    P233
    P233
    Jun 21, 2014
    13
    @paloalto 补充 SVG Filter

    <svg version="1.1" xmlns="http://www.w3.org/2000/svg">
    <filter id="blur">
    <feGaussianBlur stdDeviation="7" />
    </filter>
    </svg>


    #div { filter:url(#blur) }

    上一句在 Firefox 中需要写成 inline style, 写进 CSS 文件中无效,搜了下没人提过,也不知道为什么
    iislong
    iislong
    Jun 21, 2014
    14
    @wzxjohn 里面有个撸过(guo.lu)的域名,进去后应该注意到
    jdqingm
    jdqingm
    Jun 21, 2014 via iPhone
    15
    好帅气…
    wintr
    wintr
    Jun 21, 2014❤️1
    16
    最后 DESIGN 拼错了
    taobeier
    taobeier
    Jun 21, 2014
    17
    很漂亮!
    coraline
    coraline
    OP
    Jun 21, 2014
    18
    @Geeker 哈哈

    @guoqiao 已经修正,不小心打多一个字母

    @wintr 谢谢
    jaylong
    jaylong
    Jun 21, 2014
    19
    楼主的http://guo.lu 这个很赞啊
    wildplant
    wildplant
    Jun 21, 2014
    20
    @coraline 好牛啊。是哪里的牛人?
    falconeye
    falconeye
    Jun 21, 2014
    21
    Good!
    wensonsmith
    wensonsmith
    Jun 21, 2014
    22
    图片模糊能详细说明一下吗?? 没找到源码
    openroc
    openroc
    Jun 21, 2014
    23
    同赞,guo.lu~~~
    coraline
    coraline
    OP
    Jun 21, 2014❤️1
    24
    @wensonsmith

    这个是canvas生成模糊image的方法:

    var CanvasImage = function(ele,img) {
    this.element = ele;
    this.image = img;

    this.element.width = this.image.width;
    this.element.height = this.image.height;

    this.context = this.element.getContext("2d");

    this.context.drawImage(this.image,0,0)
    };

    CanvasImage.prototype.blur = function(i) {
    this.context.globalAlpha = 0.5;

    for (var y = -i; y <= i; y += 2) {
    for (var x = -i; x <= i; x += 2) {
    this.context.drawImage(this.element, x, y)

    if (x >= 0 && y >= 0) {
    this.context.drawImage(this.element, -(x-1), -(y-1))
    }
    }
    }
    this.context.globalAlpha = 1
    };

    其实就是双层图片模拟的,上层是canvas,下层是原来image
    hustlzp
    hustlzp
    Jun 21, 2014
    25
    楼主好强大!
    cxshun
    cxshun
    Jun 22, 2014
    26
    好帅气
    zola
    zola
    Jun 22, 2014
    27
    请教鼠标点击出现小圈的效果是叫什么名字?
    wensonsmith
    wensonsmith
    Jun 22, 2014
    28
    @coraline 调用的话是这样么? 我怎么成功不了啊···你能在http://jsfiddle.net/ 上写一个demo么?

    var cImg = CanvasImage(document.getElementById('blur'),document.getElementById('img'));

    cImg.blur(2);
    wensonsmith
    wensonsmith
    Jun 22, 2014
    29
    @coraline 噢! 知道自己错在哪了。。

    哈哈,成功了,多谢啊!!!
    guoqiao
    guoqiao
    Jun 22, 2014
    30
    @coraline
    还有那句"会变得永远只是人心而已". 设计很不错, 但一个无关痛痒的错别字, 立即让逼格大幅降低.
    wensonsmith
    wensonsmith
    Jun 22, 2014
    31
    楼主,图片尺寸如果超出窗口宽度,比如 一张1440 的图,我可以用 width = “100%” 来缩小至重口大小,但是canvas 里面绘制的是原图的大小,怎样处理的呢?

    PS: 你给的源码里面的js都是压缩过的。。。看哭了啊!
    shyrz
    shyrz
    Jun 22, 2014
    32
    楼主流弊,给你点赞!(/ w \ )
    shyrz
    shyrz
    Jun 22, 2014❤️1
    33
    看了下素锦阅读,我知道你是谁了
    coraline
    coraline
    OP
    Jun 22, 2014❤️1
    34
    ychongsaytc
    ychongsaytc
    Jun 22, 2014
    35
    支持 Retina Display 就更棒了
    h2sky
    h2sky
    Jun 22, 2014
    36
    觉得不算是博客吧,更像幻灯片演示 --_--!@
    g0thic
    g0thic
    Jun 22, 2014
    37
    xunxun
    xunxun
    Jun 22, 2014
    38
    我看到了。。。简书。。
    juo
    juo
    Jun 23, 2014
    39
    @coraline “会变得只是人心”,这张好像从丁一那看到过,你是?
    coraline
    coraline
    OP
    Jun 23, 2014
    40
    @juo 文章不是我弄的,是另一个作者
    imSam
    imSam
    Jun 24, 2014
    41
    帅气,若是兼容RETINA,必然屌爆了。
    goldenlove
    goldenlove
    Jul 2, 2014
    42
    挺赞的... 喜欢那个大括号的loading ...
    lisposter
    lisposter
    Jul 2, 2014
    43
    域名好好看 赞
    JoyNeop
    JoyNeop
    Jul 2, 2014
    44
    占用了 Safari 的手势,无法正确地 show the previous page
    hellov22ex
    hellov22ex
    Jul 2, 2014
    45
    很漂亮
    ansenlee
    ansenlee
    Jul 2, 2014
    46
    这体验好没逻辑啊。。
    TimLang
    TimLang
    Jul 2, 2014
    47
    从lz的网站找到个很有意思的js插件:Isotope,不过不开源。。
    coraline
    coraline
    OP
    Jul 2, 2014
    48
    @TimLang

    For non-commercial, personal, or open source projects and applications, you may use Isotope under the terms of the GPL v3 License. You may use Isotope for free.

    guo.lu 这个网站并没有涉及商业,并且还是属于个人项目
    ytf4425
    ytf4425
    Jul 3, 2014
    49
    警告

    尊敬的用户,您好!
    您访问的网站或页面因如下原因而暂时禁止访问:
    1、网站未备案,按照国家相关法律法规,该网站被临时屏蔽!
    2、网站主机上绑定多个未备案域名。
    3、网站页面内含有敏感或有害信息,如涉黄、赌、毒等内容。
    4、将备案号/经营许可号显示在网站首页的醒目位置,如当地电管局另有要求则以当地电管局要求为准。
    iam36
    iam36
    Jul 3, 2014
    50
    锅炉你好!
    :P
    yangkeao
    yangkeao
    Jul 4, 2014
    51
    我一直想知道这个滑动是怎么做的。

    监听的什么事件?能够做到跨平台
    bydgd
    bydgd
    Sep 17, 2015
    52
    @coraline 为嘛 我在网站源文件中 没有找到这些代码 ?
    bydgd
    bydgd
    Sep 17, 2015
    53
    就是 canvas 模糊效果的代码
    bydgd
    bydgd
    Sep 17, 2015
    54
    脑抽了·····说的不一个,,无视我
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1094 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 134ms · UTC 18:21 · PVG 02:21 · LAX 10:21 · JFK 13:21
    ♥ Do have faith in what you're doing.