Skip to content

Commit

Permalink
Lazyload image
Browse files Browse the repository at this point in the history
  • Loading branch information
halfrost committed Oct 19, 2020
1 parent 0f3fc01 commit c0e4568
Show file tree
Hide file tree
Showing 6 changed files with 193 additions and 27 deletions.
44 changes: 22 additions & 22 deletions content/home/accomplishments.md
Expand Up @@ -27,7 +27,7 @@ date_format = "Jan 2006"
date_start = "2020-07-20"
date_end = ""
description = """
<img src="/media/ACM_.png" alt="ACM" style="height: 60px;">
<img data-src="/media/ACM.png" alt="ACM" style="height: 60px;" class="lazyload">
"""

[[item]]
Expand All @@ -39,7 +39,7 @@ date_format = "Jan 2006"
date_start = "2020-07-15"
date_end = ""
description = """
<img src="/media/IEEE_.png" alt="IEEE" style="height: 60px;">
<img data-src="/media/IEEE.png" alt="IEEE" style="height: 60px;" class="lazyload">
"""

[[item]]
Expand All @@ -51,7 +51,7 @@ date_format = "Jan 2006"
date_start = "2020-07-10"
date_end = ""
description = """
<img src="/media/IEEE-CS_.png" alt="IEEE-CS" style="height: 60px;">
<img data-src="/media/IEEE-CS.png" alt="IEEE-CS" style="height: 60px;" class="lazyload">
"""

[[item]]
Expand All @@ -63,7 +63,7 @@ date_format = "Jan 2006"
date_start = "2020-07-05"
date_end = ""
description = """
<img src="/media/CCF_.png" alt="CCF" style="height: 60px;">
<img data-src="/media/CCF.png" alt="CCF" style="height: 60px;" class="lazyload">
"""

[[item]]
Expand All @@ -75,7 +75,7 @@ date_format = "Jan 2006"
date_start = "2020-07-01"
date_end = ""
description = """
<img src="/media/Coursera_.png" alt="Coursera" style="height: 60px;">
<img data-src="/media/Coursera.png" alt="Coursera" style="height: 60px;" class="lazyload">
"""

[[item]]
Expand All @@ -87,7 +87,7 @@ date_format = "Jan 2006"
date_start = "2020-06-15"
date_end = ""
description = """
<img src="/media/Apple-teacher_.png" alt="Apple Teacher" style="height: 60px;">
<img data-src="/media/Apple-teacher.png" alt="Apple Teacher" style="height: 60px;" class="lazyload">
"""

[[item]]
Expand All @@ -99,7 +99,7 @@ date_format = "Jan 2006"
date_start = "2018-03-26"
date_end = ""
description = """
<img src="/media/Coursera_.png" alt="Coursera" style="height: 60px;">
<img data-src="/media/Coursera.png" alt="Coursera" style="height: 60px;" class="lazyload">
"""


Expand All @@ -112,7 +112,7 @@ date_format = "Jan 2006"
date_start = "2011-10-01"
date_end = ""
description = """
<img src="/media/ACM-ICPC_.png" alt="ACM-ICPC" style="height: 60px;">
<img data-src="/media/ACM-ICPC.png" alt="ACM-ICPC" style="height: 60px;" class="lazyload">
"""

[[item]]
Expand All @@ -124,7 +124,7 @@ date_format = "Jan 2006"
date_start = "2011-05-01"
date_end = ""
description = """
<img src="/media/ACM-ICPC_.png" alt="ACM-ICPC" style="height: 60px;">
<img data-src="/media/ACM-ICPC.png" alt="ACM-ICPC" style="height: 60px;" class="lazyload">
"""

[[item]]
Expand All @@ -136,7 +136,7 @@ date_format = "Jan 2006"
date_start = "2012-05-01"
date_end = "2014-05-01"
description = """
<img src="/media/CQC_.png" alt="CQC" style="height: 60px;">
<img data-src="/media/CQC.png" alt="CQC" style="height: 60px;" class="lazyload">
"""

[[item]]
Expand All @@ -148,7 +148,7 @@ date_format = "Jan 2006"
date_start = "2011-11-01"
date_end = "2013-11-01"
description = """
<img src="/media/CQC_.png" alt="CQC" style="height: 60px;">
<img data-src="/media/CQC.png" alt="CQC" style="height: 60px;" class="lazyload">
"""


