avant corrections

This commit is contained in:
Valentin
2023-11-02 08:04:25 +01:00
parent 52fdf5bdf4
commit 4999a4a944
12 changed files with 1328 additions and 137 deletions
+153
View File
@@ -100,7 +100,160 @@ collect(['setup', 'filters'])
}
add_action('admin_footer', 'cacher_bloc_foot_admin');
function custom_filter_dropdown() {
global $typenow;
if ($typenow == 'post') { // Adjust post type if needed
$selected = isset($_GET['custom_field_filter']) ? $_GET['custom_field_filter'] : '';
$options = array(
'isMainPart' => __('isMainPart', 'textdomain'),
'isSubPart' => __('isSubPart', 'textdomain'),
);
echo '<select name="custom_field_filter">';
echo '<option value="">' . __('All Custom Fields', 'textdomain') . '</option>';
foreach ($options as $key => $label) {
echo '<option value="' . $key . '"' . selected($selected, $key, false) . '>' . $label . '</option>';
}
echo '</select>';
}
}
add_action('restrict_manage_posts', 'custom_filter_dropdown');
function filter_by_custom_field($query) {
global $pagenow;
if (is_admin() && $pagenow == 'edit.php' && isset($_GET['custom_field_filter'])) {
$custom_field_key = sanitize_text_field($_GET['custom_field_filter']);
if (!empty($custom_field_key)) {
$meta_query = array(
array(
'key' => $custom_field_key,
'compare' => 'EXISTS',
),
);
$query->query_vars['meta_query'] = $meta_query;
}
}
}
add_filter('parse_query', 'filter_by_custom_field');
add_action('wp', 'generate_csv');
function generate_csv() {
if ('csv' === (isset($_GET['format']) ? $_GET['format'] : null)) {
// Query to get all posts
$args = array(
'post_type' => 'post',
'posts_per_page' => -1,
'meta_key' => 'index',
'meta_type' => 'NUMERIC',
'orderby' => 'meta_value',
'order' => 'ASC'
);
$posts = get_posts($args);
if (!empty($posts)) {
// Initialize CSV data array
$csvData = array();
// Add CSV header row
$csvData[] = array('Temps', 'Images', 'Voix Off et In', 'Bande Son', 'Écrits', 'Section');
// Loop through posts and add them to the CSV data array
foreach ($posts as $post) {
$post_content = wp_strip_all_tags($post->post_content);
$content_array = explode("---", $post_content);
$temps = $post->post_title;
$images = isset($content_array[1]) ? $content_array[1] : '';
$images = substr($images, 0, -15);
$voixOffIn = isset($content_array[2]) ? $content_array[2] : '';
$voixOffIn = substr($voixOffIn, 0, -10);
$bandeson = isset($content_array[3]) ? $content_array[3] : '';
$bandeson = substr($bandeson, 0, -8);
$ecrits = isset($content_array[4]) ? $content_array[4] : '';
if (get_post_meta($post->ID, 'isMainPart', true)) {
$section = get_post_meta($post->ID, 'isMainPart', true);
} elseif (get_post_meta($post->ID, 'isSubPart', true)) {
$section = get_post_meta($post->ID, 'isSubPart', true);
} else {
$section = '';
}
$csvData[] = array(
$temps,
$images,
$voixOffIn,
$bandeson,
$ecrits,
$section,
);
}
$csvFileName = 'partition_livre_d_image.csv';
header('Content-Encoding: UTF-8');
header('Content-Type: text/csv; charset=utf-8');
header('Content-Disposition: attachment; filename=' . $csvFileName);
echo "\xEF\xBB\xBF"; // UTF-8 BOM
// Output CSV data
$output = fopen('php://output', 'w');
foreach ($csvData as $row) {
fputcsv($output, $row);
}
fclose($output);
exit;
}
}
}
function custom_admin_styles() {
wp_enqueue_style('custom-admin', get_template_directory_uri() . '/resources/styles/admin_custom.css');
}
add_action('admin_enqueue_scripts', 'custom_admin_styles');
function restrict_revisions_by_author($query) {
global $current_user;
// Check if the user is logged in
if (is_user_logged_in()) {
get_currentuserinfo();
$author_id = $current_user->ID;
// Modify the query to filter revisions by author
if (isset($query->query_vars['post_type']) && $query->query_vars['post_type'] == 'revision') {
$query->set('author', $author_id);
}
}
}
add_action('pre_get_posts', 'restrict_revisions_by_author');
function customize_editor_for_editor_role() {
if (current_user_can('revisor')) {
wp_enqueue_script('custom-editor-script', get_template_directory_uri() . '/resources/scripts/custom-editor-script.js', array(), null, true);
wp_enqueue_style('custom-editor-style', get_template_directory_uri() . '/resources/styles/custom-editor-style.css');
// Get the content of the specific page (replace '123' with the actual page ID)
$page_id = 13940;
$page_content = get_post_field('post_content', $page_id);
// Localize the page content to be accessible in your custom script
wp_localize_script('custom-editor-script', 'pageContentData', array('content' => $page_content));
}
}
add_action('admin_enqueue_scripts', 'customize_editor_for_editor_role');
// function supprimer_tous_les_articles() {
+58
View File
@@ -4,6 +4,64 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php wp_head(); ?>
<style>
span[class^="dot-"]{
opacity: 0;
}
.dot-one{
animation: dot-one 2s infinite linear
}
.dot-two{
animation: dot-two 2s infinite linear
}
.dot-three{
animation: dot-three 2s infinite linear
}
@keyframes dot-one{
0%{
opacity: 0;
}
15%{
opacity: 0;
}
25%{
opacity: 1;
}
100%{
opacity: 1;
}
}
@keyframes dot-two{
0%{
opacity: 0;
}
25%{
opacity: 0;
}
50%{
opacity: 1;
}
100%{
opacity: 1;
}
}
@keyframes dot-three{
0%{
opacity: 0;
}
50%{
opacity: 0;
}
75%{
opacity: 1;
}
100%{
opacity: 1;
}
}
</style>
</head>
<body <?php body_class(); ?> style="background-color: #010d19;">
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
height="24"
viewBox="0 -960 960 960"
width="24"
version="1.1"
id="svg1"
sodipodi:docname="arrow_drop_down.svg"
inkscape:version="1.3 (0e150ed6c4, 2023-07-21)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs1" />
<sodipodi:namedview
id="namedview1"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:zoom="38.541667"
inkscape:cx="12"
inkscape:cy="12"
inkscape:window-width="2160"
inkscape:window-height="1440"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg1" />
<path
d="M480-360 280-560h400L480-360Z"
id="path1"
style="fill:#ffffff" />
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

+38
View File
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
height="24"
viewBox="0 -960 960 960"
width="24"
version="1.1"
id="svg1"
sodipodi:docname="arrow_drop_up.svg"
inkscape:version="1.3 (0e150ed6c4, 2023-07-21)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs1" />
<sodipodi:namedview
id="namedview1"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:zoom="38.541667"
inkscape:cx="9.1718919"
inkscape:cy="11.532973"
inkscape:window-width="2160"
inkscape:window-height="1440"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg1" />
<path
d="m280-400 200-200 200 200H280Z"
id="path1"
style="fill:#ffffff" />
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

