add play button for gallery

This commit is contained in:
rzen 2020-09-07 10:00:23 -04:00
parent 9a79558814
commit 2cc6343944
7 changed files with 64 additions and 28 deletions

View File

@ -6,7 +6,7 @@ gemspec
group :jekyll_plugins do group :jekyll_plugins do
gem 'jekyll-tidy' gem 'jekyll-tidy'
gem 'jekyll-tagging' # gem 'jekyll-tagging'
gem 'jekyll-mentions' gem 'jekyll-mentions'
gem 'jekyll-sitemap' gem 'jekyll-sitemap'
gem 'jekyll-feed' gem 'jekyll-feed'

View File

@ -101,7 +101,7 @@ defaults:
plugins: plugins:
- rouge - rouge
- jekyll-tidy - jekyll-tidy
- jekyll/tagging # - jekyll-tagging
- jekyll-mentions - jekyll-mentions
- jekyll-sitemap - jekyll-sitemap
- jekyll-feed - jekyll-feed

View File

@ -15,10 +15,15 @@
{% if image_extensions contains image_ext %} {% if image_extensions contains image_ext %}
{% if image_path contains gallery_prefix %} {% if image_path contains gallery_prefix %}
{% assign image_index = image_index | plus: 1 %} {% assign image_index = image_index | plus: 1 %}
<img id="{{ gallery_name}}-{{ image_index }}" src="{{ site.baseurl }}{{ image_path }}" /> <img id="{{ gallery_name }}-{{ image_index }}" src="{{ site.baseurl }}{{ image_path }}" />
{% endif %} {% endif %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</div> </div>
<nav></nav> <nav>
<div class="play">
<input type="checkbox" value="" id="{{ gallery_name }}-play" />
<label for="{{ gallery_name }}-play"></label>
</div>
</nav>
</div> </div>

View File

@ -252,7 +252,7 @@ main {
cursor: pointer; cursor: pointer;
border-radius: 6px; border-radius: 6px;
display: none; display: none;
transition: all .3s ease; transition: all 300ms ease;
} }
img:first-child { img:first-child {
@ -271,13 +271,44 @@ main {
width: 1rem; width: 1rem;
height: 1rem; height: 1rem;
border-radius: .5rem; border-radius: .5rem;
transition: all .3s ease; transition: all 300ms ease;
background-color: hsl($hue,10,80); background-color: hsl($hue,10,80);
&.selected { &.selected {
background-color: hsl($hue,50,40); background-color: hsl($hue,50,40);
} }
} }
.play {
label {
margin: .5rem;
display: inline-block;
box-sizing: border-box;
width: 0;
height: .5rem;
cursor: pointer;
border-color: transparent transparent transparent #202020;
transition: 300ms all ease;
will-change: border-width;
// paused state
border-style: double;
border-width: 0 0 0 .5rem;
} }
input[type='checkbox'] {
visibility: hidden;
&:checked + label {
border-style: solid;
border-width: .3rem 0 .3rem .5rem;
}
}
}
}
} }
div.gallery + p { div.gallery + p {

View File

@ -38,9 +38,10 @@
navHtml += '<i class="' + (i===0? 'selected' : '') + '" data-target="' + image.id + '"></i>' navHtml += '<i class="' + (i===0? 'selected' : '') + '" data-target="' + image.id + '"></i>'
} }
gallery_nav.innerHTML = navHtml; gallery_nav.innerHTML += navHtml;
navs = gallery_nav.querySelectorAll('i'); navs = gallery_nav.querySelectorAll('i');
for (var i=0; i<navs.length; ++i) { for (var i=0; i<navs.length; ++i) {
var nav = navs[i]; var nav = navs[i];
nav.addEventListener('click', nav_to_image) nav.addEventListener('click', nav_to_image)

View File

@ -5,61 +5,60 @@ services:
serve: serve:
container_name: isabelline-serve container_name: isabelline-serve
image: docker.rzen.dev/jekyll-serve image: jekyll/jekyll:4
# command: jekyll serve --host 0.0.0.0 --future --draft --force_polling --livereload command: jekyll serve --host 0.0.0.0 --future --draft --force_polling --livereload
environment: environment:
JEKYLL_ENV: local JEKYLL_ENV: local
ports: ports:
- 4000:4000 - 4000:4000
- 35729:35729 - 35729:35729
volumes: volumes:
- .:/site - .:/srv/jekyll
- .bundle:/usr/local/bundle - .bundle:/usr/local/bundle
# build and push to rubygems.org # build and push to rubygems.org
gem-push: gem-push:
container_name: jekyll-gem-push container_name: jekyll-gem-push
image: docker.rzen.dev/jekyll image: jekyll/jekyll:4
command: | command: >
bash -c "gem build -v jekyll-theme-isabelline.gemspec bash -c "gem build -v jekyll-theme-isabelline.gemspec \
&& GEM_VER=`ruby -e ' && GEM_VER=`ruby -e '\
require \"rubygems\"; require \"rubygems\"; \
spec = Gem::Specification::load(\"jekyll-theme-isabelline.gemspec\"); spec = Gem::Specification::load(\"jekyll-theme-isabelline.gemspec\"); \
puts \"#{spec.version}\"'` puts \"#{spec.version}\"'` \
&& gem push jekyll-theme-isabelline-$${GEM_VER}.gem && gem push jekyll-theme-isabelline-$${GEM_VER}.gem
" "
volumes: volumes:
- .:/site - .:/srv/jekyll
- .bundle:/usr/local/bundle - .bundle:/usr/local/bundle
- ./.gem:/root/.gem - .gem:/root/.gem
# helpers # helpers
jekyll: jekyll:
container_name: jekyll container_name: jekyll
image: docker.rzen.dev/jekyll image: jekyll/jekyll:4
entrypoint: jekyll entrypoint: jekyll
environment: environment:
JEKYLL_ENV: local JEKYLL_ENV: local
volumes: volumes:
- .:/srv/jekyll
- .bundle:/usr/local/bundle - .bundle:/usr/local/bundle
- .:/site
gem: gem:
container_name: jekyll-gem container_name: jekyll-gem
image: docker.rzen.dev/jekyll image: jekyll/jekyll:4
entrypoint: gem entrypoint: gem
volumes: volumes:
- .:/srv/jekyll
- .bundle:/usr/local/bundle - .bundle:/usr/local/bundle
- .:/site
- ./.gem:/root/.gem
bundle: bundle:
container_name: bundle container_name: bundle
image: jekyll/jekyll:4 image: jekyll/jekyll:4.0
entrypoint: bundle entrypoint: bundle
volumes: volumes:
- .:/srv/jekyll
- .bundle:/usr/local/bundle - .bundle:/usr/local/bundle
- .:/site - .gem:/root/.gem
- ./.gem:/root/.gem