Coder Social home page Coder Social logo

mnm5774.github.io's Introduction

My portfolio-live site.

Example template of how I am creating elements. Not cleaned up yet.

" /* So the controller should handle the compiling of the content, and calling render. The template should handle the actual creating of the elements, assigning event listeners where needed, and I think handling and hiding each of the elements created as JS objects; which is possible because of my library.

If we modularize each individual item here, and append them in the controller, I think it will make it simpler to add and use these items in other components, reducing code. Also, if I decide to handle external content in the controller, it will be simpler to incorporate it into the new internal content. */ var page1Templates = { // here's what I want: hero: function () { // Here's an example of how we would use variables to simplify changing aspects of a webpage.

/* So here we have an object, which is fed as the argument to create a new MM object. MM
handles the functionality needed to support the object, and changes in these parameters.
*/
var container = {
  type: `div`,
  attributes: {class: `heroclass`, id: `heroid`},
  styles: {
    display: `grid`,
    justifyContent: `center`,
    border: `7px`,
    borderColor: `darkgoldenrod`,
    borderStyle: `hidden hidden outset hidden`,
    backgroundImage: `url('/photos-highres/stars1.jpg')`,
    backgroundSize: `cover`,
    backgroundRepeat: `no-repeat`,
    backgroundColor: `#222`,
    minHeight: `36vw`
  }
};

var title = {
  type: 'h1',
  attributes: {class: 'hero-header'},
  styles: {
    justifySelf: `center`,
    fontSize: `5.0vw`,
    fontFamily: `TimesNewRoman`,
    opacity: `0.5`,
    justifySelf: `center`,
    color: `darkgrey`,
    textRendering: `optimizeLegibility`,
    textShadow: `0px -7px black`
  },
  text: 'The Showcase'
};

var description = {
  type: `a`,
  attributes: {class: `hero-text`},
  styles: {
    alignSelf: `end`,
    paddingBottom: `20px`,
    color: `darkgoldenrod`,
    fontFamily: `TimesNewRoman`,
    fontSize: `1.9vw`
  },
    text: `Welcome. Here is where I showcase my portfolio, play with code and further my
      knowledge.`};
    
// Creating a new object returns that element. This will be the parent element.
// need to figure out how to remove the below step.
var pe = MM (parent);
var he = MM (header);
var ie = MM (intro);

// Append the elements, all inside the parent.
he.append (header.text);
ie.append (intro.text);
pe.append (he, ie);

/*********************************************************************************************
var input = {
  type: 'input',
  attributes: {class: 'test-input'}};
var button = {
  type: 'button',
    text: 'click here'};

var testin = MM (input);
var testbt = MM (button);
pe.append (testin, testbt);

// Here I will build an example function of adding new elements on demand.
// this probably does not belong in the template, but it is working.
function addText () {
  var obj = {
    type: 'div',
    attributes: {class: 'unique-entry'},
      text: testin.value};
  var newEl = MM (obj);
  newEl.append (obj.text);
  pe.append (newEl);
  console.log (pe);
}

testbt.addEventListener ('click', addText);*/

return pe;

}, "

mnm5774.github.io's People

Contributors

jsdelivrbot avatar mnm5774 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.