mirror of
https://github.com/cupcakearmy/liquet.git
synced 2025-09-06 07:50:41 +00:00
Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
6ff2e56501 | |||
|
331d47c9e9 | ||
|
8a7393b593 | ||
|
64dad4c4b0 | ||
|
e0277ff7e1 | ||
|
b425bce2a7 |
@@ -31,5 +31,5 @@ steps:
|
||||
- docker-compose -f docker-compose.prod.yml down
|
||||
- docker-compose -f docker-compose.prod.yml up -d
|
||||
when:
|
||||
event: push
|
||||
event: tag
|
||||
branch: master
|
3
.gitignore
vendored
3
.gitignore
vendored
@@ -6,9 +6,8 @@ data/
|
||||
|
||||
# Node
|
||||
node_modules/
|
||||
pnpm-lock.yaml
|
||||
yarn.lock
|
||||
|
||||
# Generated
|
||||
.cache/
|
||||
liquet/dist/
|
||||
liquet.zip
|
@@ -8,7 +8,7 @@ add_theme_support( 'post-thumbnails' );
|
||||
|
||||
|
||||
add_filter( 'wp_headers', function ( $headers ) {
|
||||
$headers['Content-Security-Policy'] = "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https://s.w.org; report-uri csp@nicco.io";
|
||||
$headers['Content-Security-Policy'] = "default-src 'self' wp.com; script-src 'self' 'unsafe-inline' wp.com; style-src 'self' 'unsafe-inline' wp.com; img-src 'self' wp.com data: https://s.w.org;";
|
||||
$headers['X-Content-Type-Options'] = 'nosniff';
|
||||
$headers['X-Frame-Options'] = "deny";
|
||||
$headers['Strict-Transport-Security'] = "max-age=31536000";
|
||||
|
@@ -2,7 +2,7 @@
|
||||
Theme Name: Liquet
|
||||
Author: Niccolo Borgioli
|
||||
Description: Minimalistic clean theme
|
||||
Version: 0.14
|
||||
Version: 0.17
|
||||
License: MIT
|
||||
Tags: minimal, simple, typography, clean
|
||||
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",
|
||||
"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": {
|
||||
"@swup/preload-plugin": "1.0.x",
|
||||
"jquery": "^3.4.1",
|
||||
|
@@ -3,9 +3,9 @@ import lazy from './lazy'
|
||||
import swup from './swup'
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
lights()
|
||||
lights()
|
||||
lazy()
|
||||
swup(() => {
|
||||
lazy()
|
||||
swup(() => {
|
||||
lazy()
|
||||
})
|
||||
})
|
||||
})
|
@@ -1,42 +1,39 @@
|
||||
import $ from 'jquery'
|
||||
|
||||
export default () => {
|
||||
const bottomOffset = 300
|
||||
const app = document.getElementById('app')
|
||||
let loading = false
|
||||
let page = WPParams.lazy.current_page
|
||||
const bottomOffset = 300
|
||||
const app = document.getElementById('app')
|
||||
let loading = false
|
||||
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) {
|
||||
loading = true
|
||||
|
||||
$.ajax({
|
||||
url: WPParams.lazy.ajaxurl,
|
||||
data: {
|
||||
name: window.location.pathname
|
||||
.replace(/(\/\d+){3}\//, '')
|
||||
.replace(/\/$/, ''),
|
||||
action: 'lazy_load',
|
||||
page,
|
||||
},
|
||||
type: 'POST',
|
||||
success: (data) => {
|
||||
if (data) {
|
||||
$('#list').find('hr:last-of-type').after(data) // where to insert posts
|
||||
page++
|
||||
loading = false
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
$.ajax({
|
||||
url: WPParams.lazy.ajaxurl,
|
||||
data: {
|
||||
name: window.location.pathname.replace(/(\/\d+){3}\//, '').replace(/\/$/, ''),
|
||||
action: 'lazy_load',
|
||||
page,
|
||||
},
|
||||
type: 'POST',
|
||||
success: (data) => {
|
||||
if (data) {
|
||||
$('#list').find('hr:last-of-type').after(data) // where to insert posts
|
||||
page++
|
||||
loading = false
|
||||
}
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// Bind to the scroll event
|
||||
$('#app').scroll(load)
|
||||
// Bind to the scroll event
|
||||
$('#app').scroll(load)
|
||||
|
||||
// Check initial page if they need loading
|
||||
load.bind(app)()
|
||||
// Check initial page if they need loading
|
||||
load.bind(app)()
|
||||
}
|
@@ -1,30 +1,30 @@
|
||||
export default () => {
|
||||
// Lights
|
||||
const key = 'nicco.io:blog:lights'
|
||||
const CSS = 'body, .wp-block-image img, .thumbnail img {filter: invert(1);} '
|
||||
const style = window.document.createElement('style')
|
||||
document.head.appendChild(style)
|
||||
// Lights
|
||||
const key = 'nicco.io:blog:lights'
|
||||
const CSS = 'body, .wp-block-image img, .thumbnail img {filter: invert(1);} '
|
||||
const style = window.document.createElement('style')
|
||||
document.head.appendChild(style)
|
||||
|
||||
const on = () => {
|
||||
style.sheet.deleteRule(parseInt(window.localStorage.getItem(key)))
|
||||
window.localStorage.removeItem(key)
|
||||
}
|
||||
const on = () => {
|
||||
style.sheet.deleteRule(parseInt(window.localStorage.getItem(key)))
|
||||
window.localStorage.removeItem(key)
|
||||
}
|
||||
|
||||
const off = () => {
|
||||
const i = style.sheet.insertRule(CSS)
|
||||
window.localStorage.setItem(key, i)
|
||||
}
|
||||
const off = () => {
|
||||
const i = style.sheet.insertRule(CSS)
|
||||
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
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const toFocus = document.querySelector('[data-focusme]')
|
||||
toFocus.tabIndex = '1'
|
||||
toFocus.focus({preventScroll: true})
|
||||
})
|
||||
// Focus scrolling
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const toFocus = document.querySelector('[data-focusme]')
|
||||
toFocus.tabIndex = '1'
|
||||
toFocus.focus({ preventScroll: true })
|
||||
})
|
||||
}
|
@@ -2,11 +2,11 @@ import Swup from 'swup'
|
||||
import SwupPreloadPlugin from '@swup/preload-plugin'
|
||||
|
||||
export default (fn) => {
|
||||
const swup = new Swup({
|
||||
linkSelector: `a[href^="${window.location.origin}"]:not([data-no-swup]), a[href^="/"]:not([data-no-swup])`,
|
||||
plugins: [new SwupPreloadPlugin()],
|
||||
containers: ['#app']
|
||||
})
|
||||
const swup = new Swup({
|
||||
linkSelector: `a[href^="${window.location.origin}"]:not([data-no-swup]), a[href^="/"]:not([data-no-swup])`,
|
||||
plugins: [new SwupPreloadPlugin()],
|
||||
containers: ['#app'],
|
||||
})
|
||||
|
||||
swup.on('contentReplaced', fn)
|
||||
swup.on('contentReplaced', fn)
|
||||
}
|
||||
|
@@ -86,6 +86,10 @@
|
||||
display: inline-block
|
||||
font-size: 105%
|
||||
|
||||
figure
|
||||
img
|
||||
height: 100%
|
||||
|
||||
.links
|
||||
& > div
|
||||
transform rotate(180deg) scale(1)
|
||||
|
Reference in New Issue
Block a user