Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev mip story #1344

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
670 changes: 670 additions & 0 deletions src/mip-story/lib/qrcode.js

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions src/mip-story/mip-story-hint.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ define(function (require) {
var MIP_STORY_PAGE_SWITCH_RIGHT_CLASS = 'mip-story-page-switch-rt';

var util = require('util');
var QRCode = require('./lib/qrcode');

function MIPStoryHint(root) {
this.rootEl = root;
Expand All @@ -39,6 +40,7 @@ define(function (require) {
+ '<div class="mip-story-hint-rotate">'
+ '<mip-img src="https://www.mipengine.org/static/img/mip-story/mip-story-rotate.png"></mip-img>'
+ '<p>为了更好的体验,请将手机横过来</p>'
+ '<div class="mip-story-qrcode"></div>'
+ '</div>'
+ '<div class="mip-story-page-switch">'
+ '<span class="mip-story-page-switch-left">'
Expand All @@ -54,6 +56,19 @@ define(function (require) {
return html;
};

MIPStoryHint.prototype.generateQRCode = function () {
var ele = this.rootEl.querySelector('.mip-story-qrcode');
new QRCode(ele, {
text: window.location.href,
width: 96,
height: 96,
border: 2,
colorDark : "#000000",
colorLight : "#ffffff",
correctLevel : QRCode.CorrectLevel.H
});
}

MIPStoryHint.prototype.showDamping = function () {
var self = this;
var ele = this.rootEl.querySelector(MIP_STORY_HINT_CLASS);
Expand Down
2 changes: 1 addition & 1 deletion src/mip-story/mip-story-video.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ define(function (require) {
'use strict';

var customElement = require('customElement').create();
var JSMpeg = require('./jsmpeg/jsmpeg');
var JSMpeg = require('./lib/jsmpeg');
var util = require('util');
var Detector = require('./video-detector');
var css = util.css;
Expand Down
1 change: 1 addition & 0 deletions src/mip-story/mip-story.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ define(function (require) {
this.hint = new HintLayer(element);
var html = dm.create(this.hint.build());
this.element.appendChild(html);
this.hint.generateQRCode();
};

MIPStory.prototype.initShare = function (storyConfig, element) {
Expand Down
4 changes: 4 additions & 0 deletions src/mip-story/mip-story.less
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,10 @@ mip-story-layer[template=thirds] {
height: 45px;
}

.mip-story-qrcode {
margin-top: 10px;
}

@media all and (orientation: portrait) {
.mip-story-hint-rotate {
display: none;
Expand Down