Author: Per Thykjaer Jensen

  • SoMe-Menu

    SoMe-Menu

    Sådan laver du en SoMe-menu.

    • Lav en menu
    • Rediger menuen (tandhjul)
    • Placer markøren på

    Når du klikker på + kan nye ikoner tilføjes. Vælg de sociale mediekanaler, som du bruger.

    Klik på ikonet og tilføj url’en til din SoMe-kanal:

    Her er det i.ø. lidt træls, hvis du har en sort baggrund. For så kan du ikke se dette +.

  • Stable Diffusion – free AI image creation

    Stable Diffusion – free AI image creation

    Fun and easy to use. More usable than Dall E2 because you don’t have to pay and pay.









    My only complaint is the apparent all american scare of the human body. Untill now most socalled AI has a moral like an ultra-conservative missionary from the Bible Belt in the US. The images will never leave the scope of “cute’ism”. Which will exclude most major art forms.




  • Matt Mullenweg’s visions for WP 2022 and on

    Matt Mullenweg’s visions for WP 2022 and on

    Matt Mullenweg’s great and inspiring talk in New York, December 2022. Looking back on the development of WP during 2022 – and some visions for the future.

    Among the features Matt mentions was:

  • How to use jQuery in a Page or Post

    How to use jQuery in a Page or Post

    In order to use jQuery you must get the library. Here we’ll use a CDN. You can import the jQuery CDN in a custom HTML block, like this:

    <script
      src="https://code.jquery.com/jquery-3.6.3.min.js"
      integrity="sha256-pvPw+upLPUjgMXY0G+8O0xUf+/Im1MZjXxxgOcBQBXU="
      crossorigin="anonymous"></script>

    That’s it. Now you can use jQuery.

    Just for the Hell of it, let’s try and create a button that will hide/show all <p> tags. Select the button, and give it an id. You can do this in advanced settings. Here the id is removeP.

    Here is the code that should remove the <p>-elements. Add the script tag to a custom HTML block:

    <script>
    $('#removeP').click(function(){
       $('p').toggle(777);
    })
    </script>
    

    The code above will detect a click event on the button. We gave the button the id removeP. When a click is detected a new selector will mark all <p> elements and toggle them. A toggle is a bit like a normal on/off switch on the wall. If the elements are visible they will hide away. Or vice versa. The number in the parethesis (777) is the number of microseconds that the toggle animation will last.

    Now try to click the button. Does it work as intended?

  • How to Integrate JavaScript Libraries in WordPress

    How to Integrate JavaScript Libraries in WordPress

    JavaScript libraries can add cool animations or parallax effects to a traditional webpage in HTML, CSS and JavaScript. Here you can learn how to do the same thing in the WordPress editor.

    Case: Animate on Scroll (AOS)

    Animate on Scroll is a populer animation library. In order to use the library on a single WP page or post you’ll have to load the CSS and JavaScript. Do this in a custom HTML block looking somewhat like this in the <head> section – or at least before the blocks you want to animate:

    <link rel="stylesheet" href="https://unpkg.com/aos@next/dist/aos.css" />

    This will load the CSS. At the bottom of your page/post you’ll have to load the script in a custom HTML-block:

    <script src="https://unpkg.com/aos@next/dist/aos.js"></script>
      <script>
        AOS.init();
      </script>

    Now you can add the custom code, that will animate for instance an image. Let’s try this with my logo:

    Now select the block in the List View. Click the kebab menu, and select “Edit as HTML“.

    Now you can see the WP “markup”, and add whatever code you fancy. For instance if you want to flip the image you’ll need code around these lines:

    In the HTML block add data-aos=”flip-up” to the image tag:

    <figure class="wp-block-image size-full">
    
    <img data-aos="flip-up" src="https://multimusen.dk/wp-content/uploads/cropped-cropped-multimusen-150-150-1.png" alt="" class="wp-image-9017"/>
    
    </figure>

    Now test the page. With a little luck the image will flip.

    More Libraries

    Now you should be able to integrate all kinds of JavaScript libraries to your pages and posts. Just remember to load the code in the correct position:

    • Load CSS before the blocks you want to manipulate.
    • Load the JavaScript as close to the bottom of your page as possible.

    By your own research try to add effects to your pages and posts, such as:

    • Parallax
    • Animation
    • even jQuery might work
    • Bootstrap
    • etc.
    • et
    • cetera


  • Dall E2 – is it Art or just pictures?

    Dall E2 – is it Art or just pictures?

    The image processing program Dall E2 is very popular these days. In the interface you write a few words, and then a picture will come up. They even suggest that you add style concepts, such as “oil painting” or style.

    Now the part of me that is art historian gets curious. Can this AI create Art. That is Art with a capital A. Does the AI really know styles? Let’s give it a spin and see.

    A Croquis Model?

    One of the standard exercises in the craft of art is croquis model drawing. That is: drawing after a nude model in order to learn the geometry and composition of the human body. How good is AI for this purpose? Can we get a decent croquis model via AI?

    Mostly you get a negative answer like this:

    So nudity is not allowed. Hence croquis is not permitted in Dall E2.

    This will exclude art inspiration from most of the art history from renaissance artists like Leonardo da Vinci (1452 – 1519) and Michelangelo (1475 – 1564) to contemporary art.

    And this will also exclude most of the known works from the classical greek and roman art.

    Here are some suggestions for croquis in oil paint. These suggestions are not croquis at all:

    Above: a gallery with socalled “croquis in oil paint”.

    So in the case scenario the AI does not know what it is doing. Leonardo’s drawing of the Vitruvian Man which is based on croquis studies of the geometry of the human body would simply not be permitted in Dall E2 because of the prudish policies of our time – probably based on an irrational angst of the human bodily functions.

    Above: Leonardo da Vinci’s “Vitruvian Man”. The renaissance rediscovered the human body and were inspired by the architecture and sculptures of ancient Greece and Roman culture.

    So much for croquis. Here the AI fails. But how about the styles of art history? Does the AI have any clues about that?

    Art History Styles

    If anything should count as artificial intelligence we would asume a keen knowledge of the styles of art history. Here I’ve made experiments with more success, but the knowledge of art styles seems limited to our time – perhaps from the impressionists to pop art.

    I’ve made a few excursions here. Let’s see what happens with a few art styles.

    Prompt: 16th century tarot card “The Universe”. A decent attempt by Dall E-2, but the style is definitely not like anything 16th century.

    Prompt: “Mouse and elephant in surrealist style“. Dall E2 is decent at “surrealist images”. They are more in the grand imitated style from Salvador Dali or Wilhemlm Freddie than the more abstract Miro.

    Of course the satirical critique of society, the surrealist focus on freudian inspired libido and erotic images will be totally removed by the censorship of Dall E2. It will just use the outer form of surrealism.

    In that sense the output from Dall E2 will never become a real disturbing avant garde critique of society. Surrealism wants to provoke. Dall E2 is an attempt to please.

    Prompt: “A mouse and the moon in renaissance style“. A cute image, indeed. But the style is definitely not looking like anything from the renaissance.

    Andy Warhol in Heaven” – well it is close to pop art. Probably Andy could have created some artworks via Dall E2’s AI. However, Andy used to say:

    “I want to be a machine.”

    Art? Really?

    My anwer is definitely no. The pictures from Dall E2 are just pictures.

    However, the pictures from Dall E2 could be used by an artist like the dadaist readymades or the odd surrealist object trouve. So here we may perhaps weird connotations from Salvador to Dall E2. In that sense the randomized output from an artistic prompt could be considered art – but only if it is the will of the artist.

    First of all the purist approach to the web will block the free expression of artists. The croquis sample falsified Dall E2 as Art because of the limitations inspired by “online moral attitudes”. The artistic expressions are limited to Disney-like bodies that are without any form of gender attributes.

    Dall E2’s knowledge of art history styles is very limited. “Oil painting” hardly qualifies as a style. Pixels are not oil paint. So we’re somewhat in a surrealist tradition according to Magritte’s work: Ceci n’est pas une pipe.

    I tried several times to see if the AI was able to reproduce something looking like an art style. Surrealism and Pop Art was somewhat decent. However, if you try to get a work in a renaissance, medieval or rokoko style the AI will fail – at least untill the creative forces behind Dall E2 feeds the system with that kind of images and data (which is not the same as knowledge or wisdom).

    To me it seems like the programmers have a limited knowledge about art history and styles.

    At a certain point I tried to help the AI with rokoko style. Even “manierist style virgin and death” was too much for the artificial “intelligence”.

    If you want to create cute, innocent, undangerous, neat pictures that will not offend anybody in any way whatsoever Dall E2 is a nice tool. But don’t even try something like:

    Death of the virgin in gothic style

    Probably the AI does not know, that the gothic style is medieval – like the great cathedrals. And that death of the virgin is a classic motive in christian iconography.

    Death of the Virgin in gothic style, from an illuminated medieval manuscript. Dall E2 refused to create such an image. The AI has an extremely limited understanding af art history.

    To me it seems like the socalled Dark Ages were far more enlightened than our present day AI.

    Conclusion: is this Art?

    Dall-e wants to please. The moral of the thing seems like the sick repressed moral you find in bookbanning highschools in midwest USA. Luckily Dall-e is not iconoclasst. Thou shallt not provoke. Never ever show the human body as it is actually made by whatever create them in their image. Especially the things found in the center around the pelvis.

    Dall-e’s knowledge of art history is not impressing at all. They steal the name of the great Salvador Dalí in order to create cute images. But Dalí wanted to create surrealist paranoiac-critical images. Surrealism was against the facism – and they attaced the norms of the society.

    Since Dall-e refuses to show nudity and the knowledge of art history is extremely poor you will never get images that mimic the style of say ancient greece or renaissance art.

    So will Dall-e create art, or just images. I my humble oppinion Dall-e will just create images. O course skilled artist can use such images in an art project – when it comes to art the AI will not make artists as long as the balls of art are removed from the mental model. The images from Dall-e are just images and the have absolutely noting to do with art.

    But why use such images at all? Well, sometimes such images come in handy. You can use them as long as you do not confuse them with Art.

    Art vs. Image

    Last attemt let Dall-e mimici Dalí. Prompt: “create a surrealist image like Salvador Dali that will attack the bourgeois angst of nudity“.

    The outer form is there, but why are all the figures castrated? This robot attempt to please is even more creepy than the surrealists ever were.

    The image to the right was made by Salvador Dalí (1904 – 1984) in 1936 as a protest against the barbaric civil war: “Soft Construction with Boiled Beans – (Premonition of Civil War)“. (Source: Wikimedia).

  • How to add a simple login to a web page

    How to add a simple login to a web page

    Do you need to hide or protect content on a web page. Here is a simple, but not 100% secure way to add a log on.

    If the images are under copyright you might have a point in keeping the cards somewhat close. Here you can add a .gitignore file (you can choose to ignore a file or folder before you push). In that case you could share the code – but keep the images to yourself.

    First hide everything: https://www.sitepoint.com/hide-elements-in-css/ 

    Then add a log on to the web page. This can be done in JavaScript. Just add an input field, and select a codeword, say “cheesecake”. Now encrypt the word by an online service such as https://www.md5online.org/md5-encrypt.html 

    Then you’ll get this string: 5ac5355b84894ede056ab81b324c4675

    In the CSS add a style that will hide everything. You can do this by hiding the <body> element. You can do this via JavaScript also.

    You can use prompt in order to get the password from the user. https://www.w3schools.com/jsref/met_win_prompt.asp

    Now you can compare the input from the form with the string – and display what’s on the webpage, e.g. via a window.open() 

    if (myCode == "5ac5355b84894ede056ab81b324c4675"){
    
          // here: display the page content
    
               body.style.display = "block"
    
    } else {
    
              // error message
    
              document.write("No access")
    
    }
    

    Probably your user don’t want to log in every time. Here you can save a true for logged in in local storage / session storage.

    Protecting a Web page in .htacces

    Now the solution above is not 100% secure. A better way to protect your pages is by .htaccess. Here you can follow my tutorial on YouTube.

  • Calculate Age

    Calculate Age

    A JavaScript age calculator – when you need to know the exact age of a person.

    If you want to use the age calculator as a web app then use this URI.

    The code is based on this turotial from Tutorials Tonight.

  • PWA: Webapp with Push in WordPress

    PWA: Webapp with Push in WordPress

    A web app is an application made by web technologies. The web app will run similar to a native app, that is if the user agrees to install the web app on the device. Several WordPress plugins are able to do this.

    Creating a web app i WordPress is surprisingly easy. But make sure, that your web solution looks cool on mobile devices during your design. Probably one or more elements will need some CSS tweaks.

    Here I don’t recommend page builders such as Elementor, Divi &c.

    Plugin: PWA for WP & AMP

    Install this PWA plugin:

    It’s easy to use and works in most mobile browsers:

    • Chrome: works like a charm. You’ll get a “want to install” message. That’s it.
    • AdBlock: you have to install the app manually. However, that’s what we’d expect from this browser, isn’t it?

    Push Notifications

    Here you have to add a plugin to the plugin. After that create a user profile. Add the token to the PWA plugin. Now pushing should be possible. That is in theory.

    When I run the browser version, I’m asked whether notifications are ok. Just answer yeah here. Below: the plugin for push notifications.

    Pro & Con

    • Pro: a web app will run without web connection if the pages are cached. The pages visited will be cached too. And the app is fast.
    • Con: why install yet another app when you can just browse the web?
    • Con: When the app is active the cashe now and then work in unexpected ways. You may see old versions of new pages. Because of this I removed the app.
  • WP.tv: Demystifying theme.json

    WP.tv: Demystifying theme.json

    These days I’m following tutorials about block theme development. In these articles I’ll collect the best of them.

    In the excellent WordPress.tv series Nick Diego has this workshop about theme.json. Topics covered are:

    • How to add fonts
    • Color palette – and how to use the variables
    • Style variations
    • How to use the Child Theme plugin

    If theme.json seems baflfing to you Nick’s video is a very good walthrough.

    One of the participants asked about child themes. Nick answered that the child theme is still possible. It’s useful for theme variations. The only file you need to edit in the child theme could be theme.json.

    The idea seems good, since you would get the benefit from theme updates. If you create a simple copy of a theme, you will not get such updates.

  • WordPress: wrap columns so that the right one gets on top on mobile devices

    WordPress: wrap columns so that the right one gets on top on mobile devices

    Normally WP will wrap the columns after a manner where the right one goes to the bottom om mobile devices. Here is a recipe:

    Add a class to your column block

    In additional classes add your class. In this case I added: petjReverse as my class.

    style.css

    Then add the this to your style.css:

    /* Mobile, Tablet */
    @media only screen and (max-width: 783px) {
    
       /* will stack reversed */
       .petjReverse {
    	   flex-wrap: wrap-reverse !important;
       }
    	
    }

    Save and update. If need be clear the cache in WordPress and your browser. That’s it.

  • WP.TV: Columns

    WP.TV: Columns

    Nick Diego gives a fine demonstration of how to use columns, rows and stacks. There are also suggestions for some custom CSS that’s reusable.

    Building with Columns, Groups, Rows and Stacks. Source: WordPress.TV

    Part of the reusable CSS is this:

    body * {
       box-sizing: border-box;
    }
Enable Notifications OK No thanks

We use cookies - more information

Multimusen.dk will set a few cookies from Doubleclick, Google and the Social Media plugins they ay set some cookies. Some of my pages use APIs - such as YouTube, LinkedIn, Google Fonts, Google Maps, Mapbox, Spotify, Jetpack, Twitter, Facebook &c.. Such plugins may set the odd cookie.

Close