Expand All @@ -161,7 +161,7 @@ date_format = "Jan 2006"
date_start = "2012-03-01"
date_end = "2017-03-01"
description = """
<img src="/media/NCRE_.png" alt="NCRE" style="height: 60px;">
<img data-src="/media/NCRE.png" alt="NCRE" style="height: 60px;" class="lazyload">
"""

[[item]]
Expand All @@ -173,7 +173,7 @@ date_format = "Jan 2006"
date_start = "2016-12-01"
date_end = ""
description = """
<img src="/media/juejin_.png" alt="juejin" style="height: 60px;">
<img data-src="/media/juejin.png" alt="juejin" style="height: 60px;" class="lazyload">
"""

[[item]]
Expand All @@ -185,7 +185,7 @@ date_format = "Jan 2006"
date_start = "2016-12-01"
date_end = ""
description = """
<img src="/media/jianshu_.png" alt="jianshu" style="height: 60px;">
<img data-src="/media/jianshu.png" alt="jianshu" style="height: 60px;" class="lazyload">
"""

#[[item]]
Expand All @@ -197,7 +197,7 @@ date_format = "Jan 2006"
# date_start = "2012-04-01"
# date_end = ""
# description = """
#<img src="/media/HUZU_.png" alt="HUZU" style="height: 60px;">
#<img data-src="/media/HUZU.png" alt="HUZU" style="height: 60px;" class="lazyload">
#"""

[[item]]
Expand All @@ -209,7 +209,7 @@ date_format = "Jan 2006"
date_start = "2011-06-01"
date_end = ""
description = """
<img src="/media/ACM-ICPC_.png" alt="ACM-ICPC" style="height: 60px;">
<img data-src="/media/ACM-ICPC.png" alt="ACM-ICPC" style="height: 60px;" class="lazyload">
"""

#[[item]]
Expand All @@ -221,7 +221,7 @@ date_format = "Jan 2006"
# date_start = "2011-03-01"
# date_end = ""
# description = """
#<img src="/media/HUZU_.png" alt="HUZU" style="height: 60px;">
#<img data-src="/media/HUZU.png" alt="HUZU" style="height: 60px;" class="lazyload">
#"""


Expand All @@ -234,7 +234,7 @@ date_format = "Jan 2006"
# date_start = "2010-03-01"
# date_end = ""
# description = """
#<img src="/media/HUZU_.png" alt="HUZU" style="height: 60px;">
#<img data-src="/media/HUZU.png" alt="HUZU" style="height: 60px;" class="lazyload">
#"""

#[[item]]
Expand All @@ -246,7 +246,7 @@ date_format = "Jan 2006"
# date_start = "2009-12-01"
# date_end = ""
# description = """
#<img src="/media/HUZU_.png" alt="HUZU" style="height: 60px;">
#<img data-src="/media/HUZU.png" alt="HUZU" style="height: 60px;" class="lazyload">
#"""

#[[item]]
Expand All @@ -258,7 +258,7 @@ date_format = "Jan 2006"
# date_start = "2012-06-01"
# date_end = ""
# description = """
#<img src="/media/HUZU_.png" alt="HUZU" style="height: 60px;">
#<img data-src="/media/HUZU.png" alt="HUZU" style="height: 60px;" class="lazyload">
#"""

#[[item]]
Expand All @@ -270,7 +270,7 @@ date_format = "Jan 2006"
# date_start = "2012-06-01"
# date_end = ""
# description = """
#<img src="/media/HUZU_.png" alt="HUZU" style="height: 60px;">
#<img data-src="/media/HUZU.png" alt="HUZU" style="height: 60px;" class="lazyload">
#"""

#[[item]]
Expand All @@ -282,7 +282,7 @@ date_format = "Jan 2006"
# date_start = "2011-12-01"
# date_end = ""
# description = """
#<img src="/media/HUZU_.png" alt="HUZU" style="height: 60px;">
#<img data-src="/media/HUZU.png" alt="HUZU" style="height: 60px;" class="lazyload">
#"""