+501 -112
View File
@@ -4,8 +4,18 @@ import domReady from '@roots/sage/client/dom-ready';
* Application entrypoint
*/
domReady(async () => {
// pour régler tous les pb au refresh quand la page est déjà scrollée
window.scrollTo(0, 0);
window.addEventListener('load', function() {
setTimeout(function() {
window.scrollTo(0, 0);
}, 0);
});
window.addEventListener('resize', function() {
setTimeout(function() {
window.scrollTo(0, 0);
}, 0);
});
// CLEANER LE TABLEAU
let minHeadTh = document.querySelector("#main table thead tr th:first-of-type");
@@ -27,6 +37,12 @@ domReady(async () => {
for (let otherTableTd of otherTableTds) {
otherTableTd.style.width = `${100 / 8 * 1.75}%`;
}
let editButtons = document.querySelectorAll(".edit-button");
for (let editButton of editButtons) {
let editContainer = editButton.parentElement;
editContainer.style.height = `${editContainer.previousElementSibling.offsetHeight}px`;
}
// HEADER AU SCROLL
let tableHead = document.querySelector("thead tr");
let tHeadHeight = tableHead.offsetHeight;
@@ -42,22 +58,65 @@ domReady(async () => {
tableHead.style.height = tableHead.style.minHeight;
}
}
// italiques -> A FAIRE SUR LE CSV AVANT D'IMPORTER CA RALENTIT DE OUF LE CHARGEMENT
/* let tbody = document.querySelector('body main table tbody');
let tbodyContent = tbody.innerHTML;
let asteriskCounter = 0;
for (let i = 0; i < tbodyContent.length; i++) {
if (tbodyContent[i] == "*") {
if (asteriskCounter % 2 == 0) {
tbodyContent = tbodyContent.substring(0, i) + '<span class="font-caslon italic">' + tbodyContent.substring(i + 1);
} else {
tbodyContent = tbodyContent.substring(0, i) + '</span>' + tbodyContent.substring(i + 1);
}
asteriskCounter++;
// C'EST LA POUR LES PRIVACY POLICY
// texte d'explication du login popup
// et privacy policy
let loginPopupText = document.getElementById('content_login_popup');
let privacyText = document.getElementById('content_privacy').innerHTML;
loginPopupText = loginPopupText.innerText;
let loginPopupTextWrapper = document.getElementsByClassName('xoo-el-sidebar');
if (loginPopupTextWrapper[0]) {
loginPopupTextWrapper[0].innerHTML = `<p>${loginPopupText}</p>`;
}
let policyDropdown = document.createElement('div');
policyDropdown.style.width = "100%";
policyDropdown.style.cursor = "pointer";
policyDropdown.style.fontWeight = "bold";
policyDropdown.style.display = "flex";
policyDropdown.style.justifyContent = "space-between";
policyDropdown.style.backgroundColor = "white";
policyDropdown.style.padding = "20px 30px";
let policyDropdownTitle = document.createElement('p');
policyDropdownTitle.style.padding = "0";
let policyDropdownPlus = document.createElement('p');
policyDropdownPlus.style.padding = "0";
policyDropdownPlus.innerText = '+';
policyDropdownTitle.innerText = "Politique de confidentialité";
policyDropdown.appendChild(policyDropdownTitle);
policyDropdown.appendChild(policyDropdownPlus);
let privacyPolicyContent = document.createElement('div');
privacyPolicyContent.innerHTML = privacyText;
privacyPolicyContent.style.width = "100%";
privacyPolicyContent.style.padding = "0px";
let policyParagraphs = privacyPolicyContent.querySelectorAll('p, h2');
for (let policyParagraph of policyParagraphs) {
policyParagraph.style.padding = '0';
policyParagraph.style.marginBottom = '15px';
}
privacyPolicyContent.style.height = "0px";
privacyPolicyContent.style.overflow = "hidden";
let policyOpen = false;
policyDropdown.addEventListener('click', togglePolicy);
if (loginPopupTextWrapper[0]) {
loginPopupTextWrapper[0].appendChild(policyDropdown);
loginPopupTextWrapper[0].style.overflowY = "scroll";
loginPopupTextWrapper[0].appendChild(privacyPolicyContent);
}
function togglePolicy() {
if (policyOpen) {
privacyPolicyContent.style.height = "0px";
privacyPolicyContent.style.padding = "0px";
policyOpen = false;
} else {
privacyPolicyContent.style.height = "auto";
privacyPolicyContent.style.padding = "10px 20px";
policyOpen = true;
}
}
tbody.innerHTML = tbodyContent;
*/
// titres de parties dans le tableau
let mainpartTitless = document.querySelectorAll('.isMainPart');
@@ -128,7 +187,7 @@ domReady(async () => {
}
let totalTime = convertToSeconds(lastTime[0].innerText);
let tlContainer, tlContainerHeight, bodyHeight;
let tlContainer, tlContainerHeight;
let partBlockHeights = [];
let activePartIndex = 0;
@@ -139,7 +198,6 @@ domReady(async () => {
tlContainer.style.height = `calc(100vh - ${header.offsetHeight}px - ${footer.offsetHeight}px - 60px)`;
tlContainer.style.top = `${document.querySelector('header').offsetHeight + 30}px`;
tlContainerHeight = tlContainer.offsetHeight;
bodyHeight = document.querySelector('body').offsetHeight;
for (let partDuration of partDurations) {
partBlockHeights.push(partDuration / totalTime * tlContainerHeight);
}
@@ -172,6 +230,7 @@ domReady(async () => {
toggleTitleHover(i, 'hide');
});
tlContainer.children[0].addEventListener("click", function() {
isScrollingFromGrab = false;
titresFrise[i].el.scrollIntoView({ behavior: 'smooth', block: 'center' });
});
}
@@ -197,6 +256,8 @@ domReady(async () => {
let lastMain = null;
let grabbing = false;
for (let i = 0; i < elements.length; i++) {
let current = elements[i];
let next = elements[i + 1];
@@ -302,6 +363,11 @@ domReady(async () => {
}
}
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// ICI IL Y A LE GRAB DU CURSEUR DE LA TL
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// make the cursor move on scroll
let cursor = document.querySelector('#cursor');
cursor.style.top = `${document.querySelector('#timeline_container').getBoundingClientRect().top}px`;
@@ -312,8 +378,7 @@ domReady(async () => {
partRects = Array.from(partRects);
partRects = partRects.reverse();
partRects[0].style.width = '32px';
let grabbing = false;
document.addEventListener("scroll", (event) => {
document.addEventListener("scroll", () => {
if (!grabbing) {
displayCurrentPartTitle(getCurrentPartFromScroll());
moveCursorFromScroll(getCurrentPartFromScroll());
@@ -324,9 +389,15 @@ domReady(async () => {
let offsetY;
element.addEventListener('mousedown', (e) => {
let elTransformY;
if (!element.style.transform) {
elTransformY = 0;
} else {
elTransformY = +element.style.transform.split('(')[1].split('p')[0];
}
e.preventDefault();
grabbing = true;
offsetY = e.clientY - +element.style.top.slice(0, -2);
offsetY = e.clientY - elTransformY;
element.style.cursor = 'grabbing';
});
@@ -334,74 +405,29 @@ domReady(async () => {
if (grabbing) {
if (e.clientY < tlContainerHeight + tlContainer.offsetTop && e.clientY > tlContainer.offsetTop) {
const y = e.clientY - offsetY;
element.style.top = `${y}px`;
relatedEl.style.top = `${y}px`;
element.style.transform = `translateY(${y}px)`;
relatedEl.style.transform = `translateY(${y}px)`;
if (!isNaN(y)) displayCurrentPartTitle(getCurrentPartFromCursor(y));
} else if (e.clientY <= tlContainer.offsetTop) {
element.style.top = `${tlContainer.offsetTop}px`;
relatedEl.style.top = `${tlContainer.offsetTop}px`;
} else if (e.clientY < tlContainer.offsetTop + 10) {
element.style.transform = `translateY(0px)`;
relatedEl.style.transform = `translateY(0px)`;
} else if (e.clientY >= tlContainerHeight + tlContainer.offsetTop) {
element.style.top = `${tlContainerHeight + tlContainer.offsetTop}px`;
relatedEl.style.top = `${tlContainerHeight + tlContainer.offsetTop}px`;
element.style.transform = `translateY(${tlContainerHeight}px)`;
relatedEl.style.transform = `translateY(${tlContainerHeight}px)`;
}
}
});
document.addEventListener('mouseup', () => {
grabbing = false;
if (grabbing) scrollOnGrab(element);
element.style.cursor = 'grab';
grabbing = false;
});
}
makeElementDraggable(cursor, titres);
makeElementDraggable(titres, cursor);
/* let cursorPrevTranslateAmount = +cursor.style.transform.slice(0, -3).slice(11);
// make the cursor draggable
let prevMousePos = 0;
cursor.addEventListener("mousedown", (event) => {
if (!grabbing) {
event.preventDefault();
grabbing = true;
prevMousePos = event.clientY;
}
});
window.addEventListener("mousemove", (event) => {
if (grabbing) {
event.preventDefault();
let newPos = cursorPrevTranslateAmount + (event.clientY - prevMousePos);
if (event.clientY < tlContainerHeight + tlContainer.offsetTop && event.clientY > tlContainer.offsetTop) {
cursor.style.transform = `translateY(${newPos}px)`;
window.scrollBy(0, (event.clientY - prevMousePos) * (bodyHeight / tlContainerHeight));
cursorPrevTranslateAmount = +cursor.style.transform.slice(0, -3).slice(11);
} else if (event.clientY <= tlContainer.offsetTop) {
cursor.style.transform = "translateY(0px)";
window.scroll(0, 0);
cursorPrevTranslateAmount = 0;
} else if (event.clientY >= tlContainerHeight + tlContainer.offsetTop) {
cursor.style.transform = `translateY(${tlContainerHeight}px)`;
window.scroll(0, bodyHeight);
cursorPrevTranslateAmount = +cursor.style.transform.slice(0, -3).slice(11);
}
prevMousePos = event.clientY;
}
});
window.addEventListener("mouseup", (event) => {
if (grabbing) {
grabbing = false;
}
});
*/
// get heights of parts dans le tableau et dans la timeline
function getSteps() {
let tlElSteps = [];
@@ -422,45 +448,102 @@ domReady(async () => {
});
}
function moveCursorFromScroll(currentPartIndex) {
let currentScroll = window.scrollY;
let cursorTopValue = 0;
let tlPartHeight, tlPartBottom;
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// ICI IL Y A LE SCROLL DU GRAB
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
let isScrollingFromGrab = false;
function scrollOnGrab(el) {
let scrollValue =
((getSteps().scrollSteps[getCursorPositionInTimelinePart(el).stepAfterMouseUp] - getSteps().scrollSteps[getCursorPositionInTimelinePart(el).stepAfterMouseUp - 1]) * getCursorPositionInTimelinePart(el).proportionInPart)
+ getSteps().scrollSteps[getCursorPositionInTimelinePart(el).stepAfterMouseUp];
isScrollingFromGrab = true;
window.scrollTo({ top: scrollValue, behavior: 'smooth' });
setTimeout(() => {
isScrollingFromGrab = false;
}, 2000);
}
function getCursorPositionInTimelinePart(el) {
let elTransformY;
if (!el.style.transform) {
elTransformY = 0;
} else {
elTransformY = +el.style.transform.split('(')[1].split('p')[0];
}
let tlPartHeight, tlPartBottom, tlPartTop, proportionInPart, stepAfterMouseUp;
for (let j = 0; j < partRects.length; j++) {
tlPartHeight = partRects[j].getBoundingClientRect().height
tlPartBottom = partRects[j].getBoundingClientRect().top - tlContainer.getBoundingClientRect().top;
cursorTopValue = tlPartBottom;
// get the amount of the current scrollpart scrolled
if (j === currentPartIndex) break;
if (j === getCurrentPartFromCursor(elTransformY)) {
tlPartHeight = partRects[j].getBoundingClientRect().height;
tlPartBottom = partRects[j].getBoundingClientRect().top - tlContainer.getBoundingClientRect().top;
tlPartTop = tlPartBottom - tlPartHeight;
proportionInPart = ((tlPartHeight - (elTransformY - tlPartTop)) / tlPartHeight) * -1;
if (proportionInPart > 0 && proportionInPart < 1) {
stepAfterMouseUp = j;
return {stepAfterMouseUp, proportionInPart};
} else {
stepAfterMouseUp = j;
proportionInPart = 0;
return {stepAfterMouseUp, proportionInPart};
}
}
}
}
let currentScrollPartBottom = getSteps().scrollSteps[currentPartIndex - 1] ? getSteps().scrollSteps[currentPartIndex - 1] : 0;
let currentScrollPartHeight;
if (getSteps().scrollSteps[currentPartIndex + 1]) {
currentScrollPartHeight = getSteps().scrollSteps[currentPartIndex + 1] - currentScrollPartBottom;
} else {
currentScrollPartHeight = document.querySelector('body').scrollHeight - currentScrollPartBottom;
}
let currentScrollSincePartBottom = currentScroll - currentScrollPartBottom;
let scrollPartProportion = currentScrollSincePartBottom / currentScrollPartHeight;
cursorTopValue = cursorTopValue + tlPartHeight * (tlPartHeight / tlPartHeight * (scrollPartProportion - 0.3));
if (cursorTopValue > 0) {
cursor.style.transform = `translateY(${cursorTopValue}px)`;
titres.style.transform = `translateY(${cursorTopValue}px)`;
} else {
cursor.style.transform = `translateY(0px)`;
titres.style.transform = `translateY(0px)`;
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// ICI IL Y A LE RAPPORT SCROLL / TIMELINE
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
function moveCursorFromScroll(currentPartIndex) {
if (!isScrollingFromGrab) {
let currentScroll = window.scrollY;
let cursorTopValue = 0;
let tlPartHeight, tlPartBottom;
for (let j = 0; j < partRects.length; j++) {
tlPartHeight = partRects[j].getBoundingClientRect().height
tlPartBottom = partRects[j].getBoundingClientRect().top - tlContainer.getBoundingClientRect().top;
cursorTopValue = tlPartBottom;
// get the amount of the current scrollpart scrolled
if (j === currentPartIndex) break;
}
let currentScrollPartBottom = getSteps().scrollSteps[currentPartIndex - 1] ? getSteps().scrollSteps[currentPartIndex - 1] : 0;
let currentScrollPartHeight;
if (getSteps().scrollSteps[currentPartIndex + 1]) {
currentScrollPartHeight = getSteps().scrollSteps[currentPartIndex + 1] - currentScrollPartBottom;
} else {
currentScrollPartHeight = document.querySelector('body').scrollHeight - currentScrollPartBottom;
}
let currentScrollSincePartBottom = currentScroll - currentScrollPartBottom;
let scrollPartProportion = currentScrollSincePartBottom / currentScrollPartHeight;
cursorTopValue = cursorTopValue + tlPartHeight * (tlPartHeight / tlPartHeight * (scrollPartProportion - 0.3));
if (cursorTopValue > 0) {
cursor.style.transform = `translateY(${cursorTopValue}px)`;
titres.style.transform = `translateY(${cursorTopValue}px)`;
} else {
cursor.style.transform = `translateY(0px)`;
titres.style.transform = `translateY(0px)`;
}
}
}
let prevPartIndex = 0;
let lastCallTimestamp = 0;
function displayCurrentPartTitle(currentPartIndex) {
titres.firstElementChild.innerText = getCurrentTime(titresFrise[currentPartIndex]?.el);
if (isNaN(currentPartIndex)) currentPartIndex = 0;
const currentTime = performance.now();
if (currentTime - lastCallTimestamp >= 400) {
lastCallTimestamp = currentTime;
titres.firstElementChild.innerText = getCurrentTime(titresFrise[currentPartIndex]?.el); // ICI POUR METTRE LE TEMPS BIEN
}
let mainEl = titres.children[1];
let subEl = titres.lastElementChild;
if (mainEl.innerText != titresFrise[currentPartIndex]?.main || subEl.innerText != titresFrise[currentPartIndex]?.sub) {
@@ -487,26 +570,332 @@ domReady(async () => {
}
}
function getCurrentPartFromCursor(cursorTop) {
function getCurrentPartFromCursor(cursorTransformY) {
for (let i = 0; i < getSteps().tlElSteps.length; i++) {
if (cursorTop - tlContainer.offsetTop >= getSteps().tlElSteps[i] && cursorTop - tlContainer.offsetTop < getSteps().tlElSteps[i + 1]) {
if (cursorTransformY >= getSteps().tlElSteps[i] && cursorTransformY < getSteps().tlElSteps[i + 1]) {
return(i);
} else if (cursorTop - tlContainer.offsetTop > getSteps().tlElSteps[getSteps().tlElSteps.length - 1]) {
} else if (cursorTransformY > getSteps().tlElSteps[getSteps().tlElSteps.length - 1]) {
return(getSteps().tlElSteps.length - 1);
}
}
}
///////////////////////////////////////
// ICI LE GETCURRENTTIME !!!!!!!!!!!!!!
///////////////////////////////////////
function getCurrentTime(titleEl) {
let nextRow = titleEl?.nextElementSibling;
while(nextRow) {
if (nextRow.offsetTop > window.scrollY &&
nextRow.classList.contains('isContentPart')) {
return(nextRow.firstElementChild.innerText);
if (!grabbing) {
while(nextRow) {
if (nextRow.offsetTop > window.scrollY &&
nextRow.classList.contains('isContentPart')) {
return(nextRow.firstElementChild.innerText);
}
nextRow = nextRow.nextElementSibling;
}
nextRow = nextRow.nextElementSibling;
} else {
let cursor = document.querySelector('#cursor');
let allRowsUnder = [];
nextRow = nextRow.nextElementSibling.nextElementSibling;
while(nextRow) {
if (nextRow.classList.contains('isMainPart') || nextRow.classList.contains('isSubPart')) {
break;
}
allRowsUnder.push(nextRow);
nextRow = nextRow.nextElementSibling;
}
return allRowsUnder[Math.floor(allRowsUnder.length * getCursorPositionInTimelinePart(cursor).proportionInPart)].firstElementChild.innerText;
}
}
// désactive le loading quand les éléments sont affichés correctement
setTimeout(() => {
let loadingEl = document.getElementById('loading');
loadingEl.style.opacity = "0";
setTimeout(() => {
loadingEl.style.display = "none";
}, 200);
}, 100);
// recherche
let searchableContent = document.querySelectorAll('tr td:not(:first-of-type):not(:last-of-type)');
let searchInput = document.querySelector('input[type="search"]');
let searchResults = document.querySelector('#search_results');
let isResultOpen = false;
let resultAmount = 0;
let resultAmountText = document.querySelector('#result_amount');
let hilightedWords;
let typingTimer;
let currentSelectedWord = 0;
let downArrow = document.querySelector('#search_results div div img:first-of-type');
let upArrow = document.querySelector('#search_results div div img:last-of-type');
let thereAreResults = false;
let inputIsActive = false;
searchInput.addEventListener('focus', () => { inputIsActive = true; toggleSearchResults(); });
searchInput.addEventListener('blur', () => { inputIsActive = false; });
searchInput.addEventListener('keydown', function(e) {
triggerSearch();
});
function triggerSearch() {
setTimeout(() => {
hilightedWords = [];
removeHighlightTags();
resultAmount = 0;
let input = searchInput.value.toLowerCase();
if (searchInput.value.length >= 3) {
thereAreResults = true;
clearTimeout(typingTimer);
typingTimer = setTimeout(function() {
searchInContent(input);
/* if (!isResultOpen) {
toggleSearchResults();
}
*/
let currentScroll = window.scrollY;
if (hilightedWords.length != 0) {
searchResults.querySelector('div p:first-of-type').style.display = "block";
searchResults.querySelector('div p:last-of-type').style.display = "none";
for (let i = 0; i < hilightedWords.length; i++) {
let wordBoundingTop = hilightedWords[i].getBoundingClientRect().top;
if (hilightedWords.length <= 1) {
let scrollValue = (wordBoundingTop + currentScroll) - window.innerHeight / 2;
window.scrollTo({ top: scrollValue, behavior: 'smooth' });
currentSelectedWord = 1;
resultAmountText.innerText = currentSelectedWord + "/" + resultAmountText.innerText;
upArrow.classList.add('disabled');
downArrow.classList.add('disabled');
} else {
if (currentScroll < hilightedWords[i].getBoundingClientRect().top && i === 0) {
let scrollValue = (wordBoundingTop + currentScroll) - window.innerHeight / 2;
window.scrollTo({ top: scrollValue, behavior: 'smooth' });
currentSelectedWord = 1;
resultAmountText.innerText = currentSelectedWord + "/" + resultAmountText.innerText;
upArrow.classList.add('disabled');
downArrow.classList.remove('disabled');
break;
} else if (
currentScroll < wordBoundingTop + currentScroll && currentScroll > hilightedWords[i - 1]?.getBoundingClientRect().top + currentScroll
) {
let scrollValue = (wordBoundingTop + currentScroll) - window.innerHeight / 2;
window.scrollTo({ top: scrollValue, behavior: 'smooth' });
currentSelectedWord = i + 1;
resultAmountText.innerText = currentSelectedWord + "/" + resultAmountText.innerText;
upArrow.classList.remove('disabled');
downArrow.classList.remove('disabled');
break;
} else if (currentScroll > wordBoundingTop && i === hilightedWords.length - 1) {
let scrollValue = (wordBoundingTop + currentScroll) - window.innerHeight / 2;
window.scrollTo({ top: scrollValue, behavior: 'smooth' });
currentSelectedWord = hilightedWords.length;
resultAmountText.innerText = currentSelectedWord + "/" + resultAmountText.innerText;
upArrow.classList.remove('disabled');
downArrow.classList.add('disabled');
break;
}
}
}
} else {
searchResults.querySelector('div p:first-of-type').style.display = "none";
searchResults.querySelector('div p:last-of-type').style.display = "block";
upArrow.classList.add('disabled');
downArrow.classList.add('disabled');
}
}, 800);
} else {
removeHighlightTags();
thereAreResults = false;
searchResults.querySelector('div p:first-of-type').style.display = "none";
searchResults.querySelector('div p:last-of-type').style.display = "block";
upArrow.classList.add('disabled');
downArrow.classList.add('disabled');
/* if (isResultOpen) {
toggleSearchResults();
}
*/ }
}, 10);
}
function searchInContent(input) {
for (let content of searchableContent) {
if (content.innerText != '') {
for (let textEl of content.children) {
if (textEl.innerText !== '') {
if (textEl.innerHTML.toLowerCase().includes(input)) {
let splitContent = textEl.innerHTML.toLowerCase().split(input);
let processedText = '';
for (let i = 0; i < splitContent.length; i++) {
if (splitContent[0] !== '' || splitContent[splitContent.length - 1] !== '') {
if (i === 0) {
processedText += textEl.innerHTML.substring(0, splitContent[i].length);
} else {
let amountOfTextToConcatenate = 0;
for (let j = 0; j <= i - 1; j ++) {
amountOfTextToConcatenate += splitContent[j].length + input.length;
}
processedText +=
'<span class="highlight">' +
textEl.innerHTML.substring(amountOfTextToConcatenate - input.length, amountOfTextToConcatenate) +
'</span>' +
textEl.innerHTML.substring(
amountOfTextToConcatenate, amountOfTextToConcatenate + splitContent[i].length
);
}
} else if (splitContent[splitContent.length - 1] === '' && splitContent[0] === '') {
processedText = '<span class="highlight">' + textEl.innerHTML.substring(splitContent[i - 1].length, splitContent[i - 1].length + input.length) + '</span>';
}
}
textEl.innerHTML = processedText;
hilightedWords = document.querySelectorAll('.highlight');
resultAmount = hilightedWords.length;
}
}
}
}
}
resultAmountText.innerText = resultAmount;
}
function removeHighlightTags() {
for (let content of searchableContent) {
if (content.innerHTML.includes('<span class="highlight">')) {
content.innerHTML = content.innerHTML.replace(/<span class="highlight">|<\/span>/g, '');
}
}
}
function toggleSearchResults() {
if (thereAreResults || inputIsActive) {
searchResults.style.display = "block";
searchResults.style.opacity = 1;
searchResults.style.maxHeight = "1000px";
isResultOpen = true;
} else {
searchResults.style.opacity = 0;
searchResults.style.maxHeight = "0px";
isResultOpen = false;
setTimeout(() => {
searchResults.style.display = "none";
}, 300);
}
}
upArrow.addEventListener('click', function (el) {
if (!el.target.classList.contains('disabled')) {
let currentScroll = window.scrollY;
currentSelectedWord--;
let wordBoundingTop = hilightedWords[currentSelectedWord - 1].getBoundingClientRect().top;
let scrollValue = (wordBoundingTop + currentScroll) - window.innerHeight / 2;
window.scrollTo({ top: scrollValue, behavior: 'smooth' });
resultAmountText.innerText = currentSelectedWord + "/" + resultAmountText.innerText.split('/')[1];
if (currentSelectedWord === 1) {
upArrow.classList.add('disabled');
downArrow.classList.remove('disabled');
} else {
upArrow.classList.remove('disabled');
downArrow.classList.remove('disabled');
}
}
});
downArrow.addEventListener('click', function (el) {
if (!el.target.classList.contains('disabled')) {
let currentScroll = window.scrollY;
currentSelectedWord++;
let wordBoundingTop = hilightedWords[currentSelectedWord - 1].getBoundingClientRect().top;
let scrollValue = (wordBoundingTop + currentScroll) - window.innerHeight / 2;
window.scrollTo({ top: scrollValue, behavior: 'smooth' });
resultAmountText.innerText = currentSelectedWord + "/" + resultAmountText.innerText.split('/')[1];
if (currentSelectedWord === hilightedWords.length) {
downArrow.classList.add('disabled');
upArrow.classList.remove('disabled');
} else {
downArrow.classList.remove('disabled');
upArrow.classList.remove('disabled');
}
}
});
let tagsDiv = document.querySelector('#search_results > div:last-of-type');
window.addEventListener('click', function (el) {
if (!searchResults.contains(el.target) && isResultOpen && el.target != searchInput && el.target != tagsDiv) {
toggleSearchResults();
}
});
let searchWordList = document.querySelector('#content_search_tag');
searchWordList = searchWordList.innerText.substring(1, searchWordList.innerText.length - 1).split(', ');
for (let tag of searchWordList) {
let tagWrapper = document.createElement('p');
tagWrapper.innerText = tag;
tagWrapper.addEventListener('click', function () {
searchInput.value = tag;
triggerSearch();
});
tagsDiv.appendChild(tagWrapper);
}
});
/**
+21
View File
@@ -0,0 +1,21 @@
(function($) {
// Access the page content
var pageContent = pageContentData.content;
// Now you can use the 'pageContent' variable in your JavaScript code
console.log(pageContent);
setTimeout(() => {
let editorWriting = document.querySelector('.edit-post-visual-editor');
let writingSpace = document.querySelector('.block-editor-writing-flow');
writingSpace.style.padding = "0";
console.log(editorWriting);
let tutorialWrapper = document.createElement('div');
tutorialWrapper.style.width = "100%";
tutorialWrapper.style.backgroundColor = "#384756";
tutorialWrapper.style.padding = "20px";
tutorialWrapper.innerHTML = pageContent;
editorWriting.appendChild(tutorialWrapper);
}, 2000);
})(jQuery);
+139
View File
@@ -0,0 +1,139 @@
@font-face {
font-family: "Authentic_Sans_60";
src: url("../assets/fonts/authentic-sans-90/AUTHENTICSans-60.woff") format("woff"),
url("../assets/fonts/authentic-sans-90/AUTHENTICSans-60.woff2") format("woff2"),
url("../assets/fonts/authentic-sans-90/AUTHENTICSans-60.otf") format("otf");
font-style: normal;
}
html {
background-color: #1e262e !important;
}
body.wp-admin {
background-color: #26313b;
color: white !important;
font-family: "Authentic_Sans_60";
}
.wp-admin table,
.wp-admin #adminmenuwrap li,
.wp-admin #adminmenuwrap ul {
background: #1f2730 !important;
border: none;
}
.wp-admin #adminmenu li.current a {
background: #384756 !important;
}
.wp-admin .selected {
background-color: #384756 !important;
}
#wpadminbar .menupop {
background: #1e262e !important;
}
.wp-admin li,
.wp-admin ul {
background-color: #26313b !important;
}
.wp-admin .current::after {
border-right-color: #26313b !important;
}
.wp-admin table tbody tr,
.wp-admin #adminmenuback,
.wp-admin #adminmenuwrap,
.wp-admin #adminmenu,
#wpadminbar {
background-color: #1e262e !important;
}
.wp-admin th,
.wp-admin h1,
.wp-admin h2,
.wp-admin p,
.wp-admin label,
.wp-admin abbr,
.wp-admin td {
color: white !important;
}
.wp-admin a {
color: #bbb !important;
}
.editor-styles-wrapper {
background-color: #26313b !important;
}
.edit-post-header {
background-color: #1e262e !important;
color: white !important;
}
.edit-post-header .components-button svg {
fill: white !important;
outline: white !important;
}
.edit-post-header button {
color: white !important;
outline-color: white !important;
background: none !important;
}
.interface-interface-skeleton__footer {
display: none !important;
}
.components-panel__header {
background-color: #26313b !important;
}
.components-panel__header ul li button {
color: white !important;
}
/* .components-panel__header ul li:last-of-type {
display: none;
} */
.components-panel__header button svg {
fill: white !important;
outline: white !important;
}
.interface-interface-skeleton__sidebar {
background-color: #1e262e !important;
}
.components-panel__body-title:hover {
background-color: initial !important;
}
.components-panel__body-title button {
color: white !important;
}
.components-panel__body-title button svg {
fill: white !important;
outline: white !important;
}
.components-panel {
background-color: #1e262e !important;
color: white !important;
}
/*
.components-panel > div {
display: none !important;
} */
.components-panel > div:first-of-type {
display: block !important;
}
+159 -2
View File
@@ -28,7 +28,6 @@
url("/assets/fonts/authentic-sans-90/AUTHENTICSans-60.woff2") format("woff2"),
url("/assets/fonts/authentic-sans-90/AUTHENTICSans-60.otf") format("otf");
font-style: normal;
}
@font-face {
@@ -47,5 +46,163 @@
font-style: italic;
}
#wpadminbar {
display: none;
}
thead::after {
content: '';
display: block;
position: fixed;
width: 100px;
height: 80px;
background-color: #010d19;
top: 100px;
left: 83.3333vw;
z-index: 10;
}
.isContentPart td:last-of-type {
position: absolute;
width: auto !important;
padding: 0;
right: 14vw;
height: auto;
display: flex;
align-items: center;
padding-bottom: 0.75rem;
}
.isContentPart td:last-of-type a {
font-size: 1.1rem;
opacity: 0.4;
transition: opacity 0.2s ease-in;
}
.isContentPart td:last-of-type a:hover {
opacity: 1 !important;
}
.isContentPart:hover td:last-of-type a {
opacity: 0.7;
}
em {
font-family: "Libre_Caslon";
font-style: italic;
}
.xoo-el-sidebar {
max-width: 50%;
background-color: #eee;
}
.xoo-el-sidebar p {
padding: 40px 40px;
color: 010d19;
}
#about_popup {
z-index: 10;
position: fixed;
top: 0;
left: 0;
display: none;
opacity: 0;
width: 100vw;
height: 100vh;
align-items: center;
justify-content: center;
transition: opacity 0.3s ease-out;
}
#about_popup #about_modale {
position: relative;
background-color: white;
color: #010d19;
width: 75vw;
}
#about_popup #about_modale span {
position: absolute;
top: -11px;
right: -11px;
color: #010d19;
font-size: 23px;
border-radius: 50%;
background-color: white;
border: 4px solid white;
cursor: pointer;
}
#about_popup #about_modale span:hover {
color: red;
}
#about_popup #about_modale #about_title {
color: #010d19;
background-color: white;
width: 100%;
height: 80px;
text-align: center;
font-family: 'Libre_Caslon';
padding-top: 25px;
text-transform: uppercase;
font-size: 1.3rem;
}
#about_popup #about_modale #about_content {
color: #010d19;
background-color: #eee;
padding: 40px 30px;
height: 100%;
}
#about_popup #about_modale #about_content p {
margin-bottom: 15px;
}
.highlight {
color: #010d19;
background-color: yellow;
}
input {
width: 100%;
}
#search_results {
display: none;
top: 8vh;
background-color: #26313b;
max-height: 0px;
height:auto;
opacity: 0;
transition: opacity 0.3s ease, max-height 0.3s ease;
}
#search_results img.disabled {
opacity: 0.4;
cursor: default;
}
#search_results > div:last-of-type {
padding: 15px;
border-top: solid 1px white;
}
#search_results > div:last-of-type p {
display: inline-block;
padding: 3px 9px;
margin: 5px 3px;
border: solid 1px white;
border-radius: 10px;
background-color: rgba(255, 255, 255, 0.2);
cursor: pointer;
transition: background-color 0.2s ease;
}
#search_results > div:last-of-type p:hover {
background-color: rgba(255, 255, 255, 0.1);
}
}
+57
View File
@@ -0,0 +1,57 @@
.edit-post-header > div:first-of-type,
.block-editor-block-toolbar {
display: none !important;
}
/* .block-library-classic__toolbar
*/
#mceu_54-body > div:first-of-type,
#mceu_54-body > div:nth-of-type(2),
#mceu_54-body > div:nth-of-type(4),
#mceu_54-body > div:nth-of-type(5),
#mceu_54-body > div:nth-of-type(6),
#mceu_54-body > div:nth-of-type(7),
#mceu_54-body > div:nth-of-type(8),
#mceu_54-body > div:nth-of-type(9),
#mceu_54-body > div:nth-of-type(10),
#mceu_54-body > div:nth-of-type(11),
#mceu_54-body > div:nth-of-type(12),
#mceu_54-body > div:nth-of-type(13),
#mceu_54-body > div:nth-of-type(14) {
display: none !important;
}
.edit-post-header-toolbar__left > button:first-of-type,
.edit-post-header-toolbar__left > div:first-of-type,
.edit-post-header-toolbar__left > button:last-of-type {
display: none !important;
}
.edit-post-header__settings > button:first-of-type,
.edit-post-header__settings > div:first-of-type,
.edit-post-header__settings > div:last-of-type,
.edit-post-header__settings > button:last-of-type,
.block-editor-inserter,
.components-panel__header ul > li:last-of-type {
display: none !important;
}
.components-panel > div:not(:first-of-type),
.edit-post-post-status > h2,
.edit-post-post-status > div:nth-of-type(3) {
display: none !important;
}
.rvy-author-selection,
.rvy-submission-div > a:last-of-type,
.revision-created > a {
display: none !important;
}
#bulk-action-selector-top > option[value="submit_revision"],
#bulk-action-selector-top > option[value="approve_revision"],
#bulk-action-selector-top > option[value="decline_revision"],
#bulk-action-selector-top > option[value="publish_revision"] {
display: none !important;
}
+57 -16
View File
@@ -1,6 +1,21 @@
@extends('layouts.app')
@section('content')
<div id="about_popup">
<div id="about_modale">
<span class="xoo-el-icon-cancel-circle" aria-hidden="true" onclick="closeAboutPopup()"></span>
<div id="about_title">
À propos
</div>
<div id="about_content">
<?php echo apply_filters('the_content', get_post(9962)->post_content) ?>
</div>
</div>
</div>
<div id="content_search_tag" style="display: none;"><?php echo apply_filters('the_content', get_post(13943)->post_content) ?></div>
<div id="content_login_popup" style="display: none;"><?php echo apply_filters('the_content', get_post(9960)->post_content) ?></div>
<div id="content_privacy" style="display: none;"><?php echo apply_filters('the_content', get_post(3)->post_content) ?></div>
<div class="fixed left-0 w-8 flex flex-col-reverse z-1" id="timeline_container"></div>
@@ -12,7 +27,7 @@
<table class="w-full bg-jlg-dark-blue flex justify-center mt-[70px] z-0 pl-10 lg:pl-[10px]">
<thead>
<tr class="border-jlg-white border-b h-64 top-0 w-full lg:w-2/3 fixed z-0 flex items-stretch justify-around text-left uppercase bg-jlg-dark-blue">
<tr class="border-jlg-white border-b h-64 top-0 lg:w-2/3 fixed z-0 flex items-stretch justify-around text-left uppercase bg-jlg-dark-blue">
<th class="flex items-end justify-start"></th>
<th class="flex items-end justify-start pb-4">Images</th>
<th class="flex items-end justify-start pb-4">Voix Off et In</th>
@@ -26,7 +41,7 @@
$args = array(
'post_type' => 'post',
'posts_per_page' => -1,
'meta_key' => 'Index',
'meta_key' => 'index',
'meta_type' => 'NUMERIC',
'orderby' => 'meta_value',
'order' => 'ASC'
@@ -35,27 +50,52 @@
if ($query->have_posts()) :
while ($query->have_posts()) : $query->the_post();
$contenu = get_the_content();
if (get_post_meta(get_the_ID(), 'isMainPart', true)) { ?>
<tr class="border-jlg-white border-b font-authentic-90 uppercase w-full flex flex-row py-6 isMainPart">
<td class="pl-0 flex">
<div class="w-2 h-5 bg-jlg-white mr-3"></div>
<div>{{ get_post_meta(get_the_ID(), 'isMainPart', true) }}</div>
</td>
</tr>
<?php } elseif (get_post_meta(get_the_ID(), 'isSubPart', true)) { ?>
<tr class="border-jlg-white border-b font-authentic-90 w-full flex flex-row py-6 isSubPart">
<td class="pl-0 flex">
<div class="w-2 h-5 bg-jlg-white mr-3"></div>
<div>{{ get_post_meta(get_the_ID(), 'isSubPart', true) }}</div>
</td>
</tr>
<?php } else {
$contenu = wpautop(get_the_content());
$infosArray = explode("---", $contenu); // Divise le contenu en fonction des séparateurs
// Initialisez des variables pour stocker les informations
$images = isset($infosArray[0]) ? $infosArray[0] : '';
$voixOffIn = isset($infosArray[1]) ? $infosArray[1] : '';
$bandeson = isset($infosArray[2]) ? $infosArray[2] : '';
$ecrits = isset($infosArray[3]) ? $infosArray[3] : '';
$images = isset($infosArray[1]) ? $infosArray[1] : '';
$images = substr($images, 0, -21);
$voixOffIn = isset($infosArray[2]) ? $infosArray[2] : '';
$voixOffIn = substr($voixOffIn, 0, -16);
$bandeson = isset($infosArray[3]) ? $infosArray[3] : '';
$bandeson = substr($bandeson, 0, -14);
$ecrits = isset($infosArray[4]) ? $infosArray[4] : '';
//lien pour le crayon
$edit_link = 'https://localhost/wp/wp-admin/admin.php?page=rvy-revisions&post='. get_the_ID() .'&action=revise';
?>
<tr class="border-jlg-light-white border-b font-authentic-60 w-full flex flex-row py-6 isContentPart">
<td class="block text-sm pl-0 pr-6">{{ the_title()}}</td>
<td class="block pl-0 pr-6"><?php echo $images; ?></td>
<td class="block pl-0 pr-6"><?php echo $voixOffIn; ?></td>
<td class="block pl-0 pr-6"><?php echo $bandeson; ?></td>
<td class="block pl-0 pr-6"><?php echo $ecrits; ?></td>
<td class="block text-sm pl-0 pr-6"><?php if(is_user_logged_in()){ echo '<a href="' . esc_url( $edit_link ) . '" class="edit-button">&#128393;</a>';} elseif (!is_user_logged_in()) { echo '<a href="' . esc_url( $edit_link ) . '" class="edit-button xoo-el-login-tgr ">&#128393;</a>';}?></td>
</tr>
<?php
<tr class="border-jlg-light-white border-b font-authentic-60 w-full flex flex-row py-6 isContentPart">
<td class="block text-sm pl-0 pr-6">{{ the_title()}}</td>
<td class="block pl-0 pr-6"><?php echo $images; ?></td>
<td class="block pl-0 pr-6"><?php echo $voixOffIn; ?></td>
<td class="block pl-0 pr-6"><?php echo $bandeson; ?></td>
<td class="block pl-0 pr-6"><?php echo $ecrits; ?></td>
<td class="block text-sm pl-0 pr-6">
<?php if(is_user_logged_in()){
echo '<a title="Contribution" href="' . esc_url( $edit_link ) . '" class="edit-button">&#128393;</a>';
} elseif (!is_user_logged_in()) {
echo '<a href="' . esc_url( $edit_link ) . '" class="edit-button xoo-el-login-tgr ">&#128393;</a>';
}?>
</td>
</tr>
<?php }
// endif;
endwhile;
endif;
@@ -65,6 +105,7 @@
</table>
@if (! have_posts())
<x-alert type="warning">
{!! __('Sorry, no results were found.', 'sage') !!}
+66 -2
View File
@@ -1,8 +1,8 @@
<footer class="fixed w-full h-[8vh] py-4 bottom-0 bg-jlg-dark-blue border-t border-jlg-light-white flex justify-between">
<!-- @php(dynamic_sidebar('sidebar-footer'))-->
<div class="text-sm">
<button class="px-4 py-2 rounded-md ml-6 underline underline-offset-8 hover:underline-offset-4 active:underline-offset-8">À PROPOS</button>
<button class="px-4 py-2 rounded-md ml-6 underline underline-offset-8 hover:underline-offset-4 active:underline-offset-8">CONTACT</button>
<button class="px-4 py-2 rounded-md ml-6 underline underline-offset-8 hover:underline-offset-4 active:underline-offset-8" onclick="displayAboutPopup()" id="about_button">À PROPOS</button>
<button class="px-4 py-2 rounded-md ml-6 underline underline-offset-8 hover:underline-offset-4 active:underline-offset-8"><a href="mailto:<?php echo get_option('admin_email') ?>">CONTACT</a></button>
</div>
<div class="mr-6 flex items-center">
<a href="https://www.thalim.cnrs.fr/?lang=fr" target="_blank" class="w-12 mr-4">
@@ -19,3 +19,67 @@
</a>
</div>
</footer>
<div id="loading" style="
width: 100vw;
height: 100vh;
background-color: #010d19;
z-index: 9999;
position: fixed;
top: 0;
left: 0;
display: flex;
justify-content: center;
align-items: center;
font-family: sans-serif;
color: white;
opacity: 1;
transition: opacity 0.2s ease-out;
">
<p>
Chargement
<span class="dot-one">.</span>
<span class="dot-two">.</span>
<span class="dot-three">.</span>
</p>
</div>
<script>
// Define the event listener function
function closeAboutPopupHandler(event) {
event.preventDefault();
console.log(event.target);
if (
event.target != document.querySelector('#about_modale') &&
event.target != document.querySelector('#about_button') &&
event.target != document.querySelector('#about_title') &&
event.target != document.querySelector('#about_content') &&
event.target.parentElement != document.querySelector('#about_content')
) {
closeAboutPopup();
}
}
// Attach the event listener in the displayAboutPopup function
function displayAboutPopup() {
document.getElementById('about_popup').style.display = 'flex';
setTimeout(() => {
document.getElementById('about_popup').style.opacity = '1';
window.addEventListener('click', closeAboutPopupHandler);
}, 1);
document.body.style.overflow = 'hidden';
}
// Remove the event listener in the closeAboutPopup function
function closeAboutPopup() {
document.getElementById('about_popup').style.opacity = '0';
setTimeout(() => {
document.getElementById('about_popup').style.display = 'none';
}, 300);
document.body.style.overflowY = 'scroll';
// Remove the event listener
window.removeEventListener('click', closeAboutPopupHandler);
}
</script>
+41 -5
View File
@@ -1,7 +1,20 @@
<header class="border-b border-jlg-light-white py-4 h-1/12 shadow-xlg fixed top-0 w-full bg-jlg-dark-blue flex flex-row justify-between items-center z-10">
<div class="text-sm">
<button class="bg-jlg-xlight-white hover:bg-jlg-hxlight-white active:bg-jlg-axlight-white px-4 py-2 rounded-full border-jlg-hxlight-white border ml-6 transition-colors xoo-el-login-tgr">MES CONTRIBUTIONS</button>
<button class="bg-jlg-xlight-white hover:bg-jlg-hxlight-white active:bg-jlg-axlight-white px-4 py-2 rounded-full border-jlg-hxlight-white border ml-6 transition-colors">EXPORT</button>
<button class="bg-jlg-xlight-white hover:bg-jlg-hxlight-white active:bg-jlg-axlight-white px-4 py-2 rounded-full border-jlg-hxlight-white border ml-6 transition-colors">
<?php
$current_user = wp_get_current_user();
$author_id = $current_user->ID;
$revisionary_page = admin_url('admin.php?page=revisionary-q&author=' . $author_id);
$link = sprintf(
'<a href="%s">MES CONTRIBUTIONS</a>',
esc_url($revisionary_page)
);
echo do_shortcode('[xoo_el_action type="login" change_to="' . $revisionary_page . '" change_to_text="MES CONTRIBUTIONS" text="CONTRIBUER" redirect_to="' . $revisionary_page . '"]');
?>
</button>
<button class="bg-jlg-xlight-white hover:bg-jlg-hxlight-white active:bg-jlg-axlight-white px-4 py-2 rounded-full border-jlg-hxlight-white border ml-6 transition-colors"><a href="<?php echo esc_url(home_url('/?format=csv')); ?>">EXPORT</a></button>
</div>
<a class="brand text-center text-2xl leading-none" href="{{ home_url('/') }}">
@@ -10,13 +23,36 @@
<span class="font-caslon italic">Le Livre d'Image</span>
</a>
<div class="mr-6">
<div class="mr-6 w-52">
<input type="search" class="px-4 py-2 rounded bg-jlg-xlight-white text-sm" placeholder="RECHERCHER">
</div>
<div class="z-30 right-6 absolute w-52 max-h-52 border-jlg-light-white border rounded" id="search_results">
<div class="flex flex-row p-3 justify-around items-center h-full text-sm">
<p><span id="result_amount">0</span> occurences</p>
<p class="hidden">Aucune occurence</p>
<div class="flex flex-row">
<img src="<?= get_template_directory_uri(); ?>/resources/assets/icons/arrow_drop_down.svg" alt="arrow down" class="cursor-pointer">
<img src="<?= get_template_directory_uri(); ?>/resources/assets/icons/arrow_drop_up.svg" alt="arrow up" class="cursor-pointer">
</div>
</div>
<div class="text-sm w-full">
</div>
</div>
@if (has_nav_menu('primary_navigation'))
<nav class="nav-primary" aria-label="{{ wp_get_nav_menu_name('primary_navigation') }}">
{!! wp_nav_menu(['theme_location' => 'primary_navigation', 'menu_class' => 'nav', 'echo' => false]) !!}
<nav class="nav-primary" aria-label="{{ wp_get_nav_menu_name('primary_navigation') }}">
{!! wp_nav_menu(['theme_location' => 'primary_navigation', 'menu_class' => 'nav', 'echo' => false]) !!}
</nav>
@endif
</header>
<script>
setTimeout(() => {
const privacyLink = document.querySelector('.xoo-aff-checkbox_single a');
privacyLink.addEventListener('click', function (e) {
e.preventDefault();
});
}, 1000);
</script>