Web Development

There are a few ways to make a website.

Or you can use a frameworks such as

Sections

Getting Started

Angular

Node

Posthere.io

Static Website

Building a Material Theme

https://material.io/resources/build-a-material-theme

Creating a favicon for browser tab website icon

https://favicon.io/

Copy text to clipboard in Javascript

Copy text to clipboard in javascript:

Found at https://codepen.io/Mestika/pen/NxLzNq published by Emil Devantie Brockdorff

html:

<div class="wrap">
<input type="text" placeholder="Write some text you want to copy" />
<button>Copy my text</button>
<br />
<br />
<br />

<textarea placeholder="Try to copy stuff out here!"></textarea>
</div>

css:

body{
  width: 100%;
  height: 100%;
  margin-top: 40px;
}

.wrap{
  width: 300px;
  margin: 0 auto;
}

input, textarea, button{
  width: 100%;
}
button{
  margin-top: 10px;
}

textarea{
  width: 200px;
  height: 200px;
}

.divide{
  height: 20px;
}

javascript:

$('button').click(function(){
  var txt = $('input').val();
  if(!txt || txt == ''){
    return;
  }
  
  copyTextToClipboard(txt);
  $('textarea').val('').focus();
});

function copyTextToClipboard(text) {
  var textArea = document.createElement("textarea");

  textArea.style.position = 'fixed';
  textArea.style.top = 0;
  textArea.style.left = 0;
  textArea.style.width = '2em';
  textArea.style.height = '2em';
  textArea.style.padding = 0;
  textArea.style.border = 'none';
  textArea.style.outline = 'none';
  textArea.style.boxShadow = 'none';
  textArea.style.background = 'transparent';
  textArea.value = text;
  document.body.appendChild(textArea);
  textArea.select();
  try {
    var successful = document.execCommand('copy');
    var msg = successful ? 'successful' : 'unsuccessful';
    console.log('Copying text command was ' + msg);
  } catch (err) {
    console.log('Oops, unable to copy');
  }
  document.body.removeChild(textArea);
}

Journal