css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <!-- 

-Dans cet exemple, le paragraphe est positionné aléatoirement à chaque chargement de la page.

-Le style du texte est fait en CSS -> .hello

-Le positionnement top et left est fait avec 2 variables dans p5.js

-OPTIONNEL : on ajoute un léger mouvement en boucle sur le texte en CSS

-->

<p class="hello">
	HELLO!
	<br>
	Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie, enim est eleifend mi, non fermentum diam nisl sit amet erat. Duis semper. Duis arcu massa, scelerisque vitae, consequat in, pretium a, enim. Pellentesque congue. Ut in risus volutpat libero pharetra tempor. Cras vestibulum bibendum augue. Praesent egestas leo in pede. Praesent blandit odio eu enim. Pellentesque sed dui ut augue blandit sodales. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam nibh. Mauris ac mauris sed pede pellentesque fermentum. Maecenas adipiscing ante non diam sodales hendrerit.</p>
            
          
!
            
              body {
	margin: 0; /*pas de marge dans la page*/
	background-color: #F2E9D0; /*la couleur de fond*/
	overflow-x: hidden; /*on enleve le scroll horizontal*/
}

/*La class hello est ici*/
.hello {
	width: 30%; /*largeur du bloc de texte*/
	position: absolute; /*le positionnement du bloc en absolute dans la page*/
	color: #BB5A5A; /*la couleur du texte*/
	font-family: 'Roboto Mono', monospace; /*la google font*/
	font-weight: 900; /*la graisse de la font*/
	border-left: 3px solid #BB5A5A; /*la bordure gauche du texte*/
	padding-left: 20px; /*on pousse le texte de 20px vers la droite pour ne pas qu'il colle la bordure*/
	
	
	/*OPTIONNEL : on ajoute une animation css pour faire un léger déplacement de va-et-vient sur le texte*/
	animation: viber 5s infinite;
	animation-direction: alternate;
}


/*OPTIONNEL : les paramétres de l'animation de 0% à 100%*/
@keyframes viber {
  0% {
    -webkit-transform: translate(0, 0);
            transform: translate(0, 0);
  }
  100% {
    -webkit-transform: translate(10px, 12px);
            transform: translate(10px, 12px);
  }
}
            
          
!
            
              var texte1;
var deplaceLeft;
var deplaceTop;

function setup() {
	
		createCanvas (
		window.innerWidth,
		window.innerHeight
	);
	
	texte1 = select('.hello');
	deplaceLeft = random(0,800);
	deplaceTop = random(0,600);
	
}

function draw() {
	texte1.style('left', deplaceLeft + 'px');
	texte1.style('top', deplaceTop + 'px');
}


            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console