Просмотр исходного кода

Removed image expand buttons because they were dumb

Steffen Cole Blake 4 лет назад
Родитель
Сommit
e78eaff0f3
3 измененных файлов с 2 добавлено и 114 удалено
  1. 0 37
      layouts/partials/header.html
  2. 2 55
      static/css/custom.css
  3. 0 22
      static/js/custom.js

+ 0 - 37
layouts/partials/header.html

@@ -1,37 +0,0 @@
-<!-- Navbar
-================================================== -->
-<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
-    <a class="navbar-brand" href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>
-    <button type="button" class="navbar-toggler" data-toggle="collapse" data-target="#main-nav" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
-        <span class="navbar-toggler-icon"></span>
-    </button>
-    <div id="main-nav" class="collapse nav-collapse">
-        <ul class="navbar-nav">
-            {{ $currentPage := . }} {{ range .Site.Menus.main }} {{ if .HasChildren }}
-            <li class="nav-item dropdown">
-                <a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" id="themes" style="" aria-expanded="false">Themes <span class="caret"></span></a>
-                <div class="dropdown-menu">
-                    {{ range .Children }}
-                    <a class="dropdown-item {{ if $currentPage.IsMenuCurrent " main " . }}active{{ end }}" href="{{ .URL }}">{{ .Name }}</a> {{ end }}
-                </div>
-            </li>
-            {{ else }}
-            <li class="nav-item {{ if $currentPage.HasMenuCurrent " main " . }}active{{ end }}">
-                <a class="nav-link" href="{{ .URL }}">
-                                    {{ .Pre }}
-                                    <span>{{ .Name }}</span>
-                                </a>
-            </li>
-            {{ end }} {{ end }}
-        </ul>
-    </div>
-    </div>
-    </div>
-</nav>
-
-<div class="expand-img">
-    <div id="expand-img" class="expand-img-wrapper" style="display: none;">
-        <img src="http://localhost:1313/images/RPI-GPIO.png"/>
-        <button class="btn btn-primary btn-lg">X</button>
-    </div>
-</div>

+ 2 - 55
static/css/custom.css

@@ -6,18 +6,9 @@ html, body.crt {
   max-width: 100vw;
 }
 
-p {
-  position: relative;
-}
-
-p.img-container {
-  border: honeydew;
-  border-style: solid;
-}
-
 p > img {
-  max-width: 90%;
-  max-height: 90%;
+  max-width: 95%;
+  max-height: 95%;
   display: block;
   position: relative;
   margin-left: auto;
@@ -25,50 +16,6 @@ p > img {
   padding: 1%;
 }
 
-p > img+button, p > img+.btn-primary.btn-lg:not(:disabled):not(.disabled):active {
-  position: absolute;
-  right: 0;
-  bottom: 0;
-  top: auto;
-  left: auto;
-}
-
-.expand-img {
-  width: 100vw;
-  height: 100vh;
-  position: fixed;
-  top: 0;
-  left: 0;
-  z-index: 1;
-  pointer-events: none;
-}
-
-.expand-img > .expand-img-wrapper {
-  width: auto;
-  height: auto;
-  position: absolute;
-  top:50%;
-  left:50%;
-  transform: translate(-50%, -50%);
-}
-
-.expand-img > .expand-img-wrapper > img {
-  max-width: 90vw;
-  max-height: 90vh;
-  width: auto;
-  height: auto;
-}
-
-.expand-img > .expand-img-wrapper > button, 
-.expand-img > .expand-img-wrapper > .btn-primary.btn-lg:not(:disabled):not(.disabled):active {
-  position: absolute;
-  bottom: 0;
-  right: 0;
-  top: auto;
-  left: auto;
-  pointer-events: all;
-}
-
 p > a {
   overflow-wrap: break-word;
 }

+ 0 - 22
static/js/custom.js

@@ -1,27 +1,5 @@
 function onReady() {
-    var imgs = $(`p>img`)
-    imgs
-    .after(appendExpandButton)
-    .next()
-    .on('click', onExpandButton);
 
-    imgs.parent().addClass(`img-container`);
-
-    $(`#expand-img button`).on(`click`, onHideImgExpand);
-}
-
-function appendExpandButton(img) {
-    return `<button class='btn btn-primary btn-lg' data-img="${this.src}">+</button>`
-}
-
-function onExpandButton(e) {
-    var imgSrc = this.getAttribute(`data-img`);
-    $(`#expand-img img`).attr(`src`, imgSrc);
-    $(`#expand-img`).show(0);
-}
-
-function onHideImgExpand() {
-    $(`#expand-img`).hide(500);
 }
 
 (function() {