mirror of
https://github.com/cupcakearmy/liquet.git
synced 2025-09-05 23:40:40 +00:00
Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
38ff8cdc2c | |||
6ff2e56501 | |||
|
331d47c9e9 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -10,3 +10,4 @@ node_modules/
|
|||||||
# Generated
|
# Generated
|
||||||
.cache/
|
.cache/
|
||||||
liquet/dist/
|
liquet/dist/
|
||||||
|
liquet.zip
|
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
A minimalistic and clean wordpress theme. Guteberg support out of the box.
|
A minimalistic and clean wordpress theme. Guteberg support out of the box.
|
||||||
|
|
||||||
|
> 🚨 Discontinued
|
||||||
|
|
||||||
## Required Plugins
|
## Required Plugins
|
||||||
|
|
||||||
- [Code Prettify](https://wordpress.org/plugins/code-prettify/)
|
- [Code Prettify](https://wordpress.org/plugins/code-prettify/)
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
Theme Name: Liquet
|
Theme Name: Liquet
|
||||||
Author: Niccolo Borgioli
|
Author: Niccolo Borgioli
|
||||||
Description: Minimalistic clean theme
|
Description: Minimalistic clean theme
|
||||||
Version: 0.15
|
Version: 0.17
|
||||||
License: MIT
|
License: MIT
|
||||||
Tags: minimal, simple, typography, clean
|
Tags: minimal, simple, typography, clean
|
||||||
Author URI: https://nicco.io
|
Author URI: https://nicco.io
|
||||||
|
@@ -4,6 +4,11 @@
|
|||||||
"dev": "parcel watch --no-hmr --no-source-maps -d liquet/dist ./src/js/index.js ./src/styles/index.styl",
|
"dev": "parcel watch --no-hmr --no-source-maps -d liquet/dist ./src/js/index.js ./src/styles/index.styl",
|
||||||
"build": "rm -rf ./liquet/dist && parcel build --no-source-maps -d liquet/dist ./src/js/index.js ./src/styles/index.styl"
|
"build": "rm -rf ./liquet/dist && parcel build --no-source-maps -d liquet/dist ./src/js/index.js ./src/styles/index.styl"
|
||||||
},
|
},
|
||||||
|
"browserslist": [
|
||||||
|
"last 2 chrome versions",
|
||||||
|
"last 2 safari versions",
|
||||||
|
"last 2 firefox versions"
|
||||||
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@swup/preload-plugin": "1.0.x",
|
"@swup/preload-plugin": "1.0.x",
|
||||||
"jquery": "^3.4.1",
|
"jquery": "^3.4.1",
|
||||||
|
@@ -3,9 +3,9 @@ import lazy from './lazy'
|
|||||||
import swup from './swup'
|
import swup from './swup'
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
lights()
|
lights()
|
||||||
|
lazy()
|
||||||
|
swup(() => {
|
||||||
lazy()
|
lazy()
|
||||||
swup(() => {
|
})
|
||||||
lazy()
|
|
||||||
})
|
|
||||||
})
|
})
|
@@ -1,42 +1,39 @@
|
|||||||
import $ from 'jquery'
|
import $ from 'jquery'
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
const bottomOffset = 300
|
const bottomOffset = 300
|
||||||
const app = document.getElementById('app')
|
const app = document.getElementById('app')
|
||||||
let loading = false
|
let loading = false
|
||||||
let page = WPParams.lazy.current_page
|
let page = WPParams.lazy.current_page
|
||||||
|
|
||||||
function load() {
|
function load() {
|
||||||
|
const pixelToBottom = this.scrollHeight - (this.scrollTop + this.clientHeight)
|
||||||
|
|
||||||
const pixelToBottom = this.scrollHeight - (this.scrollTop + this.clientHeight)
|
if (!loading && pixelToBottom < bottomOffset) {
|
||||||
|
loading = true
|
||||||
|
|
||||||
if (!loading && pixelToBottom < bottomOffset) {
|
$.ajax({
|
||||||
loading = true
|
url: WPParams.lazy.ajaxurl,
|
||||||
|
data: {
|
||||||
$.ajax({
|
name: window.location.pathname.replace(/(\/\d+){3}\//, '').replace(/\/$/, ''),
|
||||||
url: WPParams.lazy.ajaxurl,
|
action: 'lazy_load',
|
||||||
data: {
|
page,
|
||||||
name: window.location.pathname
|
},
|
||||||
.replace(/(\/\d+){3}\//, '')
|
type: 'POST',
|
||||||
.replace(/\/$/, ''),
|
success: (data) => {
|
||||||
action: 'lazy_load',
|
if (data) {
|
||||||
page,
|
$('#list').find('hr:last-of-type').after(data) // where to insert posts
|
||||||
},
|
page++
|
||||||
type: 'POST',
|
loading = false
|
||||||
success: (data) => {
|
}
|
||||||
if (data) {
|
},
|
||||||
$('#list').find('hr:last-of-type').after(data) // where to insert posts
|
})
|
||||||
page++
|
|
||||||
loading = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Bind to the scroll event
|
// Bind to the scroll event
|
||||||
$('#app').scroll(load)
|
$('#app').scroll(load)
|
||||||
|
|
||||||
// Check initial page if they need loading
|
// Check initial page if they need loading
|
||||||
load.bind(app)()
|
load.bind(app)()
|
||||||
}
|
}
|
@@ -1,30 +1,30 @@
|
|||||||
export default () => {
|
export default () => {
|
||||||
// Lights
|
// Lights
|
||||||
const key = 'nicco.io:blog:lights'
|
const key = 'nicco.io:blog:lights'
|
||||||
const CSS = 'body, .wp-block-image img, .thumbnail img {filter: invert(1);} '
|
const CSS = 'body, .wp-block-image img, .thumbnail img {filter: invert(1);} '
|
||||||
const style = window.document.createElement('style')
|
const style = window.document.createElement('style')
|
||||||
document.head.appendChild(style)
|
document.head.appendChild(style)
|
||||||
|
|
||||||
const on = () => {
|
const on = () => {
|
||||||
style.sheet.deleteRule(parseInt(window.localStorage.getItem(key)))
|
style.sheet.deleteRule(parseInt(window.localStorage.getItem(key)))
|
||||||
window.localStorage.removeItem(key)
|
window.localStorage.removeItem(key)
|
||||||
}
|
}
|
||||||
|
|
||||||
const off = () => {
|
const off = () => {
|
||||||
const i = style.sheet.insertRule(CSS)
|
const i = style.sheet.insertRule(CSS)
|
||||||
window.localStorage.setItem(key, i)
|
window.localStorage.setItem(key, i)
|
||||||
}
|
}
|
||||||
|
|
||||||
const isDark = () => window.localStorage.getItem(key) !== null
|
const isDark = () => window.localStorage.getItem(key) !== null
|
||||||
|
|
||||||
if (isDark()) off()
|
if (isDark()) off()
|
||||||
|
|
||||||
window.toggleLights = () => isDark() ? on() : off()
|
window.toggleLights = () => (isDark() ? on() : off())
|
||||||
|
|
||||||
// Focus scrolling
|
// Focus scrolling
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
const toFocus = document.querySelector('[data-focusme]')
|
const toFocus = document.querySelector('[data-focusme]')
|
||||||
toFocus.tabIndex = '1'
|
toFocus.tabIndex = '1'
|
||||||
toFocus.focus({preventScroll: true})
|
toFocus.focus({ preventScroll: true })
|
||||||
})
|
})
|
||||||
}
|
}
|
@@ -2,11 +2,11 @@ import Swup from 'swup'
|
|||||||
import SwupPreloadPlugin from '@swup/preload-plugin'
|
import SwupPreloadPlugin from '@swup/preload-plugin'
|
||||||
|
|
||||||
export default (fn) => {
|
export default (fn) => {
|
||||||
const swup = new Swup({
|
const swup = new Swup({
|
||||||
linkSelector: `a[href^="${window.location.origin}"]:not([data-no-swup]), a[href^="/"]:not([data-no-swup])`,
|
linkSelector: `a[href^="${window.location.origin}"]:not([data-no-swup]), a[href^="/"]:not([data-no-swup])`,
|
||||||
plugins: [new SwupPreloadPlugin()],
|
plugins: [new SwupPreloadPlugin()],
|
||||||
containers: ['#app']
|
containers: ['#app'],
|
||||||
})
|
})
|
||||||
|
|
||||||
swup.on('contentReplaced', fn)
|
swup.on('contentReplaced', fn)
|
||||||
}
|
}
|
||||||
|
@@ -86,6 +86,10 @@
|
|||||||
display: inline-block
|
display: inline-block
|
||||||
font-size: 105%
|
font-size: 105%
|
||||||
|
|
||||||
|
figure
|
||||||
|
img
|
||||||
|
height: 100%
|
||||||
|
|
||||||
.links
|
.links
|
||||||
& > div
|
& > div
|
||||||
transform rotate(180deg) scale(1)
|
transform rotate(180deg) scale(1)
|
||||||
|
Reference in New Issue
Block a user