CSS
- 13 ответов
- 0 вопросов
4
Вклад в тег
focusin):// Resets CSS animation based on keyframes.
System.resetAnimation = function (elements)
{
elements.forEach(element =>
{
element.style.animation = 'none';
element.offsetHeight; // Trigger reflow.
element.style.animation = null;
});
}const map = $('.map');
map
.css('--current-position-y', getComputedStyle(map[0]).backgroundPositionY)
.css('--direction', position.y > 0 ? '-1' : '1') // Map is scrolled in opposite direction.
.css('--speed', Math.abs(position.y).toString());
System.resetAnimation([map[0]]);@keyframes move-map-bg_map
{
from
{
background-position-y: var(--current-position-y);
}
to
{
background-position-y: calc(var(--current-position-y) + var(--direction) * var(--city-map-size));
}
}<a href="сайт">текст</a>, заменить их на текст. Если трудно, можно открыть в визуальном редакторе HTML, но я бы не стал.import blah from 'blah-blah';. Вот так и подключаете.Motivation
Instead of implementing XMLHttpRequest in Node.js to run browser-specific Fetch polyfill, why not go from native http to fetch API directly? Hence, node-fetch, minimal code for a window.fetch compatible API on Node.js runtime.
window.fetch для сервера под нодой. Если это так, то и вызывайте родной браузерный, а не эмуляцию, которая в браузере не нужна. Или я что-то неправильно понимаю? from Npp import notepad, NOTIFICATION
import os
import subprocess
import datetime
import threading
expected_folder = r"C:\path\to\folder"
def git_auto_commit(path):
def task():
work_dir = os.path.dirname(path)
timestamp = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
msg = "Auto-commit on save: {0} at {1}".format(path, timestamp)
# Flag to hide the console window
CREATE_NO_WINDOW = 0x08000000
# git add
p1 = subprocess.Popen(
["git", "add", path],
cwd=work_dir,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
creationflags=CREATE_NO_WINDOW
)
p1.communicate()
# git commit
p2 = subprocess.Popen(
["git", "commit", "-m", msg],
cwd=work_dir,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
creationflags=CREATE_NO_WINDOW
)
p2.communicate()
threading.Thread(target=task).start()
def is_subfolder_case_insensitive(path, folder):
return path.lower().startswith(folder.lower())
def on_save(args):
filename = notepad.getBufferFilename(args["bufferID"])
if not is_subfolder_case_insensitive(filename, expected_folder):
return
git_auto_commit(filename)
notepad.callback(on_save, [NOTIFICATION.FILESAVED])