first version

This commit is contained in:
Josevi Canet
2024-06-14 15:48:06 +02:00
parent 7a1361419a
commit 19403eb4c8
16 changed files with 453 additions and 165 deletions

View File

@@ -2,5 +2,61 @@
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="PhpCSValidationInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
<inspection_tool class="SecurityAdvisoriesInspection" enabled="true" level="WARNING" enabled_by_default="true">
<option name="optionConfiguration">
<list>
<option value="barryvdh/laravel-debugbar" />
<option value="behat/behat" />
<option value="brianium/paratest" />
<option value="codeception/codeception" />
<option value="codedungeon/phpunit-result-printer" />
<option value="composer/composer" />
<option value="doctrine/coding-standard" />
<option value="filp/whoops" />
<option value="friendsofphp/php-cs-fixer" />
<option value="humbug/humbug" />
<option value="infection/infection" />
<option value="jakub-onderka/php-parallel-lint" />
<option value="johnkary/phpunit-speedtrap" />
<option value="kalessil/production-dependencies-guard" />
<option value="mikey179/vfsStream" />
<option value="mockery/mockery" />
<option value="mybuilder/phpunit-accelerator" />
<option value="orchestra/testbench" />
<option value="pdepend/pdepend" />
<option value="phan/phan" />
<option value="phing/phing" />
<option value="phpcompatibility/php-compatibility" />
<option value="phpmd/phpmd" />
<option value="phpro/grumphp" />
<option value="phpspec/phpspec" />
<option value="phpspec/prophecy" />
<option value="phpstan/phpstan" />
<option value="phpunit/phpunit" />
<option value="povils/phpmnd" />
<option value="roave/security-advisories" />
<option value="satooshi/php-coveralls" />
<option value="sebastian/phpcpd" />
<option value="slevomat/coding-standard" />
<option value="spatie/phpunit-watcher" />
<option value="squizlabs/php_codesniffer" />
<option value="sstalle/php7cc" />
<option value="symfony/debug" />
<option value="symfony/maker-bundle" />
<option value="symfony/phpunit-bridge" />
<option value="symfony/var-dumper" />
<option value="vimeo/psalm" />
<option value="wimg/php-compatibility" />
<option value="wp-coding-standards/wpcs" />
<option value="yiisoft/yii2-coding-standards" />
<option value="yiisoft/yii2-debug" />
<option value="yiisoft/yii2-gii" />
<option value="zendframework/zend-coding-standard" />
<option value="zendframework/zend-debug" />
<option value="zendframework/zend-test" />
</list>
</option>
</inspection_tool>
</profile>
</component>

37
.idea/php.xml generated
View File

@@ -7,12 +7,49 @@
<option name="transferred" value="true" />
</component>
<component name="PHPCodeSnifferOptionsConfiguration">
<option name="codingStandard" value="Custom" />
<option name="customRuleset" value="$PROJECT_DIR$/phpcs.xml.dist" />
<option name="highlightLevel" value="WARNING" />
<option name="transferred" value="true" />
</component>
<component name="PhpCodeSniffer">
<phpcs_settings>
<PhpCSConfiguration beautifier_path="$PROJECT_DIR$/vendor/bin/phpcbf" tool_path="$PROJECT_DIR$/vendor/bin/phpcs" />
</phpcs_settings>
</component>
<component name="PhpIncludePathManager">
<include_path>
<path value="$PROJECT_DIR$/vendor/composer" />
<path value="$PROJECT_DIR$/vendor/symfony/finder" />
<path value="$PROJECT_DIR$/vendor/mustache/mustache" />
<path value="$PROJECT_DIR$/vendor/eftec/bladeone" />
<path value="$PROJECT_DIR$/vendor/wp-coding-standards/wpcs" />
<path value="$PROJECT_DIR$/vendor/phpcompatibility/php-compatibility" />
<path value="$PROJECT_DIR$/vendor/phpcompatibility/phpcompatibility-paragonie" />
<path value="$PROJECT_DIR$/vendor/phpcompatibility/phpcompatibility-wp" />
<path value="$PROJECT_DIR$/vendor/dealerdirect/phpcodesniffer-composer-installer" />
<path value="$PROJECT_DIR$/vendor/gettext/gettext" />
<path value="$PROJECT_DIR$/vendor/gettext/languages" />
<path value="$PROJECT_DIR$/vendor/mck89/peast" />
<path value="$PROJECT_DIR$/vendor/sirbrillig/phpcs-changed" />
<path value="$PROJECT_DIR$/vendor/wp-cli/i18n-command" />
<path value="$PROJECT_DIR$/vendor/sirbrillig/phpcs-variable-analysis" />
<path value="$PROJECT_DIR$/vendor/wp-cli/mustangostang-spyc" />
<path value="$PROJECT_DIR$/vendor/wp-cli/php-cli-tools" />
<path value="$PROJECT_DIR$/vendor/wp-cli/wp-cli" />
<path value="$PROJECT_DIR$/vendor/phpcsstandards/phpcsextra" />
<path value="$PROJECT_DIR$/vendor/phpcsstandards/phpcsutils" />
<path value="$PROJECT_DIR$/vendor/squizlabs/php_codesniffer" />
</include_path>
</component>
<component name="PhpStanOptionsConfiguration">
<option name="transferred" value="true" />
</component>
<component name="PhpUnit">
<phpunit_settings>
<PhpUnitSettings custom_loader_path="$PROJECT_DIR$/vendor/autoload.php" />
</phpunit_settings>
</component>
<component name="PsalmOptionsConfiguration">
<option name="transferred" value="true" />
</component>