+++
10 changes: 5 additions & 5 deletions content/home/experience.md
Expand Up @@ -25,7 +25,7 @@ date_format = "Jan 2006"
date_start = "2017-08-01"
date_end = ""
description = """
<img src="/media/alibaba_.jpg" alt="alibaba" style="padding-bottom: 30px;">
<img data-src="/media/alibaba.jpg" alt="alibaba" style="padding-bottom: 30px;" class="lazyload">
- Lead a team of 5 engineers to build Taco ecosystem, including Taco (a distributed golang-based message streaming platform, serving more than 300 million users and 20 third party partners), taco-cli (a deployment tool), taco-console (a cost calculation and analytics service), and taco-SDK (a suite of templates for iOS/Android/H5 developers).
- Enrich the Taco ecosystem by implementing Taco v2, an Infura-like, API gateway on top of Golang backend services, using MySQL and Redis as the high-performance database, RabbitMQ and Kafka as the messaging queue, Hive, Blink and Elasticsearch as data statistics and message pipeline query, gRPC, Apache Thrift and HTTP as the communication protocol.
Expand All @@ -41,7 +41,7 @@ date_format = "Jan 2006"
date_start = "2017-02-01"
date_end = "2017-07-01"
description = """
<img src="/media/eleme_.jpg" alt="eleme" style="padding-bottom: 30px;">
<img data-src="/media/eleme.jpg" alt="eleme" style="padding-bottom: 30px;" class="lazyload">
Front-End Engineer
- Development and maintenance of the company's basic services, StormEye, a weather service that will affect the company’s daily revenue. Different weathers have different revenue for each takeaway order. Worked on various small full stack projects with high proficiency in Golang, JavaScript and Objective-C.
Expand All @@ -64,7 +64,7 @@ Senior iOS Engineer
date_start = "2016-05-01"
date_end = "2017-02-01"
description = """
<img src="/media/fangchuang_.jpg" alt="fangchuang" style="padding-bottom: 30px;">
<img data-src="/media/fangchuang.jpg" alt="fangchuang" style="padding-bottom: 30px;" class="lazyload">
- Led the engineer team to develop the second version of the iOS application, Func, a product that helps investors find and fund the most potential start-ups. Was mainly responsible for the technology architecture design, MVVM architecture reconstruction, Realm database replacement, instant messaging module migration and all UI rewriting,
- Worked closely with our clients in investment bank and legal industries to collect user feedbacks and provide new features. Also actively used Bugtags to track statistics on user behavior and optimize the user experience.
Expand All @@ -79,7 +79,7 @@ Senior iOS Engineer
date_start = "2015-11-01"
date_end = "2016-04-30"
description = """
<img src="/media/yqb_.jpg" alt="yqb" style="padding-bottom: 30px;">
<img data-src="/media/yqb.jpg" alt="yqb" style="padding-bottom: 30px;" class="lazyload">
- Was mainly responsible for the development of the 1QB Wallet hybird plug-in, using the Cordova framework to develop a payment plug-in for the 1QB Wallet app client, and burying points to count user behavior.
- Building the Code Review platform in the team. Developed H5 webpack package deployment and remote backup distribution platform, including Jenkins integrated static code scanning on a daily basis and the CI/CD pipeline.
Expand All @@ -95,7 +95,7 @@ Senior iOS Engineer
date_start = "2013-06-01"
date_end = "2015-11-01"
description = """
<img src="/media/quatanium_.jpg" alt="quatanium" style="padding-bottom: 30px;">
<img data-src="/media/quatanium.jpg" alt="quatanium" style="padding-bottom: 30px;" class="lazyload">
- Implemented and launched the very first iOS application, Qhome, a smart home client, which provided an easy-to-use home automation solutions for both businesses and consumers. Was in charge of the camera research and development (Foscam, Haikang, WRT access control plug-in), real-time viewing, intercom, playback, and interaction with the server.
- Improved the fluency by 30%, reduced the power consumption by 20% and network disconnect by 40% using Instrument (Core Animation, Time Profiler, Energy Diagnostics, Network) Optimization method. Also optimized the code structure and compress pictures and finally reduced the total size of the app installation package by 50%.
Expand Down
87 changes: 87 additions & 0 deletions layouts/partials/li_compact.html
@@ -0,0 +1,87 @@
{{ $item := . }}

{{/* Dynamic view adjusts to content type. */}}
{{ $show_authors_only := false }}{{/* Show authors only or full metadata? */}}
{{ $show_buttons := false }}
{{ $link := $item.RelPermalink }}
{{ $target := "" }}
{{ if $item.Params.external_link }}
{{ $link = $item.Params.external_link }}
{{ $target = "target=\"_blank\" rel=\"noopener\"" }}
{{ end }}
{{ if eq $item.Type "talk" }}
{{ $show_authors_only = true }}
{{ $show_buttons = true }}
{{ else if eq $item.Type "publication" }}
{{ $show_authors_only = true }}
{{ $show_buttons = true }}
{{ else if eq $item.Type "project" }}
{{ $show_authors_only = true }}
{{ $show_buttons = true }}
{{ end }}

{{/* Get summary. */}}
{{ $summary := "" }}
{{ if $item.Params.summary }}
{{ $summary = $item.Params.summary | markdownify | emojify }}
{{ else if .Params.abstract }}
{{ $summary = .Params.abstract | markdownify | emojify | truncate (site.Params.abstract_length | default 135) }}
{{ else if $item.Summary }}
{{ $summary = $item.Summary }}
{{ end }}

<div class="media stream-item">
<div class="media-body">

<h3 class="article-title mb-0 mt-0">
<a href="{{$link}}" {{ $target | safeHTMLAttr }}>{{ $item.Title }}</a>
</h3>

{{ with $summary }}
<a href="{{ $item.RelPermalink }}" class="summary-link">
<div class="article-style">
{{.}}
</div>
</a>
{{ end }}

<div class="stream-meta article-metadata">

{{ if eq $item.Type "talk" }}
<div>
<span>
{{ partial "functions/get_event_dates" $item }}
</span>
{{ with $item.Params.location }}
<span class="middot-divider"></span>
<span>{{ . }}</span>
{{ end }}
</div>
{{ end }}

{{ if and $show_authors_only $item.Params.authors }}
<div>
{{ partial "page_metadata_authors" $item }}
</div>
{{ else if not $show_authors_only }}
{{ partial "page_metadata" (dict "page" $item "is_list" 1) }}
{{ end }}
</div>

{{ if $show_buttons }}
<div class="btn-links">
{{ partial "page_links" (dict "page" $item "is_list" 1) }}
</div>
{{ end }}

</div>
<div class="ml-3">
{{ $resource := ($item.Resources.ByType "image").GetMatch "*featured*" }}
{{ with $resource }}
{{ $image := .Resize "150x" }}
<a href="{{$link}}" {{ $target | safeHTMLAttr }}>
<img data-src="{{ $image.RelPermalink }}" alt="{{ $item.Title }}" class="lazyload">
</a>
{{end}}
</div>
</div>
37 changes: 37 additions & 0 deletions layouts/partials/portfolio_li_card.html
@@ -0,0 +1,37 @@
{{ $item := .item }}
{{ $widget := .widget }}

{{ $link := .link }}
{{ $target := .target }}

{{/* Get summary. */}}
{{ $summary := "" }}
{{ if $item.Params.summary }}
{{ $summary = $item.Params.summary | markdownify | emojify }}
{{ else if .Params.abstract }}
{{ $summary = .Params.abstract | markdownify | emojify | truncate (site.Params.abstract_length | default 135) }}
{{ else if $item.Summary }}
{{ $summary = $item.Summary }}
{{ end }}

{{ $resource := ($item.Resources.ByType "image").GetMatch "*featured*" }}
{{ $js_tag_classes := delimit (apply (apply $item.Params.tags "replace" "." " " "-") "printf" "js-id-%s" ".") " " }}

<div class="project-card project-item isotope-item {{ $js_tag_classes | safeHTMLAttr }}">
<div class="card">
{{ with $resource }}
{{ $image := .Resize (printf "550x q90 %s") }}
<a href="{{ $link }}" {{ $target | safeHTMLAttr }} class="card-image hover-overlay">
<img data-src="{{ $image.RelPermalink }}" alt="" class="img-responsive lazyload">
</a>
{{ end }}
<div class="card-text">
<h4><a href="{{ $link }}" {{ $target | safeHTMLAttr }}>{{ $item.Title | markdownify | emojify }}</a></h4>
{{ with $summary }}
<div class="article-style">
<p>{{ . }}</p>
</div>
{{ end }}
</div>
</div>
</div>

0 comments on commit c0e4568

Please sign in to comment.