started druapl theme leshed
This commit is contained in:
File diff suppressed because one or more lines are too long
+36
File diff suppressed because one or more lines are too long
@@ -0,0 +1,32 @@
|
||||
import axios from 'axios'
|
||||
|
||||
// https://github.com/alvar0hurtad0/drupal-vuejs-todo/blob/master/frontend/src/api/axiosInterceptor.js
|
||||
|
||||
// console.log('drupalSettings', drupalSettings)
|
||||
console.log(window.location)
|
||||
|
||||
const JSONAPI = axios.create({
|
||||
baseURL: `${window.location.origin}/jsonapi`,
|
||||
withCredentials: true,
|
||||
headers: {
|
||||
Accept: 'application/vnd.api+json'
|
||||
// Authorization: 'Basic {token}',
|
||||
// 'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
|
||||
JSONAPI.interceptors.response.use(
|
||||
response => {
|
||||
return Promise.resolve(response)
|
||||
},
|
||||
error => {
|
||||
const { status } = error.response
|
||||
console.warn('error in json-axios', status)
|
||||
// if (status === 403) {
|
||||
// window.location = '/'
|
||||
// }
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
|
||||
export default JSONAPI
|
||||
@@ -0,0 +1,45 @@
|
||||
import axios from 'axios'
|
||||
|
||||
// https://github.com/alvar0hurtad0/drupal-vuejs-todo/blob/master/frontend/src/api/axiosInterceptor.js
|
||||
|
||||
// console.log('drupalSettings', drupalSettings)
|
||||
// console.log('window.location.origin', window.location.origin)
|
||||
|
||||
// axios.interceptors.response.use(
|
||||
// response => {
|
||||
// return Promise.resolve(response)
|
||||
// },
|
||||
// error => {
|
||||
// const { status } = error.response
|
||||
// console.warn('error in rest-axios', status)
|
||||
// if (status === 403) {
|
||||
// window.location = '/'
|
||||
// }
|
||||
// return Promise.reject(error)
|
||||
// }
|
||||
// )
|
||||
|
||||
const REST = axios.create({
|
||||
baseURL: `${window.location.origin}`,
|
||||
withCredentials: true,
|
||||
headers: {
|
||||
// Authorization: 'Bearer {token}',
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
|
||||
REST.interceptors.response.use(
|
||||
response => {
|
||||
return Promise.resolve(response)
|
||||
},
|
||||
error => {
|
||||
const { status } = error.response
|
||||
console.warn('error in rest-axios', status)
|
||||
// if (status === 403) {
|
||||
// window.location = '/'
|
||||
// }
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
|
||||
export default REST
|
||||
@@ -0,0 +1,121 @@
|
||||
// import { createApp } from 'vue'
|
||||
import '../scss/main.scss'
|
||||
// import Content from './vuejs/Content.vue'
|
||||
|
||||
// import REST from './api/rest-axios'
|
||||
|
||||
// import LocomotiveScroll from 'locomotive-scroll';
|
||||
// const scroll = new LocomotiveScroll();
|
||||
|
||||
|
||||
// /**
|
||||
// * @file
|
||||
// * https://www.drupal.org/docs/drupal-apis/javascript-api/javascript-api-overview
|
||||
// */
|
||||
// (function (Drupal) {
|
||||
|
||||
// 'use strict';
|
||||
|
||||
// Drupal.behaviors.leshed = {
|
||||
// attach: function (context, settings) {
|
||||
// console.log('It works!');
|
||||
// }
|
||||
// };
|
||||
|
||||
// } (Drupal));
|
||||
|
||||
(function (Drupal, drupalSettings) {
|
||||
const LeShedTheme = function () {
|
||||
const _is_front = drupalSettings.path.isFront
|
||||
console.log('drupalSettings', drupalSettings)
|
||||
|
||||
|
||||
// ___ _ _
|
||||
// |_ _|_ _ (_) |_
|
||||
// | || ' \| | _|
|
||||
// |___|_||_|_|\__|
|
||||
function init () {
|
||||
console.log('LeShedTheme init()')
|
||||
// initVues()
|
||||
}
|
||||
|
||||
|
||||
function onWindowResize() {
|
||||
_cardsForms.forEach(({card, forme, formepos}) => {
|
||||
// console.log(`card`, card, 'forme', forme, 'formepos', formepos);
|
||||
forme.style.top = `${card.offsetTop + formepos.top}px`;
|
||||
forme.style.left = `${card.offsetLeft + formepos.left}px`;
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// function initVues(){
|
||||
// console.log('initVues');
|
||||
|
||||
// // initVueContent();
|
||||
|
||||
|
||||
// }
|
||||
|
||||
// function initVueContent(){
|
||||
// createApp(Content).mount('main[role="main"]');
|
||||
|
||||
// // processEtapeLinks();
|
||||
// }
|
||||
|
||||
|
||||
// function onClickEtapeLink(e){
|
||||
// e.preventDefault();
|
||||
|
||||
// let a = e.currentTarget;
|
||||
// let nid = a.dataset.nodeNid;
|
||||
// console.log(nid);
|
||||
|
||||
// getNodeData(nid);
|
||||
|
||||
// return null;
|
||||
// }
|
||||
|
||||
|
||||
// function processEtapeLinks(){
|
||||
// let etape_link_fields = document.querySelectorAll('#etapes-liste div.views-field-title');
|
||||
// etape_link_fields.forEach((field, index) => {
|
||||
// let nid = null;
|
||||
// let classList = field.classList;
|
||||
// classList.forEach((classe) => {
|
||||
// let reg = /data-node-(\d+)/;
|
||||
// let result = classe.match(reg);
|
||||
// if (result) {
|
||||
// nid = result[1];
|
||||
// console.log(nid);
|
||||
// }
|
||||
// })
|
||||
|
||||
// if (nid) {
|
||||
// let a = field.querySelector('a');
|
||||
// a.setAttribute('data-node-nid', nid);
|
||||
// a.addEventListener('click', onClickEtapeLink);
|
||||
// }
|
||||
|
||||
|
||||
// })
|
||||
// }
|
||||
|
||||
// function getNodeData(nid){
|
||||
// const params = {
|
||||
// }
|
||||
// REST.get(`/node/${nid}?_format=json`, params)
|
||||
// .then((data) => {
|
||||
// console.log('user REST getUser data', data)
|
||||
// })
|
||||
// .catch(error => {
|
||||
// console.warn('Issue with getNodedata', error)
|
||||
// Promise.reject(error)
|
||||
// })
|
||||
// }
|
||||
|
||||
init()
|
||||
} // end LeShedTheme()
|
||||
|
||||
LeShedTheme()
|
||||
})(Drupal, drupalSettings)
|
||||
@@ -0,0 +1,13 @@
|
||||
<template>
|
||||
<div>
|
||||
hello HMR TROP TROP BIEN
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,15 @@
|
||||
@import "partials/colors";
|
||||
@import "partials/fonts";
|
||||
@import "partials/mixins";
|
||||
|
||||
a, a:visited{
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
transition: color 0.15s ease-out;
|
||||
}
|
||||
|
||||
body{
|
||||
margin: 0;
|
||||
// background-color: green;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
// $bleu_site: #1642bc;
|
||||
// $bleu_typo: #0b1e52;
|
||||
// $rose: #f661e2;
|
||||
@@ -0,0 +1,29 @@
|
||||
// @import "/assets/fonts/fredoka/stylesheet.css";
|
||||
// @import "/assets/fonts/Schibsted_Grotesk/stylesheet.css";
|
||||
|
||||
|
||||
// body{
|
||||
// font-family: "Schibsted Grotesk";
|
||||
// font-weight: normal;
|
||||
// font-style: normal;
|
||||
// color: $bleu_typo;
|
||||
// }
|
||||
|
||||
// @mixin titre_h2{
|
||||
// font-family: 'Fredoka';
|
||||
// font-size: 3em;
|
||||
// font-weight: 400;
|
||||
// color: $bleu_typo;
|
||||
// line-height: 1;
|
||||
// }
|
||||
|
||||
// @mixin titre_h3{
|
||||
// @include titre_h2();
|
||||
// font-size: 2em;
|
||||
// }
|
||||
|
||||
// @mixin titre_h4{
|
||||
// @include titre_h2();
|
||||
// font-size: 1.323em;
|
||||
// }
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
@mixin menu-contenus{
|
||||
ul,li{
|
||||
padding: 0;
|
||||
margin:0;
|
||||
list-style: none;
|
||||
}
|
||||
.wrapper{
|
||||
position: relative;
|
||||
}
|
||||
label{
|
||||
color:$bleu_site;
|
||||
font-weight: 600;
|
||||
display: block;
|
||||
font-size: 0.756em;
|
||||
padding:0 0 0.25em 0;
|
||||
transition: color 0.25s ease-out;
|
||||
position: absolute;
|
||||
z-index: 0;
|
||||
&:has(+ a:hover){
|
||||
color: $rose;
|
||||
}
|
||||
}
|
||||
a{
|
||||
font-size: 1.13em;
|
||||
transition: color 0.15s ease-out;
|
||||
display: block;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
padding-top: 1em;
|
||||
&:hover{
|
||||
color: $bleu_site;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@mixin card{
|
||||
position: relative;
|
||||
background-color: #fff;
|
||||
padding:2em;
|
||||
box-shadow: 0 0 10px rgba(0,0,0,0.25);
|
||||
max-width: 50em;
|
||||
box-sizing: content-box;
|
||||
margin: 30vh auto 0;
|
||||
&[role="home-presentation"]{
|
||||
margin-top: 10vh;
|
||||
}
|
||||
}
|
||||
|
||||
@mixin arrow{
|
||||
display: block;
|
||||
width:30px; height:30px;
|
||||
border-radius: 15px;
|
||||
background-repeat: no-repeat;
|
||||
background-position: center center;
|
||||
background-size: contain;
|
||||
text-indent: 100px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
@mixin arrow-white{
|
||||
@include arrow();
|
||||
background-image: url('/themes/custom/mathallo/assets/img/arrow-white.svg');
|
||||
}
|
||||
|
||||
@mixin arrow-blue{
|
||||
@include arrow();
|
||||
background-image: url('/themes/custom/mathallo/assets/img/arrow-blue.svg');
|
||||
}
|
||||
Reference in New Issue
Block a user