24
.idea/valier.iml generated
View File

@@ -1,7 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/vendor/composer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/dealerdirect/phpcodesniffer-composer-installer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/eftec/bladeone" />
<excludeFolder url="file://$MODULE_DIR$/vendor/gettext/gettext" />
<excludeFolder url="file://$MODULE_DIR$/vendor/gettext/languages" />
<excludeFolder url="file://$MODULE_DIR$/vendor/mck89/peast" />
<excludeFolder url="file://$MODULE_DIR$/vendor/mustache/mustache" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpcompatibility/php-compatibility" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpcompatibility/phpcompatibility-paragonie" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpcompatibility/phpcompatibility-wp" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpcsstandards/phpcsextra" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpcsstandards/phpcsutils" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sirbrillig/phpcs-changed" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sirbrillig/phpcs-variable-analysis" />
<excludeFolder url="file://$MODULE_DIR$/vendor/squizlabs/php_codesniffer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/finder" />
<excludeFolder url="file://$MODULE_DIR$/vendor/wp-cli/i18n-command" />
<excludeFolder url="file://$MODULE_DIR$/vendor/wp-cli/mustangostang-spyc" />
<excludeFolder url="file://$MODULE_DIR$/vendor/wp-cli/php-cli-tools" />
<excludeFolder url="file://$MODULE_DIR$/vendor/wp-cli/wp-cli" />
<excludeFolder url="file://$MODULE_DIR$/vendor/wp-coding-standards/wpcs" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>

View File

@@ -16,7 +16,8 @@
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
"dealerdirect/phpcodesniffer-composer-installer": true,
"composer/installers": true
}
}
}

View File

@@ -12,5 +12,6 @@
* editor.
*/
body {
@apply bg-background text-foreground font-sans;
@apply bg-background text-tertiary font-sans;
font-size: 18px;
}

View File

@@ -32,11 +32,6 @@
*
* https://make.wordpress.org/core/2021/06/29/on-layout-and-content-width-in-wordpress-5-8/
*/
.page-content > *,
.entry-content > * {
/* Content width from the `theme.json` file */
@apply max-w-content mx-auto;
}
.entry-content > .alignwide {
/* Wide width from the `theme.json` file */
@@ -54,3 +49,97 @@
.entry-content > .alignright {
@apply float-right ml-8;
}
:where(.wp-block-columns) {
margin-bottom: 0 !important;
}
a {
text-decoration: none !important;
}
header {
background-size: cover;
background-position: center;
#site-navigation {
img.linkedin {
height: 1rem;
}
}
.header-cointainer {
@apply pt-6 grid items-center;
height: 75vh;
position: relative
}
.video-container {
overflow: hidden;
width: 100%;
position: absolute;
z-index: 0;
top: 0;
height: 75vh;
video {
width: 100%;
}
}
&:not(.home) {
img.linkedin {
filter: invert(1);
}
h1 {
background-size: cover;
background-position: center;
}
}
}
footer {
ul.menu li::before {
@apply mr-3 italic;
content: "|";
}
}
.contact-block {
@apply relative;
.overlay {
@apply absolute drop-shadow-xl;
top: 15%;
z-index: 1000;
width: 40vw;
margin-left: 15vw;
}
}
.text-over-image {
@apply relative;
overflow: visible;
.text {
@apply absolute;
left: -10vw;
top: 10vw;
}
}
.overlay-icons {
@apply absolute drop-shadow-xl p-5;
width: 40vw;
img {
width: 100px;
}
p {
width: 250px;
}
}

