Wszystkie wpisy, których autorem jest admin

Sofa Sans: a Typeface Created with IKEA’s Couch Creator Tool

Post pobrano z: Sofa Sans: a Typeface Created with IKEA’s Couch Creator Tool

IKEA tries to innovate regularly and adapt their way of selling to their clients’ evolving buying habits. As part of this innovating mindset, they released a pretty cool couch building online tool.

Things did not go exactly as they planned, as users quickly started to have a lot of fun with the tool and built funny couches. Twitter users in particular started to share ridiculous couches, like a $15’000 couch or the fortress couch.

A user even spelled out the word couch with IKEA’s tool, which brought IKEA’s reaction to design an entire font with it: Soffa Sans.

A letter detail.
The entire font, isometric view.
The entire font, top view.

Thanks for being a subscriber, here is your FREE house vector icons set.

Sofa Sans: a Typeface Created with IKEA’s Couch Creator Tool

Post pobrano z: Sofa Sans: a Typeface Created with IKEA’s Couch Creator Tool

IKEA tries to innovate regularly and adapt their way of selling to their clients’ evolving buying habits. As part of this innovating mindset, they released a pretty cool couch building online tool.

Things did not go exactly as they planned, as users quickly started to have a lot of fun with the tool and built funny couches. Twitter users in particular started to share ridiculous couches, like a $15’000 couch or the fortress couch.

A user even spelled out the word couch with IKEA’s tool, which brought IKEA’s reaction to design an entire font with it: Soffa Sans.

A letter detail.
The entire font, isometric view.
The entire font, top view.

Thanks for being a subscriber, here is your FREE house vector icons set.

Sofa Sans: a Typeface Created with IKEA’s Couch Creator Tool

Post pobrano z: Sofa Sans: a Typeface Created with IKEA’s Couch Creator Tool

IKEA tries to innovate regularly and adapt their way of selling to their clients’ evolving buying habits. As part of this innovating mindset, they released a pretty cool couch building online tool.

Things did not go exactly as they planned, as users quickly started to have a lot of fun with the tool and built funny couches. Twitter users in particular started to share ridiculous couches, like a $15’000 couch or the fortress couch.

A user even spelled out the word couch with IKEA’s tool, which brought IKEA’s reaction to design an entire font with it: Soffa Sans.

A letter detail.
The entire font, isometric view.
The entire font, top view.

Thanks for being a subscriber, here is your FREE house vector icons set.

Design Deals for the Week

Post pobrano z: Design Deals for the Week

Every week, we’ll give you an overview of the best deals for designers, make sure you don’t miss any by subscribing to our deals feed. You can also follow the recently launched website Type Deals if you are looking for free fonts or font deals.

Sofa Sans: 18 Hand-Drawn Sans-Serif Fonts

Sofa Sans’ handcrafted character is friendly and eye-catching. Stylish features and alternates add personality while letting you create unique logos and stunning headlines. The font family boasts 18 different fonts and 4 unique weights from a monolinear Thin to Black, each containing more than 1000 glyphs and plenty of OpenType features.

$9 instead of $87 – Get it now!

The 10 for 10 Bundle

10 Font Families for JUST $10. This incredible bundle has been reduced by 93% for a limited time only. Don’t miss out!

$10 instead of $135 – Get it now!

Gorgeous Luxury Khatija Calligraphy Script Font 

This exclusive deal from 38 Lineart Studio offers up one stunning calligraphy script font. Khatija Calligraphy mixes elegant letters with a modern touch to create the perfect typeface for creating everything from invitations to packaging. OpenType features such as alternate characters and ligatures give this beauty real flexibility for your latest masterpiece.

$7 instead of $24 – Get it now!

The X Bundle: 2,400 Unique Design Elements from 5 Different Artists

The X Bundle isn’t just a bundle. It’s more of a mega bundle since it’s made up of 5 distinct bundles itself. Packed with more than 2,400 items from fonts to icons to patterns, this breathtaking collection features all kinds of themes from animals to plants to abstract designs. Whether you’re creating wedding invitations, apparel or company branding, this mega bundle will set you up for a long time coming.

$24 instead of $2822 – Get it now!

50 Custom Full-Color Coasters from Sticker Mule

This coffee-table friendly collection from Sticker Mule features 50 custom coasters in one deeply discounted deal. Upload your artwork and within just 4 days, your full-color coasters will ship! These thick, premium coaster board coasters are great to Impress your friends and family or for work or your own business.