View File

@@ -26,8 +26,8 @@ module.exports = {
require('@_tw/themejson'),
// Uncomment below to add additional first-party Tailwind plugins.
// require('@tailwindcss/forms'),
// require('@tailwindcss/aspect-ratio'),
// require('@tailwindcss/container-queries'),
require('@tailwindcss/forms'),
require('@tailwindcss/aspect-ratio'),
require('@tailwindcss/container-queries'),
],
};

Binary file not shown.

View File

@@ -50,7 +50,8 @@ if ( ! function_exists( 'vlr_setup' ) ) :
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function vlr_setup() {
function vlr_setup()
{
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
@@ -80,8 +81,8 @@ if ( ! function_exists( 'vlr_setup' ) ) :
// This theme uses wp_nav_menu() in two locations.
register_nav_menus(
array(
'menu-1' => __( 'Primary', 'valier' ),
'menu-2' => __( 'Footer Menu', 'valier' ),
'menu-primary' => __('Principal', 'valier'),
'menu-legal' => __('Legal', 'valier')
)
);
@@ -115,8 +116,14 @@ if ( ! function_exists( 'vlr_setup' ) ) :
// Add support for responsive embedded content.
add_theme_support('responsive-embeds');
// Add support for custom logo
add_theme_support('custom-logo');
add_theme_support('custom-header');
// Remove support for block templates.
remove_theme_support('block-templates');
//hidden ACF
add_filter('acf/settings/show_admin', '__return_false');
}
endif;
add_action('after_setup_theme', 'vlr_setup');
@@ -126,12 +133,13 @@ add_action( 'after_setup_theme', 'vlr_setup' );
*
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*/
function vlr_widgets_init() {
function vlr_widgets_init()
{
register_sidebar(
array(
'name' => __( 'Footer', 'valier' ),
'id' => 'sidebar-1',
'description' => __( 'Add widgets here to appear in your footer.', 'valier' ),
'name' => __('Pie', 'valier'),
'id' => 'footer-sidebar',
'description' => __('Añade los widgets para mostrarse en el pie', 'valier'),
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
@@ -139,12 +147,14 @@ function vlr_widgets_init() {
)
);
}
add_action('widgets_init', 'vlr_widgets_init');
/**
* Enqueue scripts and styles.
*/
function vlr_scripts() {
function vlr_scripts()
{
wp_enqueue_style('valier-style', get_stylesheet_uri(), array(), VLR_VERSION);
wp_enqueue_script('valier-script', get_template_directory_uri() . '/js/script.min.js', array(), VLR_VERSION, true);
@@ -152,12 +162,14 @@ function vlr_scripts() {
wp_enqueue_script('comment-reply');
}
}
add_action('wp_enqueue_scripts', 'vlr_scripts');
/**
* Enqueue the block editor script.
*/
function vlr_enqueue_block_editor_script() {
function vlr_enqueue_block_editor_script()
{
if (is_admin()) {
wp_enqueue_script(
'valier-editor',
@@ -172,6 +184,7 @@ function vlr_enqueue_block_editor_script() {
wp_add_inline_script('valier-editor', "tailwindTypographyClasses = '" . esc_attr(VLR_TYPOGRAPHY_CLASSES) . "'.split(' ');", 'before');
}
}
add_action('enqueue_block_assets', 'vlr_enqueue_block_editor_script');
/**
@@ -180,10 +193,12 @@ add_action( 'enqueue_block_assets', 'vlr_enqueue_block_editor_script' );
* @param array $settings TinyMCE settings.
* @return array
*/
function vlr_tinymce_add_class( $settings ) {
function vlr_tinymce_add_class($settings)
{
$settings['body_class'] = VLR_TYPOGRAPHY_CLASSES;
return $settings;
}
add_filter('tiny_mce_before_init', 'vlr_tinymce_add_class');
/**

View File

@@ -11,18 +11,6 @@
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<?php
if ( ! is_front_page() ) {
the_title( '<h1 class="entry-title">', '</h1>' );
} else {
the_title( '<h2 class="entry-title">', '</h2>' );
}
?>
</header><!-- .entry-header -->
<?php vlr_post_thumbnail(); ?>
<div <?php vlr_content_class('entry-content'); ?>>
<?php
the_content();
@@ -36,25 +24,4 @@
?>
</div><!-- .entry-content -->
<?php if ( get_edit_post_link() ) : ?>
<footer class="entry-footer">
<?php
edit_post_link(
sprintf(
wp_kses(
/* translators: %s: Name of current post. Only visible to screen readers. */
__( 'Edit <span class="sr-only">%s</span>', 'valier' ),
array(
'span' => array(
'class' => array(),
),
)
),
get_the_title()
)
);
?>
</footer><!-- .entry-footer -->
<?php endif; ?>
</article><!-- #post-<?php the_ID(); ?> -->

View File

@@ -9,44 +9,33 @@
?>
<footer id="colophon">
<?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?>
<aside role="complementary" aria-label="<?php esc_attr_e( 'Footer', 'valier' ); ?>">
<?php dynamic_sidebar( 'sidebar-1' ); ?>
<footer style="background: url(<?= get_field('footer_image', 'option') ?>)">
<?php if (is_active_sidebar('footer-sidebar')) : ?>
<aside role="complementary" aria-label="<?php esc_attr_e('Footer', 'valier'); ?>" class="container mx-auto ">
<?php dynamic_sidebar('footer-sidebar'); ?>
</aside>
<?php endif; ?>
<div class="container mx-auto">
<a href="<?= get_field('linkedin_link', 'option') ?>" target="_blank"
class="flex justify-center gap-3 items-end mb-2">
<img src="<?= get_field('abrevitura_de_linkedin', 'option') ?>" alt="Linkedin">
<img src="<?= get_field('logo_linkedin', 'option') ?>" alt="Linkedin">
<?php if ( has_nav_menu( 'menu-2' ) ) : ?>
<nav aria-label="<?php esc_attr_e( 'Footer Menu', 'valier' ); ?>">
</a>
</div>
<div class="bg-primary text-black py-2 has-playfair-font-family">
<div class="container mx-auto has-mini-font-size flex justify-center gap-3 italic">
<?= get_field('texto_legal', 'option') ?>
<?php
wp_nav_menu(
array(
'theme_location' => 'menu-2',
'menu_class' => 'footer-menu',
'depth' => 1,
'theme_location' => 'menu-legal',
'container' => false,
'menu_id' => 'menu-legal',
'items_wrap' => '<ul id="%1$s" class="%2$s flex justify-center gap-3" aria-label="submenu">%3$s</ul>',
)
);
?>
</nav>
<?php endif; ?>
<div>
<?php
$vlr_blog_info = get_bloginfo( 'name' );
if ( ! empty( $vlr_blog_info ) ) :
?>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>,
<?php
endif;
/* translators: 1: WordPress link, 2: WordPress. */
printf(
'<a href="%1$s">proudly powered by %2$s</a>.',
esc_url( __( 'https://wordpress.org/', 'valier' ) ),
'WordPress'
);
?>
</div>
</footer><!-- #colophon -->
</div>
</footer>

View File

@@ -7,41 +7,9 @@
* @package Valier
*/
?>
if (is_front_page()) {
get_template_part('template-parts/layout/header', 'home');
} else {
get_template_part('template-parts/layout/header', 'page');
}
<header id="masthead">
<div>
<?php
if ( is_front_page() ) :
?>
<h1><?php bloginfo( 'name' ); ?></h1>
<?php
else :
?>
<p><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
<?php
endif;
$vlr_description = get_bloginfo( 'description', 'display' );
if ( $vlr_description || is_customize_preview() ) :
?>
<p><?php echo $vlr_description; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></p>
<?php endif; ?>
</div>
<nav id="site-navigation" aria-label="<?php esc_attr_e( 'Main Navigation', 'valier' ); ?>">
<button aria-controls="primary-menu" aria-expanded="false"><?php esc_html_e( 'Primary Menu', 'valier' ); ?></button>
<?php
wp_nav_menu(
array(
'theme_location' => 'menu-1',
'menu_id' => 'primary-menu',
'items_wrap' => '<ul id="%1$s" class="%2$s" aria-label="submenu">%3$s</ul>',
)
);
?>
</nav><!-- #site-navigation -->
</header><!-- #masthead -->

View File

@@ -0,0 +1,29 @@
<header id="masthead" style="background-image: url(<?= get_header_image() ?>)" class="home">
<div class="video-container">
<video autoplay muted loop src="<?= get_field('video_header', 'option') ?>"></video>
</div>
<div class="header-cointainer">
<div class="container mx-auto flex justify-between self-start justify-self-start ">
<img src="<?= get_field('logo_home', 'option') ?>" alt="<?= get_bloginfo('name') ?>">
<nav id="site-navigation" aria-label="<?php esc_attr_e('Main Navigation', 'valier'); ?>"
class="has-small-font-size uppercase has-cinzel-font-family flex items-center gap-6">
<?php
wp_nav_menu(
array(
'theme_location' => 'menu-primary',
'container' => false,
'menu_id' => 'menu-primary',
'items_wrap' => '<ul id="%1$s" class="%2$s flex justify-center gap-6 text-white " aria-label="submenu">%3$s</ul>',
)
);
?>
<a href="<?= get_field('linkedin_link', 'option') ?>" target="_blank">
<img src="<?= get_field('abrevitura_de_linkedin', 'option') ?>" alt="Linkedin" class="linkedin">
</a>
</nav>
</div>
<h1 class="self-start justify-self-center has-extreme-font-size has-white-color has-cinzel-font-family uppercase "><?= get_the_title() ?></h1>
</div>
</header>

View File

@@ -0,0 +1,25 @@
<header id="masthead">
<div class="bg-white py-6">
<div class="container mx-auto flex justify-between self-start justify-self-start ">
<?= get_custom_logo() ?>
<nav id="site-navigation" aria-label="<?php esc_attr_e('Main Navigation', 'valier'); ?>"
class="has-small-font-size uppercase has-cinzel-font-family flex items-center gap-6 ">
<?php
wp_nav_menu(
array(
'theme_location' => 'menu-primary',
'container' => false,
'menu_id' => 'menu-primary',
'items_wrap' => '<ul id="%1$s" class="%2$s flex justify-center gap-6 " aria-label="submenu">%3$s</ul>',
)
);
?>
<a href="<?= get_field('linkedin_link', 'option') ?>" target="_blank">
<img src="<?= get_field('abrevitura_de_linkedin', 'option') ?>" alt="Linkedin" class="linkedin">
</a>
</nav>
</div>
</div>
<h1 class="self-start justify-self-center has-extreme-font-size has-white-color has-cinzel-font-family uppercase text-center py-10"
style="background-image: url(<?= get_the_post_thumbnail_url() ?>)"><?= get_the_title() ?></h1>
</header>

View File

@@ -1,39 +1,128 @@
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"$schema": "https:\/\/schemas.wp.org\/trunk\/theme.json",
"version": 2,
"settings": {
"appearanceTools": true,
"color": {
"palette": [
{
"slug": "background",
"color": "#ffffff",
"color": "#ecedf0",
"name": "Background"
},
{
"slug": "foreground",
"color": "#404040",
"name": "Foreground"
},
{
"slug": "primary",
"color": "#b91c1c",
"color": "#b37b20",
"name": "Primary"
},
{
"slug": "secondary",
"color": "#15803d",
"color": "#002e4f",
"name": "Secondary"
},
{
"slug": "tertiary",
"color": "#0369a1",
"color": "#706f6f",
"name": "Tertiary"
}
]
},
"typography": {
"fontFamilies": [
{
"name": "Cinzel",
"slug": "cinzel",
"fontFamily": "\"Cinzel\", serif",
"fontFace": [
{
"fontFamily": "cinzel",
"fontWeight": "400 900",
"fontStyle": "normal",
"fontStretch": "normal",
"src": [
"file:./assets/fonts/Cinzel-VariableFont_wght.ttf"
]
}
]
},
{
"name": "Playfair",
"slug": "playfair",
"fontFamily": "\"Playfair Display\", serif",
"fontFace": [
{
"fontFamily": "playfair",
"fontWeight": "400 900",
"fontStyle": "normal",
"fontStretch": "normal",
"src": [
"file:./assets/fonts/PlayfairDisplay-VariableFont_wght.ttf"
]
}
]
}
],
"fontSizes": [
{
"slug": "mini",
"size": "0.77rem",
"name": "Pequeño"
},
{
"slug": "small",
"size": "0.88rem",
"name": "Pequeño"
},
{
"slug": "regular",
"size": "1rem",
"name": "Normal"
},
{
"slug": "big",
"size": "1.66rem",
"name": "Grande"
},
{
"slug": "extreme",
"size": "2.55rem",
"name": "Enorme"
}
]
},
"spacing": [
{
"units": [
"px",
"em",
"rem",
"vh",
"vw"
]
}
],
"layout": {
"contentSize": "40rem",
"wideSize": "60rem"
"contentSize": "840px",
"wideSize": "1100px"
},
"shadow": {
"presets": [
{
"name": "Small",
"slug": "sm",
"shadow": "0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)"
},
{
"name": "Medium",
"slug": "md",
"shadow": "0 4px 10px 0 rgba( 0, 0, 0, 0.3 )"
},
{
"name": "Large",
"slug": "lg",
"shadow": "0 8px 15px 0 rgba( 0, 0, 0, 0.3 )"
}
]
}
}
}