$9 instead of $65 – Get it now!

Thanks for being a subscriber, here is your FREE house vector icons set.

Design Deals for the Week

Post pobrano z: Design Deals for the Week

Every week, we’ll give you an overview of the best deals for designers, make sure you don’t miss any by subscribing to our deals feed. You can also follow the recently launched website Type Deals if you are looking for free fonts or font deals.

Sofa Sans: 18 Hand-Drawn Sans-Serif Fonts

Sofa Sans’ handcrafted character is friendly and eye-catching. Stylish features and alternates add personality while letting you create unique logos and stunning headlines. The font family boasts 18 different fonts and 4 unique weights from a monolinear Thin to Black, each containing more than 1000 glyphs and plenty of OpenType features.

$9 instead of $87 – Get it now!

The 10 for 10 Bundle

10 Font Families for JUST $10. This incredible bundle has been reduced by 93% for a limited time only. Don’t miss out!

$10 instead of $135 – Get it now!

Gorgeous Luxury Khatija Calligraphy Script Font 

This exclusive deal from 38 Lineart Studio offers up one stunning calligraphy script font. Khatija Calligraphy mixes elegant letters with a modern touch to create the perfect typeface for creating everything from invitations to packaging. OpenType features such as alternate characters and ligatures give this beauty real flexibility for your latest masterpiece.

$7 instead of $24 – Get it now!

The X Bundle: 2,400 Unique Design Elements from 5 Different Artists

The X Bundle isn’t just a bundle. It’s more of a mega bundle since it’s made up of 5 distinct bundles itself. Packed with more than 2,400 items from fonts to icons to patterns, this breathtaking collection features all kinds of themes from animals to plants to abstract designs. Whether you’re creating wedding invitations, apparel or company branding, this mega bundle will set you up for a long time coming.

$24 instead of $2822 – Get it now!

50 Custom Full-Color Coasters from Sticker Mule

This coffee-table friendly collection from Sticker Mule features 50 custom coasters in one deeply discounted deal. Upload your artwork and within just 4 days, your full-color coasters will ship! These thick, premium coaster board coasters are great to Impress your friends and family or for work or your own business.

$9 instead of $65 – Get it now!

Thanks for being a subscriber, here is your FREE house vector icons set.

Weekly Platform News: HTML Inspection in Search Console, Global Scope of Scripts, Babel env Adds defaults Query

Post pobrano z: Weekly Platform News: HTML Inspection in Search Console, Global Scope of Scripts, Babel env Adds defaults Query

In this week’s look around the world of web platform news, Google Search Console makes it easier to view crawled markup, we learn that custom properties aren’t computing hogs, variables defined at the top-level in JavaScript are global to other page scripts, and Babel env now supports the defaults query — plus all of last month’s news compiled into a single package for you.

Easier HTML inspection in Google Search Console

The URL Inspection tool in Google Search Console now includes useful controls for searching within and copying the HTML code of the crawled page.

Note: The URL Inspection tool provides information about Google’s indexed version of a specific page. You can access Google Search Console at https://search.google.com/search-console.

(via Barry Schwartz)

CSS properties are computed once per element

The value of a CSS custom property is computed once per element. If you define a custom property --func on the <html> element that uses the value of another custom property --val, then re-defining the value of --val on a nested DOM element that uses --func won’t have any effect because the inherited value of --func is already computed.

html {
  --angle: 90deg;
  --gradient: linear-gradient(var(--angle), blue, red);
}

header {
  --angle: 270deg; /* ignored */
  background-image: var(--gradient); /* inherited value */
}

(via Miriam Suzanne)

The global scope of scripts

JavaScript variables created via let, const, or class declarations at the top level of a script (<script> element) continue to be defined in subsequent scripts included in the page.

Note:Axel Rauschmayer calls this the global scope of scripts.”)

(via Surma)

Babel env now supports the defaults query

Babel’s env preset (@babel/preset-env) now allows you to target browserslist’s default browsers (which are listed at browsersl.ist). Note that if you don’t specify your target browsers, Babel env will run every syntax transform on your code.

{
  "presets": [
    [
      "@babel/preset-env",
      {
        "targets": { "browsers": "defaults" }
      }
    ]
  ]
}

(via Nicolò Ribaudo)

All the June 2019 news that’s fit to… print

For your convenience, I have compiled all 59 news items that I’ve published throughout June into one 10-page PDF document.

Download PDF

The post Weekly Platform News: HTML Inspection in Search Console, Global Scope of Scripts, Babel env Adds defaults Query appeared first on CSS-Tricks.

Protecting Vue Routes with Navigation Guards

Post pobrano z: Protecting Vue Routes with Navigation Guards

Authentication is a necessary part of every web application. It is a handy means by which we can personalize experiences and load content specific to a user — like a logged in state. It can also be used to evaluate permissions, and prevent otherwise private information from being accessed by unauthorized users.

A common practice that applications use to protect content is to house them under specific routes and build redirect rules that navigate users toward or away from a resource depending on their permissions. To gate content reliably behind protected routes, they need to build to separate static pages. This way, redirect rules can properly handle redirects.

In the case of Single Page Applications (SPAs) built with modern front-end frameworks, like Vue, redirect rules cannot be utilized to protect routes. Because all pages are served from a single entry file, from a browser’s perspective, there is only one page: index.html. In a SPA, route logic generally stems from a routes file. This is where we will do most of our auth configuration for this post. We will specifically lean on Vue’s navigation guards to handle authentication specific routing since this helps us access selected routes before it fully resolves. Let’s dig in to see how this works.

Roots and Routes

Navigation guards are a specific feature within Vue Router that provide additional functionality pertaining to how routes get resolved. They are primarily used to handle error states and navigate a user seamlessly without abruptly interrupting their workflow.

There are three main categories of guards in Vue Router: Global Guards, Per Route Guards and In Component Guards. As the names suggest, Global Guards are called when any navigation is triggered (i.e. when URLs change), Per Route Guards are called when the associated route is called (i.e. when a URL matches a specific route), and Component Guards are called when a component in a route is created, updated or destroyed. Within each category, there are additional methods that gives you more fine grained control of application routes. Here’s a quick break down of all available methods within each type of navigation guard in Vue Router.

Global Guards

  • beforeEach: action before entering any route (no access to this scope)
  • beforeResolve: action before the navigation is confirmed, but after in-component guards (same as beforeEach with this scope access)
  • afterEach: action after the route resolves (cannot affect navigation)

Per Route Guards

  • beforeEnter: action before entering a specific route (unlike global guards, this has access to this)

Component Guards

  • beforeRouteEnter: action before navigation is confirmed, and before component creation (no access to this)
  • beforeRouteUpdate: action after a new route has been called that uses the same component
  • beforeRouteLeave: action before leaving a route

Protecting Routes

To implement them effectively, it helps to know when to use them in any given scenario. If you wanted to track page views for analytics for instance, you may want to use the global afterEach guard, since it gets fired when the route and associated components are fully resolved. And if you wanted to prefetch data to load onto a Vuex store before a route resolves, you could do so using the beforeEnter per route guard.

Since our example deals with protecting specific routes based on a user’s access permissions, we will use in component navigation guards, namely the beforeEnter hook. This navigation guard gives us access to the proper route before the resolve completes; meaning that we can fetch data or check that data has loaded before letting a user pass through. Before diving into the implementation details of how this works, let’s briefly look at how our beforeEnter hook fits into our existing routes file. Below, we have our sample routes file, which has our protected route, aptly named protected. To this, we will add our beforeEnter hook to it like so:

const router = new VueRouter({
  routes: [
    ...
    {
      path: "/protected",
      name: "protected",
      component: import(/* webpackChunkName: "protected" */ './Protected.vue'),
      beforeEnter(to, from, next) {
        // logic here
      }
  ]
})

Anatomy of a route

The anatomy of a beforeEnter is not much different from other available navigation guards in Vue Router. It accepts three parameters: to, the “future” route the app is navigating to; from, the “current/soon past” route the app is navigating away from and next, a function that must be called for the route to resolve successfully.

Generally, when using Vue Router, next is called without any arguments. However, this assumes a perpetual success state. In our case, we want to ensure that unauthorized users who fail to enter a protected resource have an alternate path to take that redirects them appropriately. To do this, we will pass in an argument to next. For this, we will use the name of the route to navigate users to if they are unauthorized like so:

next({
  name: "dashboard"
})

Let’s assume in our case, that we have a Vuex store where we store a user’s authorization token. In order to check that a user has permission, we will check this store and either fail or pass the route appropriately.

beforeEnter(to, from, next) {
  // check vuex store //
  if (store.getters["auth/hasPermission"]) {
    next()
  } else {
    next({
      name: "dashboard" // back to safety route //
    });
  }
}

In order to ensure that events happen in sync and that the route doesn’t prematurely load before the Vuex action is completed, let’s convert our navigation guards to use async/await.

async beforeEnter(to, from, next) {
  try {
    var hasPermission = await store.dispatch("auth/hasPermission");
    if (hasPermission) {
      next()
    }
  } catch (e) {
    next({
      name: "dashboard" // back to safety route //
    })
  }
} 

Never forget where you came from

So far our navigation guard fulfills its purpose of preventing unauthorized users access to protected resources by redirecting them to where they may have come from (i.e. the dashboard page). Even so, such a workflow is disruptive. Since the redirect is unexpected, a user may assume user error and attempt to access the route repeatedly with the eventual assumption that the application is broken. To account for this, let’s create a way to let users know when and why they are being redirected.

We can do this by passing in a query parameter to the next function. This allows us to append the protected resource path to the redirect URL. So, if you want to prompt a user to log into an application or obtain the proper permissions without having to remember where they left off, you can do so. We can get access to the path of the protected resource via the to route object that is passed into the beforeEnter function like so: to.fullPath.

async beforeEnter(to, from, next) {
  try {
    var hasPermission = await store.dispatch("auth/hasPermission");
    if (hasPermission) {
      next()
    }
  } catch (e) {
    next({
      name: "login", // back to safety route //
      query: { redirectFrom: to.fullPath }
    })
  }
}

Notifying

The next step in enhancing the workflow of a user failing to access a protected route is to send them a message letting them know of the error and how they can solve the issue (either by logging in or obtaining the proper permissions). For this, we can make use of in component guards, specifically, beforeRouteEnter, to check whether or not a redirect has happened. Because we passed in the redirect path as a query parameter in our routes file, we now can check the route object to see if a redirect happened.

beforeRouteEnter(to, from, next) {
  if (to.query.redirectFrom) {
    // do something //
  }
}

As I mentioned earlier, all navigation guards must call next in order for a route to resolve. The upside to the next function as we saw earlier is that we can pass an object to it. What you may not have known is that you can also access the Vue instance within the next function. Wuuuuuuut? Here’s what that looks like:

next(() => {
  console.log(this) // this is the Vue instance
})

You may have noticed that you don’t technically have access to the this scope when using beforeEnter. Though this might be the case, you can still access the Vue instance by passing in the vm to the function like so:

next(vm => {
  console.log(vm) // this is the Vue instance
})

This is especially handy because you can now create and appropriately update a data property with the relevant error message when a route redirect happens. Say you have a data property called errorMsg. You can now update this property from the next function within your navigation guards easily and without any added configuration. Using this, you would end up with a component like this:

<template>
  <div>
    <span>{{ errorMsg }}</span>
    <!-- some other fun content -->
    ...
    <!-- some other fun content -->
  </div>
</template>
<script>
export default {
  name: "Error",
  data() {
    return {
      errorMsg: null
    }
  },
  beforeRouteEnter(to, from, next) {
    if (to.query.redirectFrom) {
      next(vm => {
        vm.errorMsg =
          "Sorry, you don't have the right access to reach the route requested"
      })
    } else {
      next()
    }
  }
}
</script>

Conclusion

The process of integrating authentication into an application can be a tricky one. We covered how to gate a route from unauthorized access as well as how to put workflows in place that redirect users toward and away from a protected resource based on their permissions. The assumption thus far has been that you already have authentication configured in your application. If you don’t yet have this configured and you’d like to get up and running fast, I highly recommend working with authentication as a service. There are providers like Netlify’s Identity Widget or Auth0’s lock.

The post Protecting Vue Routes with Navigation Guards appeared first on CSS-Tricks.

Position Sticky and Table Headers

Post pobrano z: Position Sticky and Table Headers

You can’t position: sticky; a <thead>. Nor a <tr>. But you can sticky a <th>, which means you can make sticky headers inside a regular ol’ <table>. This is tricky stuff, because if you didn’t know this weird quirk, it would be hard to blame you. It makes way more sense to sticky a parent element like the table header rather than each individiaul element in a row.

The issue boils down to the fact that stickiness requires position: relative to work and that doesn’t apply to <thead> and <tr> in the CSS 2.1 spec.

There are two very extreme reactions to this, should you need to implement sticky table headers and not be aware of the <th> workaround.

  • Don’t use table markup at all. Instead, use different elements (<div>s and whatnot) and other CSS layout methods to replicate the style of a table, but not locked out of using position: relative and creating position: sticky parent elements.
  • Use table elements, but totally remove all their styling defaults with new display values.

The first is dangerous because you aren’t using semantic and accessible elements for the content to be read and navigated. The second is almost the same. You can go that route, but need to be really careful to re-apply semantic roles.

Anyway, none of that matters if you just stick (get it?!) to using a sticky value on those <th> elements.

See the Pen
Sticky Table Headers with CSS
by Chris Coyier (@chriscoyier)
on CodePen.

It’s probably a bit weird to have table headers as a row in the middle of a table, but it’s just illustrating the idea. I was imagining colored header bars separating players on different sports teams or something.

Anytime I think about data tables, I also think about how tricky it can be to make them responsive. Fortunately, there are a variety of ways, all depending on the best way to group and explore the data in them.

The post Position Sticky and Table Headers appeared first on CSS-Tricks.

Joelapompe.net Copycat Hunting Website: #lookalikejoelapompe

Post pobrano z: Joelapompe.net Copycat Hunting Website: #lookalikejoelapompe
Print, Online
Joelapompe.Net

For the 20th anniversary of Joelapompe.net (The Advertising Copycat hunter since 1999), The Masked Agency is launching an ad campaign starring well-known admen and adwomen who have a curious resemblance to other celebrities with the catchphrase: &ldquo;Advertising is full of look-alikes. Some are funny, others no. Joe La Pompe. Copycat hunter since 1999&rdquo;. Who is the original and who is the copy? Like on this blog, it&rsquo;s up to you to judge! With this small difference that here, it&rsquo;s only coincidences.

Franck Provost (Hairdresser) vs St&eacute;phane Xiberras (BETC Paris) – Mike Horn vs Olivier Altmann (Altmann + Pacreau) – Peter Graves vs Maurice Levy (Publicis Worldwide) – Josiane Balasko (french actress) vs Mercedes Erra (BETC) – Clint Eastwood vs Sir John Hegarty (BBH) – Vahid Halilhodzic (Soccer manager) vs Jean-Marie Dru (TBWA) – Catherine O’Hara vs Margaret Johnson (Goodby Silverstein &amp; Partners) – Tim Burton vs Gabriel Gaultier – Jorge Garcia vs Pierre Berville – Michael Cain vs Sir Franck Lowe (LOLA Mullen Lowe) – Christopher Lee vs Lee Clow (TBWA)

Advertising Agency:The masked agency, Paris, France
Copywriters:Cédric Luceau

Joelapompe.net Copycat Hunting Website: #lookalikejoelapompe

Post pobrano z: Joelapompe.net Copycat Hunting Website: #lookalikejoelapompe
Print, Online
Joelapompe.Net

For the 20th anniversary of Joelapompe.net (The Advertising Copycat hunter since 1999), The Masked Agency is launching an ad campaign starring well-known admen and adwomen who have a curious resemblance to other celebrities with the catchphrase: &ldquo;Advertising is full of look-alikes. Some are funny, others no. Joe La Pompe. Copycat hunter since 1999&rdquo;. Who is the original and who is the copy? Like on this blog, it&rsquo;s up to you to judge! With this small difference that here, it&rsquo;s only coincidences.

Franck Provost (Hairdresser) vs St&eacute;phane Xiberras (BETC Paris) – Mike Horn vs Olivier Altmann (Altmann + Pacreau) – Peter Graves vs Maurice Levy (Publicis Worldwide) – Josiane Balasko (french actress) vs Mercedes Erra (BETC) – Clint Eastwood vs Sir John Hegarty (BBH) – Vahid Halilhodzic (Soccer manager) vs Jean-Marie Dru (TBWA) – Catherine O’Hara vs Margaret Johnson (Goodby Silverstein &amp; Partners) – Tim Burton vs Gabriel Gaultier – Jorge Garcia vs Pierre Berville – Michael Cain vs Sir Franck Lowe (LOLA Mullen Lowe) – Christopher Lee vs Lee Clow (TBWA)

Advertising Agency:The masked agency, Paris, France
Copywriters:Cédric Luceau